Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

project-archive-cleanup

БесплатноБез исполняемых скриптовНе проверен

Archive-clean finished, long-idle project directories — retain planning documents and result artifacts, strip execution traces (one-off scripts, import…

haiyangchenbjот haiyangchenbj371 установка в других каталогах

Об этом скилле

project-archive-cleanup

When to use

  • A project is described as finished or long-idle and the ask is to reduce process residue — keep the planning and result layer, drop the execution layer.
  • Periodic workspace hygiene alongside a disk health check.
  • After iterative work left several near-identical versions of one deliverable.

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.

    • Reusable scanner: an outputs/scan_projects.py-style walk that reports size / files / last activity / process-file count per unit.
  2. Classify each unit before touching anything:

    • Active (last activity < 14d) → out of scope.
    • Restricted (company or brand campaign material, anything with holdings or PII) → list as "needs sign-off", do not clean.
    • Finished + idle + unrestricted → in scope.
  3. 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
  4. 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.

  5. Check references before deleting a script. Grep the project for the base name, then judge the source of the hit:

    • hit only in workspace memory logs or a changelog → process trace, safe to strip.
    • hit in a result doc (e.g. a test report) or it is an operational script → keep, otherwise the result file loses its referent.
  6. 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.

  7. Two-phase execution. Dry-run script prints every item with size + reason; only --apply writes.

    • Respect the safe-delete limit — do not work around it. Count every file a recursive delete expands, submit the complete deletion manifest through the approved deletion mechanism in one turn, and stop for explicit user authorization when the hook's threshold (50 expanded files, scope=turn) is reached. Do not split batches across separate processes or switch to a lower-level API to stay under the limit — already-deleted items do not roll back, so a run that hits the limit is reported and resumed only after approval.
    • Directory deletes go through the same approved mechanism; verify removal with [System.IO.Directory]::Exists($p) and reconcile against the manifest.
  8. 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.

  9. 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).

  10. 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

  • "Long idle" is not "dead". Check whether a copy is the only surviving instance before judging it disposable.
  • Same size ≠ same file. Always hash. Files that look like a pair by name can differ by tens of KB.
  • Version series are the trap. Keep the newest + the history index; superseded chains (earlier vN when a later version exists elsewhere) are the noise, but recent mid-series versions (last few days) belong in "archive, don't delete".
  • Volume is a poor success metric. A cleanup of many items may reclaim very little disk — the value is structural, say so instead of selling a number.
  • Do not blanket-delete 0-byte files. Virtualenv trees are full of legitimate empty __init__.py / py.typed.
  • Windows reserved names (nul, con) break Python exists() (always True) and os.remove; use .NET File.Delete with the \\?\ prefix and verify via os.listdir.
  • Treat a backup as verified because the copy command exited 0 — confirm a few representativ
Полный SKILL.md на ClawHub

Установить project-archive-cleanup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл 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.

Как установить скилл project-archive-cleanup?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл project-archive-cleanup запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить project-archive-cleanup с