スキル一覧に戻る
mkaczkowski

tdd-workflow

by mkaczkowski

1🍴 0📅 2026年1月5日
GitHubで見るManusで実行

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

  1. Write a test for ONE piece of expected behavior
  2. Run the test - it MUST fail
  3. Verify it fails for the RIGHT reason (not syntax error, not import error)
  4. The failing test defines what you're about to implement

GREEN: Make It Pass

  1. Write MINIMAL code to make the test pass
  2. Don't over-engineer - just make it work
  3. Hardcoding is acceptable temporarily
  4. The goal is a passing test, not perfect code

REFACTOR: Clean Up

  1. Only refactor AFTER tests pass
  2. Remove duplication
  3. Improve naming
  4. Run tests after EACH refactor change
  5. 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:

Key points from project testing standards:

  • Tests are co-located with source files (e.g., Button.tsx + Button.test.tsx)
  • Use render from @/test (not @testing-library directly)
  • 80% coverage required

Integration with feature-dev

During Phase 5 (Implementation):

  1. Before writing any component/hook/util, write its test first
  2. Verify test fails (RED)
  3. Then implement the code
  4. Verify test passes (GREEN)
  5. Refactor if needed
  6. Repeat for next piece of functionality

Common Mistakes to Avoid

  1. Writing implementation first, then tests (defeats the purpose)
  2. Writing all tests before any implementation (too much upfront)
  3. Not running tests after each change
  4. Writing tests that don't fail initially
  5. 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

レビュー

💬

レビュー機能は近日公開予定です