Skip to content

Add whet install --prune (manifest-scoped, safe alongside other tools' skills) - #9

Merged
ortizeg merged 1 commit into
developfrom
feat-install-prune
Jul 24, 2026
Merged

Add whet install --prune (manifest-scoped, safe alongside other tools' skills)#9
ortizeg merged 1 commit into
developfrom
feat-install-prune

Conversation

@ortizeg

@ortizeg ortizeg commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Problem

whet install copies skills but never removes ones deleted upstream. After the recent cleanup, 8 deleted skills were still installed and still being loaded by Claude Code:

code-review  data-engineer  devops-infra  dvc
expert-coder  ml-engineer  pydantic-strict  test-engineer

So the broken "agents" (the ones with no frontmatter), the removed dvc, and a stale pydantic-strict sitting next to the new pydantic were all still live. The repo was clean; the installed copies were not.

Why this isn't just rm -rf

A skills directory is shared. ~/.claude/skills/ here holds 104 skills — most of them GSD's, plus interface-design and hand-written ones. A prune that removed "anything not in whet's skills/" would delete all of them.

So prune is manifest-scoped:

  • Each install writes .whet-manifest.json into the target directory, recording which skills whet owns there.
  • Prune only ever removes names from that manifest → skills owned by other tools are invisible to it.
  • Orphans are computed against the unfiltered source set, so a skill merely skipped by --category or by the extra tier is never mistaken for a deleted one.
  • Without --prune, orphans are reported, not touched.
  • A corrupt or missing manifest yields an empty owned-set, which fails safe — prune is authorized to remove nothing.

Usage

whet install --prune

Installs predating the manifest are invisible to prune by design (whet has no record it owns them); clear those once with whet remove <name>.

Tests

10 new tests in tests/test_manifest.py, including the two that matter:

  • test_find_orphans_ignores_skills_whet_did_not_install — the GSD/interface-design protection
  • test_find_orphans_ignores_filtered_but_existing_skills — an extra skill skipped this run is not an orphan
  • plus corrupt-manifest and wrong-shape tolerance

202 passed; ruff, mypy --strict, and mkdocs build --strict clean.

🤖 Generated with Claude Code

`whet install` copied skills but never removed ones that disappeared from the
source, so deleted skills lingered in .claude/skills/ indefinitely. After the
recent cleanup that left 8 stale skills installed — including the broken
"agents" and the removed dvc — still being loaded by Claude Code.

The hazard is that a skills directory is shared: a Claude Code skills dir also
holds GSD's skills, interface-design, and hand-written ones. A naive prune would
delete them. So prune is manifest-scoped:

- Each install writes .whet-manifest.json into the target directory recording
  which skills whet owns there.
- Prune only ever removes names from that manifest, so skills owned by other
  tools are invisible to it.
- Orphans are computed against the *unfiltered* source set, so a skill merely
  skipped by --category or by the extra tier is never mistaken for a deleted one.
- Without --prune, orphans are reported but not touched.
- A corrupt or absent manifest yields an empty owned-set, which fails safe:
  prune is authorized to remove nothing.

Installs predating the manifest are invisible to prune by design; those are
cleared once with `whet remove <name>`.

202 tests (10 new); ruff, mypy --strict, and mkdocs --strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ortizeg
ortizeg merged commit a70b117 into develop Jul 24, 2026
2 checks passed
@ortizeg
ortizeg deleted the feat-install-prune branch July 24, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant