Add whet install --prune (manifest-scoped, safe alongside other tools' skills) - #9
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
whet installcopies skills but never removes ones deleted upstream. After the recent cleanup, 8 deleted skills were still installed and still being loaded by Claude Code:So the broken "agents" (the ones with no frontmatter), the removed
dvc, and a stalepydantic-strictsitting next to the newpydanticwere all still live. The repo was clean; the installed copies were not.Why this isn't just
rm -rfA skills directory is shared.
~/.claude/skills/here holds 104 skills — most of them GSD's, plusinterface-designand hand-written ones. A prune that removed "anything not in whet'sskills/" would delete all of them.So prune is manifest-scoped:
.whet-manifest.jsoninto the target directory, recording which skills whet owns there.--categoryor by theextratier is never mistaken for a deleted one.--prune, orphans are reported, not touched.Usage
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 protectiontest_find_orphans_ignores_filtered_but_existing_skills— anextraskill skipped this run is not an orphan202 passed; ruff,
mypy --strict, andmkdocs build --strictclean.🤖 Generated with Claude Code