Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:51:21 +08:00
commit 6b4cf5895e
24 changed files with 4061 additions and 0 deletions

322
commands/00-SYSTEM.md Normal file
View File

@@ -0,0 +1,322 @@
---
description: "HyperClaude Nano global system instructions and mandatory policies"
priority: system
always-load: true
---
# HyperClaude Nano - System Instructions
**THIS FILE CONTAINS MANDATORY POLICIES THAT OVERRIDE ALL OTHER INSTRUCTIONS**
These instructions apply to ALL operations, commands, agents, and workflows within the HyperClaude Nano framework.
---
## ⛔ MANDATORY TOOL POLICY - NO EXCEPTIONS ⛔
### ABSOLUTE RULE: NEVER use bash commands for file operations
**VIOLATION = IMMEDIATE FAILURE. Zero tolerance. No exceptions.**
### ⛔ BANNED BASH COMMANDS ⛔
- `cat`, `head`, `tail`, `less`, `more`**USE Read**
- `grep`, `rg`, `ag`, `ack`**USE Grep**
- `find`, `ls` (for searching) → **USE Glob**
- `echo >`, `echo >>`, `>`, `>>`**USE Write**
- `sed`, `awk`, `perl -pi`**USE Edit**
- `tree`, `du -h`**USE Glob + Read**
- `wc -l`, `wc -w`**USE Read + process**
### ✅ REQUIRED TOOLS
**File Operations:**
1. **Read** - ALWAYS first choice for viewing files
2. **Grep** - ALWAYS for content search
3. **Glob** - ALWAYS for file discovery
4. **Edit** - ALWAYS for file modifications
5. **Write** - ALWAYS for new files
6. **Tree-Sitter** - ALWAYS for code analysis
**When Bash IS Acceptable:**
- System commands: `npm test`, `npm run build`, `npm install`
- Git operations: `git status`, `git commit`, `git push`
- Process management: `npm start`, `docker-compose up`
- **NEVER for file operations**
### Enforcement Protocol
**BEFORE ANY OPERATION:**
1. Can built-in tool do this? → USE IT
2. Absolutely impossible with built-ins? → EXPLAIN WHY
3. Only then use bash WITH JUSTIFICATION
### Correct Patterns
```bash
# ❌ WRONG - NEVER DO THIS:
bash: cat file.txt
bash: grep "pattern" *.js
bash: find . -name "*.py"
bash: echo "content" > file.txt
bash: sed 's/old/new/' file.js
# ✅ RIGHT - ALWAYS DO THIS:
Read: file.txt
Grep: pattern in *.js
Glob: **/*.py
Write: content to file.txt
Edit: file.js (old→new)
```
---
## 📋 TodoWrite Requirements
### Mandatory Activation
TodoWrite MUST be used for:
- **3+ operations/steps**
- **Multi-file/component tasks**
- **Non-trivial/complex work**
- **User explicitly requests tracking**
Skip ONLY for:
- Single trivial operations
- Info-only queries
### Task States
- `pending` - Task not yet started
- `in_progress` - Currently working (ONLY ONE at a time)
- `completed` - Task finished WITH EVIDENCE
### Completion Requirements
NEVER mark complete without:
- Full accomplishment of task
- Validation/testing performed
- Evidence provided (file references, metrics, etc.)
If blocked or encountering errors:
- Keep as `in_progress`
- Create new task for blocker resolution
---
## 🌊 Wave Orchestration
### Trigger Conditions
Wave mode activates for:
- **>15 files** in scope
- **>5 component types** detected
- **>3 domains** involved
- **"comprehensive"** keyword in request
### Wave Structure
- **W1 (Architect)** - Design & analysis → Memory storage
- **W2 (Security)** - Vulnerability assessment → Alert system
- **W3 (Parallel)** - Coder + Designer → Simultaneous implementation
- **W4 (Test)** - Validation & quality → Gate enforcement
- **W5 (Documentation)** - Comprehensive docs → Knowledge capture
---
## 🎯 Core Principles
### Priority Rules
- **Evidence > Assumptions** - Verify before concluding
- **Code > Docs** - Working code takes precedence
- **Efficiency > Verbosity** - Concise communication
- **SOLID + DRY + KISS + YAGNI** - Code quality principles
### Operation Principles
- **BUILT-INS > Bash** - ALWAYS use built-in tools
- **Read → Edit > Write** - Prefer editing over rewriting
- **Parallel > Sequential** - Maximize concurrent operations
- **Test → Validate** - Always verify changes
---
## 🤖 Agent System
### 7 Specialized Agents
- **architect** - System design & architecture analysis
- **coder** - Feature implementation & bug fixes
- **designer** - UI/UX development & accessibility
- **security-analyst** - Vulnerability scanning & compliance
- **test-engineer** - Test creation & quality assurance
- **tech-writer** - Documentation & technical writing
- **cloud-engineer** - Infrastructure & deployment
### Agent Activation Mappings
```
/hc:analyze → architect
/hc:build → coder, designer (parallel)
/hc:cleanup → coder
/hc:design → designer
/hc:document → tech-writer
/hc:implement → coder
/hc:improve → architect, coder
/hc:index → tech-writer
/hc:task → architect
/hc:test → test-engineer
/hc:troubleshoot → architect
/hc:workflow → architect, coder
```
---
## 🔧 MCP Server Integration
### 5 MCP Servers Available
1. **memory** - entities, relations, search, store
2. **context7** - resolve-lib, get-docs
3. **tree-sitter** - search, usage, analyze, errors
4. **puppeteer** - navigate, interact, test
5. **sequential-thinking** - complex reasoning
### Usage Priorities
- **Memory**: Cache patterns, share between agents (-40% tokens)
- **Tree-Sitter**: Code analysis, pattern detection (+35% speed)
- **Context7**: Documentation lookup, framework patterns (-50% lookups)
- **Puppeteer**: Visual validation, E2E testing
- **Sequential**: Complex planning, multi-step reasoning
---
## ⚡ Parallel Operations - MANDATORY
### ALWAYS Parallel
- Multiple file reads
- Independent searches
- Concurrent agent operations
- Separate validations
### NEVER Sequential When Parallel Possible
```bash
# ❌ WRONG - Sequential
Read: file1.txt
(wait for result)
Read: file2.txt
# ✅ RIGHT - Parallel (single message)
Read: file1.txt
Read: file2.txt
Read: file3.txt
```
---
## 🔒 Git Operations
### Commit Policy
- **Explicit request ONLY** - Never commit without being asked
- **HEREDOC format** - Always use heredoc for commit messages
- **No dangerous operations** - Never force push, hard reset without explicit request
- **No skip hooks** - Never use --no-verify unless requested
### Proper Commit Format
```bash
git commit -m "$(cat <<'EOF'
Commit message here
EOF
)"
```
---
## 🎯 Planning & Execution
### When to Use Plan Mode
- **Use ExitPlanMode**: Implementation tasks requiring code
- **Skip plan mode**: Research, exploration, info gathering
### Validation Gates
**Before marking ANY task complete:**
- Tests pass
- Lints pass
- Type checks pass
- Evidence provided
**On success:**
- Store patterns → Memory
- Update documentation
**On failure:**
- Retry with corrections
- Use fallback approach
- Ask for clarification
---
## ❌ AUTOMATIC FAILURES - ZERO TOLERANCE
These violations cause immediate task failure:
1. Using `cat` instead of Read
2. Using `grep/rg` instead of Grep
3. Using `find` instead of Glob
4. Using `echo >` instead of Write
5. Using `sed/awk` instead of Edit
6. Not explaining why bash was necessary
7. Sequential operations when parallel available
8. Marking task complete without evidence
9. Skipping TodoWrite for 3+ step tasks
---
## ✅ SUCCESS CRITERIA
Every operation should achieve:
- ✅ Built-in tools used exclusively for file operations
- ✅ TodoWrite tracking for complex tasks
- ✅ Parallel execution where possible
- ✅ Evidence-based completion
- ✅ Quality validation performed
- ✅ Patterns stored in Memory for reuse
---
## 🎓 Remember
**Do what has been asked; nothing more, nothing less.**
- NEVER create files unless absolutely necessary
- ALWAYS prefer editing existing files
- NEVER proactively create documentation
- **ALWAYS USE BUILT-IN TOOLS - NO EXCUSES**
---
**THIS POLICY IS NON-NEGOTIABLE AND OVERRIDES ALL OTHER INSTRUCTIONS.**
For detailed tool policy, see MANDATORY_TOOL_POLICY.md
For agent communication, see AGENT_PROTOCOLS.md
For MCP optimization, see SHARED_PATTERNS.md

