
implementing-tdd
by sato-dev1234
SKILL.md
name: implementing-tdd description: "TDD workflow executor using Canon TDD (Red-Green-Refactor). Supports test list creation, failing test writing, minimal implementation, and refactoring with test verification. Use when implementing features with TDD approach." allowed-tools: Read, Write, Edit, Bash, Grep, Glob context: fork
Quick start
RED-GREEN-REFACTOR cycle:
1. RED: Write failing test → verify it fails
2. GREEN: Implement minimal code → verify test passes
3. REFACTOR: Improve code → verify tests still pass
Run tests:
npm test # or pytest, gradle test, etc.
TDD workflow
Copy this checklist and track your progress:
Progress:
- [ ] Step 1: Parse REQUIREMENTS, DESIGN, and KNOWLEDGE
- [ ] Step 2: Create test list (or use provided TEST_LIST)
- [ ] Step 3: Execute RED-GREEN-REFACTOR cycle
- [ ] Step 4: Generate completion report
Step 1: Parse REQUIREMENTS, DESIGN, and KNOWLEDGE
Parse REQUIREMENTS from task prompt.
Parse DESIGN from task prompt.
Parse TEST_LIST (optional) from task prompt. If TEST_LIST is provided, skip Step 2.
Run: python ~/.claude/scripts/resolve_knowledge.py --refs "${TICKET_PATH}/knowledge-refs.md" --workflow "/tdd" --base "${CONFIG.BASE_PATH}"
- On success/partial: use
knowledge[].contentfor Troubleshooting section
Step 2: Create test list
Create test list from requirements and design, ordered simple to complex.
Implementation principles
Before starting RED-GREEN-REFACTOR cycle, internalize these principles:
- WHY-first comments: Write reasons (business constraints, security requirements), not HOW
- Declarative comments: Avoid conversational tone in comments, state facts
- Input validation first: For functions receiving external input, implement validation first
Step 3: Execute RED-GREEN-REFACTOR cycle
Execute RED-GREEN-REFACTOR cycle for each test item:
- RED: Write failing test
- GREEN: Verify failure, implement minimal code
- REFACTOR: If needed, improve code
Apply implementation principles during GREEN and REFACTOR phases.
Step 4: Generate completion report
Generate completion report with test list status and implementation summary.
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon