test-driven-development
Use when implementing a high-risk behavior change, reproduced regression, or costly contract. Do NOT use by default for docs, styling, config, or low-risk wiring.
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 16
- Forks
- 5
01 前言 Front Matter
- name
- test-driven-development
- version
- 6.2.0
- category
- workflow
- description
- Use when implementing a high-risk behavior change, reproduced regression, or costly contract. Do NOT use by default for docs, styling, config, or low-risk wiring.
02 资源文件 2
- 参考文档CHANGELOG.md311 B
- 参考文档writing-good-tests.md8.1 KB
03 SKILL.md 正文
Risk-Based Test-Driven Development
TDD protects critical behavior. It is not a requirement to create a test for every changed function.
Read ../using-superpowers/references/risk-policy.md and classify the change.
Decision
| Risk | New test |
|---|---|
| Low | None by default; use a focused check or smoke path |
| Medium | Only for a key outcome, non-obvious branch, or hard-to-notice regression |
| High | One minimal regression or contract test first when practical |
Do not test private helpers, trivial branches, static rendering details, or behavior already covered through a public seam.
Critical TDD Cycle
For a warranted test:
- Write the smallest test that describes the critical observable behavior.
- Run it and confirm it fails for the expected missing behavior.
- Implement the smallest production change.
- Run the focused test and the affected suite once.
- Refactor only if needed, then rerun the closest affected target.
Mocks are limited to external boundaries. Prefer real in-process behavior.
Existing Code or Impractical Automation
Do not delete completed code merely because the test was not written first. Add a focused regression test when it materially protects the outcome. If automation is disproportionately expensive or impossible, record and run a reproducible smoke check instead.
Completion
- Every check that was run must pass.
- A passing focused test does not justify running unrelated suites.
- State what was verified and what was intentionally not tested.
04 同仓库更多 Skills
bad
暂无简介
writing-skills
Use when creating, editing, or validating reusable agent skills and their trigger behavior. Do NOT use for ordinary project documentation or one-off prompts.
writing-plans
Use when an approved change spans multiple dependent outcomes and needs a durable implementation sequence before coding. Do NOT use for small, obvious, reversible edits.
verification-before-completion
Use when about to claim work is complete, fixed, passing, or ready to integrate. Do NOT use to repeat checks without a completion claim or concrete doubt.
using-superpowers
Use when starting a conversation or deciding whether a Superpowers workflow matches the current task. Do NOT use it to auto-invoke skills whose stated triggers do not match.
using-git-worktrees
Use when feature work needs isolation from the current workspace or before executing a risky implementation plan. Do NOT use when the current workspace is already safe and isolated.