Home / Market / project-archive-cleanup

project-archive-cleanup

Archive-clean finished, long-idle project directories — retain planning documents and result artifacts, strip execution traces (one-off scripts, import intermediates, scrape snapshots, console logs, superseded versions, byte-identical duplicates). Use when asked to clean up project leftovers, reduce process noise, or archive completed work. Always read-only scan first, then a two-phase backup-and-delete with batching for the safe-delete threshold.

skill★ 00 dlclawhubMIT-0Install in CosmosUpstream Source

Documentation & Preview

--- name: project-archive-cleanup description: "Archive-clean finished, long-idle project directories — retain planning documents and result artifacts, strip execution traces (one-off scripts, import intermediates, scrape snapshots, console logs, superseded versions, byte-identical duplicates). Use when asked to clean up project leftovers, reduce process noise, or archive completed work. Always read-only scan first, then a two-phase backup-and-delete with batching for the safe-delete threshold." description_zh: "项目归档清理:保留策划与结果,剥离执行过程痕迹" description_en: "Project archive cleanup" disable: false agent_created: true version: "1.0.3"

---

project-archive-cleanup

When to use

Do not use for: active projects (last activity < ~14 days), the runtime dir itself (~/.workbuddy, a disk-health job), or any unit holding private or company-restricted data without explicit sign-off.

Steps

  1. Scope the units. Enumerate top-level dirs plus one level under the main project root. Skip .git, .venv, node_modules, __pycache__, site-packages. Record size / file count / last-activity / process-file ratio per unit.
  1. Classify each unit before touching anything:
  1. Apply the keep/strip rule:

| | keep | strip | | --- | --- | --- | | planning | PRD, strategy, checklists, changelog, history index | — | | result | latest deliverable, report, source, cloud functions, config, result data | byte-identical duplicate copies | | process | — | one-off scripts, import intermediates, scrape snapshots, console logs, superseded versions |

  1. Prove "duplicate" with sha256, never by name or size. Size equality is not identity. Recurring shapes: two identical page snapshots from the same browser run; report copies identical to files already in the result dir; a before-*.docx identical to the final stage output.
  1. Check references before deleting a script. Grep the project for the base name, then judge the *source* of the hit:
  1. Check installation before deleting any skill or dependency copy, and require explicit user confirmation for the deletion. Compare against {p.name for p in (~/.workbuddy/skills).iterdir()} — if the local copy is not installed there, it is the only copy and long idle time says nothing about disposability. Include these items in the dry-run report and obtain approval before any --apply.
  1. Two-phase execution. Dry-run script prints every item with size + reason; only --apply writes.
  1. Back up before delete to <workspace>/outputs/_archive_<date>/, then verify by comparing file counts src vs bak for every entry. Do not trust the script's success echo.
  1. Clean up directories your own deletes emptied; leave pre-existing empty dirs alone (they are often tool-expected paths such as template output dirs or sync audit scratch dirs).
  1. Write the outcome into the health/archive report: what was stripped, what was kept and why, the backup location, and a "needs your call" table for restricted or private items.

Pitfalls

Verification

Reference

Worked case (a 26-item run across 7 projects, with the keep/strip decisions and the near-miss on uninstalled skill copies) is recorded in the workspace health report for that date — see <workspace>/outputs/workbuddy-health-report-<date>.md, project-archive section.