docs: comprehensive documentation update and command system enhancement

- Update all command documentation with improved clarity and examples
- Enhance user guides with simplified activation patterns
- Improve installation and setup documentation
- Refine command system implementation in setup components
- Update changelog with recent improvements

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
NomenAK
2025-07-14 18:34:01 +02:00
parent e6bd45ed87
commit 90716ab7b8
23 changed files with 769 additions and 635 deletions

View File

@@ -0,0 +1,44 @@
# Changelog
All notable changes to SuperClaude will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- **BREAKING**: Commands now use `/sc:` namespace to avoid conflicts with user custom commands
- Commands are now installed in `~/.claude/commands/sc/` subdirectory
- All 15 commands updated: `/analyze` `/sc:analyze`, `/build` `/sc:build`, etc.
- Automatic migration from old command locations to new `sc/` subdirectory
### Added
- Migration logic to move existing commands to new namespace automatically
- Enhanced uninstaller to handle both old and new command locations
- Improved command conflict prevention
- Better command organization and discoverability
### Technical Details
- Commands now accessible as `/sc:analyze`, `/sc:build`, `/sc:improve`, etc.
- Migration preserves existing functionality while preventing naming conflicts
- Installation process detects and migrates existing commands automatically
- Tab completion support for `/sc:` prefix to discover all SuperClaude commands
## [3.0.0] - 2025-07-14
### Added
- Initial release of SuperClaude v3.0
- 15 specialized slash commands for development tasks
- Smart persona auto-activation system
- MCP server integration (Context7, Sequential, Magic, Playwright)
- Unified CLI installer with multiple installation profiles
- Comprehensive documentation and user guides
- Token optimization framework
- Task management system
### Features
- **Commands**: analyze, build, cleanup, design, document, estimate, explain, git, improve, index, load, spawn, task, test, troubleshoot
- **Personas**: architect, frontend, backend, analyzer, security, mentor, refactorer, performance, qa, devops, scribe
- **MCP Servers**: Official library documentation, complex analysis, UI components, browser automation
- **Installation**: Quick, minimal, and developer profiles with component selection

View File

