Test-Driven Development workflow coordinator. Detects TDD intent and offers guided red-green-refactor cycle. Activates for TDD, test-driven, red-green-refactor, write tests first, test-first development, Kent Beck, TDD cycle.
View on GitHubanton-abyzov/specweave
sw
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/anton-abyzov/specweave/blob/main/plugins/specweave/skills/tdd-workflow/SKILL.md -a claude-code --skill tdd-workflowInstallation paths:
.claude/skills/tdd-workflow/# TDD Workflow - Discovery & Coordination Skill
## Purpose
This skill acts as a **discovery hub** for Test-Driven Development (TDD) in SpecWeave. It:
- โ
Detects when users want to implement features with TDD
- โ
Asks user preference for TDD workflow enforcement
- โ
Routes to appropriate TDD tools (commands vs agent)
- โ
Provides TDD education and best practices
**NOT a full TDD implementation** - delegates to:
- `tdd-orchestrator` agent (deep TDD expertise)
- `/sw:tdd:cycle` command (enforced red-green-refactor)
- Individual phase commands (`/sw:tdd:red`, `/sw:tdd:green`, `/sw:tdd:refactor`)
---
## When to Activate
**Automatic activation when user mentions**:
- "implement with TDD"
- "use test-driven development"
- "red-green-refactor"
- "write tests first"
- "test-first approach"
- "Kent Beck style"
- "TDD discipline"
**Example triggers**:
```
User: "Implement authentication with TDD"
User: "Use test-driven development for this feature"
User: "Let's do red-green-refactor for the payment module"
```
---
## Workflow
### Step 1: Detect TDD Intent
When activated, confirm user's TDD intent:
```
"I detected you want to use Test-Driven Development (TDD).
TDD follows the red-green-refactor cycle:
๐ด RED: Write a failing test first
๐ข GREEN: Write minimal code to make it pass
๐ต REFACTOR: Improve code while keeping tests green
Would you like to:"
```
### Step 2: Offer TDD Options
**Use AskUserQuestion tool** to present choices:
```typescript
Question: "How would you like to implement TDD for this feature?"
Options:
1. "Guided TDD Workflow (/sw:tdd:cycle)"
Description: "Full red-green-refactor cycle with gates between phases.
Can't proceed to GREEN without RED test. Most rigorous."
2. "Expert TDD Agent (tdd-orchestrator)"
Description: "Deep TDD expertise with flexible workflow.
Best for complex scenarios, property-based testing, legacy code."
3. "Manual TDD (I'll guide myself)"
Description: "I'll