本文へ移動
cccskills
無料GitHub で公開日本語紹介

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.

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • テストを先に書いて機能追加したいとき
  • バグを再現してから修正したいとき
  • 結合テストの確認箇所を決めたいとき
  • 内部構造に依存するテストの見直し

日本語での紹介

できること

機能追加やバグ修正を、先に失敗するテストを書き、それを通す最小限のコードを実装する順番で進めます。一度に扱うのは一つのテストと実装です。公開インターフェース、つまり外から機能を使う接点で振る舞いを確かめ、内部構造が変わっても使い続けられるテストを目指します。

こんなときに便利

テストを先に書いて開発したいときや、結合テストを置く場所を決めたいときに向いています。内部の処理に依存するテストや、実装と同じ計算で期待値を作るテストなど、見直すべきパターンも確認できます。

使い方の例

  • 「この機能を、失敗するテストから一つずつ実装して」
  • 「このバグを再現するテストを書いてから修正して」
  • 「公開インターフェースのどこをテスト対象にするか整理して」

注意点

テストを書く前に、対象とする公開インターフェースを利用者と確認します。CONTEXT.mdがあれば用語を合わせ、関連する設計上の決定にも従います。リファクタリングは実装サイクルに含めず、code-reviewを参照するレビュー段階で扱います。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(4)

  • SKILL.md3.5 KB
  • agents/openai.yaml90 B
  • mocking.md1.5 KB
  • tests.md2.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Test-Driven Development

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.

What a good test is

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.

Seams — where tests go

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 pre-agreed seams. Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything — agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.

Ask: "What's the public interface, and which seams should we test?"

When the shape of that interface is itself in question — how deep the module is, where the seam belongs, what the interface should expose — use the /codebase-design skill for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.

Anti-patterns

  • Implementation-coupled — mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
  • Tautological — the assertion recomputes the expected value the way the code does (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.
  • Horizontal slicing — writing all tests first, then all implementation. Bulk tests verify imagined behavior: you test the shape of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in vertical slices instead — one test → one implementation → repeat, each test a tracer bullet that responds to what the last cycle taught you.

Rules of the loop

  • Red before green. Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
  • One slice at a time. One seam, one test, one minimal implementation per cycle.
  • Refactoring is not part of the loop. It belongs to the review stage (see the code-review skill), not the red → green implementation cycle.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

brainstorming

無料概要あり

機能追加や動作変更の前に、対話で目的・制約・成功条件を整理し、複数の案を比較します。承認した設計を仕様書にまとめ、実装計画へつなぐスキル。

  • 新機能の要件を整理したいとき
  • 動作変更の実装案を比較したいとき
  • 大規模な依頼を分割したいとき
rpamis/comet3,2282026年10月23日 更新

code-review

無料概要あり

指定したコミットやブランチを基準に、コード変更を規約への適合と仕様の実現という二つの観点で並行レビューします。それぞれの指摘を分けて報告するスキルです。

  • ブランチやPRをレビューしたいとき
  • 指定コミット以降の変更確認
  • 仕様の実装漏れや余分な変更の確認
rpamis/comet3,2282026年10月23日 更新

comet

無料概要あり

開発の依頼内容と進行中の変更を確認し、設計・実装・検証・アーカイブの適切な段階へ振り分け、不具合修正や小規模変更にも対応するスキル。

  • 新機能の開発を始めたいとき
  • 中断した変更を再開したいとき
  • 不具合修正や小規模変更を進めたいとき
rpamis/comet3,2282026年10月23日 更新

comet

無料概要あり

開発の現在地を判定し、要件整理・設計・実装・検証・保管の各手順へ案内します。OpenSpecとSuperpowersを組み合わせ、変更の進行を管理するスキル。

  • 開発の変更を手順に沿って始めたいとき
  • 作業の現在地を確認して再開したいとき
  • 修正や小規模変更の進め方を選びたいとき
rpamis/comet3,2282026年10月23日 更新

comet

無料概要あり

プロジェクトの設定に従ってCometのNativeまたはClassicを選び、依頼を対応するワークフローへ引き渡すスキル。設定がない場合は既定値を保存します。

  • /cometから作業を始めたいとき
  • プロジェクト設定の方式を使いたいとき
  • 新規プロジェクトに既定設定を保存
rpamis/comet3,2282026年10月23日 更新

comet

無料概要あり

プロジェクトに保存された設定からCometのNativeかClassicを選び、依頼を対応するスキルへ引き渡します。方式を指定せずにCometの作業を始めるための入口です。

  • 方式を指定せずCometを始めたいとき
  • プロジェクト設定に従った作業開始
  • 既定値からプロジェクト設定を初期化
rpamis/comet3,2282026年10月23日 更新

rpamis のスキルをすべて見る

このスキルの問題を報告する