Skills / sickn33/agentic-awesome-skills / tdd-workflow Try your first task tdd-workflow
Start a fresh conversation. Replace the highlighted placeholders.
Use tdd-workflow to implement [feature or fix] against [acceptance criteria] with tests written first and the RED-GREEN-REFACTOR cycle; once the test suite passes, stop and ask me whether to integrate the branch rather than merging or pushing. Required inputs User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
name: tdd-workflow description: "Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle." risk: critical source: community date_added: "2026-02-27" TDD Workflow
Write tests first, code second.
1. The TDD Cycle
🔴 RED → Write failing test
↓
🟢 GREEN → Write minimal code to pass
↓
🔵 REFACTOR → Improve code quality
↓
Repeat...
2. The Three Laws of TDD
Write production code only to make a failing test pass
Write only enough test to demonstrate failure
Write only enough code to make the test pass
3. RED Phase Principles
What to Write
RED Phase Rules
Test must fail first
Test name describes expected behavior
One assertion per test (ideally)
4. GREEN Phase Principles
Minimum Code
GREEN Phase Rules
Don't write unneeded code
Don't optimize yet
Pass the test, nothing more
5. REFACTOR Phase Principles
What to Improve
REFACTOR Rules
All tests must stay green
Small incremental changes
Commit after each refactor
6. AAA Pattern
Every test follows:
7. When to Use TDD
8. Test Prioritization
9. Anti-Patterns
10. AI-Augmented TDD
Multi-Agent Pattern
Remember: The test is the specification. If you can't write a test, you don't understand the requirement.
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
Use this skill only when the task clearly matches the scope described above.
Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.