repo-cleanup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Repo 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

避免场景

TaskLoad reference
Code cleanup
skills/repo-cleanup/references/code-cleanup.md
Dependency cleanup
skills/repo-cleanup/references/deps-cleanup.md
Docs cleanup
skills/repo-cleanup/references/docs-cleanup.md
Test cleanup
skills/repo-cleanup/references/test-cleanup.md
Sprint archive
skills/repo-cleanup/references/archive-sprint.md
  • 正在进行事件响应
  • 目标区域没有负责人或回滚保障

Workflow

快速参考

  1. Define scope and safety mode (safe vs aggressive).
  2. Capture baseline state (git status, key tests, backups).
  3. Load the relevant reference file(s) for the target area.
  4. Execute cleanup steps with usage checks before removal.
  5. Validate changes (tests, build, lint, or doc checks).
  6. Report outcomes (actions taken, risks, follow-ups).
任务参考文件路径
代码清理
skills/repo-cleanup/references/code-cleanup.md
依赖项清理
skills/repo-cleanup/references/deps-cleanup.md
文档清理
skills/repo-cleanup/references/docs-cleanup.md
测试清理
skills/repo-cleanup/references/test-cleanup.md
迭代归档
skills/repo-cleanup/references/archive-sprint.md

Output

工作流

  • Summary of actions and files touched
  • Validation results and remaining risks
  • Follow-up recommendations or backlog items
  1. 定义范围和安全模式(安全型 vs 激进型)。
  2. 捕获基线状态(git状态、关键测试、备份)。
  3. 加载目标区域的相关参考文件。
  4. 执行清理步骤,删除前先检查使用情况。
  5. 验证变更(测试、构建、代码检查或文档检查)。
  6. 报告结果(已执行操作、风险、后续工作)。

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
  • 已执行操作和涉及文件的摘要
  • 验证结果和剩余风险
  • 后续建议或待办事项

常见错误

  • 未确认使用情况或可再生性就删除文件
  • 跳过基线测试和回滚检查点
  • 删除依赖项但未更新构建/测试脚本
  • 合并文档时未保留入口点