2025-08-25 13:13:19 +09:00
|
|
|
---
|
|
|
|
allowed-tools: [Read, Grep, Glob, Bash, Edit, MultiEdit]
|
|
|
|
description: "Clean up code, remove dead code, and optimize project structure"
|
|
|
|
---
|
2025-08-19 12:51:49 +09:00
|
|
|
|
2025-08-25 13:13:19 +09:00
|
|
|
# /sc:cleanup - Code and Project Cleanup
|
2025-08-19 12:51:49 +09:00
|
|
|
|
2025-08-25 13:13:19 +09:00
|
|
|
## Purpose
|
|
|
|
Systematically clean up code, remove dead code, optimize imports, and improve project structure.
|
2025-08-19 12:51:49 +09:00
|
|
|
|
2025-08-25 13:13:19 +09:00
|
|
|
## Usage
|
2025-08-19 12:51:49 +09:00
|
|
|
```
|
2025-08-25 13:13:19 +09:00
|
|
|
/sc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive] [--dry-run]
|
2025-08-19 12:51:49 +09:00
|
|
|
```
|
|
|
|
|
2025-08-25 13:13:19 +09:00
|
|
|
## Arguments
|
|
|
|
- `target` - Files, directories, or entire project to clean
|
|
|
|
- `--type` - Cleanup type (code, imports, files, all)
|
|
|
|
- `--safe` - Conservative cleanup (default)
|
|
|
|
- `--aggressive` - More thorough cleanup with higher risk
|
|
|
|
- `--dry-run` - Preview changes without applying them
|
|
|
|
|
|
|
|
## Execution
|
|
|
|
1. Analyze target for cleanup opportunities
|
|
|
|
2. Identify dead code, unused imports, and redundant files
|
|
|
|
3. Create cleanup plan with risk assessment
|
|
|
|
4. Execute cleanup operations with appropriate safety measures
|
|
|
|
5. Validate changes and report cleanup results
|
|
|
|
|
|
|
|
## Claude Code Integration
|
|
|
|
- Uses Glob for systematic file discovery
|
|
|
|
- Leverages Grep for dead code detection
|
|
|
|
- Applies MultiEdit for batch cleanup operations
|
|
|
|
- Maintains backup and rollback capabilities
|