SuperClaude/Docs/Reference/advanced-workflows.md
NomenAK d2f4ef43e4 📁 Major documentation restructure and comprehensive Reference section
- Restructured all documentation under unified Docs/ directory
- Removed outdated phase summaries and consolidated content
- Added comprehensive Reference section with 11 new guides:
  * Advanced patterns and workflows
  * Basic examples and common issues
  * Integration patterns and MCP server guides
  * Optimization and diagnostic references
- Enhanced User-Guide with updated agent and mode documentation
- Updated MCP configurations for morphllm and serena
- Added TODO.md for project tracking
- Maintained existing content quality while improving organization

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 11:58:55 +02:00

22 KiB

SuperClaude Advanced Workflows Collection

Status: VERIFIED SuperClaude v4.0 - Multi-agent coordination, complex orchestration patterns, and enterprise-scale workflows.

Expert Coordination Guide: Advanced patterns for complex projects, multi-tool coordination, and sophisticated development workflows.

Overview and Usage Guide

Purpose: Advanced SuperClaude coordination patterns for complex, multi-step projects requiring sophisticated agent orchestration and tool integration.

Target Audience: Experienced SuperClaude users, enterprise development teams, complex project coordination

Usage Pattern: Plan → Coordinate → Execute → Validate → Optimize

Key Features:

  • Multi-agent collaboration patterns
  • Complex orchestration workflows
  • Enterprise-scale project examples
  • Performance optimization strategies
  • Session management and persistence

Multi-Agent Collaboration Patterns

Full-Stack Development Team

# E-commerce platform requiring multiple specialists
/sc:implement "secure e-commerce platform with payment processing and admin dashboard"

# Automatic agent activation and coordination:
# - frontend-architect: Dashboard UI components and user interface
# - backend-architect: API design, database schema, server logic  
# - security-engineer: Payment security, authentication, data protection
# - devops-architect: Deployment, scaling, monitoring setup
# - quality-engineer: Testing strategy, validation, compliance

# Expected coordination workflow:
# 1. security-engineer establishes security requirements and patterns
# 2. backend-architect designs API with security validation
# 3. frontend-architect creates UI components with security compliance
# 4. devops-architect plans secure deployment and monitoring
# 5. quality-engineer validates all security and functionality requirements

Performance Optimization Team

# Complex performance problem requiring systematic analysis
/sc:troubleshoot "microservices platform experiencing latency spikes under load"

# Automatic agent activation:
# - root-cause-analyst: Systematic problem investigation and hypothesis testing
# - performance-engineer: Performance profiling, bottleneck identification
# - system-architect: Architecture analysis, service communication patterns
# - devops-architect: Infrastructure analysis, scaling recommendations

# Coordination workflow:
# 1. root-cause-analyst leads systematic investigation methodology
# 2. performance-engineer provides technical performance analysis
# 3. system-architect evaluates architectural bottlenecks
# 4. devops-architect recommends infrastructure optimizations

Security-Focused Development Team

# Security agent leading with comprehensive support
/sc:implement "OAuth 2.0 authentication with PKCE and security best practices"

# Primary: security-engineer
# - Threat modeling and security requirement specification
# - Security pattern selection and implementation guidance
# - Vulnerability assessment and compliance validation

# Supporting: backend-architect
# - Technical implementation of security patterns
# - Database security and session management
# - API security and rate limiting implementation

# Integration: Context7 MCP
# - Official OAuth 2.0 documentation and patterns
# - Security library recommendations and usage examples

Complex Project Workflows

Complete E-Commerce Platform Development

# Phase 1: Discovery & Planning
/sc:brainstorm "e-commerce platform for small businesses"
# Expected: Requirements discovery, feature prioritization, technical scope

/sc:save "ecommerce-requirements-complete"

/sc:analyze "microservices architecture for e-commerce" --focus architecture --think-hard
# Expected: Service boundaries, data flow diagrams, technology recommendations
# ✅ Verified: SuperClaude v4.0

# Phase 2: Core Implementation
/sc:load "ecommerce-requirements-complete"

/sc:implement "user authentication and profile management with social login"
# Activates: security-engineer + backend-architect + frontend-architect + Context7
# Expected: Complete auth system with OAuth integration

