🧪 TDD Workflow Commands: - /workflow:tdd-plan: 5-phase TDD planning with Red-Green-Refactor chains - /workflow:tdd-verify: 4-phase TDD compliance verification - /workflow:tools:task-generate-tdd: TDD task chain generator - /workflow:tools:tdd-coverage-analysis: Test coverage and cycle analysis 📋 Task Architecture: - Task ID format: TEST-N.M → IMPL-N.M → REFACTOR-N.M - Dependency enforcement: IMPL depends_on TEST, REFACTOR depends_on IMPL - Meta fields: tdd_phase (red/green/refactor), agent assignments 📊 Compliance Scoring: - Base score: 100 points with deductions for missing tasks - Comprehensive validation: chain structure, dependencies, cycle execution - Detailed reporting: TDD_COMPLIANCE_REPORT.md with recommendations 📚 Documentation: - Updated README.md and README_CN.md with TDD workflow examples - Added "How It Works" section explaining context-first architecture - Enhanced Getting Started with complete 4-phase workflow - Updated CHANGELOG.md with comprehensive v3.1.0 details 🎯 Design Philosophy: - Context-first architecture eliminates execution uncertainty - Pre-defined context gathering via context-package.json - JSON-first task model with pre_analysis steps - Multi-model orchestration (Gemini/Qwen/Codex) 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.1 KiB
name, description, usage, argument-hint, examples, allowed-tools
| name | description | usage | argument-hint | examples | allowed-tools | |||
|---|---|---|---|---|---|---|---|---|
| tdd-plan | Orchestrate TDD workflow planning with Red-Green-Refactor task chains | /workflow:tdd-plan [--agent] <input> | [--agent] "feature description"|file.md|ISS-001 |
|
SlashCommand(*), TodoWrite(*), Read(*), Bash(*) |
TDD Workflow Plan Command (/workflow:tdd-plan)
Coordinator Role
This command is a pure orchestrator: Execute 5 slash commands in sequence, parse outputs, pass context, and ensure complete TDD workflow creation.
Execution Modes:
- Manual Mode (default): Use
/workflow:tools:task-generate-tdd - Agent Mode (
--agent): Use/workflow:tools:task-generate-tdd --agent
Core Rules
- Start Immediately: First action is TodoWrite initialization, second action is Phase 1 execution
- No Preliminary Analysis: Do not read files before Phase 1
- Parse Every Output: Extract required data for next phase
- Sequential Execution: Each phase depends on previous output
- Complete All Phases: Do not return until Phase 5 completes
- TDD Context: All descriptions include "TDD:" prefix
5-Phase Execution
Phase 1: Session Discovery
Command: /workflow:session:start --auto "TDD: [structured-description]"
TDD Structured Format:
TDD: [Feature Name]
GOAL: [Objective]
SCOPE: [Included/excluded]
CONTEXT: [Background]
TEST_FOCUS: [Test scenarios]
Parse: Extract sessionId
Phase 2: Context Gathering
Command: /workflow:tools:context-gather --session [sessionId] "TDD: [structured-description]"
Parse: Extract contextPath
Phase 3: TDD Analysis
Command: /workflow:tools:concept-enhanced --session [sessionId] --context [contextPath]
Parse: Verify ANALYSIS_RESULTS.md
Phase 4: TDD Task Generation
Command:
- Manual:
/workflow:tools:task-generate-tdd --session [sessionId] - Agent:
/workflow:tools:task-generate-tdd --session [sessionId] --agent
Parse: Extract feature count, chain count, task count
Validate:
- TDD_PLAN.md exists
- IMPL_PLAN.md exists
- TEST-.json, IMPL-.json, REFACTOR-*.json exist
- TODO_LIST.md exists
Phase 5: TDD Structure Validation
Internal validation (no command)
Validate:
- Each feature has TEST → IMPL → REFACTOR chain
- Dependencies: IMPL depends_on TEST, REFACTOR depends_on IMPL
- Meta fields: tdd_phase correct ("red"/"green"/"refactor")
- Agents: TEST uses @code-review-test-agent, IMPL/REFACTOR use @code-developer
Return Summary:
TDD Planning complete for session: [sessionId]
Features analyzed: [N]
TDD chains generated: [N]
Total tasks: [3N]
Structure:
- Feature 1: TEST-1.1 → IMPL-1.1 → REFACTOR-1.1
[...]
Plans:
- TDD Structure: .workflow/[sessionId]/TDD_PLAN.md
- Implementation: .workflow/[sessionId]/IMPL_PLAN.md
Next: /workflow:execute or /workflow:tdd-verify
TodoWrite Pattern
// Initialize
[
{content: "Execute session discovery", status: "in_progress", activeForm: "..."},
{content: "Execute context gathering", status: "pending", activeForm: "..."},
{content: "Execute TDD analysis", status: "pending", activeForm: "..."},
{content: "Execute TDD task generation", status: "pending", activeForm: "..."},
{content: "Validate TDD structure", status: "pending", activeForm: "..."}
]
// Update after each phase: mark current "completed", next "in_progress"
Input Processing
Convert user input to TDD-structured format:
Simple text → Add TDD context Detailed text → Extract components with TEST_FOCUS File/Issue → Read and structure with TDD
Error Handling
- Parsing failure: Retry once, then report
- Validation failure: Report missing/invalid data
- Command failure: Keep phase in_progress, report error
- TDD validation failure: Report incomplete chains or wrong dependencies
Related Commands
/workflow:plan- Standard (non-TDD) planning/workflow:execute- Execute TDD tasks/workflow:tdd-verify- Verify TDD compliance/workflow:status- View progress