44
commands/analyze.md Normal file
View File

@@ -0,0 +1,44 @@
---
allowed-tools: [Read, Grep, Glob, Bash, TodoWrite, Task]
description: "Analyze code quality, security, performance, and architecture"
wave-enabled: true
complexity-threshold: 0.6
---
# /hc:analyze - Code Analysis
## Purpose
Execute comprehensive code analysis across quality, security, performance, and architecture domains.
## Usage
```
/hc:analyze [target] [--focus quality|security|performance|architecture] [--depth quick|deep]
```
## Arguments
- `target` - Files, directories, or project to analyze
- `--focus` - Analysis focus area (quality, security, performance, architecture)
- `--depth` - Analysis depth (quick, deep)
- `--format` - Output format (text, json, report)
## Execution
1. Discover and categorize files for analysis
2. Apply appropriate analysis tools and techniques (use @agent-architect for system-wide analysis)
3. **PARALLEL**: For security focus, engage @agent-security-analyst alongside architect
4. Generate findings with severity ratings
5. Create actionable recommendations with priorities
6. Present comprehensive analysis report
**Wave Trigger**: Activates for codebases >15 files or >5 component types
## Claude Code Integration
- Uses Glob for systematic file discovery
- Leverages Grep for pattern-based analysis
- Applies Read for deep code inspection
- Utilizes @agent-architect via Task tool for comprehensive system analysis
- Maintains structured analysis reporting

49
commands/build.md Normal file
View File

@@ -0,0 +1,49 @@
---
allowed-tools: [Read, Bash, Glob, TodoWrite, Task]
description: "Build, compile, and package projects with error handling and optimization"
wave-enabled: true
complexity-threshold: 0.5
---
# /hc:build - Project Building
## Purpose
Build, compile, and package projects with comprehensive error handling and optimization.
## Usage
```bash
/hc:build [target] [--type dev|prod|test] [--clean] [--optimize]
```
## Arguments
- `target` - Project or specific component to build
- `--type` - Build type (dev, prod, test)
- `--clean` - Clean build artifacts before building
- `--optimize` - Enable build optimizations
- `--verbose` - Enable detailed build output
## Execution
1. Use @agent-architect to analyze project structure and build configuration
2. **PARALLEL**: Pass analysis to @agent-coder for build scripts AND @agent-designer for UI assets
3. @agent-coder generates/modifies build scripts (parallel with designer)
4. @agent-designer optimizes assets for UI projects (parallel with coder)
5. Validate dependencies and environment setup
6. Execute build process with error monitoring
7. Handle build errors and provide diagnostic information
8. Optionally use @agent-test-engineer for build validation
9. Optimize build output and report results
**Wave Trigger**: Activates for projects >15 files or >5 component types
## Claude Code Integration
- Uses Task tool to orchestrate @agent-architect → parallel(@agent-coder, @agent-designer) workflow
- Uses Bash for build command execution
- Leverages Read for build configuration analysis
- Applies TodoWrite for build progress tracking
- Maintains comprehensive error handling and reporting
- Shares build configurations between agents via MCP memory server

39
commands/cleanup.md Normal file
View File

@@ -0,0 +1,39 @@
---
allowed-tools: [Read, Grep, Glob, Bash, Task]
description: "Clean up code, remove dead code, and optimize project structure"
---
# /hc:cleanup - Code and Project Cleanup
## Purpose
Systematically clean up code, remove dead code, optimize imports, and improve project structure.
## Usage
```
/hc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive]
```
## Arguments
- `target` - Files, directories, or entire project to clean
- `--type` - Cleanup type (code, imports, files, all)
- `--safe` - Conservative cleanup (default)
- `--aggressive` - More thorough cleanup with higher risk
- `--dry-run` - Preview changes without applying them
## Execution
1. Analyze target for cleanup opportunities
2. Identify dead code, unused imports, and redundant files
3. Create cleanup plan with risk assessment
4. Execute cleanup operations with appropriate safety measures
5. Validate changes and report cleanup results
## Claude Code Integration
- Uses Glob for systematic file discovery
- Leverages Grep for dead code detection
- Uses Task for batch cleanup operations and file modifications
- Maintains backup and rollback capabilities

46
commands/design.md Normal file
View File

@@ -0,0 +1,46 @@
---
allowed-tools: [Read, Grep, Glob, TodoWrite, Task]
description: "Design system architecture, APIs, and component interfaces"
wave-enabled: true
complexity-threshold: 0.6
---
# /hc:design - System and Component Design
## Purpose
Design system architecture, APIs, component interfaces, and technical specifications.
## Usage
```bash
/hc:design [target] [--type architecture|api|component|database] [--format diagram|spec|code]
```
## Arguments
- `target` - System, component, or feature to design
- `--type` - Design type (architecture, api, component, database)
- `--format` - Output format (diagram, spec, code)
- `--iterative` - Enable iterative design refinement
## Execution
1. Use @agent-architect to analyze requirements and design constraints
2. **PARALLEL**: Engage @agent-designer for visual components while @agent-architect works on system design
3. @agent-architect creates system design and architectural patterns (parallel with step 4)
4. @agent-designer creates UI specifications and component designs (parallel with step 3)
5. Pass design specs to @agent-coder for implementation planning
6. Validate design against requirements and best practices
7. Generate design documentation and implementation guides
**Note**: Steps 2-4 execute in parallel for optimal performance per CLAUDE.md directives
## Claude Code Integration
- Uses Task tool to orchestrate @agent-architect and @agent-designer in parallel
- Uses Read for requirement analysis
- Uses Task for design documentation and specification creation
- Applies TodoWrite for design task tracking
- Maintains consistency with architectural patterns
- Shares design specifications between agents via MCP memory server

104
commands/document.md Normal file
View File

@@ -0,0 +1,104 @@
---
allowed-tools: [Read, Grep, Glob, Task, WebSearch, WebFetch]
description: "Create clear, accurate technical documentation following project patterns"
wave-enabled: true
complexity-threshold: 0.5
---
# /hc:document - Technical Documentation
## Purpose
Create clear, accurate technical documentation that follows existing project patterns and helps users succeed with the software.
## Usage
```bash
/hc:document [target] [--type readme|api|guide|inline|reference] [--scope focused|comprehensive] [--framework nextra|docusaurus|vitepress|none]
```
## Arguments
- `target` - File, directory, function, or feature to document
- `--type` - Documentation type:
- `readme` - Project or module README files
- `api` - API reference documentation
- `guide` - User guides and tutorials
- `inline` - Code comments and annotations
- `reference` - Technical specifications and configurations
- `--scope` - Documentation depth (focused for specific items, comprehensive for full coverage)
- `--framework` - Documentation framework to use (optional, defaults to existing or none)
## Execution
1. **Pattern Analysis Phase**
- Use @agent-tech-writer to analyze existing documentation patterns
- Identify project's documentation style and conventions
- Understand the codebase structure and implementation
- Determine target audience and their needs
2. **Content Generation Phase**
- @agent-tech-writer creates documentation following identified patterns
- For API docs: Extract from actual implementation and annotations
- For guides: Focus on real user tasks and common scenarios
- For README: Follow project's existing structure or best practices
- Ensure technical accuracy over comprehensive coverage
3. **Quality Assurance Phase**
- Validate accuracy against actual code implementation
- Check consistency with existing documentation
- Ensure examples work and are practical
- Verify accessibility and readability
4. **Integration Phase**
- Place documentation in appropriate locations
- Update cross-references and navigation
- Ensure documentation fits naturally in project
## Claude Code Integration
- **Primary Agent**: @agent-tech-writer for all documentation tasks
- **Supporting Agents**:
- @agent-architect: When needing system design context
- @agent-coder: For extracting implementation details
- @agent-designer: For UI component documentation
- **MCP Servers**:
- Tree-Sitter: Analyze code structure and extract signatures
- Context7: Research best practices when patterns unclear
- Memory: Store and retrieve documentation patterns
- **Search Priority**: WebSearch > WebFetch for documentation standards
- **Tools**:
- Read/Grep: Analyze existing documentation
- Task: Create, update, and manage documentation files
- Task: Coordinate with other agents when needed
## Examples
```bash
# Document a specific API endpoint
/hc:document src/api/users.js --type api --scope focused
# Create comprehensive project README
/hc:document . --type readme --scope comprehensive
# Generate user guide for a feature
/hc:document src/features/auth --type guide
# Add inline documentation to code
/hc:document src/utils/validators.js --type inline
# Build documentation site with Nextra
/hc:document . --type guide --scope comprehensive --framework nextra
```
## Best Practices
- Always analyze existing patterns first
- Focus on what users need to accomplish
- Write from the user's perspective
- Provide working, practical examples
- Maintain technical accuracy
- Let content drive structure, not framework features

38
commands/explain.md Normal file
View File

@@ -0,0 +1,38 @@
---
allowed-tools: [Read, Grep, Glob, Bash]
description: "Provide clear explanations of code, concepts, or system behavior"
---
# /hc:explain - Code and Concept Explanation
## Purpose
Deliver clear, comprehensive explanations of code functionality, concepts, or system behavior.
## Usage
```
/hc:explain [target] [--level basic|intermediate|advanced] [--format text|diagram|examples]
```
## Arguments
- `target` - Code file, function, concept, or system to explain
- `--level` - Explanation complexity (basic, intermediate, advanced)
- `--format` - Output format (text, diagram, examples)
- `--context` - Additional context for explanation
## Execution
1. Analyze target code or concept thoroughly
2. Identify key components and relationships
3. Structure explanation based on complexity level
4. Provide relevant examples and use cases
5. Present clear, accessible explanation with proper formatting
## Claude Code Integration
- Uses Read for comprehensive code analysis
- Leverages Grep for pattern identification
- Applies Bash for runtime behavior analysis
- Maintains clear, educational communication style

80
commands/implement.md Normal file
View File

@@ -0,0 +1,80 @@
---
allowed-tools: [Read, Bash, Glob, TodoWrite, Task, WebSearch, WebFetch]
description: "Feature and code implementation with intelligent persona activation and MCP integration"
wave-enabled: true
complexity-threshold: 0.6
---
# /hc:implement - Feature Implementation
## Purpose
Implement features, components, and code functionality with intelligent expert activation and comprehensive development support.
## Usage
```
/hc:implement [feature-description] [--type component|api|service|feature] [--framework react|vue|express|etc] [--safe]
```
## Arguments
- `feature-description` - Description of what to implement
- `--type` - Implementation type (component, api, service, feature, module)
- `--framework` - Target framework or technology stack
- `--safe` - Use conservative implementation approach
- `--iterative` - Enable iterative development with validation steps
- `--with-tests` - Include test implementation
- `--documentation` - Generate documentation alongside implementation
## Execution
1. Use @agent-architect via Task tool to analyze requirements and create implementation plan
2. **PARALLEL**: Pass architect's findings to @agent-coder AND @agent-designer simultaneously
3. @agent-coder implements logic (parallel with designer)
4. @agent-designer implements UI components (parallel with coder)
5. Auto-activate relevant personas (frontend, backend, security, etc.)
6. Coordinate with MCP servers (Context7 for patterns, Sequential for complex logic)
7. Generate implementation code following architect's specifications
8. **PARALLEL**: Engage @agent-test-engineer AND @agent-tech-writer when flags are used
9. Apply security and quality validation
10. Provide testing recommendations and next steps
**Wave Trigger**: Activates Wave orchestration for >15 files, >5 types, or >3 domains
**Search Priority**: WebSearch > WebFetch for framework documentation
## Claude Code Integration
- Uses Task tool to orchestrate @agent-architect → parallel(@agent-coder, @agent-designer) → parallel(@agent-test-engineer, @agent-tech-writer) workflow
- Leverages Read and Glob for codebase analysis and context understanding
- Uses Task for code generation, modification, and file operations
- Applies TodoWrite for implementation progress tracking
- Coordinates with MCP servers for specialized functionality
- Auto-activates appropriate personas based on implementation type
- Shares implementation plans between agents via MCP memory server
- @agent-tech-writer receives implementation details from @agent-coder/@agent-designer for documentation creation
## Agent Orchestration
- **@agent-architect**: Analyzes requirements, creates implementation specifications
- **@agent-coder**: Implements business logic, services, and backend functionality
- **@agent-designer**: Implements UI components, frontend features, and UX elements
- **@agent-test-engineer**: Creates test coverage when --with-tests flag is used
- **@agent-tech-writer**: Creates comprehensive documentation when --documentation flag is used
## Auto-Activation Patterns
- **Frontend**: UI components → @agent-designer with frontend persona
- **Backend**: APIs, services → @agent-coder with backend persona
- **Security**: Authentication → @agent-architect analysis → @agent-coder with security persona
- **Full-Stack**: Combined @agent-architect → parallel @agent-coder + @agent-designer
- **Performance**: @agent-architect analysis → @agent-coder with performance persona
## Examples
```
/hc:implement user authentication system --type feature --with-tests --documentation
/hc:implement dashboard component --type component --framework react --documentation
/hc:implement REST API for user management --type api --safe --documentation
/hc:implement payment processing service --type service --iterative
```

47
commands/improve.md Normal file
View File

@@ -0,0 +1,47 @@
---
allowed-tools: [Read, Grep, Glob, TodoWrite, Task]
description: "Apply systematic improvements to code quality, performance, and maintainability"
wave-enabled: true
complexity-threshold: 0.6
---
# /hc:improve - Code Improvement
## Purpose
Apply systematic improvements to code quality, performance, maintainability, and best practices.
## Usage
```bash
/hc:improve [target] [--type quality|performance|maintainability|style] [--safe]
```
## Arguments
- `target` - Files, directories, or project to improve
- `--type` - Improvement type (quality, performance, maintainability, style)
- `--safe` - Apply only safe, low-risk improvements
- `--preview` - Show improvements without applying them
## Execution
1. Use @agent-architect to analyze code for improvement opportunities
2. @agent-architect creates improvement plan with risk assessment and patterns
3. **PARALLEL**: Pass findings to @agent-coder AND @agent-designer simultaneously
4. @agent-coder implements code improvements (parallel with designer)
5. @agent-designer implements UI improvements (parallel with coder)
6. Apply improvements with appropriate validation
7. Optionally use @agent-test-engineer to verify improvements
8. Report changes and quality metrics
**Wave Trigger**: Activates for improvements spanning >15 files or >5 types
## Claude Code Integration
- Uses Task tool to orchestrate @agent-architect → parallel(@agent-coder, @agent-designer) workflow
- Uses Read for comprehensive code analysis
- Uses Task for batch improvements and file operations
- Applies TodoWrite for improvement tracking
- Maintains safety and validation mechanisms
- Shares improvement plans between agents via MCP memory server

191
commands/task.md Normal file
View File

@@ -0,0 +1,191 @@
---
allowed-tools:
[
Read,
Glob,
Grep,
TodoWrite,
Task,
mcp__sequential-thinking__sequentialthinking,
]
description: "Execute complex tasks with intelligent workflow management and cross-session persistence"
wave-enabled: true
complexity-threshold: 0.7
performance-profile: complex
personas: [architect, analyzer, project-manager]
mcp-servers: [sequential, context7]
---
# /hc:task - Enhanced Task Management
## Purpose
Execute complex tasks with intelligent workflow management, cross-session persistence, hierarchical task organization, and advanced orchestration capabilities.
## Usage
```
/hc:task [action] [target] [--strategy systematic|agile|enterprise] [--persist] [--hierarchy] [--delegate]
```
## Actions
- `create` - Create new project-level task hierarchy
- `execute` - Execute task with intelligent orchestration
- `status` - View task status across sessions
- `analytics` - Task performance and analytics dashboard
- `optimize` - Optimize task execution strategies
- `delegate` - Delegate tasks across multiple agents
- `validate` - Validate task completion with evidence
## Arguments
- `target` - Task description, project scope, or existing task ID
- `--strategy` - Execution strategy (systematic, agile, enterprise)
- `--persist` - Enable cross-session task persistence
- `--hierarchy` - Create hierarchical task breakdown
- `--delegate` - Enable multi-agent task delegation
- `--wave-mode` - Enable wave-based execution
- `--validate` - Enforce quality gates and validation
- `--mcp-routing` - Enable intelligent MCP server routing
## Execution Modes
### Systematic Strategy
1. **Discovery Phase**: Use @agent-architect for comprehensive project analysis and scope definition
2. **Planning Phase**: @agent-architect creates hierarchical task breakdown with dependency mapping
3. **Execution Phase**: Orchestrate @agent-coder/@agent-designer for implementation with validation gates
4. **Validation Phase**: @agent-test-engineer performs evidence collection and quality assurance
5. **Optimization Phase**: @agent-architect provides performance analysis and improvement recommendations
### Agile Strategy
1. **Sprint Planning**: Priority-based task organization
2. **Iterative Execution**: Short cycles with continuous feedback
3. **Adaptive Planning**: Dynamic task adjustment based on outcomes
4. **Continuous Integration**: Real-time validation and testing
5. **Retrospective Analysis**: Learning and process improvement
### Enterprise Strategy
1. **Stakeholder Analysis**: Multi-domain impact assessment
2. **Resource Allocation**: Optimal resource distribution across tasks
3. **Risk Management**: Comprehensive risk assessment and mitigation
4. **Compliance Validation**: Regulatory and policy compliance checks
5. **Governance Reporting**: Detailed progress and compliance reporting
## Advanced Features
### Task Hierarchy Management
- **Epic Level**: Large-scale project objectives (weeks to months)
- **Story Level**: Feature-specific implementations (days to weeks)
- **Task Level**: Specific actionable items (hours to days)
- **Subtask Level**: Granular implementation steps (minutes to hours)
### Intelligent Task Orchestration
- **Agent Coordination**: @agent-architect analyzes → @agent-coder/@agent-designer implement → @agent-test-engineer validates
- **Dependency Resolution**: Automatic dependency detection and sequencing
- **Parallel Execution**: Independent task parallelization with multiple agents
- **Resource Optimization**: Intelligent resource allocation and scheduling
- **Context Sharing**: Cross-task context via MCP memory server protocols
### Cross-Session Persistence
- **Task State Management**: Persistent task states across sessions
- **Context Continuity**: Preserved context and progress tracking
- **Historical Analytics**: Task execution history and learning
- **Recovery Mechanisms**: Automatic recovery from interruptions
### Quality Gates and Validation
- **Evidence Collection**: Systematic evidence gathering during execution
- **Validation Criteria**: Customizable completion criteria
- **Quality Metrics**: Comprehensive quality assessment
- **Compliance Checks**: Automated compliance validation
## Integration Points
### Wave System Integration
- **Wave Coordination**: Multi-wave task execution strategies
- **Context Accumulation**: Progressive context building across waves
- **Performance Monitoring**: Real-time performance tracking and optimization
- **Error Recovery**: Graceful error handling and recovery mechanisms
### MCP Server Coordination
- **Context7**: Framework patterns, library documentation, and UI component patterns
- **Sequential**: Complex analysis and multi-step reasoning
- **Puppeteer**: End-to-end testing and performance validation
### Agent & Persona Integration
- **@agent-architect**: System design, architectural decisions, and task planning
- **@agent-coder**: Implementation of business logic and backend features
- **@agent-designer**: UI/UX implementation and frontend components
- **@agent-security-analyst**: Security assessment and vulnerability detection
- **@agent-test-engineer**: Validation, testing, and quality assurance
- **Personas**: Overlay behavioral patterns on agents for domain expertise
## Performance Optimization
### Execution Efficiency
- **Batch Operations**: Grouped execution for related tasks
- **Parallel Processing**: Independent task parallelization
- **Context Caching**: Reusable context and analysis results
- **Resource Pooling**: Shared resource utilization
### Intelligence Features
- **Predictive Planning**: AI-driven task estimation and planning
- **Adaptive Execution**: Dynamic strategy adjustment based on progress
- **Learning Systems**: Continuous improvement from execution patterns
- **Optimization Recommendations**: Data-driven improvement suggestions
## Usage Examples
### Create Project-Level Task Hierarchy
```
/hc:task create "Implement user authentication system" --hierarchy --persist --strategy systematic
```
### Execute with Multi-Agent Delegation
```
/hc:task execute AUTH-001 --delegate --wave-mode --validate
```
### Analytics and Optimization
```
/hc:task analytics --project AUTH --optimization-recommendations
```
### Cross-Session Task Management
```
/hc:task status --all-sessions --detailed-breakdown
```
## Claude Code Integration
- **Agent Orchestration**: Uses Task tool to coordinate specialized agents
- **TodoWrite Integration**: Seamless session-level task coordination
- **Wave System**: Advanced multi-stage execution orchestration
- **Hook System**: Real-time task monitoring and optimization
- **MCP Coordination**: Intelligent server routing and resource utilization
- **Inter-Agent Protocol**: Follows AGENT_PROTOCOLS.md for data exchange
- **Performance Monitoring**: Sub-100ms execution targets with comprehensive metrics
## Success Criteria
- **Task Completion Rate**: >95% successful task completion
- **Performance Targets**: <100ms hook execution, <5s task creation
- **Quality Metrics**: >90% validation success rate
- **Cross-Session Continuity**: 100% task state preservation
- **Intelligence Effectiveness**: >80% accurate predictive planning

