一键导入
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing any feature or bugfix, before writing implementation code
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Explore ideas and create designs before implementation
Use when about to claim work is complete or before committing - enforces verification and proposes a commit
Fetch current library and framework documentation from Context7 instead of relying on training data
Use when you have a written implementation plan to execute - direct execution by default, subagents for complex tasks
Use when encountering any bug, test failure, or unexpected behavior — find root cause before proposing any fix
Use when starting substantive work to choose the right workflow skill without adding unnecessary ceremony to trivial interactions
| name | test-driven-development |
| description | Use when implementing any feature or bugfix, before writing implementation code |
| license | MIT |
| compatibility | opencode |
| metadata | {"category":"development-process","workflow":"tdd"} |
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over. Do not keep it as "reference" — delete means delete.
| Rationalization | Reality |
|---|---|
| "Too simple to test" | Simple code breaks too. Test takes 30 seconds. |
| "I'll write tests after" | Tests passing immediately prove nothing. |
| "Already manually tested" | Ad-hoc ≠ systematic. You can't re-run it. |
| "Deleting X hours is wasteful" | Sunk cost. Keeping unverified code is technical debt. |
| "TDD will slow me down" | TDD is faster than debugging. |
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
Any of these? Delete code. Start over with TDD.
skills/test-driven-development/examples.md only when needed