fix(install): remove the agent dir on skill-md uninstall (#60)#74
Merged
Conversation
skill-md tools (Antigravity, Osaurus) install each agent as `<slug>/SKILL.md`. Uninstall removed only the SKILL.md file via remove_file, orphaning the empty `<slug>/` directory. The reconcile scan keys on the directory for dir-unit formats, so the leftover dir was re-surfaced as an untracked phantom that could never be removed — exactly the #60 report ("turns to untracked, agent still there"). After deleting the leaf, prune the now-empty agent dir with remove_dir (empty-only, so a dir a user dropped their own files into is left untouched). Gated on tool_is_dir_unit so file-per-agent tools never touch their shared agents/ root. Test: uninstall_removes_orphaned_skill_dir covers Antigravity + Osaurus. Closes #60 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WdX6PvnCfRgYD11yVpXVor
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 (#60)
Uninstalling an agent from Antigravity flips it to "untracked" and leaves it in the list — the file stays in the skills directory.
Root cause
skill-md tools (Antigravity, Osaurus) install each agent as a directory:
…/skills/<slug>/SKILL.md. Uninstall (remove_agent_files→remove_file_strict) removed only the leafSKILL.md, orphaning the empty<slug>/dir. The reconcile scan keys on the directory for dir-unit formats (dir_unit = suffix.starts_with('/')), so the leftover dir was re-recognized and — with noSKILL.mdbytes to match — classified Foreign/untracked. It could never leave the list.Fix (Safe)
After deleting the leaf, prune the now-empty agent dir with
remove_dir(empty-only, so a dir a user dropped their own files into is left untouched). Gated on a newtool_is_dir_unit(tool)so file-per-agent tools never touch their sharedagents/root.Test
uninstall_removes_orphaned_skill_dir— installs then uninstalls for Antigravity + Osaurus, asserts both theSKILL.mdand the<slug>/dir are gone. Full install module suite green (20/20).Closes #60
🤖 Generated with Claude Code