repo-cleanup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRepo Cleanup
仓库清理
Overview
概述
Establish a safe, repeatable cleanup workflow for code, dependencies, docs, tests, and sprint artifacts. Minimize risk by validating usage, archiving before deletion, and verifying with tests.
为代码、依赖项、文档、测试和迭代工件建立一个安全、可重复的清理工作流。通过验证使用情况、删除前归档以及测试验证来降低风险。
When to Use
适用场景
- Repository bloat (generated artifacts, caches, unused files)
- Dead code or unused dependencies suspected
- Docs drifted from actual behavior
- Tests are brittle, redundant, or mislocated
- Sprint closure needs structured archiving
Avoid when:
- Active incident response is ongoing
- The target area lacks owners or rollback coverage
- 仓库臃肿(生成的工件、缓存、未使用文件)
- 疑似存在死代码或未使用依赖项
- 文档与实际行为脱节
- 测试脆弱、冗余或位置错误
- 迭代收尾需要结构化归档
Quick Reference
避免场景
| Task | Load reference |
|---|---|
| Code cleanup | |
| Dependency cleanup | |
| Docs cleanup | |
| Test cleanup | |
| Sprint archive | |
- 正在进行事件响应
- 目标区域没有负责人或回滚保障
Workflow
快速参考
- Define scope and safety mode (safe vs aggressive).
- Capture baseline state (git status, key tests, backups).
- Load the relevant reference file(s) for the target area.
- Execute cleanup steps with usage checks before removal.
- Validate changes (tests, build, lint, or doc checks).
- Report outcomes (actions taken, risks, follow-ups).
| 任务 | 参考文件路径 |
|---|---|
| 代码清理 | |
| 依赖项清理 | |
| 文档清理 | |
| 测试清理 | |
| 迭代归档 | |
Output
工作流
- Summary of actions and files touched
- Validation results and remaining risks
- Follow-up recommendations or backlog items
- 定义范围和安全模式(安全型 vs 激进型)。
- 捕获基线状态(git状态、关键测试、备份)。
- 加载目标区域的相关参考文件。
- 执行清理步骤,删除前先检查使用情况。
- 验证变更(测试、构建、代码检查或文档检查)。
- 报告结果(已执行操作、风险、后续工作)。
Common Mistakes
输出
- Deleting without confirming usage or regenerability
- Skipping baseline tests and rollback checkpoints
- Removing dependencies without updating build/test scripts
- Collapsing docs without preserving entry points
- 已执行操作和涉及文件的摘要
- 验证结果和剩余风险
- 后续建议或待办事项
—
常见错误
—
- 未确认使用情况或可再生性就删除文件
- 跳过基线测试和回滚检查点
- 删除依赖项但未更新构建/测试脚本
- 合并文档时未保留入口点