Back to Skills

tdd-workflow

verified

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 GitHub

Marketplace

specweave

anton-abyzov/specweave

Plugin

sw

development

Repository

anton-abyzov/specweave
27stars

plugins/specweave/skills/tdd-workflow/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/anton-abyzov/specweave/blob/main/plugins/specweave/skills/tdd-workflow/SKILL.md -a claude-code --skill tdd-workflow

Installation paths:

Claude
.claude/skills/tdd-workflow/
Powered by add-skill CLI

Instructions

# 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 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
9253 chars