一键导入
tdd
Test-Driven Development enforcer. Red→Green→Refactor cycle with no production code without a failing test first. Use for new features and bug fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test-Driven Development enforcer. Red→Green→Refactor cycle with no production code without a failing test first. Use for new features and bug fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Ring 3 evolution engine. Analyzes session observations, generates and improves evolved skills, shows metrics dashboard. Subcommands: status, history, rollback, reset. Use for post-session review and skill improvement.
State-persisted autonomous pipeline: spec → go → audit → eval → ship → evolve in one command. Auto-detects direct/council/interactive mode. Crash-recoverable via PIPELINE-*.json. Hands-off until PR.
Core router. Always active. Auto-invokes matching skill before every response. Runs confusion protocol on high-risk ambiguity.
Loop-breaking self-diagnosis. Use when 3+ consecutive failures occur, circular retries persist, or context overwhelms the session.
Audit phase. Parallel review: code quality + security + tests. Semantic dedup of cross-mode findings. Outputs PASS/WARN/FAIL per dimension. Validates spec coverage.
Conventional Commits 1.0 generator. Stages relevant files, infers type(scope): description, never uses --no-verify.
| name | tdd |
| dimension | control_and_safety |
| description | Test-Driven Development enforcer. Red→Green→Refactor cycle with no production code without a failing test first. Use for new features and bug fixes. |
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST. Violating the letter of this process is violating the spirit of this process.
Red: Write a failing test that describes the desired behavior
it("returns 401 when token is expired") (reason: the test name IS your specification — it must communicate intent to future readers)Green: Write the minimum code to make the test pass
Refactor: Clean up without changing behavior
Repeat for each behavior. One test, one behavior, one cycle — because scope creep in a single test cycle leads to unverified code.
/go subagents: always — because autonomous agents without TDD produce unverified code| Excuse | Rebuttal | What to do instead |
|---|---|---|
| "This is too simple for tests" | Simple code still breaks. The Beyonce Rule applies: if you liked it, you should have put a test on it. | Write the test anyway — it takes 30 seconds and catches edge cases. |
| "I'll write tests after" | That's documentation, not specification. Tests written after confirm what you built; tests written before define what you should build. | Write the test first. If you can't describe the behavior, you don't understand the requirement. |
| "Tests slow me down" | 15 minutes of TDD saves hours of debugging regression bugs later. | Time the cycle — Red-Green-Refactor is usually faster than debug-after-deploy. |
| "I'll just test manually" | Manual tests don't catch regressions. Automate it once, save hours forever. | Write an automated test that runs on every commit. |
| "The types guarantee correctness" | Types check shape, not logic. add(a,b) can still return a-b. | Write a test that verifies the actual business rule, not just the type signature. |
| "I need to see the API shape first" | Spike freely, then delete and rebuild test-first. A throwaway spike is research, not implementation. | Spike, discard, then TDD the real implementation from what you learned. |
Before claiming TDD is done, show ALL of these:
✓ with the same test nameNo evidence = not done. "I wrote tests" without showing output is not TDD.