Files
SuperClaude/plugins/superclaude/commands/cleanup.md
mithun50 ab8904bc8c feat: restore all 30 slash commands with comprehensive documentation
Restored 26 additional commands from commit d4a17fc, bringing total from 5 to 30 commands.

## New Commands Added (26):
- /analyze - Code and architecture analysis
- /brainstorm - Structured brainstorming sessions
- /build - Build and compilation workflows
- /business-panel - Multi-expert business analysis
- /cleanup - Code cleanup and refactoring
- /design - System design and architecture
- /document - Documentation generation
- /estimate - Effort and time estimation
- /explain - Code explanation
- /git - Git operations and workflows
- /help - Command help and usage
- /implement - Implementation workflows
- /improve - Code improvement suggestions
- /index - Project indexing (alias for index-repo)
- /load - Load saved sessions
- /pm - Project management workflows
- /reflect - Reflection and retrospectives
- /save - Save current session
- /select-tool - Tool selection guidance
- /spawn - Spawn parallel tasks
- /spec-panel - Multi-expert specification analysis
- /task - Task management
- /test - Testing workflows
- /troubleshoot - Debugging and troubleshooting
- /workflow - Custom workflow automation

## Documentation Updates:
- Created docs/reference/commands-list.md with categorized command reference
- Updated README.md with expandable 30-command list
- Updated README-zh.md with Chinese translations
- Updated README-ja.md with Japanese translations
- Updated README-kr.md with Korean translations
- Changed statistics: "3 plugins" → "30 commands"
- Added command categories: Planning & Design, Development, Testing & Quality,
  Documentation, Version Control, Project Management, Research & Analysis, Utilities

## Files Changed:
- 60 files changed, 7930 insertions(+), 267 deletions(-)
- Added 26 commands to plugins/superclaude/commands/
- Added 26 commands to src/superclaude/commands/
- Created comprehensive command documentation

Commands restored from: d4a17fc (superclaude/commands/)
Total: 30 commands now available

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 16:08:56 +01:00

93 lines
3.5 KiB
Markdown

---
name: cleanup
description: "Systematically clean up code, remove dead code, and optimize project structure"
category: workflow
complexity: standard
mcp-servers: [sequential, context7]
personas: [architect, quality, security]
---
# /sc:cleanup - Code and Project Cleanup
## Triggers
- Code maintenance and technical debt reduction requests
- Dead code removal and import optimization needs
- Project structure improvement and organization requirements
- Codebase hygiene and quality improvement initiatives
## Usage
```
/sc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive] [--interactive]
```
## Behavioral Flow
1. **Analyze**: Assess cleanup opportunities and safety considerations across target scope
2. **Plan**: Choose cleanup approach and activate relevant personas for domain expertise
3. **Execute**: Apply systematic cleanup with intelligent dead code detection and removal
4. **Validate**: Ensure no functionality loss through testing and safety verification
5. **Report**: Generate cleanup summary with recommendations for ongoing maintenance
Key behaviors:
- Multi-persona coordination (architect, quality, security) based on cleanup type
- Framework-specific cleanup patterns via Context7 MCP integration
- Systematic analysis via Sequential MCP for complex cleanup operations
- Safety-first approach with backup and rollback capabilities
## MCP Integration
- **Sequential MCP**: Auto-activated for complex multi-step cleanup analysis and planning
- **Context7 MCP**: Framework-specific cleanup patterns and best practices
- **Persona Coordination**: Architect (structure), Quality (debt), Security (credentials)
## Tool Coordination
- **Read/Grep/Glob**: Code analysis and pattern detection for cleanup opportunities
- **Edit/MultiEdit**: Safe code modification and structure optimization
- **TodoWrite**: Progress tracking for complex multi-file cleanup operations
- **Task**: Delegation for large-scale cleanup workflows requiring systematic coordination
## Key Patterns
- **Dead Code Detection**: Usage analysis → safe removal with dependency validation
- **Import Optimization**: Dependency analysis → unused import removal and organization
- **Structure Cleanup**: Architectural analysis → file organization and modular improvements
- **Safety Validation**: Pre/during/post checks → preserve functionality throughout cleanup
## Examples
### Safe Code Cleanup
```
/sc:cleanup src/ --type code --safe
# Conservative cleanup with automatic safety validation
# Removes dead code while preserving all functionality
```
### Import Optimization
```
/sc:cleanup --type imports --preview
# Analyzes and shows unused import cleanup without execution
# Framework-aware optimization via Context7 patterns
```
### Comprehensive Project Cleanup
```
/sc:cleanup --type all --interactive
# Multi-domain cleanup with user guidance for complex decisions
# Activates all personas for comprehensive analysis
```
### Framework-Specific Cleanup
```
/sc:cleanup components/ --aggressive
# Thorough cleanup with Context7 framework patterns
# Sequential analysis for complex dependency management
```
## Boundaries
**Will:**
- Systematically clean code, remove dead code, and optimize project structure
- Provide comprehensive safety validation with backup and rollback capabilities
- Apply intelligent cleanup algorithms with framework-specific pattern recognition
**Will Not:**
- Remove code without thorough safety analysis and validation
- Override project-specific cleanup exclusions or architectural constraints
- Apply cleanup operations that compromise functionality or introduce bugs