* fix(orchestration): add WebFetch auto-trigger for infrastructure configuration Problem: Infrastructure configuration changes (e.g., Traefik port settings) were being made based on assumptions without consulting official documentation, violating the 'Evidence > assumptions' principle in PRINCIPLES.md. Solution: - Added Infrastructure Configuration Validation section to MODE_Orchestration.md - Auto-triggers WebFetch for infrastructure tools (Traefik, nginx, Docker, etc.) - Enforces MODE_DeepResearch activation for investigation - BLOCKS assumption-based configuration changes Testing: Verified WebFetch successfully retrieves Traefik official docs (port 80 default) This prevents production outages from infrastructure misconfiguration by ensuring all technical recommendations are backed by official documentation. * feat: Add PM Agent (Project Manager Agent) for seamless orchestration Introduces PM Agent as the default orchestration layer that coordinates all sub-agents and manages workflows automatically. Key Features: - Default orchestration: All user interactions handled by PM Agent - Auto-delegation: Intelligent sub-agent selection based on task analysis - Docker Gateway integration: Zero-token baseline with dynamic MCP loading - Self-improvement loop: Automatic documentation of patterns and mistakes - Optional override: Users can specify sub-agents explicitly if desired Architecture: - Agent spec: SuperClaude/Agents/pm-agent.md - Command: SuperClaude/Commands/pm.md - Updated docs: README.md (15→16 agents), agents.md (new Orchestration category) User Experience: - Default: PM Agent handles everything (seamless, no manual routing) - Optional: Explicit --agent flag for direct sub-agent access - Both modes available simultaneously (no user downside) Implementation Status: - ✅ Specification complete - ✅ Documentation complete - ⏳ Prototype implementation needed - ⏳ Docker Gateway integration needed - ⏳ Testing and validation needed Refs: kazukinakai/docker-mcp-gateway (IRIS MCP Gateway integration) * feat: Add Agent Orchestration rules for PM Agent default activation Implements PM Agent as the default orchestration layer in RULES.md. Key Changes: - New 'Agent Orchestration' section (CRITICAL priority) - PM Agent receives ALL user requests by default - Manual override with @agent-[name] bypasses PM Agent - Agent Selection Priority clearly defined: 1. Manual override → Direct routing 2. Default → PM Agent → Auto-delegation 3. Delegation based on keywords, file types, complexity, context User Experience: - Default: PM Agent handles everything (seamless) - Override: @agent-[name] for direct specialist access - Transparent: PM Agent reports delegation decisions This establishes PM Agent as the orchestration layer while respecting existing auto-activation patterns and manual overrides. Next Steps: - Local testing in agiletec project - Iteration based on actual behavior - Documentation updates as needed * refactor(pm-agent): redesign as self-improvement meta-layer Problem Resolution: PM Agent's initial design competed with existing auto-activation for task routing, creating confusion about orchestration responsibilities and adding unnecessary complexity. Design Change: Redefined PM Agent as a meta-layer agent that operates AFTER specialist agents complete tasks, focusing on: - Post-implementation documentation and pattern recording - Immediate mistake analysis with prevention checklists - Monthly documentation maintenance and noise reduction - Pattern extraction and knowledge synthesis Two-Layer Orchestration System: 1. Task Execution Layer: Existing auto-activation handles task routing (unchanged) 2. Self-Improvement Layer: PM Agent meta-layer handles documentation (new) Files Modified: - SuperClaude/Agents/pm-agent.md: Complete rewrite with meta-layer design - Category: orchestration → meta - Triggers: All user interactions → Post-implementation, mistakes, monthly - Behavioral Mindset: Continuous learning system - Self-Improvement Workflow: BEFORE/DURING/AFTER/MISTAKE RECOVERY/MAINTENANCE - SuperClaude/Core/RULES.md: Agent Orchestration section updated - Split into Task Execution Layer + Self-Improvement Layer - Added orchestration flow diagram - Clarified PM Agent activates AFTER task completion - README.md: Updated PM Agent description - "orchestrates all interactions" → "ensures continuous learning" - Docs/User-Guide/agents.md: PM Agent section rewritten - Section: Orchestration Agent → Meta-Layer Agent - Expertise: Project orchestration → Self-improvement workflow executor - Examples: Task coordination → Post-implementation documentation - PR_DOCUMENTATION.md: Comprehensive PR documentation added - Summary, motivation, changes, testing, breaking changes - Two-layer orchestration system diagram - Verification checklist Integration Validated: Tested with agiletec project's self-improvement-workflow.md: ✅ PM Agent aligns with existing BEFORE/DURING/AFTER/MISTAKE RECOVERY phases ✅ Complements (not competes with) existing workflow ✅ agiletec workflow defines WHAT, PM Agent defines WHO executes it Breaking Changes: None - Existing auto-activation continues unchanged - Specialist agents unaffected - User workflows remain the same - New capability: Automatic documentation and knowledge maintenance Value Proposition: Transforms SuperClaude into a continuously learning system that accumulates knowledge, prevents recurring mistakes, and maintains fresh documentation without manual intervention. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add Claude Code conversation history management research Research covering .jsonl file structure, performance impact, and retention policies. Content: - Claude Code .jsonl file format and message types - Performance issues from GitHub (memory leaks, conversation compaction) - Retention policies (consumer vs enterprise) - Rotation recommendations based on actual data - File history snapshot tracking mechanics Source: Moved from agiletec project (research applicable to all Claude Code projects) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: add Development documentation structure Phase 1: Documentation Structure complete - Add Docs/Development/ directory for development documentation - Add ARCHITECTURE.md - System architecture with PM Agent meta-layer - Add ROADMAP.md - 5-phase development plan with checkboxes - Add TASKS.md - Daily task tracking with progress indicators - Add PROJECT_STATUS.md - Current status dashboard and metrics - Add pm-agent-integration.md - Implementation guide for PM Agent mode This establishes comprehensive documentation foundation for: - System architecture understanding - Development planning and tracking - Implementation guidance - Progress visibility Related: #pm-agent-mode #documentation #phase-1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: PM Agent session lifecycle and PDCA implementation Phase 2: PM Agent Mode Integration (Design Phase) Commands/pm.md updates: - Add "Always-Active Foundation Layer" concept - Add Session Lifecycle (Session Start/During Work/Session End) - Add PDCA Cycle (Plan/Do/Check/Act) automation - Add Serena MCP Memory Integration (list/read/write_memory) - Document auto-activation triggers Agents/pm-agent.md updates: - Add Session Start Protocol (MANDATORY auto-activation) - Add During Work PDCA Cycle with example workflows - Add Session End Protocol with state preservation - Add PDCA Self-Evaluation Pattern - Add Documentation Strategy (temp → patterns/mistakes) - Add Memory Operations Reference Key Features: - Session start auto-activation for context restoration - 30-minute checkpoint saves during work - Self-evaluation with think_about_* operations - Systematic documentation lifecycle - Knowledge evolution to CLAUDE.md Implementation Status: - ✅ Design complete (Commands/pm.md, Agents/pm-agent.md) - ⏳ Implementation pending (Core components) - ⏳ Serena MCP integration pending Salvaged from mistaken development in ~/.claude directory Related: #pm-agent-mode #session-lifecycle #pdca-cycle #phase-2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: disable Serena MCP auto-browser launch Disable web dashboard and GUI log window auto-launch in Serena MCP server to prevent intrusive browser popups on startup. Users can still manually access the dashboard at http://localhost:24282/dashboard/ if needed. Changes: - Add CLI flags to Serena run command: - --enable-web-dashboard false - --enable-gui-log-window false - Ensures Git-tracked configuration (no reliance on ~/.serena/serena_config.yml) - Aligns with AIRIS MCP Gateway integration approach 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: rename directories to lowercase for PEP8 compliance - Rename superclaude/Agents -> superclaude/agents - Rename superclaude/Commands -> superclaude/commands - Rename superclaude/Core -> superclaude/core - Rename superclaude/Examples -> superclaude/examples - Rename superclaude/MCP -> superclaude/mcp - Rename superclaude/Modes -> superclaude/modes This change follows Python PEP8 naming conventions for package directories. * style: fix PEP8 violations and update package name to lowercase Changes: - Format all Python files with black (43 files reformatted) - Update package name from 'SuperClaude' to 'superclaude' in pyproject.toml - Fix import statements to use lowercase package name - Add missing imports (timedelta, __version__) - Remove old SuperClaude.egg-info directory PEP8 violations reduced from 2672 to 701 (mostly E501 line length due to black's 88 char vs flake8's 79 char limit). * docs: add PM Agent development documentation Add comprehensive PM Agent development documentation: - PM Agent ideal workflow (7-phase autonomous cycle) - Project structure understanding (Git vs installed environment) - Installation flow understanding (CommandsComponent behavior) - Task management system (current-tasks.md) Purpose: Eliminate repeated explanations and enable autonomous PDCA cycles 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat(pm-agent): add self-correcting execution and warning investigation culture ## Changes ### superclaude/commands/pm.md - Add "Self-Correcting Execution" section with root cause analysis protocol - Add "Warning/Error Investigation Culture" section enforcing zero-tolerance for dismissal - Define error detection protocol: STOP → Investigate → Hypothesis → Different Solution → Execute - Document anti-patterns (retry without understanding) and correct patterns (research-first) ### docs/Development/hypothesis-pm-autonomous-enhancement-2025-10-14.md - Add PDCA workflow hypothesis document for PM Agent autonomous enhancement ## Rationale PM Agent must never retry failed operations without understanding root causes. All warnings and errors require investigation via context7/WebFetch/documentation to ensure production-quality code and prevent technical debt accumulation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat(installer): add airis-mcp-gateway MCP server option ## Changes - Add airis-mcp-gateway to MCP server options in installer - Configuration: GitHub-based installation via uvx - Repository: https://github.com/oraios/airis-mcp-gateway - Purpose: Dynamic MCP Gateway for zero-token baseline and on-demand tool loading ## Implementation Added to setup/components/mcp.py self.mcp_servers dictionary with: - install_method: github - install_command: uvx test installation - run_command: uvx runtime execution - required: False (optional server) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: kazuki <kazuki@kazukinoMacBook-Air.local> Co-authored-by: Claude <noreply@anthropic.com>
15 KiB
SuperClaude Architecture
Last Updated: 2025-10-14 Version: 4.1.5
📋 Table of Contents
- System Overview
- Core Architecture
- PM Agent Mode: The Meta-Layer
- Component Relationships
- Serena MCP Integration
- PDCA Engine
- Data Flow
- Extension Points
System Overview
What is SuperClaude?
SuperClaude is a Context-Oriented Configuration Framework that transforms Claude Code into a structured development platform. It is NOT standalone software with running processes - it is a collection of .md instruction files that Claude Code reads to adopt specialized behaviors.
Key Components
SuperClaude Framework
├── Commands (26) → Workflow patterns
├── Agents (16) → Domain expertise
├── Modes (7) → Behavioral modifiers
├── MCP Servers (8) → External tool integrations
└── PM Agent Mode → Meta-layer orchestration (Always-Active)
Version Information
- Current Version: 4.1.5
- Commands: 26 slash commands (
/sc:*) - Agents: 16 specialized domain experts
- Modes: 7 behavioral modes
- MCP Servers: 8 integrations (Context7, Sequential, Magic, Playwright, Morphllm, Serena, Tavily, Chrome DevTools)
Core Architecture
Context-Oriented Configuration
SuperClaude's architecture is built on a simple principle: behavioral modification through structured context files.
User Input
↓
Context Loading (CLAUDE.md imports)
↓
Command Detection (/sc:* pattern)
↓
Agent Activation (manual or auto)
↓
Mode Application (flags or triggers)
↓
MCP Tool Coordination
↓
Output Generation
Directory Structure
~/.claude/
├── CLAUDE.md # Main context with @imports
├── FLAGS.md # Flag definitions
├── RULES.md # Core behavioral rules
├── PRINCIPLES.md # Guiding principles
├── MODE_*.md # 7 behavioral modes
├── MCP_*.md # 8 MCP server integrations
├── agents/ # 16 specialized agents
│ ├── pm-agent.md # 🆕 Meta-layer orchestrator
│ ├── backend-architect.md
│ ├── frontend-architect.md
│ ├── security-engineer.md
│ └── ... (13 more)
└── commands/sc/ # 26 workflow commands
├── pm.md # 🆕 PM Agent command
├── implement.md
├── analyze.md
└── ... (23 more)
PM Agent Mode: The Meta-Layer
Position in Architecture
PM Agent operates as a meta-layer above all other components:
┌─────────────────────────────────────────────┐
│ PM Agent Mode (Meta-Layer) │
│ • Always Active (Session Start) │
│ • Context Preservation │
│ • PDCA Self-Evaluation │
│ • Knowledge Management │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ Specialist Agents (16) │
│ backend-architect, security-engineer, etc. │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ Commands & Modes │
│ /sc:implement, /sc:analyze, etc. │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ MCP Tool Layer │
│ Context7, Sequential, Magic, etc. │
└─────────────────────────────────────────────┘
PM Agent Responsibilities
-
Session Lifecycle Management
- Auto-activation at session start
- Context restoration from Serena MCP memory
- User report generation (前回/進捗/今回/課題)
-
PDCA Cycle Execution
- Plan: Hypothesis generation
- Do: Experimentation with checkpoints
- Check: Self-evaluation
- Act: Knowledge extraction
-
Documentation Strategy
- Temporary documentation (
docs/temp/) - Formal patterns (
docs/patterns/) - Mistake records (
docs/mistakes/) - Knowledge evolution to CLAUDE.md
- Temporary documentation (
-
Sub-Agent Orchestration
- Auto-delegation to specialists
- Context coordination
- Quality gate validation
- Progress monitoring
Component Relationships
Commands → Agents → Modes → MCP
User: "/sc:implement authentication" --security
↓
[Command Layer]
commands/sc/implement.md
↓
[Agent Auto-Activation]
agents/security-engineer.md
agents/backend-architect.md
↓
[Mode Application]
MODE_Task_Management.md (TodoWrite)
↓
[MCP Tool Coordination]
Context7 (auth patterns)
Sequential (complex analysis)
↓
[PM Agent Meta-Layer]
Document learnings → docs/patterns/
Activation Flow
-
Explicit Command: User types
/sc:implement- Loads
commands/sc/implement.md - Activates related agents (backend-architect, etc.)
- Loads
-
Agent Activation:
@agent-securityor auto-detected- Loads agent expertise context
- May activate related MCP servers
-
Mode Application:
--brainstormflag or keywords- Modifies interaction style
- Enables specific behaviors
-
PM Agent Meta-Layer: Always active
- Monitors all interactions
- Documents learnings
- Preserves context across sessions
Serena MCP Integration
Memory Operations
Serena MCP provides semantic code analysis and session persistence through memory operations:
Session Start:
PM Agent → list_memories()
PM Agent → read_memory("pm_context")
PM Agent → read_memory("last_session")
PM Agent → read_memory("next_actions")
PM Agent → Report to User
During Work (every 30min):
PM Agent → write_memory("checkpoint", progress)
PM Agent → write_memory("decision", rationale)
Session End:
PM Agent → write_memory("last_session", summary)
PM Agent → write_memory("next_actions", todos)
PM Agent → write_memory("pm_context", complete_state)
Memory Structure
{
"pm_context": {
"project": "SuperClaude_Framework",
"current_phase": "Phase 1: Documentation",
"active_tasks": ["ARCHITECTURE.md", "ROADMAP.md"],
"architecture": "Context-Oriented Configuration",
"patterns": ["PDCA Cycle", "Session Lifecycle"]
},
"last_session": {
"date": "2025-10-14",
"accomplished": ["PM Agent mode design", "Salvaged implementations"],
"issues": ["Serena MCP not configured"],
"learned": ["Session Lifecycle pattern", "PDCA automation"]
},
"next_actions": [
"Create docs/Development/ structure",
"Write ARCHITECTURE.md",
"Configure Serena MCP server"
]
}
PDCA Engine
Continuous Improvement Cycle
┌─────────────┐
│ Plan │ → write_memory("plan", goal)
│ (仮説) │ → docs/temp/hypothesis-YYYY-MM-DD.md
└──────┬──────┘
↓
┌─────────────┐
│ Do │ → TodoWrite tracking
│ (実験) │ → write_memory("checkpoint", progress)
└──────┬──────┘ → docs/temp/experiment-YYYY-MM-DD.md
↓
┌─────────────┐
│ Check │ → think_about_task_adherence()
│ (評価) │ → think_about_whether_you_are_done()
└──────┬──────┘ → docs/temp/lessons-YYYY-MM-DD.md
↓
┌─────────────┐
│ Act │ → Success: docs/patterns/[name].md
│ (改善) │ → Failure: docs/mistakes/mistake-*.md
└──────┬──────┘ → Update CLAUDE.md
↓
[Repeat]
Documentation Evolution
Trial-and-Error (docs/temp/)
↓
Success → Formal Pattern (docs/patterns/)
↓
Accumulate Knowledge
↓
Extract Best Practices → CLAUDE.md (Global Rules)
Mistake Detection (docs/temp/)
↓
Root Cause Analysis → docs/mistakes/
↓
Prevention Checklist
↓
Update Anti-Patterns → CLAUDE.md
Data Flow
Session Lifecycle Data Flow
Session Start:
┌──────────────┐
│ Claude Code │
│ Startup │
└──────┬───────┘
↓
┌──────────────┐
│ PM Agent │ list_memories()
│ Activation │ read_memory("pm_context")
└──────┬───────┘
↓
┌──────────────┐
│ Serena │ Return: pm_context,
│ MCP │ last_session,
└──────┬───────┘ next_actions
↓
┌──────────────┐
│ Context │ Restore project state
│ Restoration │ Generate user report
└──────┬───────┘
↓
┌──────────────┐
│ User │ 前回: [summary]
│ Report │ 進捗: [status]
└──────────────┘ 今回: [actions]
課題: [blockers]
Implementation Data Flow
User Request → PM Agent Analyzes
↓
PM Agent → Delegate to Specialist Agents
↓
Specialist Agents → Execute Implementation
↓
Implementation Complete → PM Agent Documents
↓
PM Agent → write_memory("checkpoint", progress)
PM Agent → docs/temp/experiment-*.md
↓
Success → docs/patterns/ | Failure → docs/mistakes/
↓
Update CLAUDE.md (if global pattern)
Extension Points
Adding New Components
1. New Command
File: ~/.claude/commands/sc/new-command.md
Structure:
- Metadata (name, category, complexity)
- Triggers (when to use)
- Workflow Pattern (step-by-step)
- Examples
Integration:
- Auto-loads when user types /sc:new-command
- Can activate related agents
- PM Agent automatically documents usage patterns
2. New Agent
File: ~/.claude/agents/new-specialist.md
Structure:
- Metadata (name, category)
- Triggers (keywords, file types)
- Behavioral Mindset
- Focus Areas
Integration:
- Auto-activates on trigger keywords
- Manual activation: @agent-new-specialist
- PM Agent orchestrates with other agents
3. New Mode
File: ~/.claude/MODE_NewMode.md
Structure:
- Activation Triggers (flags, keywords)
- Behavioral Modifications
- Interaction Patterns
Integration:
- Flag: --new-mode
- Auto-activation on complexity threshold
- Modifies all agent behaviors
4. New MCP Server
File: ~/.claude/.claude.json
{
"mcpServers": {
"new-server": {
"command": "npx",
"args": ["-y", "new-server-mcp@latest"]
}
}
}
File: ~/.claude/MCP_NewServer.md
Structure:
- Purpose (what this server provides)
- Triggers (when to use)
- Integration (how to coordinate with other tools)
PM Agent Integration for Extensions
All new components automatically integrate with PM Agent meta-layer:
- Session Lifecycle: New components' usage tracked across sessions
- PDCA Cycle: Patterns extracted from new component usage
- Documentation: Learnings automatically documented
- Orchestration: PM Agent coordinates new components with existing ones
Architecture Principles
1. Simplicity First
- No executing code, only context files
- No performance systems, only instructional patterns
- No detection engines, Claude Code does pattern matching
2. Context-Oriented
- Behavior modification through structured context
- Import system for modular context loading
- Clear trigger patterns for activation
3. Meta-Layer Design
- PM Agent orchestrates without interfering
- Specialist agents work transparently
- Users interact with cohesive system
4. Knowledge Accumulation
- Every experience generates learnings
- Mistakes documented with prevention
- Patterns extracted to reusable knowledge
5. Session Continuity
- Context preserved across sessions
- No re-explanation needed
- Seamless resumption from last checkpoint
Technical Considerations
Performance
- Framework is pure context (no runtime overhead)
- Token efficiency through dynamic MCP loading
- Strategic context caching for related phases
Scalability
- Unlimited commands/agents/modes through context files
- Modular architecture supports independent development
- PM Agent meta-layer handles coordination complexity
Maintainability
- Clear separation of concerns (Commands/Agents/Modes)
- Self-documenting through PDCA cycle
- Living documentation evolves with usage
Extensibility
- Drop-in new contexts without code changes
- MCP servers add capabilities externally
- PM Agent auto-integrates new components
Future Architecture
Planned Enhancements
-
Auto-Activation System
- PM Agent activates automatically at session start
- No manual invocation needed
-
Enhanced Memory Operations
- Full Serena MCP integration
- Cross-project knowledge sharing
- Pattern recognition across sessions
-
PDCA Automation
- Automatic documentation lifecycle
- AI-driven pattern extraction
- Self-improving knowledge base
-
Multi-Project Orchestration
- PM Agent coordinates across projects
- Shared learnings and patterns
- Unified knowledge management
Summary
SuperClaude's architecture is elegantly simple: structured context files that Claude Code reads to adopt sophisticated behaviors. The addition of PM Agent mode as a meta-layer transforms this from a collection of tools into a continuously learning, self-improving development platform.
Key Architectural Innovation: PM Agent meta-layer provides:
- Always-active foundation layer
- Context preservation across sessions
- PDCA self-evaluation and learning
- Systematic knowledge management
- Seamless orchestration of specialist agents
This architecture enables SuperClaude to function as a 最高司令官 (Supreme Commander) that orchestrates all development activities while continuously learning and improving from every interaction.
Last Verified: 2025-10-14 Next Review: 2025-10-21 (1 week) Version: 4.1.5