feat(setup): enumerate managed skills from repo checkout - #130
Merged
Conversation
Replace the hardcoded MANAGED_SKILLS tuple with manifest.managed_skills(repo_root), which scans .claude/skills/*/SKILL.md. A skill added to the repo is linked into ~/.claude/skills on the next session's autocheck with no code change; a skill removed from the repo has its user-level link pruned (foreign entries are never touched — only links targeting the repo skills tree). - diff() reports stale repo-targeted links as drift, so autocheck's if-drift guard triggers the pruning apply() - autocheck._mtimes() now stats skills_dir: a manually deleted link busts the fingerprint cache and is relinked next session - enumeration is sorted, so fingerprint() stays deterministic and a repo skill add/remove invalidates the cache for free Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QMxQKgsP9Dw9b5kN53MJfo
There was a problem hiding this comment.
🟢 Claude BugBot Analysis
Reviewed the migration from a static MANAGED_SKILLS tuple to dynamic managed_skills() enumeration plus the new stale-link pruning logic in engine.py/manifest.py/autocheck.py; all call sites, the fingerprint/mtime cache-invalidation reasoning, and the prune/unlink fallback logic (consistent with the existing symlink/junction removal pattern) check out with no concrete defects found.
No bugs were detected in this PR.
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.
Summary
Replaces the hardcoded
MANAGED_SKILLStuple with dynamic enumeration:manifest.managed_skills(repo_root)scans<repo>/.claude/skills/*/SKILL.md. Any skill added to the repo is registered at user level (~/.claude/skills) on the next session's autocheck with no code change; a skill removed from the repo has its user-level link pruned.Changes
MANAGED_SKILLSconstant deleted;managed_skills(repo_root)enumerates skill dirs (sorted, sofingerprint()stays deterministic — a repo skill add/remove invalidates the autocheck cache for free).render()/diff()/install_skills()consume the enumeration. New_stale_repo_skill_links(): links in the user skills dir that target the repo skills tree but whose name left the managed set are pruned byinstall_skills()and reported as drift bydiff()(needed so autocheck'sif drift:guard triggers the pruning apply). Foreign entries — user's own skill dirs, links targeting anywhere else — are never touched._mtimes()now statsskills_dir: a manually deleted skill link busts the fingerprint cache and gets relinked next session.Testing
mklink /Jjunctions so they run on Windows without symlink privilege.🤖 Generated with Claude Code
https://claude.ai/code/session_01QMxQKgsP9Dw9b5kN53MJfo