tdd 精选
Test-first at pre-agreed seams — one test, one implementation, tracer-bullet red/green; independent expected values; substitutions only at the seam's boundary class; launch Phase 4 reference.
安装方式
cp -r skills/tdd ~/.claude/skills/tdd把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/
/plugin marketplace add Yeachan-Heo/oh-my-claudecode⚠️ 该命令形态随客户端版本变化,仅在检测到 .claude-plugin/marketplace.json 时展示;不可用时请用「目录复制」。
https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/8262f9f790eed35e6cbd66572b36c2acba18f679/skills/tdd/SKILL.md下载后另存为 ~/.claude/skills/tdd/SKILL.md。链接锁定采集时的 commit,内容与本站展示一致。
整仓一次性获取:git clone --depth 1 https://github.com/Yeachan-Heo/oh-my-claudecode.git
依赖与权限
- 无需 API Key
- 无需联网
- 无外部命令依赖
- 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
SKILL.md 正文
TDD
Red-green in small steps, at seams that were agreed in advance. In a launch run the seam list is C2's approved output; outside launch, agree the seams with the user before the first test exists — a seam nobody approved gets no tests.
The loop
One test → one implementation → repeat:
- Write the next test at a seam. Run it. Watch it fail for the reason you expect — a test that cannot fail is not a test.
- Implement the smallest change that turns it green.
- Repeat. Each test is a tracer bullet: a narrow but complete path through the behavior, not a layer finished in isolation.
Rules
- Expected values come from an independent source of truth — a spec line, a worked example, a documented output. Never from the implementation under test: a test that asserts what the code happens to do is a mirror, not a check.
- Substitute at the seam's declared boundary class only — in-process, locally substitutable, owned-remote port, or true-external, the class C2 records for each seam. No substitutes inside the boundary the test is exercising.
- Refactoring is not part of the loop. It belongs to the review stage; the repair worker owns it. Do not refactor mid-red-green.
- A bug fix starts with the failing test that reproduces it — reproduction before theory, the debugger's rule.
- When proposing a seam, say in one line what it catches and what it lets through — a seam choice nobody can price is a guess, not a decision.
When no seam fits
If the behavior cannot be tested at any approved seam, stop and say so: report the missing seam as a finding (it feeds architecture-survey and refit) rather than inventing a seam or testing through internals.
Output
- The seam list used, with boundary classes and each seam's catch/miss line
- Red/green evidence — the failing run and the passing run
- Any seam-absence findings
质量与来源
- 所属仓库
- Yeachan-Heo/oh-my-claudecode
- 仓库星标
- 4.0 万
- 最近更新
- 今天
- 采集时间
- 今天
- commit
- 8262f9f790ee
- 内容指纹
- sha256:b7270923ba707d9
- 文件路径
- skills/tdd/SKILL.md