/sc:implement "product catalog with search, filtering, and recommendation engine"
# Activates: backend-architect + database specialist + search optimization
# Expected: Scalable product system with intelligent recommendations

/sc:implement "shopping cart and checkout with Stripe integration"
# Activates: backend-architect + security-engineer + payment processing patterns
# Expected: Secure payment flow with cart persistence

# Phase 3: Advanced Features
/sc:implement "admin dashboard with analytics and inventory management"
# Activates: frontend-architect + Magic MCP + data visualization + admin patterns
# Expected: Comprehensive admin interface with real-time analytics

/sc:implement "order management and fulfillment system"
# Activates: backend-architect + workflow automation + integration patterns
# Expected: Complete order processing with status tracking

# Phase 4: Integration & Testing
/sc:test --focus quality --orchestrate
# Activates: quality-engineer + Playwright MCP + comprehensive testing
# Expected: Full test suite with E2E, integration, and unit coverage
# ✅ Verified: SuperClaude v4.0

/sc:analyze . --focus performance --think-hard && /sc:implement "performance optimizations" --focus performance --orchestrate
# Expected: Performance bottleneck identification and optimization
# ✅ Verified: SuperClaude v4.0

Enterprise Legacy System Modernization

# Phase 1: Legacy System Analysis
/sc:load legacy-system/ && /sc:analyze . --focus architecture --ultrathink --all-mcp
# Activates: All analysis capabilities for comprehensive legacy assessment
# Expected: Complete legacy architecture analysis, technical debt assessment
# ✅ Verified: SuperClaude v4.0

/sc:troubleshoot "performance bottlenecks and scalability issues"
# Expected: Systematic performance analysis, bottleneck identification

/sc:save "legacy-analysis-complete"

# Phase 2: Modernization Strategy
/sc:load "legacy-analysis-complete"

/sc:analyze "microservices migration strategy" --focus architecture --think-hard --c7
# Activates: system-architect + enterprise patterns + migration strategies
# Expected: Service decomposition plan, migration roadmap, risk assessment
# ✅ Verified: SuperClaude v4.0

/sc:save "modernization-strategy-complete"

# Phase 3: Incremental Migration
/sc:load "modernization-strategy-complete"

# Extract user management microservice
/sc:implement "user management microservice extraction with legacy integration"
# Expected: Service extraction, API compatibility, data synchronization

/sc:test --focus integration --type legacy-compatibility
# Expected: Integration testing with legacy system validation

# Extract payment processing microservice
/sc:implement "payment processing microservice with secure data migration"
# Expected: Secure payment service extraction, transaction integrity

# Continue with systematic extraction
/sc:implement "product catalog microservice with data consistency"
# Expected: Catalog service with eventual consistency patterns

# Phase 4: Infrastructure Modernization
/sc:implement "containerization and Kubernetes orchestration"
# Activates: devops-architect + containerization + orchestration patterns
# Expected: Docker containers, K8s deployment, service mesh

/sc:implement "CI/CD pipeline for microservices with quality gates"
# Expected: Automated pipeline, deployment automation, rollback capabilities

/sc:implement "monitoring and observability stack with distributed tracing"
# Expected: Comprehensive monitoring, distributed tracing, alerting

Open Source Project Development

# Understanding and Contributing to Large Projects
/sc:load open-source-project/ && /sc:analyze . --focus architecture --think-hard --serena
# Expected: Architecture understanding, contribution patterns, codebase navigation
# ✅ Verified: SuperClaude v4.0

/sc:brainstorm "feature proposal for community benefit" --focus community
# Expected: Community-oriented feature planning, RFC preparation

# Feature Implementation with Quality Focus
/sc:implement "feature implementation following project standards" --focus quality --c7
# Activates: All quality agents + comprehensive validation + community standards
# Expected: High-quality implementation with thorough testing

/sc:test --focus quality --type comprehensive --orchestrate
# Expected: Complete test coverage, edge case handling, quality validation
# ✅ Verified: SuperClaude v4.0

# Community Integration and Documentation
/sc:analyze . --focus architecture --think-hard --c7 --serena
# Expected: Compatibility analysis, community impact assessment
# ✅ Verified: SuperClaude v4.0

