tdd-implement
Skill3 starsChanged 5 months agoMITView on GitHub
Implements a feature or fix using Test-Driven Development — write failing tests first, then implement just enough to make them pass, then refactor. Keeps tests focused on acceptance criteria rather than implementation details. Use when building something new with TDD, or when the user wants to start from tests rather than code. Trigger on "implement with TDD", "use TDD for this", "write the tests first", "TDD workflow", "red-green-refactor".
2 other projects use a version of this.
Adopted by
Most recently taken up by
- GulajavaMinistudio/awesome-copilot-idtheir own version, first seen Aug 4, 2026
- UserAd/ClaudeSkillstheir own version, first seen Jul 26, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- GulajavaMinistudio/awesome-copilot-id★ 79same name
- UserAd/ClaudeSkills★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- abstraction-finderSkill
- analyze-issueSkill
- backlog-routingSkill
- band-aid-finderSkill
- browser-debugger-cliSkill
- ci-fix-with-memorySkill
- code-health-auditSkill
- comment-reaperSkill
- cyoaSkill
- dead-code-cleanupSkill
- doc-rotSkill
- drupal-mental-modelSkill
- ds-guardSkill
- evidence-checkSkill
- github-screenshotSkill
- issue-maintenanceSkill
- kissSkill
- plain-language-auditSkill
- post-mergeSkill
- prioritize-issuesSkill
- project-bootstrapSkill
- pr-review-fix-pipelineSkill
- routeSkill
- ship-issueSkill
- skill-paritySkill
- test-fixSkill
- test-reaperSkill
- test-workflowSkill
- visual-crawlSkill
- visual-qa-pipelineSkill
- worktree-enhancedSkill
- wrap-it-upSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 13 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Before writing a single test, be clear on:
- Distinctive: line 25
Write down 3-5 tests before touching implementation code.
- Distinctive: line 27
Test user-observable behavior, not internal implementation
- Distinctive: line 58
Write only what's needed to make the tests pass.
- Distinctive: line 63
Follow patterns established by similar features in the codebase
- Distinctive: line 65
Run tests after each meaningful chunk of implementation:
- Distinctive: line 71
When all tests pass, stop adding code.
- Distinctive: line 87
Remove anything that was scaffolding, not production code
- Distinctive: line 88
Ensure naming is consistent with the rest of the codebase
- Distinctive: line 90
Run tests after every non-trivial refactor to confirm they're still green.
- Distinctive: line 113
If any of these fail, fix the root cause — don't suppress warnings or skip checks.
- Distinctive: line 119
When a test is failing and you're not sure why:
- Distinctive: line 125
Never modify a test just to make it pass.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TDD Implementation
The goal is to write honest tests that define behavior, implement the minimum code to pass them, then clean up. No rigging tests to pass. No over-engineering beyond what the tests require.
Step 1: Understand what you're building
Before writing a single test, be clear on:
- What problem does this solve?
- What are the acceptance criteria (from the issue, the user, or both)?
- What already exists in the codebase that you can build on?
# Discover existing patterns before planning
find src/ -name "*.test.*" -o -name "*.spec.*" | head -5 # How tests are structured here
find src/ -name "*.ts" -o -name "*.tsx" | xargs grep -l "[relevant term]" | head -5Step 2: Define the MVP test plan
Write down 3-5 tests before touching implementation code. Each test should:
- Map directly to a specific acceptance criterion
- Test user-observable behavior, not internal implementation
- Answer: "Would a user notice if this broke?"
Tests to avoid:
- "renders without crashing"
- Prop-passing tests
- Checking that a function was called (unless it's the actual requirement)
- Exhaustive edge cases not in the acceptance criteria
- Tests that just re-assert a simple layout/visual fix — a
box-sizing, padding, or margin tweak guards a value, not behavior, and only bloats the suite
Some fixes don't warrant a test at all
TDD doesn't mean every change gets a spec. When the entire fix is a one-line CSS/layout change, a config tweak, or a copy edit, a dedicated test (Playwright or unit) that pins a single property value is test bloat, not coverage — it makes the suite slower and noisier without catching a real regression class. For these, verify it live (run the app, observe the behavior) and lean on the existing visual-regression / smoke coverage instead of adding a new spec. Say so plainly ("one-line layout fix — no dedicated test") and move on rather than padding the suite to satisfy a checkbox. Reserve new tests for changes with real behavior a user could notice breaking.
Show the user the test plan and confirm it looks right before writing code.
Step 3: Write the failing tests (red)
Implement the tests. Run them — they should fail. If they pass without any implementation, the tests aren't testing anything real.
# Run just the new tests
npm test -- --testPathPattern="[feature name]"
# or: npx jest [test file]
# or: whatever the project's test command isConfirm they're red before proceeding.
Step 4: Implement the minimum to pass (green)
Write only what's needed to make the tests pass. No extra features, no "while I'm here" additions. If you find yourself writing code that isn't required by a test, stop.
Lean on existing code:
- Extend existing components rather than creating new ones
- Reuse utilities that already exist
- Follow patterns established by similar features in the codebase
Run tests after each meaningful chunk of implementation:
npm test -- --testPathPattern="[feature name]"When all tests pass, stop adding code.
Step 5: Build verification
npm run build
# or: npx tsc --noEmit (TypeScript check without full build)Fix any type errors or build failures before continuing.
Step 6: Refactor (still green)
With passing tests as a safety net, clean up:
- Replace any placeholder implementations with proper code
- Extract reusable patterns if the same logic appears in multiple places
- Remove anything that was scaffolding, not production code
- Ensure naming is consistent with the rest of the codebase
Run tests after every non-trivial refactor to confirm they're still green.
Step 7: Cleanup
# Check for debug statements left behind
git diff --name-only | xargs grep -n "console\." 2>/dev/nullRemove:
console.log/ debug statements from production code- Commented-out code blocks
- TODO comments that were resolved
- Unused imports
Step 8: Final verification
npm test # all tests pass
npm run build # clean build
npm run lint # no new lint errorsIf any of these fail, fix the root cause — don't suppress warnings or skip checks.
If a test won't pass
When a test is failing and you're not sure why:
- Is the implementation wrong? Fix the implementation.
- Is the test expectation wrong? Fix it only if it doesn't match the acceptance criteria.
- Is the acceptance criterion itself unclear? Ask before assuming.
Never modify a test just to make it pass. A passing test that doesn't validate the right thing is worse than a failing one — it gives false confidence.
Running the loop with /goal
The red-green-refactor cycle is a natural fit for /goal once the Step 2 test plan is confirmed: the loop has a crisp, evaluator-checkable completion condition, e.g. /goal "all MVP tests green, build clean, lint clean, no debug statements left". Let it iterate across turns rather than babysitting each red-to-green step — just keep the "never rig a test to pass" rule above as the hard constraint.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

