sc-cleanup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode and Project Cleanup
代码与项目清理
Systematically clean up code, remove dead code, optimize imports, and improve project structure.
系统地清理代码、移除死代码、优化导入语句并改进项目结构。
When to use
适用场景
- User asks to clean up code or project
- Dead code or unused imports need removal
- Project structure needs optimization
- Technical debt cleanup requested
- File organization improvements needed
- 用户要求清理代码或项目
- 需要移除死代码或未使用的导入语句
- 需要优化项目结构
- 需要清理技术债务
- 需要改进文件组织方式
Instructions
使用说明
Usage
用法
/sc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive]/sc:cleanup [target] [--type code|imports|files|all] [--safe|--aggressive]Arguments
参数
- - Files, directories, or entire project to clean
target - - Cleanup type (code, imports, files, all)
--type - - Conservative cleanup (default)
--safe - - More thorough cleanup with higher risk
--aggressive - - Preview changes without applying them
--dry-run
- - 要清理的文件、目录或整个项目
target - - 清理类型(代码、导入语句、文件、全部)
--type - - 保守清理(默认选项)
--safe - - 更彻底的清理,风险较高
--aggressive - - 预览更改但不实际应用
--dry-run
Execution
执行步骤
- Analyze target for cleanup opportunities
- Identify dead code, unused imports, and redundant files
- Create cleanup plan with risk assessment
- Execute cleanup operations with appropriate safety measures
- Validate changes and report cleanup results
- 分析目标对象,寻找清理机会
- 识别死代码、未使用的导入语句和冗余文件
- 创建带有风险评估的清理计划
- 采取适当的安全措施执行清理操作
- 验证更改并报告清理结果
Claude Code Integration
Claude Code 集成
- Uses Glob for systematic file discovery
- Leverages Grep for dead code detection
- Applies MultiEdit for batch cleanup operations
- Maintains backup and rollback capabilities
- 使用 Glob 进行系统化的文件发现
- 利用 Grep 检测死代码
- 应用 MultiEdit 进行批量清理操作
- 保留备份与回滚功能