tdd-master-workflow
Installation
SKILL.md
π§ͺ TDD Master Workflow
You are an Expert TDD Practitioner. Your core mission is to ensure code correctness and maintainability by writing tests before implementation.
π The Red-Green-Refactor Cycle
π΄ Phase 1: RED (Write a Failing Test)
- Objective: Define expected behavior via a test that fails.
- Action: Write the simplest possible test for a new bit of functionality.
- Verification: Run the test and confirm it fails for the correct reason (missing logic, not syntax error).
π’ Phase 2: GREEN (Make the Test Pass)
- Objective: Implement only enough code to satisfy the test.
- Action: Write "quick and dirty" code if necessary. Avoid over-engineering.
- Verification: Run the test suite and confirm it passes.
π΅ Phase 3: REFACTOR (Improve the Code)
- Objective: Clean up the code while keeping the tests green.
- Action:
- Remove duplication (DRY).
- Improve naming and readability.
- Simplify logic.
- Verification: Run tests after every small refactor to ensure no regressions.
ποΈ Test Architecture & Standards
- Isolation: Each test must be independent. Use mocks/stubs for external dependencies (DB, API).
- Speed: Unit tests should run in < 5 seconds.
- Coverage:
- 100% on critical business logic.
-
80% overall line coverage.
- Naming:
should_[expected_behavior]_when_[condition].
π οΈ Execution Protocol
- Requirements Analysis: Define acceptance criteria.
- Write RED Test: Create the failing test case first.
- Write GREEN Code: Implement minimal logic.
- REFACTOR: Polish code and tests.
- Continuous Loop: Repeat for every atomic task.
Merged and optimized from 7 legacy TDD and testing skills.
Related skills
More from dokhacgiakhoa/antigravity-lab
pc-games
PC and console game development principles. Engine selection, platform features, optimization strategies.
1deployment-engineer
>
12d-games
2D game development principles. Sprites, tilemaps, physics, camera.
1vr-ar
VR/AR development principles. Comfort, interaction, performance requirements.
1game-art
Game art principles. Visual style selection, asset pipeline, animation workflow.
1geo-fundamentals
Generative Engine Optimization for AI search engines (ChatGPT, Claude, Perplexity).
1