Tdd workflows tdd cycle

From rmyndharis/antigravity-skills · View interactive version

Tdd workflows tdd cycle is an AI agent skill from the GitHub repository rmyndharis/antigravity-skills. Coordinate the test-driven development cycle from requirements and failing tests through implementation, refactoring, and validation. Use when building a feature with a structured TDD workflow.

How to use this skill

Skill file

Use this skill when

Do not use this skill when

Instructions

Execute a comprehensive Test-Driven Development (TDD) workflow with strict red-green-refactor discipline:

[Extended thinking: This workflow enforces test-first development through coordinated agent orchestration. Each phase of the TDD cycle is strictly enforced with fail-first verification, incremental implementation, and continuous refactoring. The workflow supports both single test and test suite approaches with configurable coverage thresholds.]

Steps marked Role name a specialist perspective: apply the matching skill when it is installed, otherwise perform the step directly.

Configuration

Coverage Thresholds

Refactoring Triggers

Phase 1: Test Specification and Design

1. Requirements Analysis

2. Test Architecture Design

Phase 2: RED - Write Failing Tests

3. Write Unit Tests (Failing)

4. Verify Test Failure

Phase 3: GREEN - Make Tests Pass

5. Minimal Implementation

6. Verify Test Success

Phase 4: REFACTOR - Improve Code Quality

7. Code Refactoring

8. Test Refactoring

Phase 5: Integration and System Tests

9. Write Integration Tests (Failing First)

10. Implement Integration

Phase 6: Continuous Improvement Cycle

11. Performance and Edge Case Tests

12. Final Code Review

Incremental Development Mode

For test-by-test development:

  1. Write ONE failing test
  2. Make ONLY that test pass
  3. Refactor if needed
  4. Repeat for next test

Use this approach by adding --incremental flag to focus on one test at a time.

Test Suite Mode

For comprehensive test suite development:

  1. Write ALL tests for a feature/module (failing)
  2. Implement code to pass ALL tests
  3. Refactor entire module
  4. Add integration tests

Use this approach by adding --suite flag for batch test development.

Validation Checkpoints

RED Phase Validation

GREEN Phase Validation

REFACTOR Phase Validation

Coverage Reports

Generate coverage reports after each phase:

Failure Recovery

If TDD discipline is broken:

  1. STOP immediately
  2. Identify which phase was violated
  3. Rollback to last valid state
  4. Resume from correct phase
  5. Document lesson learned

TDD Metrics Tracking

Track and report:

Anti-Patterns to Avoid

Success Criteria

Notes

TDD implementation for: [user request]

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.