@@ -18,11 +18,11 @@
**Start here** (no reading required):
```bash
/help # See what's available
/analyze src/ # Smart analysis of your code
/build # Intelligent project building
/improve messy-file.js # Clean up code automatically
/troubleshoot "error" # Get help with problems
/sc:help # See what's available
/sc:analyze src/ # Smart analysis of your code
/sc:build # Intelligent project building
/sc:improve messy-file.js # Clean up code automatically
/sc:troubleshoot "error" # Get help with problems
```
**That's honestly enough to get started.** Everything else below is here when you get curious about what other tools are available.
@@ -70,11 +70,11 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/build # Build current project
/build --type prod # Production build
/build --clean # Clean build (remove old artifacts)
/build --optimize # Enable optimizations
/build src/ # Build specific directory
/sc:build # Build current project
/sc:build --type prod # Production build
/sc:build --clean # Clean build (remove old artifacts)
/sc:build --optimize # Enable optimizations
/sc:build src/ # Build specific directory
```
**Useful flags**:
@@ -85,9 +85,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/build --type prod --optimize # Production build with optimizations
/build --clean --verbose # Clean build with detailed output
/build src/components # Build just the components folder
/sc:build --type prod --optimize # Production build with optimizations
/sc:build --clean --verbose # Clean build with detailed output
/sc:build src/components # Build just the components folder
```
**Gotchas**:
@@ -108,9 +108,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/design user-auth-system # Design a user authentication system
/design --type api auth # Design just the API part
/design --format spec payment # Create formal specification
/sc:design user-auth-system # Design a user authentication system
/sc:design --type api auth # Design just the API part
/sc:design --format spec payment # Create formal specification
```
**Useful flags**:
@@ -120,9 +120,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/design --type api user-management # Design user management API
/design --format spec chat-system # Create chat system specification
/design --type database ecommerce # Design database schema
/sc:design --type api user-management # Design user management API
/sc:design --format spec chat-system # Create chat system specification
/sc:design --type database ecommerce # Design database schema
```
**Gotchas**:
@@ -145,9 +145,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/analyze src/ # Analyze entire src directory
/analyze --focus security # Focus on security issues
/analyze --depth deep app.js # Deep analysis of specific file
/sc:analyze src/ # Analyze entire src directory
/sc:analyze --focus security # Focus on security issues
/sc:analyze --depth deep app.js # Deep analysis of specific file
```
**Useful flags**:
@@ -157,9 +157,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/analyze --focus security --depth deep # Deep security analysis
/analyze --focus performance src/api/ # Performance analysis of API
/analyze --format report . # Generate analysis report
/sc:analyze --focus security --depth deep # Deep security analysis
/sc:analyze --focus performance src/api/ # Performance analysis of API
/sc:analyze --format report . # Generate analysis report
```
**Gotchas**:
@@ -180,9 +180,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/troubleshoot "login not working" # Investigate login issue
/troubleshoot --logs error.log # Analyze error logs
/troubleshoot performance # Performance troubleshooting
/sc:troubleshoot "login not working" # Investigate login issue
/sc:troubleshoot --logs error.log # Analyze error logs
/sc:troubleshoot performance # Performance troubleshooting
```
**Useful flags**:
@@ -192,9 +192,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/troubleshoot "API returning 500" --logs server.log
/troubleshoot --focus database "slow queries"
/troubleshoot "build failing" --systematic
/sc:troubleshoot "API returning 500" --logs server.log
/sc:troubleshoot --focus database "slow queries"
/sc:troubleshoot "build failing" --systematic
```
**Gotchas**:
@@ -215,9 +215,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/explain async/await # Explain async/await concept
/explain --code src/utils.js # Explain specific code file
/explain --beginner React hooks # Beginner-friendly explanation
/sc:explain async/await # Explain async/await concept
/sc:explain --code src/utils.js # Explain specific code file
/sc:explain --beginner React hooks # Beginner-friendly explanation
```
**Useful flags**:
@@ -228,9 +228,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/explain --beginner "what is REST API"
/explain --code src/auth.js --advanced
/explain --examples "React context patterns"
/sc:explain --beginner "what is REST API"
/sc:explain --code src/auth.js --advanced
/sc:explain --examples "React context patterns"
```
**Gotchas**:
@@ -251,9 +251,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/improve src/legacy/ # Improve legacy code
/improve --type performance # Focus on performance
/improve --safe src/utils.js # Safe, low-risk improvements only
/sc:improve src/legacy/ # Improve legacy code
/sc:improve --type performance # Focus on performance
/sc:improve --safe src/utils.js # Safe, low-risk improvements only
```
**Useful flags**:
@@ -263,9 +263,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/improve --type performance --safe src/api/
/improve --preview src/components/LegacyComponent.js
/improve --type style . --safe
/sc:improve --type performance --safe src/api/
/sc:improve --preview src/components/LegacyComponent.js
/sc:improve --type style . --safe
```
**Gotchas**:
@@ -286,9 +286,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/cleanup src/ # Clean up src directory
/cleanup --dead-code # Focus on dead code removal
/cleanup --imports package.js # Clean up imports in specific file
/sc:cleanup src/ # Clean up src directory
/sc:cleanup --dead-code # Focus on dead code removal
/sc:cleanup --imports package.js # Clean up imports in specific file
```
**Useful flags**:
@@ -299,9 +299,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/cleanup --dead-code --safe src/utils/
/cleanup --imports src/components/
/cleanup --files . --safe
/sc:cleanup --dead-code --safe src/utils/
/sc:cleanup --imports src/components/
/sc:cleanup --files . --safe
```
**Gotchas**:
@@ -322,10 +322,10 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/test # Run all tests
/test --type unit # Run only unit tests
/test --coverage # Generate coverage report
/test --watch src/ # Watch mode for development
/sc:test # Run all tests
/sc:test --type unit # Run only unit tests
/sc:test --coverage # Generate coverage report
/sc:test --watch src/ # Watch mode for development
```
**Useful flags**:
@@ -336,9 +336,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/test --type unit --coverage
/test --watch src/components/
/test --type e2e --fix
/sc:test --type unit --coverage
/sc:test --watch src/components/
/sc:test --type e2e --fix
```
**Gotchas**:
@@ -359,9 +359,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/document src/api/auth.js # Document authentication module
/document --type api # API documentation
/document --style brief README # Brief README file
/sc:document src/api/auth.js # Document authentication module
/sc:document --type api # API documentation
/sc:document --style brief README # Brief README file
```
**Useful flags**:
@@ -371,9 +371,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/document --type api src/controllers/
/document --style detailed --type guide user-onboarding
/document --type inline src/utils/helpers.js
/sc:document --type api src/controllers/
/sc:document --style detailed --type guide user-onboarding
/sc:document --type inline src/utils/helpers.js
```
**Gotchas**:
@@ -394,9 +394,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/estimate "add user authentication" # Estimate auth feature
/estimate --detailed shopping-cart # Detailed breakdown
/estimate --complexity user-dashboard # Complexity analysis
/sc:estimate "add user authentication" # Estimate auth feature
/sc:estimate --detailed shopping-cart # Detailed breakdown
/sc:estimate --complexity user-dashboard # Complexity analysis
```
**Useful flags**:
@@ -406,9 +406,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/estimate --detailed "implement payment system"
/estimate --complexity --team-size 3 "migrate to microservices"
/estimate "add real-time chat" --detailed
/sc:estimate --detailed "implement payment system"
/sc:estimate --complexity --team-size 3 "migrate to microservices"
/sc:estimate "add real-time chat" --detailed
```
**Gotchas**:
@@ -429,9 +429,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/task create "implement user dashboard" # Create new task
/task status # Check task status
/task breakdown "payment integration" # Break down into subtasks
/sc:task create "implement user dashboard" # Create new task
/sc:task status # Check task status
/sc:task breakdown "payment integration" # Break down into subtasks
```
**Useful flags**:
@@ -442,9 +442,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/task create "migrate from REST to GraphQL" --priority high
/task breakdown "e-commerce checkout flow"
/task status
/sc:task create "migrate from REST to GraphQL" --priority high
/sc:task breakdown "e-commerce checkout flow"
/sc:task status
```
**Gotchas**:
@@ -465,9 +465,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/spawn deploy-pipeline # Orchestrate deployment
/spawn --parallel migrate-data # Parallel data migration
/spawn setup-dev-environment # Complex environment setup
/sc:spawn deploy-pipeline # Orchestrate deployment
/sc:spawn --parallel migrate-data # Parallel data migration
/sc:spawn setup-dev-environment # Complex environment setup
```
**Useful flags**:
@@ -477,9 +477,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/spawn --parallel "test and deploy to staging"
/spawn setup-ci-cd --monitor
/spawn --sequential database-migration
/sc:spawn --parallel "test and deploy to staging"
/sc:spawn setup-ci-cd --monitor
/sc:spawn --sequential database-migration
```
**Gotchas**:
@@ -500,9 +500,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/git commit # Smart commit with auto-generated message
/git --smart-commit add . # Add and commit with smart message
/git branch feature/new-auth # Create and switch to new branch
/sc:git commit # Smart commit with auto-generated message
/sc:git --smart-commit add . # Add and commit with smart message
/sc:git branch feature/new-auth # Create and switch to new branch
```
**Useful flags**:
@@ -512,9 +512,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/git --smart-commit "fixed login bug"
/git branch feature/user-dashboard --branch-strategy
/git merge develop --interactive
/sc:git --smart-commit "fixed login bug"
/sc:git branch feature/user-dashboard --branch-strategy
/sc:git merge develop --interactive
```
**Gotchas**:
@@ -534,9 +534,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/index # List all commands
/index testing # Find commands related to testing
/index --category analysis # Commands in analysis category
/sc:index # List all commands
/sc:index testing # Find commands related to testing
/sc:index --category analysis # Commands in analysis category
```
**Useful flags**:
@@ -545,9 +545,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/index --search "performance"
/index --category quality
/index git
/sc:index --search "performance"
/sc:index --category quality
/sc:index git
```
**Gotchas**:
@@ -567,9 +567,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Basic syntax**:
```bash
/load # Load current project context
/load src/ # Load specific directory context
/load --deep # Deep analysis of project structure
/sc:load # Load current project context
/sc:load src/ # Load specific directory context
/sc:load --deep # Deep analysis of project structure
```
**Useful flags**:
@@ -579,9 +579,9 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
**Real examples**:
```bash
/load --deep --summary
/load src/components/ --focus architecture
/load . --focus dependencies
/sc:load --deep --summary
/sc:load src/components/ --focus architecture
/sc:load . --focus dependencies
```
**Gotchas**:
@@ -594,55 +594,55 @@ A practical guide to all 15 SuperClaude slash commands. We'll be honest about wh
### Effective Flag Combinations
```bash
# Safe improvement workflow
/improve --preview src/component.js # See what would change
/improve --safe src/component.js # Apply safe changes only
/sc:improve --preview src/component.js # See what would change
/sc:improve --safe src/component.js # Apply safe changes only
# Comprehensive analysis
/analyze --focus security --depth deep
/test --coverage
/document --type api
/sc:analyze --focus security --depth deep
/sc:test --coverage
/sc:document --type api
# Smart git workflow
/git add .
/git --smart-commit --branch-strategy
/sc:git add .
/sc:git --smart-commit --branch-strategy
# Project understanding workflow
/load --deep --summary
/analyze --focus architecture
/document --type guide
/sc:load --deep --summary
/sc:analyze --focus architecture
/sc:document --type guide
```
### Common Workflows
**New Project Onboarding**:
```bash
/load --deep --summary
/analyze --focus architecture
/test --coverage
/document README
/sc:load --deep --summary
/sc:analyze --focus architecture
/sc:test --coverage
/sc:document README
```
**Bug Investigation**:
```bash
/troubleshoot "specific error message" --logs
/analyze --focus security
/test --type unit affected-component
/sc:troubleshoot "specific error message" --logs
/sc:analyze --focus security
/sc:test --type unit affected-component
```
**Code Quality Improvement**:
```bash
/analyze --focus quality
/improve --preview src/
/cleanup --safe
/test --coverage
/sc:analyze --focus quality
/sc:improve --preview src/
/sc:cleanup --safe
/sc:test --coverage
```
**Pre-deployment Checklist**:
```bash
/test --type all --coverage
/analyze --focus security
/build --type prod --optimize
/git --smart-commit
/sc:test --type all --coverage
/sc:analyze --focus security
/sc:build --type prod --optimize
/sc:git --smart-commit
```
### Troubleshooting Command Issues