47
commands/test.md Normal file
View File

@@ -0,0 +1,47 @@
---
allowed-tools: [Read, Bash, Glob, TodoWrite, Task]
description: "Execute tests, generate test reports, and maintain test coverage"
wave-enabled: true
complexity-threshold: 0.5
---
# /hc:test - Testing and Quality Assurance
## Purpose
Execute tests, generate comprehensive test reports, and maintain test coverage standards.
## Usage
```bash
/hc:test [target] [--type unit|integration|e2e|all] [--coverage] [--watch]
```
## Arguments
- `target` - Specific tests, files, or entire test suite
- `--type` - Test type (unit, integration, e2e, all)
- `--coverage` - Generate coverage reports
- `--watch` - Run tests in watch mode
- `--fix` - Automatically fix failing tests when possible
## Execution
1. Use @agent-test-engineer to analyze test requirements
2. @agent-test-engineer discovers and categorizes available tests
3. If creating new tests, @agent-coder implements test code
4. Execute tests with appropriate configuration
5. @agent-test-engineer monitors results and collects metrics
6. Generate comprehensive test reports with coverage analysis
7. Provide recommendations for test improvements to all agents
**Wave Trigger**: Activates for test suites >15 files or >5 test types
## Claude Code Integration
- Uses Task tool to orchestrate @agent-test-engineer (primary) with @agent-coder support
- Uses Bash for test execution and monitoring
- Leverages Glob for test discovery
- Applies TodoWrite for test result tracking
- Maintains structured test reporting and coverage analysis
- Shares test results with all agents via MCP memory server

47
commands/troubleshoot.md Normal file
View File

@@ -0,0 +1,47 @@
---
allowed-tools: [Read, Grep, Glob, Bash, TodoWrite, Task, WebSearch, WebFetch]
description: "Diagnose and resolve issues in code, builds, or system behavior"
wave-enabled: true
complexity-threshold: 0.7
---
# /hc:troubleshoot - Issue Diagnosis and Resolution
## Purpose
Systematically diagnose and resolve issues in code, builds, deployments, or system behavior.
## Usage
```bash
/hc:troubleshoot [issue] [--type bug|build|performance|deployment] [--trace]
```
## Arguments
- `issue` - Description of the problem or error message
- `--type` - Issue category (bug, build, performance, deployment)
- `--trace` - Enable detailed tracing and logging
- `--fix` - Automatically apply fixes when safe
## Execution
1. Use @agent-architect to analyze issue and gather initial context
2. For security issues, engage @agent-security-analyst
3. Identify potential root causes and investigation paths
4. Execute systematic debugging and diagnosis
5. Pass findings to @agent-coder for fix implementation
6. Use @agent-test-engineer to validate the fix
7. Apply fixes and verify resolution
**Wave Trigger**: Complex issues spanning >15 files or >3 domains
**Search Priority**: WebSearch > WebFetch for error resolution patterns
## Claude Code Integration
- Uses Task tool to orchestrate @agent-architect → @agent-coder → @agent-test-engineer workflow
- Uses Read for error log analysis
- Leverages Bash for runtime diagnostics
- Applies Grep for pattern-based issue detection
- Maintains structured troubleshooting documentation
- Shares diagnostic findings between agents via MCP memory server

348
commands/workflow.md Normal file
View File

