本文へスキップ
Skillpedia
テスト48k · #5935

tdd-workflows-tdd-green

できること

このツールは、失敗しているテストを通すために必要な最小限のコードを書くのに役立ちます。まずは目の前の問題を解決して、テストが再び動くようにすることに重点を置いています。

使う場面

  • ✓コードのテストが失敗していて、すぐに直したいとき。
  • ✓新しい機能の開発を始めて、最初の作業としてテストを通したいとき。
  • ✓必要なものだけを実装して、コードが期待どおりに動くようにしたいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-green/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-green/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“商品一覧のテストが失敗しています。テストを通すための最小限のコードを作成してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、壊れたテストを満たす最も小さなコードの変更を分析します。その小さな修正を実装し、余計な複雑さを加えずにテストが通るかを確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

  1. Review failing tests and identify the smallest fix.
  2. Implement the minimal change to pass the next test.
  3. Run tests after each change to confirm progress.
  4. 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.md for 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.
よくある質問

TDDの「グリーンフェーズ」とはどういう意味ですか?

TDD(テスト駆動開発)における「グリーンフェーズ」とは、すべてのコードテストが通っている状態のことです。

なぜ最小限のコードを書くことが重要なのですか?

最小限のコードを書くと、不要な複雑さを避けられ、テストが示している問題だけを正確に解決できます。そのため、後のメンテナンスも楽になります。

このツールはいつ使うのをやめればよいですか?

テストがすべて通り、新しい機能を追加する段階になったら使うのをやめてください。また、テストを直すことではなく、コード全体の設計を改善することが目的になったときも使う必要はありません。

詳細

作者による元の説明

Implement the minimal code needed to make failing tests pass in the TDD green phase.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5935
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル