Skip to content

fix(install): remove the agent dir on skill-md uninstall (#60)#74

Merged
msitarzewski merged 1 commit into
mainfrom
fix/skill-md-uninstall-orphan-dir
Jul 17, 2026
Merged

fix(install): remove the agent dir on skill-md uninstall (#60)#74
msitarzewski merged 1 commit into
mainfrom
fix/skill-md-uninstall-orphan-dir

Conversation

@msitarzewski

Copy link
Copy Markdown
Owner

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_filesremove_file_strict) removed only the leaf SKILL.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 no SKILL.md bytes 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 new tool_is_dir_unit(tool) so file-per-agent tools never touch their shared agents/ root.

Test

uninstall_removes_orphaned_skill_dir — installs then uninstalls for Antigravity + Osaurus, asserts both the SKILL.md and the <slug>/ dir are gone. Full install module suite green (20/20).

Closes #60

🤖 Generated with Claude Code

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
@msitarzewski
msitarzewski merged commit b4c17fe into main Jul 17, 2026
2 checks passed
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.

Agents installed in Antigravity cannot be removed via app

1 participant