docs/Development/ARCHITECTURE.md
Last Updated: 2025-10-14 Version: 4.1.5
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.
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)
/sc:*)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
~/.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 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. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Session Lifecycle Management
PDCA Cycle Execution
Documentation Strategy
docs/temp/)docs/patterns/)docs/mistakes/)Sub-Agent Orchestration
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/
Explicit Command: User types /sc:implement
commands/sc/implement.mdAgent Activation: @agent-security or auto-detected
Mode Application: --brainstorm flag or keywords
PM Agent Meta-Layer: Always active
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)
{
"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"
]
}
โโโโโโโโโโโโโโโ
โ 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]
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
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]
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)
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
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
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
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)
All new components automatically integrate with PM Agent meta-layer:
Auto-Activation System
Enhanced Memory Operations
PDCA Automation
Multi-Project Orchestration
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:
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