Execute complete TDD cycle (RED-GREEN-REFACTOR) for implementing a feature with integrated feedback loops
Executes complete TDD cycle with integrated feedback loops and quality gates.
/plugin marketplace add DoubleslashSE/claude-marketplace/plugin install dotnet-tdd@doubleslash-pluginsExecute the complete TDD cycle for: $ARGUMENTS
┌─────────────────────────────────────────────────────────────────┐
│ TDD WITH FEEDBACK LOOPS │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ RED PHASE │ │
│ │ Design Test → Run → Fails for RIGHT reason? │ │
│ │ ▲ │ │ │
│ │ └──── NO: Adjust test ───┘ │ │
│ │ YES ↓ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ GREEN PHASE │ │
│ │ Implement → Run → All tests pass? │ │
│ │ ▲ │ │ │
│ │ └──── NO: Fix impl ──┘ │ │
│ │ YES ↓ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ REFACTOR PHASE (with Quality Gate) │ │
│ │ Refactor → Review → Score >= 90%? │ │
│ │ ▲ │ │ │
│ │ └──── NO: Apply ─────┘ │ │
│ │ feedback │ │
│ │ YES ↓ │ │
│ │ COMPLETE │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Design → Run → Analyze → Adjust (if needed) → Confirm RED
Exit Criteria: Test fails for the correct reason
Implement → Run → Analyze Failures → Fix → Re-run → Confirm GREEN
Exit Criteria: All tests pass (GREEN state)
Refactor → Review → Process Feedback → Apply Fixes → Re-review → Quality Gate
/dotnet-tdd:review)Exit Criteria: Quality score >= 90% AND all tests pass
| Category | Target | Weight |
|---|---|---|
| SOLID Compliance | 90% | 30% |
| Clean Code (DRY/KISS/YAGNI) | 90% | 25% |
| Test Quality | 90% | 25% |
| CQS Compliance | 95% | 20% |
{MethodUnderTest}_{Scenario}_{ExpectedBehavior}
# Run all tests
dotnet test
# Run specific test
dotnet test --filter "FullyQualifiedName~{TestName}"
# Run with coverage
dotnet test /p:CollectCoverage=true
# Run code review
/dotnet-tdd:review {path}
Provide a summary after completing the TDD cycle:
## TDD Cycle Complete
### RED Phase
- Tests designed: {count}
- Scenarios covered: Happy path, edge cases, errors
- All tests fail for correct reasons: ✅
### GREEN Phase
- Tests passing: {count}/{total}
- Implementation files: {list}
- Iterations to pass: {count}
### REFACTOR Phase
- Review cycles: {count}
- Initial score: {X}%
- Final score: {Y}%
- Refactorings applied: {list}
### Quality Scores
| Category | Score | Status |
|----------|-------|--------|
| SOLID | {X}% | ✅ |
| Clean Code | {X}% | ✅ |
| Test Quality | {X}% | ✅ |
| CQS | {X}% | ✅ |
| **Overall** | {X}% | ✅ PASS |
### Final Test Results
```bash
dotnet test
# {X} tests passed, 0 failed