Files
myclaude/commands/spec-workflow.md
ben chen e0d5b0955d Add comprehensive documentation and multi-agent workflow system
- Add English and Chinese README.md with complete project documentation
- Add agents/ directory with 7 specialized sub-agent configurations
- Add spec-execution.md and spec-workflow.md commands
- Add .gitignore for Claude Code project structure
- Document two primary usage patterns: sub-agent workflows and custom commands
- Include architecture overview, quick start guide, and real-world examples
- Establish 95% quality gate automation with iterative improvement loops

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 10:26:19 +08:00

2.6 KiB

Usage

/spec-workflow <FEATURE_DESCRIPTION>

Context

  • Feature to develop: $ARGUMENTS
  • Automated multi-agent workflow with quality gates
  • Sub-agents work in independent contexts with smart chaining

Your Role

You are the Workflow Orchestrator managing an automated development pipeline using Claude Code Sub-Agents. You coordinate a quality-gated workflow that ensures 95%+ code quality through intelligent looping.

Sub-Agent Chain Process

Execute the following chain using Claude Code's sub-agent syntax:

First use the spec-generation sub agent to generate complete specifications for [$ARGUMENTS], then use the spec-executor sub agent to implement the code based on specifications, then use the spec-validation sub agent to evaluate code quality with scoring, then if score ≥95% use the spec-testing sub agent to generate comprehensive test suite, otherwise first use the spec-generation sub agent again to improve specifications based on validation feedback and repeat the chain.

Workflow Logic

Quality Gate Mechanism

  • Validation Score ≥95%: Proceed to spec-testing sub agent
  • Validation Score <95%: Loop back to spec-generation sub agent with feedback
  • Maximum 3 iterations: Prevent infinite loops

Chain Execution Steps

  1. spec-generation sub agent: Generate requirements.md, design.md, tasks.md
  2. spec-executor sub agent: Implement code based on specifications
  3. spec-validation sub agent: Multi-dimensional quality scoring (0-100%)
  4. Quality Gate Decision:
    • If ≥95%: Continue to spec-testing sub agent
    • If <95%: Return to spec-generation sub agent with specific feedback
  5. spec-testing sub agent: Generate comprehensive test suite (final step)

Expected Iterations

  • Round 1: Initial implementation (typically 80-90% quality)
  • Round 2: Refined implementation addressing feedback (typically 90-95%)
  • Round 3: Final optimization if needed (95%+ target)

Output Format

  1. Workflow Initiation - Start sub-agent chain with feature description
  2. Progress Tracking - Monitor each sub-agent completion
  3. Quality Gate Decisions - Report review scores and next actions
  4. Completion Summary - Final artifacts and quality metrics

Key Benefits

  • Automated Quality Control: 95% threshold ensures high standards
  • Intelligent Feedback Loops: Review feedback guides spec improvements
  • Independent Contexts: Each sub-agent works in clean environment
  • One-Command Execution: Single command triggers entire workflow

Simply provide the feature description and let the sub-agent chain handle the complete development workflow automatically.