dot_agents/skills/test-driven-development/SKILL.md
Use when implementing features or fixes. Write tests first from acceptance criteria, confirm they fail, then implement to make them pass. Prevents the common agent failure mode of writing tests that rationalize implementation rather than verify requirements.
npx skillsauth add MrPointer/dotfiles test-driven-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write tests before implementation. Tests encode what the code should do, derived from requirements — not what the code happens to do after the fact.
This matters more for agents than for humans. When an agent writes code first and tests second, it unconsciously writes tests that validate what it built rather than what was required. Inverting the order forces tests to be grounded in requirements, making them an honest verification layer.
Before writing any test, identify what needs to be true. Look for:
If the input has a section with acceptance criteria, use those directly. If requirements are informal (conversation, rough description), extract testable claims yourself and confirm them with the user before writing tests.
Each testable claim becomes one or more test cases. Name tests after the behavior they verify, not the implementation they exercise.
| Anti-Pattern | What It Looks Like | Why It's Wrong | |---|---|---| | Rationalized tests | Tests written after implementation that mirror what the code does | Tests validate what was built, not what was required — bugs are invisible | | Assertion adjustment | Changing expected values to match actual output after a test fails | The test was right, the implementation was wrong — you just hid the bug | | Mock internals | Mocking internal components instead of their external dependencies | Tests pass in isolation but the integrated system fails — mock at the boundary, not in the middle | | Tautological tests | Testing that a function returns what it returns | Proves nothing — the test will pass regardless of correctness | | Implementation-coupled tests | Tests that break when you refactor internals without changing behavior | Tests should verify behavior, not implementation structure | | Spec-less tests | Tests for scenarios nobody asked for, "just to be safe" | Wastes tokens, adds maintenance burden, and may encode wrong assumptions |
When using this skill directly (not as a test author within an executor), follow the full RED-GREEN cycle:
testing
Create implementation plans from a reviewed RFC. Uses the RFC as the approved design baseline, decomposes it into executable sub-plans, and runs RFC-specific plan review.
tools
Create implementation plans directly from user requirements when no reviewed RFC is available or the user explicitly declines RFC-first planning. Decomposes work into self-contained sub-plans with full iterative multi-agent plan review.
content-media
Decompose a reviewed RFC into sequenced features for a single project. Uses the RFC as the approved design baseline and produces a persistent epic plan reviewed for RFC fidelity and feature decomposition.
tools
Decompose large efforts directly from user requirements when no reviewed RFC is available or the user explicitly declines RFC-first epic planning. Produces a persistent epic plan with rich feature descriptions that feed into planning-project-features separately.