/sc:implement "comprehensive documentation with community guidelines"
# Expected: Documentation following community standards and contribution guidelines

Advanced Orchestration Patterns

Parallel Development Coordination

# Complex project requiring parallel development streams
/sc:spawn "enterprise platform development" --orchestrate --all-mcp

# Intelligent parallel coordination:
# Stream 1: Frontend development (frontend-architect + Magic MCP)
# Stream 2: Backend API development (backend-architect + Context7)
# Stream 3: Database design and optimization (database specialist + performance-engineer)
# Stream 4: DevOps and infrastructure (devops-architect + monitoring setup)
# Stream 5: Security implementation (security-engineer + compliance validation)

# Orchestration intelligence:
# - Dependency awareness: Backend API completion before frontend integration
# - Resource optimization: Parallel execution where possible, sequential where required
# - Quality gates: Continuous validation across all development streams
# - Progress synchronization: Coordinated milestones and integration points
# - Risk management: Early identification of blockers and dependency conflicts

Expert-Level Multi-Tool Coordination

# Complex system performance optimization requiring all capabilities
/sc:analyze distributed-system/ --ultrathink --all-mcp --focus performance

# Activates comprehensive analysis:
# - Sequential MCP: Multi-step reasoning for complex performance analysis
# - Context7 MCP: Performance patterns and optimization documentation
# - Serena MCP: Project memory and historical performance data
# - Morphllm MCP: Code transformation for optimization patterns
# - Playwright MCP: Performance testing and validation
# - Magic MCP: UI performance optimization (if applicable)

# Expected comprehensive output:
# 1. Systematic performance analysis with bottleneck identification
# 2. Official optimization patterns and best practices
# 3. Historical performance trends and regression analysis
# 4. Automated code optimizations where applicable
# 5. Performance testing scenarios and validation
# 6. UI performance improvements if frontend components exist

/sc:implement "comprehensive performance optimizations" --focus performance --orchestrate --all-mcp
# Expected: Coordinated optimization across all system layers with impact measurement
# ✅ Verified: SuperClaude v4.0

Enterprise-Scale Security Implementation

# Comprehensive security analysis with all available intelligence
/sc:analyze enterprise-app/ --focus security --ultrathink --all-mcp

# Multi-layer security analysis:
# - Sequential: Systematic threat modeling and security analysis
# - Context7: Official security patterns and compliance requirements
# - Serena: Historical security decisions and architectural context
# - Playwright: Security testing scenarios and vulnerability validation
# - Quality gates: Compliance validation and security standards verification

# Expected deliverables:
# 1. Comprehensive threat model with attack vector analysis
# 2. Compliance assessment against industry standards (SOC 2, GDPR, HIPAA)
# 3. Vulnerability assessment with priority ranking
# 4. Automated security testing scenarios
# 5. Security improvement roadmap with implementation priorities
# 6. Executive summary with risk assessment and business impact

Advanced Mode Coordination

Task Management Mode for Complex Projects

# Large scope triggering comprehensive task management
/sc:implement "complete microservices platform with authentication, API gateway, service mesh, and monitoring"

# Mode activation: >3 steps, multiple domains, complex dependencies
# Behavioral changes:
# - Hierarchical task breakdown (Plan → Phase → Task → Todo)
# - Progress tracking with TodoWrite integration
# - Session persistence and checkpointing
# - Cross-session context maintenance

# Task hierarchy creation:
# Plan: Complete microservices platform
# ├─ Phase 1: Core infrastructure (auth, API gateway)
# ├─ Phase 2: Service mesh and communication
# ├─ Phase 3: Monitoring and observability
# └─ Phase 4: Integration testing and deployment

# Memory integration across phases:
# - Previous decisions and architectural choices
# - Component relationships and dependencies
# - Quality standards and testing approaches
# - Performance requirements and constraints

Orchestration Mode for High-Complexity Systems

# Complex task requiring multiple tools and parallel execution
/sc:spawn "full-stack application with React frontend, Node.js API, PostgreSQL database, Redis caching, Docker deployment, and comprehensive testing"

