Tdd
Build features and fix bugs test-first with a strict red/green/refactor loop. Use when the user wants reliable code, mentions TDD, red-green-refactor, or is implementing logic that can be covered by tests. The single most effective pattern for trustworthy agent-written code.From its SKILL.md
npx -y skills add joshiujjwal/sdlc-skills-plus --skill tddAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.3 KB, as published. Nobody here has run it
TDD (Red / Green / Refactor)
Untested code is a liability. Writing code is cheap; proving it works is the value. A failing-test-first loop gives the agent the feedback it needs to stop flying blind.
The loop
- RED — Write the smallest test that expresses the next behavior. Run it. Confirm it fails for the right reason. A test that passes before you implement proves nothing — it's testing the wrong thing or already covered.
- GREEN — Write the minimum code to make the test pass. No more. Run the full test file; confirm green.
- REFACTOR — With the safety net green, improve names and structure. Re-run tests. They must stay green.
- Repeat for the next behavior.
Never skip RED. Never write three tests before any implementation.
What makes a good test
- Tests behavior and public contracts, not internals. You should be able to refactor freely without rewriting tests.
- One reason to fail per test. Descriptive name:
should <behavior> when <condition>. - Arrange / Act / Assert, clearly separated.
- Cover the unhappy paths: empty, boundary, error, concurrent, malicious input.
What makes a bad test (avoid)
- Asserting on implementation details or call order.
- Over-mocking until the test only proves the mocks were called.
- Snapshot blobs nobody reads.
- Tests that pass whether or not the code is correct.
See tests.md for the test-quality checklist and mocking.md for when (not) to
mock.
Rules
- Start every session by running the existing test suite. It orients you and primes a testing mindset.
- Show evidence: paste the red failure, then the green pass.
- Prefer integration tests for APIs/CLIs; reserve unit tests for pure logic.
- Never delete or weaken a test to make a build pass — fix the code.
Adapted from the tdd skill in mattpocock/skills (MIT). Credit: Matt Pocock. Red/green discipline per Kent Beck; agentic emphasis per Simon Willison.