# SuperClaude - Claude Code Configuration Framework [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-4.0.0-blue.svg)](https://github.com/NomenAK/SuperClaude/releases) [![GitHub issues](https://img.shields.io/github/issues/NomenAK/SuperClaude)](https://github.com/NomenAK/SuperClaude/issues) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/NomenAK/SuperClaude/blob/master/CONTRIBUTING.md) > **Transform Claude Code into a specialized AI development powerhouse** ## πŸš€ Quick Start for Users **SuperClaude is a comprehensive configuration framework that supercharges Claude Code with:** ### 🎭 **9 AI Personas** Switch between specialized thinking modes: - `architect` β†’ System design & scalability - `frontend` β†’ UX & React development - `backend` β†’ APIs & performance - `security` β†’ Threat modeling & secure code - `analyzer` β†’ Root cause debugging - ...and 4 more! ### ⚑ **18 Specialized Commands** Powerful workflows at your fingertips: ```bash /user:build --react # Build React apps with best practices /user:analyze --security # Deep security analysis /user:troubleshoot --prod # Production debugging /persona:architect # Switch to system design mode ``` ### 🧠 **Intelligent Tool Integration** - **Auto Documentation Lookup** β†’ Context7 finds library docs instantly - **Complex Analysis** β†’ Sequential thinking for deep problems - **UI Generation** β†’ Magic creates React components - **Browser Testing** β†’ Puppeteer validates your work ### πŸ“Š **Smart Token Management** - **UltraCompressed Mode** β†’ 70% token reduction - **Adaptive Thinking** β†’ Right analysis depth for each task - **Evidence-Based Decisions** β†’ No more "this is better" without proof ## πŸ’‘ Why SuperClaude? **Before:** Generic AI assistance **After:** Specialized, context-aware development partner - βœ… **Consistent workflows** across all projects - βœ… **Research-first approach** β†’ Always finds official docs - βœ… **Quality standards** β†’ Built-in best practices - βœ… **Cognitive specialization** β†’ Right mindset for each task ## 🎯 Perfect For - **Developers** β†’ Faster, smarter coding workflows - **Teams** β†’ Consistent AI assistance patterns - **Projects** β†’ Quality-focused development - **Learning** β†’ AI-guided skill development --- ## Legend | Symbol | Meaning | | Abbrev | Meaning | |--------|---------|---|--------|---------| | β†’ | leads to | | cfg | configuration | | & | and/with | | fn | function | | w/ | with | | impl | implementation | | @ | at/located | | env | environment | | + | add/include | | dev | development | | - | remove/exclude | | auth | authentication | | βˆ€ | for all/every | | API | application interface | > Advanced cfg framework for Claude Code | v4.0.0 ## What is SuperClaude **Comprehensive cfg system** enhancing Claude Code w/: - **CLAUDE.md** β†’ Main cfg + ops - **RULES.md** β†’ Governance + practices - **PERSONAS.md** β†’ 9 cognitive archetypes - **MCP.md** β†’ Model Context Protocol patterns - **18 Slash Commands** β†’ Specialized workflows - **19 Shared Resources** β†’ Advanced cfgs ## Installation SuperClaude installs globally β†’ `~/.claude/` βˆ€ projects. ### Directory Structure ``` ~/.claude/ β”œβ”€β”€ CLAUDE.md # Main cfg (loads others) β”œβ”€β”€ RULES.md # Ops rules & standards β”œβ”€β”€ PERSONAS.md # 9 cognitive archetypes β”œβ”€β”€ MCP.md # Model Context Protocol ops └── commands/ # 17 specialized slash commands + index β”œβ”€β”€ analyze.md β”œβ”€β”€ build.md β”œβ”€β”€ cleanup.md β”œβ”€β”€ deploy.md β”œβ”€β”€ design.md β”œβ”€β”€ dev-setup.md β”œβ”€β”€ document.md β”œβ”€β”€ estimate.md β”œβ”€β”€ explain.md β”œβ”€β”€ git.md β”œβ”€β”€ improve.md β”œβ”€β”€ index.md β”œβ”€β”€ load.md β”œβ”€β”€ migrate.md β”œβ”€β”€ scan.md β”œβ”€β”€ spawn.md β”œβ”€β”€ test.md β”œβ”€β”€ troubleshoot.md └── shared/ # 19 cfg resources β”œβ”€β”€ ambiguity-check.yml β”œβ”€β”€ audit.yml β”œβ”€β”€ checkpoint.yml β”œβ”€β”€ cleanup-patterns.yml β”œβ”€β”€ command-memory.yml β”œβ”€β”€ documentation-dirs.yml β”œβ”€β”€ evidence.yml β”œβ”€β”€ git-operations.yml β”œβ”€β”€ git-workflow.yml β”œβ”€β”€ impl.yml β”œβ”€β”€ loading-cfg.yml β”œβ”€β”€ mcp-flags.yml β”œβ”€β”€ patterns.yml β”œβ”€β”€ performance-monitoring.yml β”œβ”€β”€ planning-mode.yml β”œβ”€β”€ research-first.yml β”œβ”€β”€ thinking-modes.yml β”œβ”€β”€ ultracompressed.yml └── validation.yml ``` ### Quick Install (Recommended) ```bash git clone https://github.com/your-username/SuperClaude.git cd SuperClaude ./install.sh ``` ### Manual Install ```bash # 1. Create structure mkdir -p ~/.claude/commands/shared # 2. Copy cfg files cp CLAUDE.md RULES.md PERSONAS.md MCP.md ~/.claude/ # 3. Copy commands cp .claude/commands/*.md ~/.claude/commands/ # 4. Copy shared resources cp .claude/commands/shared/*.yml ~/.claude/commands/shared/ ``` ### Verify Installation ```bash # Check installation ls -la ~/.claude/ # Should show 4 main files ls -la ~/.claude/commands/ # Should show 17 files (16 commands + index) # Test usage # Open any project in Claude Code & try: /user:analyze --code /persona:architect ``` ## How to Use SuperClaude ### Core Usage Patterns #### 1. Personas - Cognitive Archetypes Activate specialized thinking w/ `/persona:`: | Persona | Focus | Use When | Example | |---------|-------|----------|---------| | **architect** | Systems design, long-term maintainability | Planning large systems | `/persona:architect` β†’ `/user:design --api --ddd` | | **frontend** | UX, visual interfaces | UI/UX work | `/persona:frontend` β†’ `/user:build --react` | | **backend** | Performance, reliability, APIs | Server-side dev | `/persona:backend` β†’ `/user:build --api` | | **analyzer** | Root cause analysis, evidence-based | Debugging complex issues | `/persona:analyzer` β†’ `/user:troubleshoot --investigate` | | **security** | Threat modeling, secure by default | Security reviews | `/persona:security` β†’ `/user:scan --security` | | **mentor** | Teaching, guided discovery | Learning/explaining | `/persona:mentor` β†’ `/user:explain --depth` | | **refactorer** | Code quality, simplification | Code improvement | `/persona:refactorer` β†’ `/user:improve --quality` | | **performance** | Speed optimization, bottlenecks | Performance tuning | `/persona:performance` β†’ `/user:improve --performance` | | **qa** | Quality assurance, testing | Testing workflows | `/persona:qa` β†’ `/user:test --coverage` | #### 2. Slash Commands - Specialized Workflows **Universal Flags (βˆ€ commands):** *Planning & Thinking:* - `--plan` - Show execution plan before running - `--think` - Standard analysis mode (multi-file context) - `--think-hard` - Deep analysis mode (architecture level) - `--ultrathink` - Critical analysis mode (system-wide) *Documentation Control:* - `--ultracompressed` / `--uc` - ~70% token reduction mode *MCP Server Control:* - `--c7` / `--no-c7` - Enable/disable Context7 documentation - `--seq` / `--no-seq` - Enable/disable Sequential thinking - `--magic` / `--no-magic` - Enable/disable Magic UI builder - `--pup` / `--no-pup` - Enable/disable Puppeteer browser - `--all-mcp` - Enable all MCP servers - `--no-mcp` - Disable all MCP servers (native tools only) **Dev Commands (3):** - `/user:build` - Universal project builder - `--init` (new project), `--feature` (add feature), `--react` (React app), `--api` (backend), `--tdd` (test-driven) - `/user:dev-setup` - Dev env setup - `--install` (tools), `--ci` (CI/CD), `--monitor` (monitoring) - `/user:test` - Testing framework - `--coverage` (coverage), `--watch` (watch mode), `--e2e` (end-to-end) **Analysis & Improvement Commands (4):** - `/user:analyze` - Multi-dimensional analysis - `--code` (code review), `--architecture` (design), `--profile` (performance), `--security` (vulnerabilities) - `/user:troubleshoot` - Debug & fix issues - `--investigate` (explore), `--fix` (repair), `--five-whys` (root cause), `--prod` (production) - `/user:improve` - Enhance code/performance - `--quality` (refactor), `--performance` (optimize), `--iterate` (continuous), `--threshold` (target %) - `/user:explain` - Deep explanations - `--depth` (complexity level), `--visual` (diagrams), `--examples` (code samples) **Ops Commands (6):** - `/user:deploy` - App deployment - `--env` (environment), `--rollback` (revert) - `/user:migrate` - DB/code migration - `--dry-run` (preview), `--rollback` (revert) - `/user:scan` - Security & validation - `--validate` (verify), `--security` (vulnerabilities), `--owasp` (security scan), `--deps` (dependencies) - `/user:estimate` - Time/complexity predictions - `--detailed` (breakdown), `--worst-case` (pessimistic) - `/user:cleanup` - Project maintenance - `--code` (clean code), `--files` (artifacts), `--deps` (dependencies), `--git` (git cleanup), `--all` (everything), `--dry-run` (preview) - `/user:git` - Git workflow mgmt - `--status` (comprehensive status), `--commit` (create commits), `--branch` (manage branches), `--sync` (fetch/pull/push), `--merge` (merge branches), `--stash` (stash changes), `--history` (view history), `--checkpoint` (create checkpoint), `--rollback` (revert changes) **Design & Architecture Commands (1):** - `/user:design` - System design - `--api` (REST), `--ddd` (domain-driven), `--prd` (requirements), `--openapi` (specs), `--graphql` (GraphQL), `--bounded-context` (DDD contexts) **Workflow Commands (2):** - `/user:spawn` - Create specialized sub-agent - `--task` (specific assignment) - `/user:document` - Documentation creation - `--api` (API docs), `--user` (user guides) **System Commands (1):** - `/user:load` - Load project context - `--depth` (analysis level) #### 3. MCP Integration - Intelligent Tool Usage SuperClaude: auto & manual control over Model Context Protocol tools: **Manual Control w/ Flags:** ```bash # Explicit MCP control /user:build --react --magic # Force Magic UI builder /user:analyze --code --no-c7 # Disable Context7 /user:troubleshoot --seq --think # Sequential + thinking mode /user:test --e2e --pup # Force Puppeteer for testing /user:explain --no-mcp # Use only native tools # Combine multiple MCPs /user:design --api --seq --c7 # Sequential planning + docs /user:build --react --magic --pup # UI generation + testing ``` **Auto Activation:** **Context7 (C7) - Docs & Libraries:** ```bash # Auto activation: "How to use React hooks?" β†’ C7 resolve-library-id β†’ get-docs "Express.js auth" β†’ C7 get-docs β†’ impl # Manual w/ personas: /persona:mentor β†’ asks about lib β†’ C7 provides learning resources ``` **Sequential - Complex Analysis:** ```bash # Auto activation: "Why is my app slow?" β†’ Sequential analysis β†’ optimization plan "Design microservices architecture" β†’ Sequential system design # Manual w/ personas: /persona:architect β†’ /user:design β†’ Sequential long-term thinking /persona:analyzer β†’ /user:troubleshoot β†’ Sequential root cause analysis ``` **Magic UI Builder - Component Generation:** ```bash # Auto activation: "I need a dashboard" β†’ Magic builder β†’ component integration "Create a form component" β†’ Magic builder β†’ refiner if needed # Manual w/ personas: /persona:frontend β†’ UI request β†’ Magic + Puppeteer testing ``` **Puppeteer - Browser Testing:** ```bash # Auto activation: UI components β†’ Puppeteer validation Performance testing β†’ Puppeteer metrics # Manual w/ personas: /persona:qa β†’ testing workflows β†’ Puppeteer comprehensive testing /persona:performance β†’ /user:improve β†’ Puppeteer performance monitoring ``` #### 4. Planning Mode **Default:** Execute immediately **Control:** Add `--plan` β†’ preview before execution Ex: `/user:deploy --plan` β†’ show plan first #### 5. Thinking Modes Control analysis depth via flags: ```bash /user:analyze --code # Basic /user:analyze --code --think # Standard (~4K) /user:design --api --think-hard # Deep (~10K) /user:troubleshoot --prod --ultrathink # Critical (~32K) ``` Natural language: "think about X" / "think hard about Y" / "ultrathink Z" #### 6. Research-First Standards **Auto Research:** - External libs β†’ C7 docs lookup - UI components β†’ Magic search - API integration β†’ official docs - Performance β†’ benchmarks **Workflow:** Detect β†’ Research β†’ Cite β†’ Implement Ex: ```bash # ❌ Blocked w/o docs import { fn } from 'unknown-lib' # βœ“ Proceeds w/ citation // Source: React docs import { useState } from 'react' ``` ### Workflow Examples #### Full-Stack Dev ```bash /persona:architect β†’ /user:load --depth deep β†’ /user:analyze --architecture /user:design --api --ddd β†’ /user:estimate --detailed /persona:backend β†’ /user:build --api /persona:frontend β†’ /user:build --react β†’ /user:test --coverage /persona:security β†’ /user:scan --security β†’ /user:improve --quality /user:cleanup --all β†’ /user:deploy --env staging ``` #### Debug & Performance ```bash /persona:analyzer β†’ /user:troubleshoot --investigate --prod β†’ /user:analyze --profile "think hard about performance bottlenecks" β†’ /user:troubleshoot --five-whys /persona:performance β†’ /user:improve --performance --iterate --threshold 90% /persona:qa β†’ /user:test --e2e β†’ /user:scan --validate ``` #### Learning & Mentoring ```bash /persona:mentor β†’ /user:explain --depth beginner --visual --examples /user:document --user β†’ /user:build --tdd β†’ /user:analyze --code ``` #### Git Workflow ```bash /user:git --status β†’ /user:git --branch feature/new-component /user:build --react --magic β†’ /user:test --coverage β†’ /user:git --commit "feat: Add dashboard" /user:git --sync β†’ /user:git --merge develop --think β†’ /user:git --push /user:git --history β†’ /user:git --checkpoint before-refactor β†’ /user:cleanup --git ``` ### UltraCompressed Mode - 70% Token Reduction **Auto:** Context >70% | Token budget | "minimal tokens" **Manual:** `/user:document --uc` | `/user:explain --uc "OAuth"` **Features:** - Telegram-style: Remove articles/conjunctions/prepositions - Symbols: β†’(to), &(and), @(at), w/(with), +(add), -(remove) - Abbrevs: cfg(config), fn(function), impl(implementation) - Auto-legend: @ doc start w/ used symbols/abbrevs - Format: YAML>JSON>tables>lists>prose **Transform Ex:** ```yaml # Normal (45): "This comprehensive guide provides detailed instructions for configuring the authentication system including all environment variables and dependencies" # UltraCompressed (14): "Auth cfg guide: env vars & deps" ``` ### Docs Directory Standards **Separation:** ops reports vs project docs ``` .claudedocs/ # Claude ops docs β”œβ”€β”€ audit/ reports/ summaries/ metrics/ incidents/ /docs # Project docs β”œβ”€β”€ api/ guides/ architecture/ development/ ``` **Auto Reports:** analyzeβ†’reports/ | scanβ†’reports/ | testβ†’metrics/ | troubleshootβ†’incidents/ **Manual Docs:** `/user:document` β†’ APIβ†’/docs/api/ | guidesβ†’/docs/guides/ ### Model Selection - Simple β†’ sonnet (cost-effective) - Complex β†’ sonnet-4 (balanced) - Critical β†’ opus-4 (max capability) ### Context Mgmt ```bash /compact # Smart reduction /clear # Fresh start /model # Switch models ``` ## Troubleshooting **Commands not working:** `ls ~/.claude/commands/` (should show 17 files) **Planning:** Add `--plan` flag β†’ `/user:deploy --plan` **Personas:** `/persona:architect` β†’ `/persona:security β†’ /user:scan --security` **MCP:** "React docs" β†’ C7 | "slow app" β†’ Sequential ### Help - Install issues: `./install.sh` again - Cmd ref: `/user:load` in project - Advanced: Read `~/.claude/commands/` - Config: Modify `~/.claude/` ## Update & Maintenance **Update:** ```bash cd SuperClaude && git pull && ./install.sh ``` **Backup:** ```bash cp -r ~/.claude/ ~/.claude.backup.$(date +%Y%m%d) ``` **Uninstall:** ```bash rm -rf ~/.claude/ ``` --- *SuperClaude v4.0.0 - Cfg framework, not executable code*