project-workspace-cleaner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project Workspace Cleaner

项目工作区清理工具

Run a read-only scan over repositories in a workspace root and rank cleanup chores by severity.
对工作区根目录下的仓库执行只读扫描,并按严重程度对清理任务进行排序。

Inputs

输入项

  • Optional CLI overrides:
    • --workspace
    • --min-mb
    • --stale-days
    • --max-findings
    • --config
    • --json
  • Config precedence:
    1. CLI flags
    2. config/customization.yaml
    3. config/customization.template.yaml
    4. script defaults
  • 可选CLI覆盖参数:
    • --workspace
    • --min-mb
    • --stale-days
    • --max-findings
    • --config
    • --json
  • 配置优先级:
    1. CLI标志
    2. config/customization.yaml
    3. config/customization.template.yaml
    4. 脚本默认值

Workflow

工作流程

  1. Resolve settings using the documented precedence.
  2. Run
    scripts/scan_workspace_cleanup.py
    .
  3. Record skipped paths when traversal or stat operations fail, then continue scanning remaining accessible paths.
  4. Rank findings by severity, score, size, repo, and directory.
  5. Return the ranked findings plus repo-level totals.
  6. If there are no findings and no skipped paths, report the user-facing clean result.
  1. 根据文档记录的优先级解析设置。
  2. 运行
    scripts/scan_workspace_cleanup.py
  3. 当遍历或统计操作失败时,记录跳过的路径,然后继续扫描剩余可访问的路径。
  4. 按严重程度、分数、大小、仓库和目录对检测结果进行排序。
  5. 返回排序后的检测结果以及仓库级别的汇总数据。
  6. 如果没有检测结果且没有跳过的路径,则向用户返回工作区已清理完成的结果。

Output Contract

输出约定

Each finding includes:
  • severity
  • repo
  • directory
  • category
  • size_human
  • score
  • why_flagged
  • suggested_cleanup
  • Repo summary includes total flagged size and finding counts per severity.
  • JSON output includes
    partial_results
    and
    skipped_paths
    .
  • For user-facing clean runs, output exactly
    No findings.
  • If any path is skipped, return a partial-results warning and list skipped paths instead of using the clean-run message.
每个检测结果包含:
  • severity
    (严重程度)
  • repo
    (仓库)
  • directory
    (目录)
  • category
    (类别)
  • size_human
    (易读格式大小)
  • score
    (分数)
  • why_flagged
    (标记原因)
  • suggested_cleanup
    (建议清理方式)
  • 仓库汇总包含标记文件的总大小以及各严重程度的检测结果数量。
  • JSON输出包含
    partial_results
    skipped_paths
  • 对于无检测结果的情况,输出内容为
    No findings.
  • 如果存在跳过的路径,则返回部分结果警告并列出跳过的路径,而非使用清理完成的提示信息。

Guardrails

防护规则

  • Never run destructive commands.
  • Never remove artifacts automatically.
  • Never write into scanned repositories.
  • Provide recommendations only.
  • 绝不执行破坏性命令。
  • 绝不自动删除工件。
  • 绝不写入被扫描的仓库。
  • 仅提供建议。

References

参考资料

  • references/config-schema.md
  • references/customization.md
  • references/automation-prompts.md
  • references/patterns.md
  • references/config-schema.md
  • references/customization.md
  • references/automation-prompts.md
  • references/patterns.md