test-driven-development
できること
このスキルは、まず問題を示すテストを書き、その後に小さな修正を加える、テスト駆動開発をAIに導きます。変更が機能している証拠がほしい開発者向けです。
使う場面
- ✓テストを先に書いて、新機能を作りたいとき。
- ✓バグを直すとき、まず失敗するテストで修正を証明したいとき。
- ✓既存のテストを壊さずに、振る舞いを変えたいとき。
スキルのリンク
https://github.com/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“空の検索結果でページがクラッシュするバグを直してください。まず失敗するテストを書き、その後に修正してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは既存のコードとテストを読み、期待される振る舞いを示す最も小さなテストを書いて、それが失敗することを確認します。その後、テストを通す最小の変更を加え、差分をレビューします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
When to Use
Use when implementing a feature, fixing a bug, or changing behavior where a regression test can define the expected result. Prefer this workflow for parser, routing, agent-loop, and UI behavior changes.
Procedure
- Inspect the relevant code, existing tests, and local conventions before editing.
- Write the smallest regression test that demonstrates the requested behavior or reproduces the bug.
- Run that test and confirm it fails for the expected reason, not because the test setup is broken.
- Make the smallest production change that makes the test pass.
- Run the focused test again, then run the surrounding module suite.
- Review the diff for unrelated changes, brittle assertions, hidden state, and missing error paths.
- Report the tests run and any remaining coverage or environment limits.
Pitfalls
- Do not write a test that only mirrors the implementation; assert the user-visible contract.
- Do not weaken an assertion just to make a failing test pass.
- Do not skip the focused failing-test step when the behavior is observable in a local test.
- Keep network, filesystem, and model calls deterministic with fakes or fixtures unless the integration itself is under test.
Verification
- The new regression test fails before the fix and passes after it.
- The relevant focused suite passes.
- The broader suite passes or its failure is explained with evidence.
- The final diff contains the test and the production change needed for the same behavior.
よくある質問
なぜテストが最初に失敗する必要があるのですか?
失敗するテストは、テストが本当に振る舞いを確認していることを示し、偶然通ってしまうのを防ぐとスキルは述べています。
テストを通すためにアサーションを弱めますか?
いいえ。失敗するテストを通すためだけにアサーションを弱めないよう、スキルは述べています。
テストでネットワーク呼び出しはどう扱いますか?
接続そのものが検証対象でない限り、フェイクやフィクスチャで予測可能にしておくとスキルは述べています。
詳細
人気
- GitHubのスター
- 95k
- ランキング
- #1315
- ライセンス
- AGPL-3.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
odysseus
95kエージェントが、スコープ付きトークンを通して、ToDo、メール、カレンダー、メモリ、ドキュメントなどのOdysseusのデータを読み書きできるよう支援します。
odysseus
95kエージェントが、Codex Agentトークンを通して、ToDo、メール、カレンダー、メモリ、ドキュメントなどのOdysseusのデータを読み書きできるよう支援します。
artifact-completion
95kエージェントが、要求されたファイルや文書を早めに作成し、実際の出力をもとに改良して、完成と報告する前に確認できるよう支援します。
terminal-recovery
95kエージェントが、失敗したターミナルコマンドから、エラーを読み、考えられる原因を見つけ、狙いを絞った1つの修正を試して回復できるよう支援します。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。