End-to-end TDD SDLC workflow for adding features (orchestrator)
End-to-end TDD workflow that guides you through building features with proper discovery, test-first development, and verification gates. Use it when adding new features to ensure quality and follow best practices.
/plugin marketplace add kenotron-ms/amplifier-setup/plugin install dev-kit@amplifier-setupfeature description or empty to resumeComplete Software Development Lifecycle (SDLC) workflow using Test-Driven Development (TDD) methodology for adding features.
# Start new feature
/new-feature Add user authentication with JWT
# Resume existing feature
/new-feature
# Check progress
/new-feature:status
Feature: $ARGUMENTS
Setup: 0. Discovery → 1. Requirements → 2. Design
TDD: 3. Tests (RED) → 4. Implement (GREEN) → 5. Refactor
Finish: 6. Verify → 7. Document → 8. Cleanup
Visual Grouping:
┌─────────────────────────┐
│ SETUP │
│ 0→1→2 │
└─────────────────────────┘
↓
┌─────────────────────────┐
│ TDD CYCLE │
│ 3(RED)→4(GREEN)→5(REF) │
└─────────────────────────┘
↓
┌─────────────────────────┐
│ FINALIZE │
│ 6→7→8 │
└─────────────────────────┘
TDD Cycle: RED (write tests) → GREEN (make pass) → REFACTOR (improve quality)
Individual phase commands:
/new-feature:0-discover - Phase 0: Discovery/new-feature:1-requirements - Phase 1: Requirements/new-feature:2-design - Phase 2: Design/new-feature:3-tests - Phase 3: Test Planning (TDD RED)/new-feature:4-implement - Phase 4: Implementation (TDD GREEN)/new-feature:5-refactor - Phase 5: Refactoring (TDD REFACTOR)/new-feature:6-verify - Phase 6: Verification/new-feature:7-document - Phase 7: Documentation/new-feature:8-cleanup - Phase 8: Cleanup (archive working docs)/new-feature:status - Check progressAll operations must run in the actual project directory, not the Claude worktree.
The commands will use PROJECT_DIR environment variable if set, otherwise fall back to the current directory ($PWD).
At the start of this command, set PROJECT_DIR:
# Use PROJECT_DIR if set, otherwise use current directory
PROJECT_DIR="${PROJECT_DIR:-$PWD}"
echo "Working in: $PROJECT_DIR"
Always check for existing features first (regardless of $ARGUMENTS):
# Find existing feature directories
EXISTING=$(find ai_working -maxdepth 1 -type d -name "*-20*" 2>/dev/null | sort -r)
For each existing feature, read progress.md to extract:
Use AskUserQuestion to determine what user wants to work on.
Scenario A: Existing features found AND $ARGUMENTS provided
Check if $ARGUMENTS matches any existing feature (fuzzy match).
question: "I found existing features. You also specified: '$ARGUMENTS'. Which would you like to work on?"
header: "Feature"
multiSelect: false
options:
- label: "[Feature 1 Name] (XX% complete, YYYY-MM-DD)"
description: "Resume this feature. Current phase: [Phase Name]"
- label: "[Feature 2 Name] (XX% complete, YYYY-MM-DD)" [SIMILAR if matches $ARGUMENTS]
description: "Resume this feature. Current phase: [Phase Name]"
- label: "NEW: $ARGUMENTS"
description: "Start a new feature with the description you provided"
Scenario B: Existing features found, NO $ARGUMENTS
Even if only ONE feature exists, always ask for confirmation:
question: "Which feature would you like to work on?"
header: "Feature"
multiSelect: false
options:
- label: "[Feature 1 Name] (XX% complete, YYYY-MM-DD)"
description: "Resume this feature. Current phase: [Phase Name]"
- label: "[Feature 2 Name] (XX% complete, YYYY-MM-DD)" (if multiple features)
description: "Resume this feature. Current phase: [Phase Name]"
- (Other is automatically provided for new feature)
Do NOT assume user wants to resume just because only one feature exists. Always present choice, even for single feature.
Scenario C: NO existing features, $ARGUMENTS provided
Confirm with user:
question: "Start new feature: '$ARGUMENTS'?"
header: "Confirm"
multiSelect: false
options:
- label: "Yes, start this feature"
description: "Begin Phase 0 (Discovery) for this feature"
- (Other automatically provided for different description)
Scenario D: NO existing features, NO $ARGUMENTS
Ask for feature description (no AskUserQuestion needed, just prompt user).
If user selected existing feature:
ai_working/<feature>-<date>/progress.mdIf user starts new feature:
ai_working/<feature-name>-<YYYY-MM-DD>/Phase 1 (Requirements):
Phase 2 (Design):
Phase 6 (Verification):
This workflow enforces:
ai_working/<feature-name>-YYYY-MM-DD/
├── progress.md # Progress tracker
├── 00-discovery.md # Phase 0
├── 01-requirements.md # Phase 1
├── 02-design.md # Phase 2
├── 03-test-plan.md # Phase 3
├── 04-implementation.md # Phase 4
├── 05-review.md # Phase 5
├── 06-manual-test-plan.md # Phase 6
├── 07-docs-checklist.md # Phase 7
└── 08-cleanup-candidates.md # Phase 8 (optional)
Temporary: All files in ai_working/ are temporary brainstorming/tracking documents
Permanent: Final documentation created in Phase 7 following repository's structure
For Users:
/git:commitFor Claude Code:
"Which phase am I on?"
/new-feature:status"I want to skip a phase"
"I want to restart"
ai_working/<feature>-<date>//new-feature againReady to build features following professional TDD SDLC practices!