Files
myclaude/README.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

319 lines
11 KiB
Markdown

# Claude Code Multi-Agent Workflow System
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Claude Code](https://img.shields.io/badge/Claude-Code-blue)](https://claude.ai/code)
> Transform your development workflow from manual command chains to automated expert teams with 95% quality assurance.
## 🚀 From Manual Commands to Automated Workflows
**Before**: Manual command chains requiring constant oversight
```bash
/ask → /code → /test → /review → /optimize
# 1-2 hours of manual orchestration, context pollution, quality uncertainty
```
**After**: One-command automated expert workflows
```bash
/spec-workflow "Implement JWT user authentication system"
# 30 minutes of automated execution, 95% quality gates, zero manual intervention
```
## 🎯 Core Value Proposition
This repository provides a **meta-framework for Claude Code** that implements:
- **🤖 Multi-Agent Orchestration**: Specialized AI teams working in parallel
- **⚡ Quality Gate Automation**: 95% threshold with automatic optimization loops
- **🔄 Workflow Automation**: From requirements to production-ready code
- **📊 Context Isolation**: Each agent maintains focused expertise without pollution
## 📋 Two Primary Usage Patterns
### 1. 🏭 Sub-Agent Workflows (Automated Expert Teams)
**Architecture**: Parallel specialist coordination with quality gates
```
spec-generation → spec-executor → spec-validation → (≥95%?) → spec-testing
↑ ↓ (<95%)
←←←←←← Automatic optimization loop ←←←←←←
```
**Usage**:
```bash
# Complete development workflow in one command
/spec-workflow "Build user management system with RBAC"
# Advanced multi-stage workflow
First use spec-generation, then spec-executor, then spec-validation,
then if score ≥95% use spec-testing, finally use optimize
```
**Quality Scoring** (Total 100%):
- Requirements Compliance (30%)
- Code Quality (25%)
- Security (20%)
- Performance (15%)
- Test Coverage (10%)
### 2. 🎛️ Custom Commands (Manual Orchestration)
**Architecture**: Individual slash commands for targeted expertise
```bash
/ask # Technical consultation and architecture guidance
/spec # Interactive requirements → design → tasks workflow
/code # Feature implementation with constraints
/debug # Systematic problem analysis using UltraThink
/test # Comprehensive testing strategy
/review # Multi-dimensional code validation
/optimize # Performance optimization coordination
```
**Progression Example**:
```bash
# Step-by-step development with manual control
/ask "Help me understand microservices architecture requirements"
/spec "Generate API gateway specifications"
/code "Implement gateway with rate limiting"
/test "Create load testing suite"
/review "Validate security and performance"
```
## 🚀 Quick Start
### 1. Setup Configuration
Clone or copy the configuration structure:
```bash
# Your project directory
├── commands/ # 12 specialized slash commands
├── agents/ # 7 expert agent configurations
└── CLAUDE.md # Project-specific guidelines
```
### 2. Basic Usage
**Complete Feature Development**:
```bash
/spec-workflow "Implement OAuth2 authentication with refresh tokens"
```
**Manual Development Flow**:
```bash
/ask "Design principles for scalable microservices"
/spec "OAuth2 service specifications"
/code "Implement OAuth2 with security best practices"
```
### 3. Expected Outputs
**Automated Workflow Results**:
- ✅ Complete specifications (requirements.md, design.md, tasks.md)
- ✅ Production-ready code with security best practices
- ✅ Comprehensive test suite (unit + integration + security)
- ✅ 95%+ quality validation score
## 🏗️ Architecture Overview
### Core Components
#### **Commands Directory** (`/commands/`)
- **Specification**: `/spec` - Interactive requirements → design → tasks
- **Consultation**: `/ask` - Architecture guidance (no code changes)
- **Implementation**: `/code` - Feature development with constraints
- **Quality Assurance**: `/test`, `/review`, `/debug`
- **Optimization**: `/optimize`, `/refactor`
- **Operations**: `/deploy-check`, `/cicd`
#### **Agents Directory** (`/agents/`)
- **spec-generation**: Automated specification workflow
- **spec-executor**: Implementation coordinator with progress tracking
- **spec-validation**: Multi-dimensional quality scoring (0-100%)
- **spec-testing**: Comprehensive test strategy coordination
- **code**: Development coordinator for direct implementation
- **debug**: UltraThink systematic problem analysis
- **optimize**: Performance optimization coordination
### Multi-Agent Coordination System
**4 Core Specialists**:
1. **Specification Generator** - Requirements, design, implementation planning
2. **Implementation Executor** - Code development with task tracking
3. **Quality Validator** - Multi-dimensional scoring with actionable feedback
4. **Test Coordinator** - Comprehensive testing strategy and execution
**Key Features**:
- **Independent Contexts**: No context pollution between specialists
- **Quality Gates**: 95% threshold for automatic progression
- **Iterative Improvement**: Automatic optimization loops
- **Traceability**: Full specification → code → test traceability
## 📚 Workflow Examples
### Enterprise User Authentication System
**Input**:
```bash
/spec-workflow "Enterprise JWT authentication with RBAC, supporting 500 concurrent users, integrated with existing LDAP"
```
**Automated Process**:
1. **Round 1** (Quality: 83/100) - Basic implementation
- Issues: JWT key hardcoded, missing password complexity
- **Decision**: <95%, restart with improvements
2. **Round 2** (Quality: 91/100) - Security improvements
- Issues: Exception handling incomplete, performance not optimized
- **Decision**: <95%, continue optimization
3. **Round 3** (Quality: 97/100) - Production ready
- **Decision**: ≥95%, proceed to comprehensive testing
**Final Deliverables**:
- Complete EARS-format requirements
- Security-hardened JWT implementation
- RBAC with role hierarchy
- LDAP integration with error handling
- Comprehensive test suite (unit + integration + security)
### API Gateway Development
**Input**:
```bash
/ask "Design considerations for high-performance API gateway"
# (Interactive consultation phase)
/spec "Microservices API gateway with rate limiting and circuit breakers"
# (Specification generation)
/code "Implement gateway based on specifications"
# (Implementation phase)
```
**Results**:
- Architectural consultation on performance patterns
- Detailed specifications with load balancing strategy
- Production-ready implementation with monitoring
## 🔧 Advanced Usage Patterns
### Custom Workflow Composition
```bash
# Debug → Fix → Validate workflow
First use debug to analyze [performance issue],
then use code to implement fixes,
then use spec-validation to ensure quality
# Complete development + optimization pipeline
First use spec-generation for [feature],
then spec-executor for implementation,
then spec-validation for quality check,
then if score ≥95% use spec-testing,
finally use optimize for production readiness
```
### Quality-Driven Development
```bash
# Iterative quality improvement
First use spec-validation to score [existing code],
then if score <95% use code to improve based on feedback,
repeat until quality threshold achieved
```
## 🎯 Benefits & Impact
| Dimension | Manual Commands | Sub-Agent Workflows |
|-----------|----------------|-------------------|
| **Complexity** | Manual trigger for each step | One-command full pipeline |
| **Quality** | Subjective assessment | 95% objective scoring |
| **Context** | Pollution, requires /clear | Isolated, no pollution |
| **Expertise** | AI role switching | Focused specialists |
| **Error Handling** | Manual discovery/fix | Automatic optimization |
| **Time Investment** | 1-2 hours manual work | 30 minutes automated |
## 🔮 Key Innovations
### 1. **Specialist Depth Over Generalist Breadth**
Each agent focuses on their domain expertise in independent contexts, avoiding the quality degradation of role-switching.
### 2. **Intelligent Quality Gates**
95% objective scoring with automatic decision-making for workflow progression or optimization loops.
### 3. **Complete Automation**
One command triggers end-to-end development workflow with minimal human intervention.
### 4. **Continuous Improvement**
Quality feedback drives automatic specification refinement, creating intelligent improvement cycles.
## 🛠️ Configuration
### Setting Up Sub-Agents
1. **Create Agent Configurations**: Copy agent files to your Claude Code configuration
2. **Configure Commands**: Set up workflow trigger commands
3. **Customize Quality Gates**: Adjust scoring thresholds if needed
### Workflow Customization
```bash
# Custom workflow with specific quality requirements
First use spec-generation with [strict security requirements],
then spec-executor with [performance constraints],
then spec-validation with [90% minimum threshold],
continue optimization until threshold met
```
## 📖 Command Reference
### Specification Workflow
- `/spec` - Interactive requirements → design → tasks
- `/spec-workflow` - Automated end-to-end specification + implementation
### Development Commands
- `/ask` - Architecture consultation (no code changes)
- `/code` - Feature implementation with constraints
- `/debug` - Systematic problem analysis
- `/test` - Comprehensive testing strategy
- `/review` - Multi-dimensional code validation
### Optimization Commands
- `/optimize` - Performance optimization coordination
- `/refactor` - Code refactoring with quality gates
- `/deploy-check` - Deployment readiness validation
## 🤝 Contributing
This is a Claude Code configuration framework. Contributions welcome:
1. **New Agent Configurations**: Specialized experts for specific domains
2. **Workflow Patterns**: New automation sequences
3. **Quality Metrics**: Enhanced scoring dimensions
4. **Command Extensions**: Additional development phase coverage
## 📄 License
MIT License - see [LICENSE](LICENSE) file for details.
## 🙋 Support
- **Documentation**: Check `/commands/` and `/agents/` for detailed specifications
- **Issues**: Use GitHub issues for bug reports and feature requests
- **Discussions**: Share workflow patterns and customizations
---
## 🎉 Getting Started
Ready to transform your development workflow? Start with:
```bash
/spec-workflow "Your first feature description here"
```
Watch as your one-line request becomes a complete, tested, production-ready implementation with 95% quality assurance.
**Remember**: Professional software comes from professional processes. Sub-agents give you a tireless, always-expert virtual development team.
*Let specialized AI do specialized work - development becomes elegant and efficient.*