← スキル一覧に戻る

test-driven-development
by asadullah48
Unified Claude.ai Skills Marketplace - 39+ production-ready skills for development workflows, hackathon projects, and AI automation
⭐ 0🍴 1📅 2026年1月24日
SKILL.md
name: test-driven-development description: Use when implementing any feature or bugfix - requires writing a failing test before writing any production code
Test-Driven Development
Overview
Write a failing test first, then implement the minimal code to pass it, then refactor.
Core principle: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
This is mandatory. No exceptions for production code.
The Red-Green-Refactor Cycle
RED: Write Failing Test
- Write a minimal test demonstrating desired behavior
- Run test - it MUST fail
- Verify it fails for the right reason
GREEN: Implement Minimal Code
- Write the simplest code to pass the test
- No extra features, no optimization
- Run test - it MUST pass
REFACTOR: Clean Up
- Improve code while maintaining test pass
- Remove duplication
- Improve naming
- Run tests to ensure nothing breaks
Why This Matters
- Tests written after code pass immediately - proving nothing
- Manual testing is ad-hoc and non-repeatable
- TDD catches bugs before deployment
- Tests become safety net for future changes
Critical Requirements
Tests must be:
- Minimal - one behavior each
- Clear - descriptive naming
- Real - avoiding unnecessary mocks
Verification Checklist
- Test fails before implementation (RED)
- Test passes after implementation (GREEN)
- Refactoring maintains pass
- Test actually exercises the code
Red Flags - STOP
- Code written before test
- Tests that pass immediately
- Manual verification instead of tests
- "I'll write tests after"
- Skipping the cycle
If you wrote code before test: Delete it. Start over with test first.
Common Mistakes
| Mistake | Reality |
|---|---|
| Test passes immediately | You wrote code before test |
| Manual testing | Ad-hoc, non-repeatable |
| "This is simple" | Simple code breaks too |
| "No time for tests" | Testing saves time by preventing rework |
Integration
- Phase 4.1 of debugging - Create failing test before fixing
- Plan execution - Each task includes test-first step
- Subagent-driven development - Implementation includes test creation
スコア
総合スコア
70/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です