SuperClaude/Docs/Reference/advanced-patterns.md
NomenAK 41761f405c 📚 Major documentation cleanup: Fix CLI confusion and streamline content
## Critical Fixes 
- **CLI Command Syntax**: Fixed all ambiguous `SuperClaude --version` → `python3 -m SuperClaude --version`
- **Architecture Clarity**: Verified dual architecture documentation (Python CLI + Context Framework)
- **External Dependencies**: Marked unverified APIs as experimental (TWENTYFIRST_API_KEY, MORPH_API_KEY)
- **Installation Instructions**: Clarified NPM package names with verification warnings

## Content Optimization 🗑️
- **Removed unnecessary files**:
  - optimization-guide.md (inappropriate for context files)
  - quick-start-practices.md (duplicate content)
  - Various outdated socratic learning components
- **Updated cross-references**: Fixed all broken links to point to existing, relevant content
- **Consolidated navigation**: Streamlined Reference/README.md documentation matrix

## Technical Accuracy 🎯
- **Command References**: All commands now specify exact usage context (terminal vs Claude Code)
- **Framework Nature**: Consistently explains SuperClaude as context framework, not executable software
- **Installation Verification**: Updated diagnostic scripts with correct Python CLI commands
- **MCP Configuration**: Marked experimental services appropriately

## Impact Summary 📊
- **Files Modified**: 15+ documentation files for accuracy and consistency
- **Files Removed**: 5+ unnecessary/duplicate files
- **Broken Links**: 0 (all cross-references updated)
- **User Clarity**: Significantly improved understanding of dual architecture

Result: Professional documentation that accurately represents SuperClaude's sophisticated
dual architecture (Python CLI installation system + Claude Code context framework).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 19:03:25 +02:00

8.5 KiB

SuperClaude Advanced Patterns

Advanced Context Usage Patterns: Sophisticated combinations of commands, agents, and flags for experienced SuperClaude users working on complex projects.

Remember: SuperClaude provides context to Claude Code. All patterns here are about guiding Claude's behavior through context, not executing code or coordinating processes.

Table of Contents

Context Combination Patterns

Workflow Patterns

Multi-Agent Context Patterns

Combining Specialist Contexts

Security + Backend Pattern:

# Security-focused backend development
@agents-security "define authentication requirements"
@agents-backend-architect "design API with security requirements"
/sc:implement "secure API endpoints"

# What happens:
# 1. Security context loaded first
# 2. Backend context added
# 3. Implementation guided by both contexts
# Note: Contexts combine in Claude's understanding, not in execution

Frontend + UX + Accessibility Pattern:

# Comprehensive frontend development
@agents-frontend-architect "design component architecture"
/sc:implement "accessible React components" --magic
@agents-quality-engineer "review accessibility compliance"

# Context layering:
# - Frontend patterns guide structure
# - Magic MCP may provide UI components (if configured)
# - Quality context ensures standards

Manual vs Automatic Agent Selection

Explicit Control Pattern:

# Manually control which contexts load
@agents-python-expert "implement data pipeline"
# Only Python context, no auto-activation

# vs Automatic selection
/sc:implement "Python data pipeline"
# May activate multiple agents based on keywords

Override Auto-Selection:

# Prevent unwanted agent activation
/sc:implement "simple utility" --no-mcp
@agents-backend-architect "keep it simple"
# Limits context to specified agent only

Command Sequencing Patterns

Progressive Refinement Pattern

# Start broad, then focus
/sc:analyze project/
# General analysis

/sc:analyze project/core/ --focus architecture
# Focused on structure

/sc:analyze project/core/auth/ --focus security --think-hard
# Deep security analysis

# Each command builds on previous context within the conversation

Discovery to Implementation Pattern

# Complete feature development flow
/sc:brainstorm "feature idea"
# Explores requirements

/sc:design "feature architecture"
# Creates structure

@agents-backend-architect "review design"
# Expert review

/sc:implement "feature based on design"
# Implementation follows design

/sc:test --validate
# Verification approach

Iterative Improvement Pattern

# Multiple improvement passes
/sc:analyze code/ --focus quality
# Identify issues

/sc:improve code/ --fix
# First improvement pass

@agents-refactoring-expert "suggest further improvements"
# Expert suggestions

/sc:improve code/ --fix --focus maintainability
# Refined improvements

Flag Combination Strategies

Analysis Depth Control

# Quick overview
/sc:analyze . --quick --uc
# Fast, compressed output

# Standard analysis
/sc:analyze . --think
# Structured thinking

