Agent skill
tdd-development
TDD(テスト駆動開発)のRed-Green-Refactorサイクルでコードを「実装」する。「エンティティ」「サービス」「API」「機能」の実装時に使用。「テスト駆動」「TDD」で品質を担保する。
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/tdd-development
SKILL.md
TDD開発ワークフロー
基本サイクル: Red-Green-Refactor
実装作業では以下のサイクルを繰り返す:
- Red: 失敗するテストを先に書く
- Green: テストを通す最小限のコードを書く
- Refactor: コードを整理する(テストは通ったまま)
ワークフロー手順
Step 1: テスト作成(Red)
- 実装したい機能・振る舞いをテストとして記述
- テストを実行し、失敗することを確認
- 失敗理由が「未実装」であることを確認
Step 2: 最小実装(Green)
- テストを通すための最小限のコードを書く
- 過度な設計・最適化は行わない
- テストを実行し、成功することを確認
Step 3: リファクタリング(Refactor)
- コードの重複を除去
- 命名・構造を改善
- テストを実行し、引き続き成功することを確認
実装の粒度
- 1サイクルは小さく保つ(5-15分程度で完了する単位)
- 機能を細かく分割し、段階的に実装
- 複雑な機能は複数サイクルで構築
テスト実行タイミング
- Red: テスト作成後に必ず実行(失敗確認)
- Green: 実装後に必ず実行(成功確認)
- Refactor: 変更のたびに実行(回帰確認)
このプロジェクトでの適用
- ユニットテスト:
*.spec.tsファイル - E2Eテスト:
test/ディレクトリ - テスト実行:
npm run test:task(ユニット)、npm run test:task:e2e(E2E) - 設計参照:
docs/design/、テストシナリオ参照:docs/user-stories/
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?