🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

TDD Workflow

by @djc00p

Test-driven development workflow enforcing 80%+ code coverage with unit, integration, and E2E tests. Write tests first, validate RED state, implement minimal...

Versionv1.0.0
Downloads526
Installs7
TERMINAL
clawhub install tdd-workflow

πŸ“– About This Skill


name: tdd-workflow description: "Test-driven development workflow enforcing 80%+ code coverage with unit, integration, and E2E tests. Write tests first, validate RED state, implement minimally, validate GREEN, then refactor. Use when writing features, fixing bugs, or refactoring. Trigger phrases: write tests, TDD, test-driven, feature implementation, bug fix. Adapted from everything-claude-code by @affaan-m (MIT)" metadata: {"clawdbot":{"emoji":"βœ…","requires":{"bins":["npm","git"],"env":[]},"os":["darwin","linux","win32"]}}

Test-Driven Development Workflow

Ensure all code development follows TDD principles with 80%+ code coverage.

When to Activate

  • Writing new features or functionality
  • Fixing bugs or issues
  • Refactoring existing code
  • User says "write tests", "add specs", "how should I test this"
  • Quick Start

    1. Write user journey in acceptance-test format ("As a [role], I want...") 2. Generate test cases (happy path + edge cases + errors) 3. Run tests β†’ verify RED state (must fail before implementation) 4. Implement minimal code to make tests pass β†’ GREEN state 5. Refactor while keeping tests green 6. Verify 80%+ coverage achieved

    Key Concepts

  • Tests before code β€” Write tests first, then implementation
  • RED-GREEN-REFACTOR β€” Fail β†’ Pass β†’ Improve (no exceptions)
  • 80% coverage minimum β€” Unit, integration, and E2E combined
  • Unit-level isolation β€” Mock dependencies, test behavior not implementation
  • Independent tests β€” No test ordering dependencies; each can run solo
  • Common Usage

    Most frequent patterns:

  • Unit tests for functions and components
  • Integration tests for API endpoints and database operations
  • E2E tests for critical user flows
  • Edge case and error path testing
  • Fast execution (unit tests < 50ms each)
  • References

  • references/workflow-steps.md β€” Detailed 7-step TDD cycle with git checkpoints
  • references/patterns-and-best-practices.md β€” Test patterns, common mistakes, success metrics
  • πŸ’‘ Examples

    1. Write user journey in acceptance-test format ("As a [role], I want...") 2. Generate test cases (happy path + edge cases + errors) 3. Run tests β†’ verify RED state (must fail before implementation) 4. Implement minimal code to make tests pass β†’ GREEN state 5. Refactor while keeping tests green 6. Verify 80%+ coverage achieved