# SuperClaude Architecture Overview ## Introduction SuperClaude v3 is a comprehensive framework that extends Claude Code with specialized commands, intelligent routing, and MCP server integration for advanced development workflows. The framework has evolved from a Python-based implementation to a markdown-driven orchestration system that emphasizes configuration over code. ## Core Philosophy SuperClaude operates as an orchestration layer that: - Enhances Claude Code with 21 specialized slash commands for common development tasks - Integrates 6 MCP servers for extended capabilities (Context7, Sequential, Magic, Playwright, Morphllm, Serena) - Provides intelligent routing and persona-based task execution - Enables sophisticated development workflows through declarative configuration ## Architecture Layers ### 1. Framework Core (`SuperClaude/Core/`) The framework core consists of markdown documents installed to `~/.claude/` that guide Claude's behavior: - **CLAUDE.md**: Entry point that references all framework components - **FLAGS.md**: Behavior modification flags (--think, --delegate, --uc, etc.) - **PRINCIPLES.md**: Core development principles and philosophy - **RULES.md**: Actionable rules for framework operation - **ORCHESTRATOR.md**: Intelligent routing system for tool and persona selection - **SESSION_LIFECYCLE.md**: Session management patterns with Serena MCP integration ### 2. Commands Layer (`SuperClaude/Commands/`) 21 slash commands organized by category: #### Utility Commands (Basic Complexity) - `/sc:analyze` - Code analysis and insights - `/sc:build` - Project building and packaging - `/sc:design` - Technical design generation - `/sc:document` - Documentation creation - `/sc:git` - Git operations and workflows - `/sc:test` - Test execution and analysis - `/sc:troubleshoot` - Problem diagnosis #### Workflow Commands (Standard Complexity) - `/sc:cleanup` - Code cleanup and optimization - `/sc:estimate` - Effort estimation - `/sc:explain` - Code explanation - `/sc:implement` - Feature implementation - `/sc:improve` - Code enhancement - `/sc:index` - Project indexing #### Orchestration Commands (Advanced Complexity) - `/sc:brainstorm` - Interactive requirements discovery - `/sc:task` - Multi-session task management - `/sc:workflow` - Complex workflow orchestration #### Special Commands (High Complexity) - `/sc:spawn` - Meta-orchestration for complex operations - `/sc:select-tool` - Intelligent tool selection #### Session Commands (Cross-Session) - `/sc:load` - Project context loading with Serena - `/sc:save` - Session persistence and checkpointing - `/sc:reflect` - Task reflection and validation ### 3. MCP Server Integration (`SuperClaude/MCP/`) Six specialized MCP servers provide extended capabilities: 1. **Context7**: Official library documentation and patterns 2. **Sequential**: Multi-step problem solving and analysis 3. **Magic**: UI component generation and design systems 4. **Playwright**: Browser automation and E2E testing 5. **Morphllm**: Intelligent file editing with Fast Apply 6. **Serena**: Semantic code analysis and memory management ### 4. Behavioral Modes (`SuperClaude/Modes/`) Four behavioral modes that modify Claude's operational approach: 1. **Brainstorming Mode**: Interactive requirements discovery 2. **Introspection Mode**: Meta-cognitive analysis 3. **Task Management Mode**: Multi-layer task orchestration 4. **Token Efficiency Mode**: Intelligent compression (30-50% reduction) ### 5. Agent System (`SuperClaude/Agents/`) 12 specialized agents organized by domain: #### Analysis Agents - `security-auditor`: Security vulnerability detection - `root-cause-analyzer`: Systematic issue investigation - `performance-optimizer`: Performance bottleneck resolution #### Design Agents - `system-architect`: System design and architecture - `backend-engineer`: Backend development expertise - `frontend-specialist`: Frontend and UI development #### Quality Agents - `qa-specialist`: Testing strategy and execution - `code-refactorer`: Code quality improvement #### Education Agents - `technical-writer`: Documentation creation - `code-educator`: Programming education #### Infrastructure Agents - `devops-engineer`: Infrastructure and deployment #### Special Agents - `brainstorm-PRD`: Requirements to PRD transformation ### 6. Hooks System (`SuperClaude/Hooks/`) Python-based hooks for framework integration: - **session_lifecycle**: Session start/checkpoint/end management - **performance_monitor**: Real-time performance tracking - **quality_gates**: 8-step validation cycle - **framework_coordinator**: Framework component coordination ## Key Integration Patterns ### 1. Command-MCP Integration Commands declare MCP server requirements in metadata: ```yaml mcp-integration: servers: [serena, morphllm] personas: [backend-engineer] wave-enabled: true ``` ### 2. Mode-Command Coordination Modes provide behavioral frameworks, commands provide execution: - Brainstorming Mode detects ambiguous requests - `/sc:brainstorm` command executes discovery dialogue - Mode patterns applied throughout execution ### 3. Intelligent Routing The ORCHESTRATOR.md provides routing logic: ```yaml pattern_matching: ui_component → Magic + frontend persona deep_analysis → Sequential + think modes symbol_operations → Serena + LSP precision pattern_edits → Morphllm + token optimization ``` ### 4. Session Lifecycle Pattern ``` /sc:load → WORK → /sc:save → NEXT SESSION ↑ ↓ └────── Enhanced Context ───────┘ ``` ## Performance Architecture ### Target Metrics - Memory operations: <200ms - Project loading: <500ms - Tool selection: <100ms - Session save: <2000ms - Checkpoint creation: <1000ms ### Optimization Strategies - MCP server caching and coordination - Token efficiency mode for large operations - Parallel execution with wave orchestration - Intelligent tool selection based on complexity ## Quality Assurance ### 8-Step Quality Cycle 1. Syntax Validation 2. Type Analysis 3. Lint Rules 4. Security Assessment 5. E2E Testing 6. Performance Analysis 7. Documentation Patterns 8. Integration Testing ### Quality Gates Integration - Commands integrate at steps 2.5 and 7.5 - MCP servers provide specialized validation - Hooks enforce quality standards ## Installation and Configuration ### Directory Structure ``` ~/.claude/ ├── CLAUDE.md (entry point) ├── Core framework files ├── MCP server configurations ├── Mode definitions └── Session data SuperClaude/ ├── Core/ # Framework documents ├── Commands/ # Command definitions ├── Agents/ # Agent specifications ├── MCP/ # MCP server configs ├── Modes/ # Behavioral modes └── Hooks/ # Python hooks ``` ### Installation Process 1. Framework files copied to `~/.claude/` 2. Python hooks installed and configured 3. MCP servers configured in Claude Code 4. Session lifecycle initialized ## Evolution and Future SuperClaude has evolved from Python implementation to markdown orchestration: - **v1-v2**: Python-based with complex implementation - **v3**: Markdown-driven orchestration framework - **Future**: Enhanced MCP integration, improved session management The framework continues to evolve with focus on: - Simplified configuration over code - Enhanced MCP server capabilities - Improved session persistence - Intelligent automation ## Summary SuperClaude v3 represents a mature orchestration framework that extends Claude Code through: - Declarative configuration in markdown - Intelligent routing and tool selection - Comprehensive MCP server integration - Session lifecycle management - Quality-driven development workflows The architecture emphasizes simplicity, reliability, and extensibility while maintaining sophisticated capabilities through intelligent orchestration rather than complex implementation.