一键导入
tdd
Enforce Red-Green-Refactor cycle for a feature. Write the failing test first, then minimal implementation, then refactor with tests green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforce Red-Green-Refactor cycle for a feature. Write the failing test first, then minimal implementation, then refactor with tests green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Dispatch a multi-wave plan to specialist agents with audit + risk-area abort. Supports --auto-push, --auto-merge, --goal-mode for budgeted runs. NOT for writing the plan itself (that is /spec), and NOT for a single small edit with no waves — just make the edit.
Independently re-verify a completion claim in a separate context — mechanical evidence (files/tests/assertions) plus a refute-by-default semantic judge — before a wave or task is allowed to be called "done". Emits the shared verdict schema. NOT for code-style review (that is a reviewer's lane) and NOT for verifying work you authored in the same context — the verifier must be a fresh spawn.
Router over the harness skills — which skill fits your situation, and the main flow through them. NOT for performing the routed work itself — it only points; invoke the skill it names.
Upstream planning-discipline — brainstorm a feature into spec.md + plan.md under .agent/plans/<slug>/, then route to plan approval. Enforced by the spec-gate tool boundary, not prompt coercion. NOT for trivial/test/doc-only edits (the gate scopes those out), and NOT for executing an already-approved plan (that is /supervise).
Commits staged changes and opens a PR. Runs gitleaks + risk-area guards before committing. Push is user-confirmed by default; --auto-push and --auto-merge are opt-in. NOT for review or verification (run those before wrapping), and NOT when nothing has changed yet — there is nothing to commit.
Agent-driven, read-only self-audit of the harness — run the machine integrity layer once as a dry-run, present a per-check pass/fail table, cite the P1-1 doc-reality result, and for any failure give root-cause + fix + backlog follow-up. Consumes the machine gates; it does not reimplement them. NOT for auditing a consumer project's own codebase (use that project's test suite), and NOT for applying fixes — this skill observes and reports only.
| name | tdd |
| description | Enforce Red-Green-Refactor cycle for a feature. Write the failing test first, then minimal implementation, then refactor with tests green. |
| when_to_use | User starts a new feature, fixes a non-trivial bug, or invokes `/tdd`. |
| tools | Read, Write, Edit, Bash, Grep, Glob |
Force the discipline of writing the test before the code. Three phases: Red (failing test) → Green (minimal impl) → Refactor (with tests green).
rules/policy/strong-goal-template.md.when_input_is_empty__should_return_error).AssertionError: expected ValueError, not
ModuleNotFoundError: foo).Phase: Red | Test added: <path>:<test-name> | Status: FAIL (expected)
Phase: Green | Impl: <path>:<function> | Status: PASS
Phase: Refactor | Changes: <bullet list> | Status: PASS
Suite: <command> → <PASS/FAIL>
Coverage: <% if available>
| Anti-pattern | Fix |
|---|---|
| Writing all tests, then all code | Write one test, then one impl, then loop. |
| Tests that test the implementation, not the behavior | Test inputs → outputs. Don't assert internal state. |
| Mocking everything | Integration tests with real deps catch real bugs. Mock at the system boundary, not internally. |
| One test, multiple assertions for different cases | Split. One behavior per test. |