# Mode activation: Complexity score >0.8, multiple domains, parallel opportunities
# Behavioral changes:
# - Intelligent tool selection and coordination
# - Parallel task execution where possible
# - Resource optimization and efficiency focus
# - Multi-agent workflow orchestration

# Orchestration pattern:
# Parallel Track 1: Frontend development (frontend-architect + Magic MCP)
# Parallel Track 2: Backend development (backend-architect + Context7)
# Parallel Track 3: Database design (database specialist)
# Integration Phase: System integration and testing
# Deployment Phase: DevOps implementation

Session Management Patterns

Long-Term Project Development

# Multi-session project with persistent context
/sc:load "ecommerce-platform" && /sc:reflect "previous implementation decisions"

# Session context restoration:
# - Architectural decisions and rationale
# - Implementation patterns and standards
# - Quality requirements and testing strategies
# - Performance constraints and optimizations
# - Security considerations and compliance needs

# Phase-based development with context building:
# Authentication phase
/sc:implement "JWT authentication system" && /sc:save "auth-phase-complete"

# Product catalog phase  
/sc:load "auth-phase-complete" && /sc:implement "product catalog API" && /sc:save "catalog-phase-complete"

# Payment integration phase
/sc:load "catalog-phase-complete" && /sc:implement "Stripe payment integration" && /sc:save "payment-phase-complete"

# Each phase builds on previous context while maintaining session continuity

Cross-Session Learning and Adaptation

# Session with decision tracking and learning
/sc:load "microservices-project" && /sc:reflect "previous payment integration decisions"

# Expected adaptive behavior:
# - Recall previous architectural decisions about payment processing
# - Apply learned patterns to new payment features
# - Suggest improvements based on previous implementation experience
# - Maintain consistency with established patterns and standards

# Advanced session capabilities:
# - Pattern recognition across development sessions
# - Adaptive strategy improvement based on project history
# - Intelligent tool selection based on project characteristics
# - Quality prediction and proactive issue prevention
# - Performance optimization based on historical bottlenecks

Advanced Flag Combinations

Performance and Efficiency Optimization

# Ultra-compressed mode for large operations
/sc:analyze massive-codebase/ --uc --scope project --orchestrate
# Activates: Token efficiency mode, intelligent coordination, compressed communication
# Expected: Comprehensive analysis with 30-50% token reduction while preserving clarity
# ✅ Verified: SuperClaude v4.0

# Maximum depth analysis for critical systems
/sc:analyze . --ultrathink --all-mcp --focus architecture
# Activates: All MCP servers, maximum analysis depth (~32K tokens)
# Expected: Comprehensive system analysis with all available intelligence
# ✅ Verified: SuperClaude v4.0

# Orchestrated implementation with all capabilities
/sc:implement "enterprise application" --orchestrate --all-mcp --focus quality
# Expected: Full-featured implementation with intelligent coordination
# ✅ Verified: SuperClaude v4.0

Safety and Validation for Production

# Production-ready development with comprehensive validation
/sc:implement "payment processing system" --focus security --think-hard --c7 --serena
# Activates: Security-focused implementation with official patterns and context
# Expected: Production-ready implementation with security best practices
# ✅ Verified: SuperClaude v4.0

# Enterprise-scale system redesign
/sc:spawn "system architecture redesign" --orchestrate --ultrathink --all-mcp
# Activates: Maximum coordination and analysis for system-wide changes
# Expected: Systematic redesign with comprehensive validation and risk assessment
# ✅ Verified: SuperClaude v4.0

Real-World Advanced Scenarios

Startup MVP to Enterprise Scale

# Week 1-2: MVP Foundation
/sc:brainstorm "scalable social platform for creators" && /sc:save "mvp-requirements"

/sc:load "mvp-requirements" && /sc:implement "MVP core features with scalability considerations"
# Expected: MVP implementation with enterprise-scale architecture planning

# Month 2-3: Scale Preparation
/sc:load "mvp-requirements" && /sc:analyze . --focus architecture --think-hard
# Expected: Scalability assessment and optimization recommendations

/sc:implement "microservices migration and containerization" --orchestrate
# Expected: Systematic migration to microservices architecture

