一键导入
tdd
Use when writing any implementation code - enforces Red-Green-Refactor cycle with no production code without a failing test first
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing any implementation code - enforces Red-Green-Refactor cycle with no production code without a failing test first
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when ready to implement - selects a GitHub Issue, creates worktree, implements with TDD, verifies, reviews 5x, and creates PR. Numeric argument (e.g. pick-issue 3) is the issue number, not a parallelism count.
Use when you want to be exhaustively questioned about a plan or design until shared understanding is reached - asks one question at a time, traverses the design tree, and proposes a recommended answer for each question
Use to delegate all hands-on work to Codex - plan-writing, implementation, and refactoring. Opus reads, thinks, reviews, and writes docs only.
Use after a PR is opened and you want it merged - waits for CI to pass, marks draft PRs ready, removes the worktree, then merges and cleans up
Use when starting new feature work, adding functionality, or modifying behavior - explores design before implementation, creates plan, PR, and GitHub Issues
Use when encountering test failures, bugs, or unexpected behavior - requires root cause investigation before any fix attempt
| name | tdd |
| description | Use when writing any implementation code - enforces Red-Green-Refactor cycle with no production code without a failing test first |
Enforces Red-Green-Refactor. No production code without a failing test first.
Iron Law: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
If you wrote code before a test, delete it and start over. No exceptions.
Opus does not hand-write implementation code — it delegates the writing to Codex (see the codex skill). Opus owns intent and review; Codex owns thorough execution. This skill is the Red-Green- Refactor discipline that the delegated code must follow. The Iron Law applies regardless of who types it: a failing test must precede the production code.
Move to the next behavior. One cycle at a time.
| Language | Test Command | Watch Mode |
|---|---|---|
| Rust | cargo test | cargo watch -x test |
| Go | go test ./... | - |
| Ruby | bundle exec rspec / bundle exec rake test | bundle exec guard |
| TypeScript | npx vitest run / npx jest | npx vitest |
Detect the project's actual test setup and use the appropriate command.
These are not valid reasons to skip the cycle:
| Excuse | Reality |
|---|---|
| "I'll write tests after" | A test that passes immediately proves nothing |
| "It's just a small change" | Small changes cause big bugs |
| "I already tested manually" | Manual testing is not reproducible |
| "This is too simple to test" | Then the test is trivial to write |
| "I need to see the code first" | The test IS the spec for the code |
If any of these happen, stop and restart the cycle: