Practicing TDD
について
このClaudeスキルは、レッド・グリーン・リファクタリングサイクルを用いたテスト駆動開発のワークフローを開発者に案内します。機能開発、バグ修正の実施時、またはTDDが言及された際に発動し、TDDのベストプラクティスに従って開発フロー全体を管理します。本スキルは、テストリストの作成、最初に失敗するテストを書くこと、テストを通す最小限のコード実装、テストの整合性を維持しながらのリファクタリングを支援します。
クイックインストール
Claude Code
推奨/plugin add https://github.com/camoneart/claude-codegit clone https://github.com/camoneart/claude-code.git ~/.claude/skills/Practicing TDDこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Practicing TDD
テスト駆動開発(TDD)のベストプラクティスに従った開発フローを管理するスキル。
いつ使うか
- プロジェクト(プロダクト、アプリ、サイト等)の開発時
- 新機能実装時
- バグ修正時
- ユーザーがTDD、テスト駆動開発について言及した時
基本原則
Red-Green-Refactor サイクル
1. Red → テストを書いて失敗させる
2. Green → テストを通す最小限のコード
3. Refactor → コードを整理整頓
4. 繰り返し
開発手順
ステップ1: ToDo リスト作成
やるべきことを箇条書きで整理(テストリスト)
ステップ2: Red(レッド)
- ToDo リストから1つピックアップ
- テストから書く(テストファースト)
- テストを実行して失敗させる
ステップ3: Green(グリーン)
- 失敗しているテストを成功させることに集中
- 最小限のコードを書く(綺麗より動作優先)
- 全てのテストが成功することを確認
ステップ4: Refactor(リファクタリング)
- 全てのテストが成功している状態で整理整頓
- テストは通ったままにする
- 実装コード、テストコード両方をリファクタリング
ステップ5: 繰り返し
- 気付きを ToDo リストに反映
- 次の ToDo を選んで Red に戻る
品質基準
テスト配置
- テストコードは
src/__tests__/または実装ファイルと同階層の*.test.ts(x)に配置 pnpm testで必ず全スイートを実行
カバレッジ基準
- コードカバレッジは常に 80% 以上 を維持
- CI で閾値を下回った場合はジョブを fail させる
バグ修正フロー
- 再現テスト(Red)を書く
- 修正(Green)
- リファクタリング(Refactor)
品質ゲート
テスト追加・変更後は必ず実行:
pnpm run lint && pnpm run typecheck
参考記事
詳細は references.md を参照。
注意事項
- テストを書かずに実装を進めない
- 複数の機能を同時に実装しない(1つずつ)
- テストが失敗したままリファクタリングしない
- カバレッジ80%未満でコミットしない
GitHub リポジトリ
関連スキル
content-collections
メタThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
creating-opencode-plugins
メタThis skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.
evaluating-llms-harness
テストThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
sglang
メタSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