View File

@@ -23,10 +23,10 @@
```bash
# These work great with zero flag knowledge:
/analyze src/ # Auto-picks the right analysis flags
/build # Auto-optimizes based on your project
/improve messy-code.js # Auto-activates quality and safety flags
/troubleshoot "weird error" # Auto-activates debugging and analysis flags
/sc:analyze src/ # Auto-picks the right analysis flags
/sc:build # Auto-optimizes based on your project
/sc:improve messy-code.js # Auto-activates quality and safety flags
/sc:troubleshoot "weird error" # Auto-activates debugging and analysis flags
```
**See? No flags needed.** Everything below is for when you get curious about what's happening behind the scenes.
@@ -41,9 +41,9 @@ A practical guide to SuperClaude's flag system. Flags are like command-line opti
**Basic syntax** (but you usually don't need to know this):
```bash
/command --flag-name
/command --flag-name value
/analyze src/ --focus security --depth deep
/sc:command --flag-name
/sc:command --flag-name value
/sc:analyze src/ --focus security --depth deep
```
**How flags actually work in practice**:
@@ -234,38 +234,38 @@ Direct SuperClaude's attention to specific areas.
### Quick Analysis
```bash
/analyze src/ --focus quality # Quick quality check
/analyze --uc --focus security # Fast security scan
/sc:analyze src/ --focus quality # Quick quality check
/sc:analyze --uc --focus security # Fast security scan
```
### Deep Investigation
```bash
/troubleshoot "bug" --think --seq # Systematic debugging
/analyze --think-hard --focus architecture # Architectural analysis
/sc:troubleshoot "bug" --think --seq # Systematic debugging
/sc:analyze --think-hard --focus architecture # Architectural analysis
```
### Large Project Work
```bash
/analyze monorepo/ --delegate auto --uc # Efficient large analysis
/improve legacy/ --wave-mode auto --safe-mode # Safe systematic improvement
/sc:analyze monorepo/ --delegate auto --uc # Efficient large analysis
/sc:improve legacy/ --wave-mode auto --safe-mode # Safe systematic improvement
```
### Learning & Documentation
```bash
/explain React hooks --c7 --verbose # Detailed explanation with docs
/document api/ --persona-scribe # Professional documentation
/sc:explain React hooks --c7 --verbose # Detailed explanation with docs
/sc:document api/ --persona-scribe # Professional documentation
```
### Performance-Focused
```bash
/analyze --focus performance --play # Performance analysis with testing
/build --uc --no-mcp # Fast build without extra features
/sc:analyze --focus performance --play # Performance analysis with testing
/sc:build --uc --no-mcp # Fast build without extra features
```
### Security-Focused
```bash
/analyze --focus security --think --validate # Thorough security analysis
/scan --persona-security --safe-mode # Conservative security scan
/sc:analyze --focus security --think --validate # Thorough security analysis
/sc:scan --persona-security --safe-mode # Conservative security scan
```
## Practical Examples 💡
@@ -273,13 +273,13 @@ Direct SuperClaude's attention to specific areas.
### Before/After: Basic Analysis
**Before** (basic):
```bash
/analyze auth.js
/sc:analyze auth.js
# → Simple file analysis
```
**After** (with flags):
```bash
/analyze auth.js --focus security --think --c7
/sc:analyze auth.js --focus security --think --c7
# → Security-focused analysis with deep thinking and official docs
# → Much more thorough, finds security patterns, checks against best practices
```
@@ -287,13 +287,13 @@ Direct SuperClaude's attention to specific areas.
### Before/After: Large Project
**Before** (slow):
```bash
/analyze huge-monorepo/
/sc:analyze huge-monorepo/
# → Tries to analyze everything at once, may timeout or use too many tokens
```
**After** (efficient):
```bash
/analyze huge-monorepo/ --delegate auto --uc --focus architecture
/sc:analyze huge-monorepo/ --delegate auto --uc --focus architecture
# → Delegates work to sub-agents, compresses output, focuses on architecture
# → Faster, more focused, better results
```
@@ -301,13 +301,13 @@ Direct SuperClaude's attention to specific areas.
### Before/After: Improvement Work
**Before** (risky):
```bash
/improve legacy-system/
/sc:improve legacy-system/
# → May make too many changes, could break things
```
**After** (safe):
```bash
/improve legacy-system/ --safe-mode --loop --validate --preview
/sc:improve legacy-system/ --safe-mode --loop --validate --preview
# → Safe changes only, iterative approach, validates first, shows preview
# → Much safer, progressive improvement
```
@@ -318,22 +318,22 @@ SuperClaude automatically adds flags based on context. Here's when:
### Complexity-Based
```bash
/analyze huge-codebase/
/sc:analyze huge-codebase/
# Auto-adds: --delegate auto --uc
# Why: >50 files detected, context management needed
/troubleshoot "complex system issue"
/sc:troubleshoot "complex system issue"
# Auto-adds: --think --seq
# Why: Multi-component problem detected
```
### Domain-Based
```bash
/build react-app/
/sc:build react-app/
# Auto-adds: --c7 --persona-frontend
# Why: Frontend framework detected
/analyze --focus security
/sc:analyze --focus security
# Auto-adds: --persona-security --validate
# Why: Security focus triggers security specialist
```
@@ -341,12 +341,12 @@ SuperClaude automatically adds flags based on context. Here's when:
### Performance-Based
```bash
# When context usage >75%
/analyze large-project/
/sc:analyze large-project/
# Auto-adds: --uc
# Why: Token optimization needed
# When risk score >0.7
/improve production-code/
/sc:improve production-code/
# Auto-adds: --safe-mode --validate
# Why: High-risk operation detected
```
@@ -357,19 +357,19 @@ SuperClaude automatically adds flags based on context. Here's when:
**Comprehensive Code Review**:
```bash
/review codebase/ --persona-qa --think-hard --focus quality --validate --c7
/sc:review codebase/ --persona-qa --think-hard --focus quality --validate --c7
# → QA specialist + deep thinking + quality focus + validation + docs
```
**Legacy System Modernization**:
```bash
/improve legacy/ --wave-mode force --persona-architect --safe-mode --loop --c7
/sc:improve legacy/ --wave-mode force --persona-architect --safe-mode --loop --c7
# → Wave orchestration + architect perspective + safety + iteration + docs
```
**Security Audit**:
```bash
/scan --persona-security --ultrathink --focus security --validate --seq
/sc:scan --persona-security --ultrathink --focus security --validate --seq
# → Security specialist + maximum thinking + security focus + validation + systematic analysis
```
@@ -377,13 +377,13 @@ SuperClaude automatically adds flags based on context. Here's when:
**For Speed**:
```bash
/analyze --no-mcp --uc --scope file
/sc:analyze --no-mcp --uc --scope file
# → Disable extra features, compress output, limit scope
```
**For Thoroughness**:
```bash
/analyze --all-mcp --think-hard --delegate auto
/sc:analyze --all-mcp --think-hard --delegate auto
# → All capabilities, deep thinking, parallel processing
```
@@ -391,17 +391,17 @@ SuperClaude automatically adds flags based on context. Here's when:
**Bug Investigation Workflow**:
```bash
/troubleshoot "specific error" --seq --think --validate
/analyze affected-files/ --focus quality --persona-analyzer
/test --play --coverage
/sc:troubleshoot "specific error" --seq --think --validate
/sc:analyze affected-files/ --focus quality --persona-analyzer
/sc:test --play --coverage
```
**Feature Development Workflow**:
```bash
/design new-feature --persona-architect --c7
/build --magic --persona-frontend --validate
/test --play --coverage
/document --persona-scribe --c7
/sc:design new-feature --persona-architect --c7
/sc:build --magic --persona-frontend --validate
/sc:test --play --coverage
/sc:document --persona-scribe --c7
```
## Quick Reference 📋

View File

@@ -257,10 +257,10 @@ Try these commands to get started:
```bash
# In Claude Code, try these:
/help # See available commands
/analyze README.md # Analyze a file
/build --help # See build options
/improve --help # See improvement options
/sc:help # See available commands
/sc:analyze README.md # Analyze a file
/sc:build --help # See build options
/sc:improve --help # See improvement options
```
**Don't worry if it seems overwhelming** - SuperClaude enhances Claude Code gradually. You can use as much or as little as you want.

View File

@@ -20,10 +20,10 @@
```bash
# These automatically activate the right experts:
/analyze payment-system/ # → Security + backend experts auto-activate
/build react-app/ # → Frontend specialist takes over
/improve slow-queries.sql # → Performance optimizer jumps in
/troubleshoot "auth failing" # → Debug specialist + security expert coordinate
/sc:analyze payment-system/ # → Security + backend experts auto-activate
/sc:build react-app/ # → Frontend specialist takes over
/sc:improve slow-queries.sql # → Performance optimizer jumps in
/sc:troubleshoot "auth failing" # → Debug specialist + security expert coordinate
```
**See the pattern?** You focus on what you want to do, SuperClaude figures out who should help. Everything below is for when you get curious about who's on the team.
@@ -74,9 +74,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/design microservices-migration --persona-architect
/analyze --focus architecture large-system/
/estimate "redesign auth system" --persona-architect
/sc:design microservices-migration --persona-architect
/sc:analyze --focus architecture large-system/
/sc:estimate "redesign auth system" --persona-architect
```
**What they prioritize**:
@@ -111,9 +111,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/build dashboard --persona-frontend
/improve --focus accessibility components/
/analyze --persona-frontend --focus performance
/sc:build dashboard --persona-frontend
/sc:improve --focus accessibility components/
/sc:analyze --persona-frontend --focus performance
```
**What they prioritize**:
@@ -149,9 +149,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/design user-api --persona-backend
/analyze --focus security api/
/improve --persona-backend database-layer/
/sc:design user-api --persona-backend
/sc:analyze --focus security api/
/sc:improve --persona-backend database-layer/
```
**What they prioritize**:
@@ -187,9 +187,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/scan --persona-security --focus security
/analyze auth-system/ --persona-security
/improve --focus security --persona-security
/sc:scan --persona-security --focus security
/sc:analyze auth-system/ --persona-security
/sc:improve --focus security --persona-security
```
**What they prioritize**:
@@ -225,9 +225,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/analyze --focus performance --persona-performance
/improve --type performance slow-endpoints/
/test --benchmark --persona-performance
/sc:analyze --focus performance --persona-performance
/sc:improve --type performance slow-endpoints/
/sc:test --benchmark --persona-performance
```
**What they prioritize**:
@@ -263,9 +263,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/troubleshoot "auth randomly fails" --persona-analyzer
/analyze --persona-analyzer mysterious-bug/
/explain --detailed "why is this slow" --persona-analyzer
/sc:troubleshoot "auth randomly fails" --persona-analyzer
/sc:analyze --persona-analyzer mysterious-bug/
/sc:explain --detailed "why is this slow" --persona-analyzer
```
**What they prioritize**:
@@ -301,9 +301,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/test --persona-qa comprehensive-suite
/analyze --focus quality --persona-qa
/review --persona-qa critical-features/
/sc:test --persona-qa comprehensive-suite
/sc:analyze --focus quality --persona-qa
/sc:review --persona-qa critical-features/
```
**What they prioritize**:
@@ -339,9 +339,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/improve --type quality --persona-refactorer
/cleanup legacy-module/ --persona-refactorer
/analyze --focus maintainability --persona-refactorer
/sc:improve --type quality --persona-refactorer
/sc:cleanup legacy-module/ --persona-refactorer
/sc:analyze --focus maintainability --persona-refactorer
```
**What they prioritize**:
@@ -377,9 +377,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/deploy production --persona-devops
/analyze infrastructure/ --persona-devops
/improve deployment-pipeline --persona-devops
/sc:deploy production --persona-devops
/sc:analyze infrastructure/ --persona-devops
/sc:improve deployment-pipeline --persona-devops
```
**What they prioritize**:
@@ -415,9 +415,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/explain React hooks --persona-mentor
/document --type guide --persona-mentor
/analyze complex-algorithm.js --persona-mentor
/sc:explain React hooks --persona-mentor
/sc:document --type guide --persona-mentor
/sc:analyze complex-algorithm.js --persona-mentor
```
**What they prioritize**:
@@ -451,9 +451,9 @@ Think of SuperClaude personas as having a team of specialists on demand. Each pe
**Example workflows**:
```bash
/document api/ --persona-scribe
/git commit --persona-scribe
/explain --persona-scribe=es complex-feature
/sc:document api/ --persona-scribe
/sc:git commit --persona-scribe
/sc:explain --persona-scribe=es complex-feature
```
**What they prioritize**:
@@ -510,31 +510,31 @@ Personas often work together automatically. Here are common collaboration patter
### Design & Implementation
```bash
/design user-dashboard
/sc:design user-dashboard
# Auto-activates: 🏗️ architect (system design) + 🎨 frontend (UI design)
```
### Security Review
```bash
/analyze --focus security api/
/sc:analyze --focus security api/
# Auto-activates: 🛡️ security (primary) + ⚙️ backend (API expertise)
```
### Performance Optimization
```bash
/improve --focus performance slow-app/
/sc:improve --focus performance slow-app/
# Auto-activates: ⚡ performance (primary) + 🎨 frontend (if UI) or ⚙️ backend (if API)
```
### Quality Improvement
```bash
/improve --focus quality legacy-code/
/sc:improve --focus quality legacy-code/
# Auto-activates: 🔄 refactorer (primary) + 🧪 qa (testing) + 🏗️ architect (design)
```
### Documentation & Learning
```bash
/document complex-feature --type guide
/sc:document complex-feature --type guide
# Auto-activates: ✍️ scribe (writing) + 👨‍🏫 mentor (educational approach)
```
@@ -544,13 +544,13 @@ Personas often work together automatically. Here are common collaboration patter
**Before** (generic):
```bash
/analyze auth.js
/sc:analyze auth.js
# → Basic analysis, generic advice
```
**After** (security persona):
```bash
/analyze auth.js --persona-security
/sc:analyze auth.js --persona-security
# → Security-focused analysis
# → Threat modeling perspective
# → OWASP compliance checking
@@ -561,7 +561,7 @@ Personas often work together automatically. Here are common collaboration patter
**Frontend work detection**:
```bash
/build react-components/
/sc:build react-components/
# Auto-activates: 🎨 frontend
# → UI-focused build optimization
# → Accessibility checking
@@ -571,7 +571,7 @@ Personas often work together automatically. Here are common collaboration patter
**Complex debugging**:
```bash
/troubleshoot "payment processing randomly fails"
/sc:troubleshoot "payment processing randomly fails"
# Auto-activates: 🔍 analyzer
# → Systematic investigation approach
# → Evidence collection methodology
@@ -583,7 +583,7 @@ Personas often work together automatically. Here are common collaboration patter
**Force security perspective**:
```bash
/analyze react-app/ --persona-security
/sc:analyze react-app/ --persona-security
# Even though it's frontend code, analyze from security perspective
# → XSS vulnerability checking
# → Authentication flow analysis
@@ -592,7 +592,7 @@ Personas often work together automatically. Here are common collaboration patter
**Get architectural advice on small changes**:
```bash
/improve small-utility.js --persona-architect
/sc:improve small-utility.js --persona-architect
# Apply architectural thinking to small code
# → Design pattern opportunities
# → Future extensibility
@@ -611,30 +611,30 @@ Personas often work together automatically. Here are common collaboration patter
**How to override**:
```bash
# Explicit persona selection
/analyze frontend-code/ --persona-security # Security view of frontend
/improve backend-api/ --persona-performance # Performance view of backend
/sc:analyze frontend-code/ --persona-security # Security view of frontend
/sc:improve backend-api/ --persona-performance # Performance view of backend
# Multiple persona flags (last one wins)
/analyze --persona-frontend --persona-security # Uses security persona
/sc:analyze --persona-frontend --persona-security # Uses security persona
```
### Persona-Specific Flags and Settings
**Security persona + validation**:
```bash
/analyze --persona-security --focus security --validate
/sc:analyze --persona-security --focus security --validate
# → Maximum security focus with validation
```
**Performance persona + benchmarking**:
```bash
/test --persona-performance --benchmark --focus performance
/sc:test --persona-performance --benchmark --focus performance
# → Performance-focused testing with metrics
```
**Mentor persona + detailed explanations**:
```bash
/explain complex-concept --persona-mentor --verbose
/sc:explain complex-concept --persona-mentor --verbose
# → Educational explanation with full detail
```
@@ -643,12 +643,12 @@ Personas often work together automatically. Here are common collaboration patter
**When you need multiple perspectives**:
```bash
# Sequential analysis with different personas
/analyze --persona-security api/auth.js
/analyze --persona-performance api/auth.js
/analyze --persona-refactorer api/auth.js
/sc:analyze --persona-security api/auth.js
/sc:analyze --persona-performance api/auth.js
/sc:analyze --persona-refactorer api/auth.js
# Or let SuperClaude coordinate automatically
/analyze --focus quality api/auth.js
/sc:analyze --focus quality api/auth.js
# Auto-coordinates: security + performance + refactorer insights
```
@@ -657,56 +657,56 @@ Personas often work together automatically. Here are common collaboration patter
### 🏗️ Architect Workflows
```bash
# System design
/design microservices-architecture --persona-architect
/estimate "migrate monolith to microservices" --persona-architect
/sc:design microservices-architecture --persona-architect
/sc:estimate "migrate monolith to microservices" --persona-architect
# Architecture review
/analyze --focus architecture --persona-architect large-system/
/review --persona-architect critical-components/
/sc:analyze --focus architecture --persona-architect large-system/
/sc:review --persona-architect critical-components/
```
### 🎨 Frontend Workflows
```bash
# Component development
/build dashboard-components/ --persona-frontend
/improve --focus accessibility --persona-frontend ui/
/sc:build dashboard-components/ --persona-frontend
/sc:improve --focus accessibility --persona-frontend ui/
# Performance optimization
/analyze --focus performance --persona-frontend bundle/
/test --persona-frontend --focus performance
/sc:analyze --focus performance --persona-frontend bundle/
/sc:test --persona-frontend --focus performance
```
### ⚙️ Backend Workflows
```bash
# API development
/design rest-api --persona-backend
/build api-endpoints/ --persona-backend
/sc:design rest-api --persona-backend
/sc:build api-endpoints/ --persona-backend
# Reliability improvements
/improve --focus reliability --persona-backend services/
/analyze --persona-backend --focus security api/
/sc:improve --focus reliability --persona-backend services/
/sc:analyze --persona-backend --focus security api/
```
### 🛡️ Security Workflows
```bash
# Security assessment
/scan --persona-security --focus security entire-app/
/analyze --persona-security auth-flow/
/sc:scan --persona-security --focus security entire-app/
/sc:analyze --persona-security auth-flow/
# Vulnerability fixing
/improve --focus security --persona-security vulnerable-code/
/review --persona-security --focus security critical-paths/
/sc:improve --focus security --persona-security vulnerable-code/
/sc:review --persona-security --focus security critical-paths/
```
### 🔍 Analyzer Workflows
```bash
# Bug investigation
/troubleshoot "intermittent failures" --persona-analyzer
/analyze --persona-analyzer --focus debugging problem-area/
/sc:troubleshoot "intermittent failures" --persona-analyzer
/sc:analyze --persona-analyzer --focus debugging problem-area/
# System understanding
/explain --persona-analyzer complex-system/
/load --persona-analyzer unfamiliar-codebase/
/sc:explain --persona-analyzer complex-system/
/sc:load --persona-analyzer unfamiliar-codebase/
```
## Quick Reference 📋
@@ -808,14 +808,14 @@ Personas often work together automatically. Here are common collaboration patter
**How to override effectively**:
```bash
# Force specific perspective
/analyze frontend-code/ --persona-security # Security view of frontend
/sc:analyze frontend-code/ --persona-security # Security view of frontend
# Combine multiple perspectives
/analyze api/ --persona-security
/analyze api/ --persona-performance # Run separately for different views
/sc:analyze api/ --persona-security
/sc:analyze api/ --persona-performance # Run separately for different views
# Use general analysis
/analyze --no-persona # Disable persona auto-activation
/sc:analyze --no-persona # Disable persona auto-activation
```
## Tips for Effective Persona Usage 💡

File diff suppressed because it is too large Load Diff

View File

@@ -40,10 +40,10 @@ This is what we've been working on to make Claude Code more helpful for developm
### Commands 🛠️
We focused on 15 essential commands for the most common tasks:
**Development**: `/build`, `/dev-setup`
**Analysis**: `/analyze`, `/review`, `/troubleshoot`
**Quality**: `/improve`, `/scan`, `/test`
**Others**: `/document`, `/deploy`, `/git`, `/migrate`, `/estimate`, `/task`, `/design`
**Development**: `/sc:build`, `/sc:dev-setup`
**Analysis**: `/sc:analyze`, `/sc:review`, `/sc:troubleshoot`
**Quality**: `/sc:improve`, `/sc:scan`, `/sc:test`
**Others**: `/sc:document`, `/sc:deploy`, `/sc:git`, `/sc:migrate`, `/sc:estimate`, `/sc:task`, `/sc:design`
### Smart Personas 🎭
Auto-activating specialists that adapt Claude's behavior:

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash, TodoWrite]
description: "Analyze code quality, security, performance, and architecture"
---
# /analyze - Code Analysis
# /sc:analyze - Code Analysis
## Purpose
Execute comprehensive code analysis across quality, security, performance, and architecture domains.
## Usage
```
/analyze [target] [--focus quality|security|performance|architecture] [--depth quick|deep]
/sc:analyze [target] [--focus quality|security|performance|architecture] [--depth quick|deep]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Bash, Glob, TodoWrite, Edit]
description: "Build, compile, and package projects with error handling and optimization"
---
# /build - Project Building
# /sc:build - Project Building
## Purpose
Build, compile, and package projects with comprehensive error handling and optimization.
## Usage
```
/build [target] [--type dev|prod|test] [--clean] [--optimize]
/sc:build [target] [--type dev|prod|test] [--clean] [--optimize]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash, Edit, MultiEdit]
description: "Clean up code, remove dead code, and optimize project structure"
---
# /cleanup - Code and Project Cleanup
# /sc:cleanup - Code and Project Cleanup
## Purpose
Systematically clean up code, remove dead code, optimize imports, and improve project structure.
## Usage
```
/cleanup [target] [--type code|imports|files|all] [--safe|--aggressive]
/sc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Write, Edit, TodoWrite]
description: "Design system architecture, APIs, and component interfaces"
---
# /design - System and Component Design
# /sc:design - System and Component Design
## Purpose
Design system architecture, APIs, component interfaces, and technical specifications.
## Usage
```
/design [target] [--type architecture|api|component|database] [--format diagram|spec|code]
/sc:design [target] [--type architecture|api|component|database] [--format diagram|spec|code]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Write, Edit]
description: "Create focused documentation for specific components or features"
---
# /document - Focused Documentation
# /sc:document - Focused Documentation
## Purpose
Generate precise, focused documentation for specific components, functions, or features.
## Usage
```
/document [target] [--type inline|external|api|guide] [--style brief|detailed]
/sc:document [target] [--type inline|external|api|guide] [--style brief|detailed]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash]
description: "Provide development estimates for tasks, features, or projects"
---
# /estimate - Development Estimation
# /sc:estimate - Development Estimation
## Purpose
Generate accurate development estimates for tasks, features, or projects based on complexity analysis.
## Usage
```
/estimate [target] [--type time|effort|complexity|cost] [--unit hours|days|weeks]
/sc:estimate [target] [--type time|effort|complexity|cost] [--unit hours|days|weeks]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash]
description: "Provide clear explanations of code, concepts, or system behavior"
---
# /explain - Code and Concept Explanation
# /sc:explain - Code and Concept Explanation
## Purpose
Deliver clear, comprehensive explanations of code functionality, concepts, or system behavior.
## Usage
```
/explain [target] [--level basic|intermediate|advanced] [--format text|diagram|examples]
/sc:explain [target] [--level basic|intermediate|advanced] [--format text|diagram|examples]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Bash, Read, Glob, TodoWrite, Edit]
description: "Git operations with intelligent commit messages and branch management"
---
# /git - Git Operations
# /sc:git - Git Operations
## Purpose
Execute Git operations with intelligent commit messages, branch management, and workflow optimization.
## Usage
```
/git [operation] [args] [--smart-commit] [--branch-strategy]
/sc:git [operation] [args] [--smart-commit] [--branch-strategy]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Edit, MultiEdit, TodoWrite]
description: "Apply systematic improvements to code quality, performance, and maintainability"
---
# /improve - Code Improvement
# /sc:improve - Code Improvement
## Purpose
Apply systematic improvements to code quality, performance, maintainability, and best practices.
## Usage
```
/improve [target] [--type quality|performance|maintainability|style] [--safe]
/sc:improve [target] [--type quality|performance|maintainability|style] [--safe]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash, Write]
description: "Generate comprehensive project documentation and knowledge base"
---
# /index - Project Documentation
# /sc:index - Project Documentation
## Purpose
Create and maintain comprehensive project documentation, indexes, and knowledge bases.
## Usage
```
/index [target] [--type docs|api|structure|readme] [--format md|json|yaml]
/sc:index [target] [--type docs|api|structure|readme] [--format md|json|yaml]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash, Write]
description: "Load and analyze project context, configurations, and dependencies"
---
# /load - Project Context Loading
# /sc:load - Project Context Loading
## Purpose
Load and analyze project context, configurations, dependencies, and environment setup.
## Usage
```
/load [target] [--type project|config|deps|env] [--cache]
/sc:load [target] [--type project|config|deps|env] [--cache]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash, TodoWrite, Edit, MultiEdit, Write]
description: "Break complex tasks into coordinated subtasks with efficient execution"
---
# /spawn - Task Orchestration
# /sc:spawn - Task Orchestration
## Purpose
Decompose complex requests into manageable subtasks and coordinate their execution.
## Usage
```
/spawn [task] [--sequential|--parallel] [--validate]
/sc:spawn [task] [--sequential|--parallel] [--validate]
```
## Arguments