# Month 4-6: Enterprise Features
/sc:implement "enterprise features: analytics, compliance, monitoring" --all-mcp
# Expected: Enterprise-grade features with comprehensive validation

/sc:test --focus quality --type enterprise-scale --orchestrate
# Expected: Enterprise-scale testing with performance and security validation

Multi-Platform Application Development

# Phase 1: Architecture Planning
/sc:analyze "cross-platform architecture strategies" --focus architecture --think-hard --c7
# Expected: Multi-platform architecture with shared business logic
# ✅ Verified: SuperClaude v4.0

# Phase 2: Parallel Development
/sc:spawn "multi-platform development" --orchestrate --all-mcp
# Stream 1: Web application (React + TypeScript)
# Stream 2: Mobile application (React Native)
# Stream 3: Backend API (Node.js + PostgreSQL)
# Stream 4: Desktop application (Electron)

# Phase 3: Integration and Testing
/sc:test --focus integration --type multi-platform --orchestrate
# Expected: Cross-platform integration testing and validation

# Phase 4: Deployment and Monitoring
/sc:implement "multi-platform deployment and monitoring" --orchestrate
# Expected: Coordinated deployment across all platforms with unified monitoring

Performance Optimization Strategies

Systematic Performance Enhancement

# Comprehensive performance analysis
/sc:analyze . --focus performance --ultrathink --all-mcp
# Expected: Multi-layer performance analysis with optimization roadmap
# ✅ Verified: SuperClaude v4.0

# Coordinated optimization implementation
/sc:implement "performance optimizations across all layers" --focus performance --orchestrate
# Expected: Frontend, backend, database, and infrastructure optimizations

# Impact measurement and validation
/sc:test --focus performance --type load-testing --orchestrate
# Expected: Performance testing with before/after comparisons
# ✅ Verified: SuperClaude v4.0

Advanced Monitoring and Observability

# Comprehensive monitoring implementation
/sc:implement "enterprise monitoring stack with distributed tracing" --orchestrate --all-mcp
# Expected: Complete observability with metrics, logging, tracing, alerting

# Advanced analytics and insights
/sc:implement "performance analytics and predictive monitoring" --focus performance
# Expected: Predictive performance monitoring with ML-based insights

# Automated optimization based on monitoring
/sc:implement "automated performance optimization based on monitoring data"
# Expected: Self-optimizing system with automated performance tuning

Expert Integration Patterns

CI/CD and DevOps Automation

# Enterprise CI/CD pipeline
/sc:implement "comprehensive CI/CD pipeline with quality gates and security scanning" --orchestrate
# Expected: Full pipeline with automated testing, security scanning, deployment

# Infrastructure as Code
/sc:implement "Infrastructure as Code with Terraform and Kubernetes" --focus infrastructure
# Expected: Complete IaC setup with automated provisioning and management

# Advanced deployment strategies
/sc:implement "blue-green deployment with automated rollback and monitoring"
# Expected: Safe deployment strategies with automated risk management

Security and Compliance Integration

# Comprehensive security implementation
/sc:implement "enterprise security framework with compliance automation" --focus security --orchestrate
# Expected: Complete security framework with automated compliance validation

# Advanced threat detection
/sc:implement "threat detection and incident response automation" --focus security
# Expected: Automated security monitoring with incident response

# Compliance automation
/sc:implement "automated compliance reporting and audit trail" --focus security
# Expected: Continuous compliance monitoring with automated reporting

Next Steps to Expert Level

Ready for Integration Patterns?

  • Mastered multi-agent coordination
  • Comfortable with complex orchestration
  • Understanding of advanced flag combinations
  • Experience with enterprise-scale workflows

Continue Learning:

  • Integration Patterns: Framework integration and cross-tool coordination
  • Expert Optimization: Advanced performance and resource optimization
  • Custom Workflows: Developing domain-specific workflow patterns

Success Indicators:

  • Can coordinate complex multi-tool workflows independently
  • Masters session management for long-term projects
  • Develops optimization strategies for specific domains
  • Ready to contribute to framework development

Remember: Advanced workflows require understanding of basic patterns. Focus on orchestration, coordination, and systematic problem-solving for enterprise-scale success.