@@ -0,0 +1,348 @@
---
allowed-tools:
[
Read,
Glob,
Grep,
TodoWrite,
Task,
mcp__sequential-thinking__sequentialthinking,
mcp__context7__resolve-library-id,
mcp__context7__get-library-docs,
]
description: "Generate structured implementation workflows from PRDs and feature requirements with expert guidance"
wave-enabled: true
complexity-threshold: 0.6
performance-profile: complex
personas:
[architect, analyzer, frontend, backend, security, devops, project-manager]
mcp-servers: [sequential, context7]
---
# /hc:workflow - Implementation Workflow Generator
## Purpose
Analyze Product Requirements Documents (PRDs) and feature specifications to generate comprehensive, step-by-step implementation workflows with expert guidance, dependency mapping, and automated task orchestration.
## Usage
```
/hc:workflow [prd-file|feature-description] [--persona expert] [--c7] [--sequential] [--strategy systematic|agile|mvp] [--output roadmap|tasks|detailed]
```
## Arguments
- `prd-file|feature-description` - Path to PRD file or direct feature description
- `--persona` - Force specific expert persona (@agent-architect, frontend, backend, security, devops, etc.)
- `--strategy` - Workflow strategy (systematic, agile, mvp)
- `--output` - Output format (roadmap, tasks, detailed)
- `--estimate` - Include time and complexity estimates
- `--dependencies` - Map external dependencies and integrations
- `--risks` - Include risk assessment and mitigation strategies
- `--parallel` - Identify parallelizable work streams
- `--milestones` - Create milestone-based project phases
## MCP Integration Flags
- `--c7` / `--context7` - Enable Context7 for framework patterns and best practices
- `--sequential` - Enable Sequential thinking for complex multi-step analysis
- `--all-mcp` - Enable all MCP servers for comprehensive workflow generation
## Workflow Strategies
### Systematic Strategy (Default)
1. **Requirements Analysis** - Deep dive into PRD structure and acceptance criteria
2. **Architecture Planning** - System design and component architecture
3. **Dependency Mapping** - Identify all internal and external dependencies
4. **Implementation Phases** - Sequential phases with clear deliverables
5. **Testing Strategy** - Comprehensive testing approach at each phase
6. **Deployment Planning** - Production rollout and monitoring strategy
### Agile Strategy
1. **Epic Breakdown** - Convert PRD into user stories and epics
2. **Sprint Planning** - Organize work into iterative sprints
3. **MVP Definition** - Identify minimum viable product scope
4. **Iterative Development** - Plan for continuous delivery and feedback
5. **Stakeholder Engagement** - Regular review and adjustment cycles
6. **Retrospective Planning** - Built-in improvement and learning cycles
### MVP Strategy
1. **Core Feature Identification** - Strip down to essential functionality
2. **Rapid Prototyping** - Focus on quick validation and feedback
3. **Technical Debt Planning** - Identify shortcuts and future improvements
4. **Validation Metrics** - Define success criteria and measurement
5. **Scaling Roadmap** - Plan for post-MVP feature expansion
6. **User Feedback Integration** - Structured approach to user input
## Expert Persona Auto-Activation
### Frontend Workflow (`--persona frontend` or auto-detected)
- **UI/UX Analysis** - Design system integration and component planning
- **State Management** - Data flow and state architecture
- **Performance Optimization** - Bundle optimization and lazy loading
- **Accessibility Compliance** - WCAG guidelines and inclusive design
- **Browser Compatibility** - Cross-browser testing strategy
- **Mobile Responsiveness** - Responsive design implementation plan
### Backend Workflow (`--persona backend` or auto-detected)
- **API Design** - RESTful/GraphQL endpoint planning
- **Database Schema** - Data modeling and migration strategy
- **Security Implementation** - Authentication, authorization, and data protection
- **Performance Scaling** - Caching, optimization, and load handling
- **Service Integration** - Third-party APIs and microservices
- **Monitoring & Logging** - Observability and debugging infrastructure
### Architecture Workflow (`--persona architect` or auto-detected)
- **System Design** - High-level architecture and service boundaries
- **Technology Stack** - Framework and tool selection rationale
- **Scalability Planning** - Growth considerations and bottleneck prevention
- **Security Architecture** - Comprehensive security strategy
- **Integration Patterns** - Service communication and data flow
- **DevOps Strategy** - CI/CD pipeline and infrastructure as code
### Security Workflow (`--persona security` or auto-detected)
- **Threat Modeling** - Security risk assessment and attack vectors
- **Data Protection** - Encryption, privacy, and compliance requirements
- **Authentication Strategy** - User identity and access management
- **Security Testing** - Penetration testing and vulnerability assessment
- **Compliance Validation** - Regulatory requirements (GDPR, HIPAA, etc.)
- **Incident Response** - Security monitoring and breach protocols
### DevOps Workflow (`--persona devops` or auto-detected)
- **Infrastructure Planning** - Cloud architecture and resource allocation
- **CI/CD Pipeline** - Automated testing, building, and deployment
- **Environment Management** - Development, staging, and production environments
- **Monitoring Strategy** - Application and infrastructure monitoring
- **Backup & Recovery** - Data protection and disaster recovery planning
- **Performance Monitoring** - APM tools and performance optimization
## Output Formats
### Roadmap Format (`--output roadmap`)
```
# Feature Implementation Roadmap
## Phase 1: Foundation (Week 1-2)
- [ ] Architecture design and technology selection
- [ ] Database schema design and setup
- [ ] Basic project structure and CI/CD pipeline
## Phase 2: Core Implementation (Week 3-6)
- [ ] API development and authentication
- [ ] Frontend components and user interface
- [ ] Integration testing and security validation
## Phase 3: Enhancement & Launch (Week 7-8)
- [ ] Performance optimization and load testing
- [ ] User acceptance testing and bug fixes
- [ ] Production deployment and monitoring setup
```
### Tasks Format (`--output tasks`)
```
# Implementation Tasks
## Epic: User Authentication System
### Story: User Registration
- [ ] Design registration form UI components
- [ ] Implement backend registration API
- [ ] Add email verification workflow
- [ ] Create user onboarding flow
### Story: User Login
- [ ] Design login interface
- [ ] Implement JWT authentication
- [ ] Add password reset functionality
- [ ] Set up session management
```
### Detailed Format (`--output detailed`)
```
# Detailed Implementation Workflow
## Task: Implement User Registration API
**Persona**: Backend Developer
**Estimated Time**: 8 hours
**Dependencies**: Database schema, authentication service
**MCP Context**: Express.js patterns, security best practices
### Implementation Steps:
1. **Setup API endpoint** (1 hour)
- Create POST /api/register route
- Add input validation middleware
2. **Database integration** (2 hours)
- Implement user model
- Add password hashing
3. **Security measures** (3 hours)
- Rate limiting implementation
- Input sanitization
- SQL injection prevention
4. **Testing** (2 hours)
- Unit tests for registration logic
- Integration tests for API endpoint
### Acceptance Criteria:
- [ ] User can register with email and password
- [ ] Passwords are properly hashed
- [ ] Email validation is enforced
- [ ] Rate limiting prevents abuse
```
## Advanced Features
### Dependency Analysis
- **Internal Dependencies** - Identify coupling between components and features
- **External Dependencies** - Map third-party services and APIs
- **Technical Dependencies** - Framework versions, database requirements
- **Team Dependencies** - Cross-team coordination requirements
- **Infrastructure Dependencies** - Cloud services, deployment requirements
### Risk Assessment & Mitigation
- **Technical Risks** - Complexity, performance, and scalability concerns
- **Timeline Risks** - Dependency bottlenecks and resource constraints
- **Security Risks** - Data protection and compliance vulnerabilities
- **Business Risks** - Market changes and requirement evolution
- **Mitigation Strategies** - Fallback plans and alternative approaches
### Parallel Work Stream Identification
- **Independent Components** - Features that can be developed simultaneously
- **Shared Dependencies** - Common components requiring coordination
- **Critical Path Analysis** - Bottlenecks that block other work
- **Resource Allocation** - Team capacity and skill distribution
- **Communication Protocols** - Coordination between parallel streams
## Integration with SuperClaude Ecosystem
### TodoWrite Integration
- Automatically creates session tasks for immediate next steps
- Provides progress tracking throughout workflow execution
- Links workflow phases to actionable development tasks
### Task Command Integration
- Converts workflow into hierarchical project tasks (`/task`)
- Enables cross-session persistence and progress tracking
- Supports complex orchestration with `/spawn`
### Implementation Command Integration
- Seamlessly connects to `/implement` for feature development
- Provides context-aware implementation guidance
- Auto-activates appropriate personas for each workflow phase
### Analysis Command Integration
- Leverages `/analyze` for codebase assessment
- Integrates existing code patterns into workflow planning
- Identifies refactoring opportunities and technical debt
## Usage Examples
### Generate Workflow from PRD File
```
/hc:workflow docs/feature-100-prd.md --strategy systematic --c7 --sequential --estimate
```
### Create Frontend-Focused Workflow
```
/hc:workflow "User dashboard with real-time analytics" --persona frontend --c7 --output detailed
```
### MVP Planning with Risk Assessment
```
/hc:workflow user-authentication-system --strategy mvp --risks --parallel --milestones
```
### Backend API Workflow with Dependencies
```
/hc:workflow payment-processing-api --persona backend --dependencies --c7 --output tasks
```
### Full-Stack Feature Workflow
```
/hc:workflow social-media-integration --all-mcp --sequential --parallel --estimate --output roadmap
```
## Quality Gates and Validation
### Workflow Completeness Check
- **Requirements Coverage** - Ensure all PRD requirements are addressed
- **Acceptance Criteria** - Validate testable success criteria
- **Technical Feasibility** - Assess implementation complexity and risks
- **Resource Alignment** - Match workflow to team capabilities and timeline
### Best Practices Validation
- **Architecture Patterns** - Ensure adherence to established patterns
- **Security Standards** - Validate security considerations at each phase
- **Performance Requirements** - Include performance targets and monitoring
- **Maintainability** - Plan for long-term code maintenance and updates
### Stakeholder Alignment
- **Business Requirements** - Ensure business value is clearly defined
- **Technical Requirements** - Validate technical specifications and constraints
- **Timeline Expectations** - Realistic estimation and milestone planning
- **Success Metrics** - Define measurable outcomes and KPIs
## Performance Optimization
### Workflow Generation Speed
- **PRD Parsing** - Efficient document analysis and requirement extraction
- **Pattern Recognition** - Rapid identification of common implementation patterns
- **Template Application** - Reusable workflow templates for common scenarios
- **Incremental Generation** - Progressive workflow refinement and optimization
### Context Management
- **Memory Efficiency** - Optimal context usage for large PRDs
- **Caching Strategy** - Reuse analysis results across similar workflows
- **Progressive Loading** - Load workflow details on-demand
- **Compression** - Efficient storage and retrieval of workflow data
## Success Metrics
### Workflow Quality
- **Implementation Success Rate** - >90% successful feature completion following workflows
- **Timeline Accuracy** - <20% variance from estimated timelines
- **Requirement Coverage** - 100% PRD requirement mapping to workflow tasks
- **Stakeholder Satisfaction** - >85% satisfaction with workflow clarity and completeness
### Performance Targets
- **Workflow Generation** - <30 seconds for standard PRDs
- **Dependency Analysis** - <60 seconds for complex systems
- **Risk Assessment** - <45 seconds for comprehensive evaluation
- **Context Integration** - <10 seconds for MCP server coordination
## Claude Code Integration
- **Multi-Tool Orchestration** - Coordinates Read, Task, Glob, Grep for comprehensive analysis
- **Progressive Task Creation** - Uses TodoWrite for immediate next steps and Task for long-term planning
- **MCP Server Coordination** - Intelligent routing to Context7 and Sequential based on workflow needs
- **Cross-Command Integration** - Seamless handoff to implement, analyze, design, and other SuperClaude commands
- **Evidence-Based Planning** - Maintains audit trail of decisions and rationale throughout workflow generation