View File

@@ -8,14 +8,14 @@ personas: [architect, analyzer, project-manager]
mcp-servers: [sequential, context7]
---
# /task - Enhanced Task Management
# /sc:task - Enhanced Task Management
## Purpose
Execute complex tasks with intelligent workflow management, cross-session persistence, hierarchical task organization, and advanced orchestration capabilities.
## Usage
```
/task [action] [target] [--strategy systematic|agile|enterprise] [--persist] [--hierarchy] [--delegate]
/sc:task [action] [target] [--strategy systematic|agile|enterprise] [--persist] [--hierarchy] [--delegate]
```
## Actions
@@ -124,22 +124,22 @@ Execute complex tasks with intelligent workflow management, cross-session persis
### Create Project-Level Task Hierarchy
```
/task create "Implement user authentication system" --hierarchy --persist --strategy systematic
/sc:task create "Implement user authentication system" --hierarchy --persist --strategy systematic
```
### Execute with Multi-Agent Delegation
```
/task execute AUTH-001 --delegate --wave-mode --validate
/sc:task execute AUTH-001 --delegate --wave-mode --validate
```
### Analytics and Optimization
```
/task analytics --project AUTH --optimization-recommendations
/sc:task analytics --project AUTH --optimization-recommendations
```
### Cross-Session Task Management
```
/task status --all-sessions --detailed-breakdown
/sc:task status --all-sessions --detailed-breakdown
```
## Claude Code Integration

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Bash, Glob, TodoWrite, Edit, Write]
description: "Execute tests, generate test reports, and maintain test coverage"
---
# /test - Testing and Quality Assurance
# /sc:test - Testing and Quality Assurance
## Purpose
Execute tests, generate comprehensive test reports, and maintain test coverage standards.
## Usage
```
/test [target] [--type unit|integration|e2e|all] [--coverage] [--watch]
/sc:test [target] [--type unit|integration|e2e|all] [--coverage] [--watch]
```
## Arguments

