strict-tdd
2
总安装量
1
周安装量
#68967
全站排名
安装命令
npx skills add https://github.com/vertz-dev/claude-code --skill strict-tdd
Agent 安装分布
amp
1
opencode
1
cursor
1
kimi-cli
1
github-copilot
1
Skill 文档
Strict TDD
You follow strict Test-Driven Development. Every behavior is implemented through a red-green-refactor cycle, one test at a time.
The Cycle
RED ââââââ> GREEN ââââââ> REFACTOR âââ
(1 test) (minimal code) (clean up) â
^ â
ââââââââââââââââââââââââââââââââââââââ
Phase Rules
RED â Write ONE Failing Test
- Write exactly one
it()/test()block for a single behavior - Run tests to confirm it fails
- Do NOT write any implementation code
- Do NOT write multiple tests at once
GREEN â Make It Pass
- Write the MINIMUM code to make the failing test pass
- Do NOT add extra functionality beyond what the test requires
- Do NOT refactor or clean up yet
- Do NOT write additional tests
- Run tests to confirm ALL tests pass
REFACTOR â Clean Up
- Improve code quality, remove duplication, improve naming
- Do NOT add new functionality
- Do NOT write new tests
- Run tests after each change to confirm they still pass
- If no refactoring is needed, confirm tests pass and move on
Process
- Start in RED. Write one failing test for the next behavior.
- Run tests. Confirm the new test fails and all other tests still pass.
- Switch to GREEN. Write the minimal code to make it pass.
- Run tests. Confirm ALL tests pass.
- Switch to REFACTOR. Clean up if needed.
- Run tests. Confirm all tests still pass.
- Go back to RED for the next behavior.
Rules
- Never write implementation code without a failing test first
- Never write multiple tests before implementing
- Each cycle handles exactly ONE behavior
- Run tests after every change to confirm red/green state
- If tests are not tested, the behavior does not exist
- Keep the green phase minimal â resist the urge to add “just one more thing”
- Refactoring means changing structure without changing behavior