# Deep analysis
/sc:analyze . --think-hard --verbose
# Comprehensive analysis

# Maximum depth (use sparingly)
/sc:analyze . --ultrathink
# Exhaustive analysis

MCP Server Selection

# Selective MCP usage
/sc:implement "React component" --magic --c7
# Only Magic and Context7 MCP

# Disable all MCP
/sc:implement "simple function" --no-mcp
# Pure Claude context only

# All available MCP
/sc:analyze complex-system/ --all-mcp
# Maximum tool availability (if configured)

Complex Project Patterns

Large Codebase Analysis

# Systematic exploration of large projects
# Step 1: Structure understanding
/sc:load project/
/sc:analyze . --quick --focus architecture

# Step 2: Identify problem areas
@agents-quality-engineer "identify high-risk modules"

# Step 3: Deep dive into specific areas
/sc:analyze high-risk-module/ --think-hard --focus quality

# Step 4: Implementation plan
/sc:workflow "improvement plan based on analysis"

Multi-Module Development

# Developing interconnected modules
# Frontend module
/sc:implement "user interface module"
@agents-frontend-architect "ensure consistency"

# Backend module
/sc:implement "API module"
@agents-backend-architect "ensure compatibility"

# Integration layer
/sc:implement "frontend-backend integration"
# Context from both previous implementations guides this

Cross-Technology Projects

# Projects with multiple technologies
# Python backend
@agents-python-expert "implement FastAPI backend"

# React frontend
@agents-frontend-architect "implement React frontend"

# DevOps setup
@agents-devops-architect "create deployment configuration"

# Integration documentation
/sc:document --type integration

Migration Patterns

Legacy System Analysis

# Understanding legacy systems
/sc:load legacy-system/
/sc:analyze . --focus architecture --verbose

@agents-refactoring-expert "identify modernization opportunities"
@agents-system-architect "propose migration strategy"

/sc:workflow "create migration plan"

Incremental Migration

# Step-by-step migration approach
# Phase 1: Analysis
/sc:analyze legacy-module/ --comprehensive

# Phase 2: Design new architecture
@agents-system-architect "design modern replacement"

# Phase 3: Implementation
/sc:implement "modern module with compatibility layer"

# Phase 4: Validation
/sc:test --focus compatibility

Review and Audit Patterns

Security Audit Pattern

# Comprehensive security review
/sc:analyze . --focus security --think-hard
@agents-security "review authentication and authorization"
@agents-security "check for OWASP vulnerabilities"
/sc:document --type security-audit

Code Quality Review

# Multi-aspect quality review
/sc:analyze src/ --focus quality
@agents-quality-engineer "review test coverage"
@agents-refactoring-expert "identify code smells"
/sc:improve --fix --preview

Architecture Review

# System architecture assessment
@agents-system-architect "review current architecture"
/sc:analyze . --focus architecture --think-hard
@agents-performance-engineer "identify bottlenecks"
/sc:design "optimization recommendations"

Important Clarifications

What These Patterns Actually Do

  • Guide Claude's Thinking: Provide structured approaches
  • Combine Contexts: Layer multiple expertise areas
  • Improve Output Quality: Better code generation through better context
  • Structure Workflows: Organize complex tasks

What These Patterns Don't Do

  • Execute in Parallel: Everything is sequential context loading
  • Coordinate Processes: No actual process coordination
  • Optimize Performance: No code runs, so no performance impact
  • Persist Between Sessions: Each conversation is independent

Best Practices for Advanced Usage

Context Management

  1. Layer Deliberately: Add contexts in logical order
  2. Avoid Overload: Too many agents can dilute focus
  3. Use Manual Control: Override auto-activation when needed
  4. Maintain Conversation Flow: Keep related work in same conversation

Command Efficiency

  1. Progress Logically: Broad → Specific → Implementation
  2. Reuse Context: Later commands benefit from earlier context
  3. Document Decisions: Use /sc:save for important summaries
  4. Scope Appropriately: Focus on manageable chunks

Flag Usage

  1. Match Task Complexity: Simple tasks don't need --ultrathink
  2. Control Output: Use --uc for concise results
  3. Manage MCP: Only activate needed servers
  4. Avoid Conflicts: Don't use contradictory flags

Summary

Advanced SuperClaude patterns are about sophisticated context management and command sequencing. They help Claude Code generate better outputs by providing richer, more structured context. Remember: all "coordination" and "optimization" happens in how Claude interprets the context, not in any actual execution or parallel processing.