🛠️ TDD Workflows TDD Green
TDDのグリーンフェーズにおいて、失敗しているテストを通過させるための最小限のコードを実装するSkill。
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Implement the minimal code needed to make failing tests pass in the TDD green phase.
🇯🇵 日本人クリエイター向け解説
TDDのグリーンフェーズにおいて、失敗しているテストを通過させるための最小限のコードを実装するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o tdd-workflows-tdd-green.zip https://jpskill.com/download/3575.zip && unzip -o tdd-workflows-tdd-green.zip && rm tdd-workflows-tdd-green.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3575.zip -OutFile "$d\tdd-workflows-tdd-green.zip"; Expand-Archive "$d\tdd-workflows-tdd-green.zip" -DestinationPath $d -Force; ri "$d\tdd-workflows-tdd-green.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
tdd-workflows-tdd-green.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
tdd-workflows-tdd-greenフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Tdd Workflows Tdd Green を使って、最小構成のサンプルコードを示して
- › Tdd Workflows Tdd Green の主な使い方と注意点を教えて
- › Tdd Workflows Tdd Green を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] tdd-workflows-tdd-green
グリーンフェーズ: シンプルな関数
def product_list(request):
products = Product.objects.all()
return JsonResponse({'products': list(products.values())})
リファクタリング: クラスベースビュー
class ProductListView(View):
def get(self, request):
products = Product.objects.all()
return JsonResponse({'products': list(products.values())})
リファクタリング: ジェネリックビュー
class ProductListView(ListView):
model = Product
context_object_name = 'products'
Express パターン
インライン → ミドルウェア → サービスレイヤー:
// グリーンフェーズ: インラインロジック
app.post('/api/users', (req, res) => {
const user = { id: Date.now(), ...req.body };
users.push(user);
res.json(user);
});
// リファクタリング: ミドルウェアの抽出
app.post('/api/users', validateUser, (req, res) => {
const user = userService.create(req.body);
res.json(user);
});
// リファクタリング: 完全なレイヤー化
app.post('/api/users',
validateUser,
asyncHandler(userController.create)
);
このスキルを使用する場面
- TDDサイクルでレッドからグリーンへ移行する際
- テストを満たすための最小限の動作を実装する際
- 意図的に実装をシンプルに保ちたい場合
このスキルを使用しない場面
- デザインやパフォーマンスのためにリファクタリングを行う場合
- テストが既にパスしており、新しい要件が必要な場合
- 完全なアーキテクチャの再設計が必要な場合
手順
- 失敗しているテストを確認し、最小限の修正を特定します。
- 次のテストをパスするための最小限の変更を実装します。
- 各変更後にテストを実行し、進捗を確認します。
- リファクタリングフェーズのためにショートカットや負債を記録します。
安全性
- テストをパスさせるためにテストを迂回することは避けてください。
- 変更は失敗している動作のみに限定してください。
リソース
- 詳細なパターンと例については
resources/implementation-playbook.mdを参照してください。
制限事項
- このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
- 出力を環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
- 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して説明を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Green Phase: Simple function
def product_list(request): products = Product.objects.all() return JsonResponse({'products': list(products.values())})
Refactor: Class-based view
class ProductListView(View): def get(self, request): products = Product.objects.all() return JsonResponse({'products': list(products.values())})
Refactor: Generic view
class ProductListView(ListView): model = Product context_object_name = 'products'
### Express Patterns
**Inline → Middleware → Service Layer:**
```javascript
// Green Phase: Inline logic
app.post('/api/users', (req, res) => {
const user = { id: Date.now(), ...req.body };
users.push(user);
res.json(user);
});
// Refactor: Extract middleware
app.post('/api/users', validateUser, (req, res) => {
const user = userService.create(req.body);
res.json(user);
});
// Refactor: Full layering
app.post('/api/users',
validateUser,
asyncHandler(userController.create)
);
Use this skill when
- Moving from red to green in a TDD cycle
- Implementing minimal behavior to satisfy tests
- You want to keep implementation intentionally simple
Do not use this skill when
- You are refactoring for design or performance
- Tests are already passing and you need new requirements
- You need a full architectural redesign
Instructions
- Review failing tests and identify the smallest fix.
- Implement the minimal change to pass the next test.
- Run tests after each change to confirm progress.
- Record shortcuts or debt for the refactor phase.
Safety
- Avoid bypassing tests to make them pass.
- Keep changes scoped to the failing behavior only.
Resources
resources/implementation-playbook.mdfor detailed patterns and examples.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.