一键导入
tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review a fixed implementation diff independently for repository standards and originating specification. Use before integration and after every blocking repair.
Deliver one unblocked ticket through a bounded MWP workspace, behavioral TDD, verification, review handoff, and harvest proposal. Use only after the controller claims a frontier ticket.
Control one bounded campaign within an approved initiative, coordinating leaf implementation, review, repair, integration, evidence, and a durable completion or pause handoff.
Decompose an accepted PRD into a reviewed dependency graph of vertical tracer tickets. Use after to-spec and before autonomous implementation begins.
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.
| name | tdd |
| description | Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests. |
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle — consult them before and during the loop, not after.
When exploring the codebase, read CONTEXT.md (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification — "user can checkout with valid cart" tells you exactly what capability exists — and survives refactors because it doesn't care about internal structure.
See tests.md for examples and mocking.md for mocking guidelines.
A seam is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
Test only at governed seams. A seam declared by an accepted PRD, ticket, ADR, or controller assignment is already confirmed; record which artifact governs it and proceed without asking the Operator again. You can't test everything — agreeing seams up front is how testing effort lands on critical paths and complex logic instead of every edge case.
If no governing artifact or authorized controller resolves the seam, ask the Operator: "What's the public interface, and which seams should we test?" Do not invent an unapproved seam or turn a routine delegated choice into another approval gate.
expect(add(a, b)).toBe(a + b), a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth — a known-good literal, a worked example, the spec.code-review skill), not the red → green implementation cycle.