project-workspace-cleaner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject 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:
- CLI flags
config/customization.yamlconfig/customization.template.yaml- script defaults
- 可选CLI覆盖参数:
--workspace--min-mb--stale-days--max-findings--config--json
- 配置优先级:
- CLI标志
config/customization.yamlconfig/customization.template.yaml- 脚本默认值
Workflow
工作流程
- Resolve settings using the documented precedence.
- Run .
scripts/scan_workspace_cleanup.py - Record skipped paths when traversal or stat operations fail, then continue scanning remaining accessible paths.
- Rank findings by severity, score, size, repo, and directory.
- Return the ranked findings plus repo-level totals.
- If there are no findings and no skipped paths, report the user-facing clean result.
- 根据文档记录的优先级解析设置。
- 运行。
scripts/scan_workspace_cleanup.py - 当遍历或统计操作失败时,记录跳过的路径,然后继续扫描剩余可访问的路径。
- 按严重程度、分数、大小、仓库和目录对检测结果进行排序。
- 返回排序后的检测结果以及仓库级别的汇总数据。
- 如果没有检测结果且没有跳过的路径,则向用户返回工作区已清理完成的结果。
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 includesand
partial_results.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.mdreferences/customization.mdreferences/automation-prompts.mdreferences/patterns.md
references/config-schema.mdreferences/customization.mdreferences/automation-prompts.mdreferences/patterns.md