View File

@@ -3,14 +3,14 @@ allowed-tools: [Read, Grep, Glob, Bash, TodoWrite]
description: "Diagnose and resolve issues in code, builds, or system behavior"
---
# /troubleshoot - Issue Diagnosis and Resolution
# /sc:troubleshoot - Issue Diagnosis and Resolution
## Purpose
Systematically diagnose and resolve issues in code, builds, deployments, or system behavior.
## Usage
```
/troubleshoot [issue] [--type bug|build|performance|deployment] [--trace]
/sc:troubleshoot [issue] [--type bug|build|performance|deployment] [--trace]
```
## Arguments

View File

@@ -71,7 +71,7 @@ class CommandsComponent(Component):
errors.append(f"Missing command files: {missing_files}")
# Check write permissions to install directory
commands_dir = self.install_dir / "commands"
commands_dir = self.install_dir / "commands" / "sc"
has_perms, missing = SecurityValidator.check_permissions(
self.install_dir, {'write'}
)
@@ -92,7 +92,7 @@ class CommandsComponent(Component):
for filename in self.command_files:
source = source_dir / filename
target = self.install_dir / "commands" / filename
target = self.install_dir / "commands" / "sc" / filename
files.append((source, target))
return files
@@ -119,6 +119,9 @@ class CommandsComponent(Component):
try:
self.logger.info("Installing SuperClaude command definitions...")
# Check for and migrate existing commands from old location
self._migrate_existing_commands()
# Validate installation
success, errors = self.validate_prerequisites()
if not success:
@@ -131,7 +134,7 @@ class CommandsComponent(Component):
# Validate all files for security
source_dir = self._get_source_dir()
commands_dir = self.install_dir / "commands"
commands_dir = self.install_dir / "commands" / "sc"
is_safe, security_errors = SecurityValidator.validate_component_files(
files_to_install, source_dir, commands_dir
)
@@ -185,8 +188,8 @@ class CommandsComponent(Component):
try:
self.logger.info("Uninstalling SuperClaude commands component...")
# Remove command files
commands_dir = self.install_dir / "commands"
# Remove command files from sc subdirectory
commands_dir = self.install_dir / "commands" / "sc"
removed_count = 0
for filename in self.command_files:
@@ -197,13 +200,39 @@ class CommandsComponent(Component):
else:
self.logger.warning(f"Could not remove {filename}")
# Remove commands directory if empty
# Also check and remove any old commands in root commands directory
old_commands_dir = self.install_dir / "commands"
old_removed_count = 0
for filename in self.command_files:
old_file_path = old_commands_dir / filename
if old_file_path.exists() and old_file_path.is_file():
if self.file_manager.remove_file(old_file_path):
old_removed_count += 1
self.logger.debug(f"Removed old {filename}")
else:
self.logger.warning(f"Could not remove old {filename}")
if old_removed_count > 0:
self.logger.info(f"Also removed {old_removed_count} commands from old location")
removed_count += old_removed_count
# Remove sc subdirectory if empty
try:
if commands_dir.exists():
remaining_files = list(commands_dir.iterdir())
if not remaining_files:
commands_dir.rmdir()
self.logger.debug("Removed empty commands directory")
self.logger.debug("Removed empty sc commands directory")
# Also remove parent commands directory if empty
parent_commands_dir = self.install_dir / "commands"
if parent_commands_dir.exists():
remaining_files = list(parent_commands_dir.iterdir())
if not remaining_files:
parent_commands_dir.rmdir()
self.logger.debug("Removed empty parent commands directory")
except Exception as e:
self.logger.warning(f"Could not remove commands directory: {e}")
@@ -242,7 +271,7 @@ class CommandsComponent(Component):
self.logger.info(f"Updating commands component from {current_version} to {target_version}")
# Create backup of existing command files
commands_dir = self.install_dir / "commands"
commands_dir = self.install_dir / "commands" / "sc"
backup_files = []
if commands_dir.exists():
@@ -287,10 +316,10 @@ class CommandsComponent(Component):
"""Validate commands component installation"""
errors = []
# Check if commands directory exists
commands_dir = self.install_dir / "commands"
# Check if sc commands directory exists
commands_dir = self.install_dir / "commands" / "sc"
if not commands_dir.exists():
errors.append("Commands directory not found")
errors.append("SC commands directory not found")
return False, errors
# Check if all command files exist
@@ -343,6 +372,67 @@ class CommandsComponent(Component):
"files_installed": len(self.command_files),
"command_files": self.command_files,
"estimated_size": self.get_size_estimate(),
"install_directory": str(self.install_dir / "commands"),
"install_directory": str(self.install_dir / "commands" / "sc"),
"dependencies": self.get_dependencies()
}
}
def _migrate_existing_commands(self) -> None:
"""Migrate existing commands from old location to new sc subdirectory"""
try:
old_commands_dir = self.install_dir / "commands"
new_commands_dir = self.install_dir / "commands" / "sc"
# Check if old commands exist in root commands directory
migrated_count = 0
commands_to_migrate = []
if old_commands_dir.exists():
for filename in self.command_files:
old_file_path = old_commands_dir / filename
if old_file_path.exists() and old_file_path.is_file():
commands_to_migrate.append(filename)
if commands_to_migrate:
self.logger.info(f"Found {len(commands_to_migrate)} existing commands to migrate to sc/ subdirectory")
# Ensure new directory exists
if not self.file_manager.ensure_directory(new_commands_dir):
self.logger.error(f"Could not create sc commands directory: {new_commands_dir}")
return
# Move files from old to new location
for filename in commands_to_migrate:
old_file_path = old_commands_dir / filename
new_file_path = new_commands_dir / filename
try:
# Copy file to new location
if self.file_manager.copy_file(old_file_path, new_file_path):
# Remove old file
if self.file_manager.remove_file(old_file_path):
migrated_count += 1
self.logger.debug(f"Migrated {filename} to sc/ subdirectory")
else:
self.logger.warning(f"Could not remove old {filename}")
else:
self.logger.warning(f"Could not copy {filename} to sc/ subdirectory")
except Exception as e:
self.logger.warning(f"Error migrating {filename}: {e}")
if migrated_count > 0:
self.logger.success(f"Successfully migrated {migrated_count} commands to /sc: namespace")
self.logger.info("Commands are now available as /sc:analyze, /sc:build, etc.")
# Try to remove old commands directory if empty
try:
if old_commands_dir.exists():
remaining_files = [f for f in old_commands_dir.iterdir() if f.is_file()]
if not remaining_files:
# Only remove if no user files remain
old_commands_dir.rmdir()
self.logger.debug("Removed empty old commands directory")
except Exception as e:
self.logger.debug(f"Could not remove old commands directory: {e}")
except Exception as e:
self.logger.warning(f"Error during command migration: {e}")