← スキル一覧に戻る

tdd-workflow
by mkaczkowski
⭐ 2🍴 0📅 2026年1月9日
SKILL.md
name: tdd-workflow description: Test-Driven Development guidance. Use during feature-dev Phase 5 (Implementation) or any code implementation. Ensures tests are written BEFORE implementation code, following Red-Green-Refactor cycle.
TDD Workflow
CRITICAL: Tests First
During implementation, you MUST write tests before writing implementation code. This is non-negotiable.
The Red-Green-Refactor Cycle
RED: Write Failing Test
- Write a test for ONE piece of expected behavior
- Run the test - it MUST fail
- Verify it fails for the RIGHT reason (not syntax error, not import error)
- The failing test defines what you're about to implement
GREEN: Make It Pass
- Write MINIMAL code to make the test pass
- Don't over-engineer - just make it work
- Hardcoding is acceptable temporarily
- The goal is a passing test, not perfect code
REFACTOR: Clean Up
- Only refactor AFTER tests pass
- Remove duplication
- Improve naming
- Run tests after EACH refactor change
- If tests fail, undo the refactor
Rules
- NEVER write implementation before tests
- One test at a time - don't write all tests upfront
- Keep tests focused and isolated
- Each test should test ONE behavior
- Use descriptive test names that explain the expected behavior
Testing Documentation
For test patterns, utilities, and conventions, reference:
- docs/TESTING.md - Unit test patterns, MSW mocking, coverage
- docs/E2E_TESTING.md - Playwright E2E patterns
Key points from project testing standards:
- Tests go in
tests/unit/mirroringsrc/structure - Use
renderfrom@/test(not @testing-library directly) - 80% coverage required
Integration with feature-dev
During Phase 5 (Implementation):
- Before writing any component/hook/util, write its test first
- Verify test fails (RED)
- Then implement the code
- Verify test passes (GREEN)
- Refactor if needed
- Repeat for next piece of functionality
Common Mistakes to Avoid
- Writing implementation first, then tests (defeats the purpose)
- Writing all tests before any implementation (too much upfront)
- Not running tests after each change
- Writing tests that don't fail initially
- Over-engineering during the GREEN phase
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です