sc-cleanup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code 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

参数

  • 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
  • target
    - 要清理的文件、目录或整个项目
  • --type
    - 清理类型(代码、导入语句、文件、全部)
  • --safe
    - 保守清理(默认选项)
  • --aggressive
    - 更彻底的清理,风险较高
  • --dry-run
    - 预览更改但不实际应用

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
  1. 分析目标对象,寻找清理机会
  2. 识别死代码、未使用的导入语句和冗余文件
  3. 创建带有风险评估的清理计划
  4. 采取适当的安全措施执行清理操作
  5. 验证更改并报告清理结果

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 进行批量清理操作
  • 保留备份与回滚功能