tdd
Skill1 starsChanged 2 months agoMITView on GitHub
入出力が明確な新規関数を追加するとき、「テスト駆動で実装して」「red-green-refactorで」と言われたときに必ず使う。
194 other projects use a version of this.
Adopted by
Most recently taken up by
- bamlab/flashlighttheir own version, first seen Nov 16, 2026
- lhotwll217/owner-operatortheir own version, first seen Nov 16, 2026
- philoserf/claude-code-configtheir own version, first seen Nov 15, 2026
- e2b-dev/E2Btheir own version, first seen Nov 15, 2026
- backnotprop/pstacktheir own version, first seen Nov 15, 2026
- quickchatai/quickreviewtheir own version, first seen Nov 15, 2026
Used with
Projects with it also use capture-learning-tools, design-frontend-dev and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
The-Vibe-CompanySkillcapture-learning-tools
Turn technical conversations, bugs, CI failures, review comments,
Also in 5 projects that use this
The-Vibe-CompanySkilldesign-frontend-dev
Clean Impeccable frontend design skill. Use when the user wants to
Also in 5 projects that use this
jaydubya818Skillfigure-it-out
Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.
Also in 61 projects that use this
jaydubya818Skillprinciple-minimize-reader-load
Apply when layers, wrappers, or hidden state make simple behavior hard to follow.
Also in 53 projects that use this
- +2 more from The-Vibe-Company
- +6 more from jaydubya818
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 194
- mattpocock/skills★ 325ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- trpc/trpc★ 41ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- The-Vibe-Company/quivr★ 40ksame name
- QuivrHQ/quivr★ 40ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
184 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- architecture-checkSkill
- brainstormSkill
- branch-namingSkill
- codex-delegateSkill
- config-explainSkill
- config-setSkill
- cross-reviewSkill
- design-interviewSkill
- diagnosing-bugsSkill
- fix-ciSkill
- handoffSkill
- leakage-checkSkill
- literature-reviewSkill
- mlflow-logSkill
- multi-seedSkill
- mutation-testSkill
- paper-writingSkill
- pre-mortemSkill
- property-testSkill
- python-standardsSkill
- refactor-scoutSkill
- regression-suiteSkill
- retrospectiveSkill
- security-reviewSkill
- spec-checklistSkill
The file
Files
テスト駆動開発(TDD)
1振る舞いずつ、失敗するテストを書いてから実装する。
進め方(1振る舞いにつき)
- Red: 実装したい振る舞いに対する、失敗するテストを1つ書く。 まだ実装がないので失敗することを確認する。実行したテストコマンドと 失敗ログ(標準出力/標準エラー)を完了報告に含める。この失敗するテストは 実装より先にコミットする(先行コミット)。
- Green: そのテストを通す最小限の実装を書く。他の振る舞いのことは
考えず、今のテストを通すことだけに集中する。この段階ではテストファイルを
編集しない。テストの誤りに気づいた場合は Red からやり直す
(
tdd_red.py --rearmでセンチネルを削除 → テストを修正 → 失敗を確認 → コミット → 再度記録、が正規の手順)。CLAUDE_TDD_GATE=1の環境では、 この手順を踏まないテスト改変をtdd_gate.pyが機械的にブロックする。 - Refactor: テストが通ったままの状態で、重複や汚いコードを整理する。 このステップでは新しい振る舞いを追加しない。
- 次の振る舞いに進み、1に戻る。
事後条件は実装より先に固定する
- テストの期待値は仕様から取る。実装や実行結果から逆算した期待値 (現在の出力をそのまま assert する)はバグを固定化するだけで検出力に ならない。
- 計画に「事後条件」欄がある場合はそれをそのまま Red のテストにする。
- バグ修正では修正前の出力を期待値にしない。「本来どうあるべきか」を 設計書・計画から決めてから Red を書く。
- 期待値の出所(設計書の R-ID、計画の事後条件、仕様の該当箇所)を テストの docstring かコメントに1行書く。
適用範囲の判断
- 新規のユーティリティ関数、データ変換処理、評価指標の計算など、 入出力が明確な処理に向いている。
- 探索的な実験スクリプト(ノートブック的な試行錯誤)には無理に適用しない。 「この関数はTDDで作るべきか」迷ったら、入出力が固定できるかどうかで判断する。
注意
- 1テスト1振る舞い。複数の振る舞いをまとめてテストしない。
- Greenの段階で、まだ確認していない振る舞いまで先回りして実装しない (YAGNI: 必要になってから作る)。
- CONTEXT.md があれば先に読み、テストで使う用語をプロジェクトの言葉に合わせる。
- テストコマンドは記録した時点の OS のシェルで実行される。記録した OS と
異なる環境で
tdd_unlock.pyによる解除を再実行する動作は保証外。
効果測定
- テスト改変ゲートの効果は、
.claude/checkpoints/tdd_gate_blocks.logの ブロック件数と、mutation-test の手動実行結果で測る。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

