remove the claude skill tree on uninstall, not just the CLAUDE.md section
claude_uninstall only stripped the CLAUDE.md section, so `graphify uninstall` and `graphify claude uninstall` orphaned the whole installed skill tree (SKILL.md + references/ + version stamp) - gemini_uninstall already removes its skill, this makes claude consistent. The #1121 split made the orphan a 10-file directory; this restores the removal that the alternative PR #1119 had. Scoped name removal preserves sibling user files; project-scope uninstall passes project=True so it never touches the user-scope skill. Verified: claude/bare uninstall now remove the tree and keep a sibling user_notes.md; full suite 1755 passed; real extract still builds a clean graph. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+11
-4
@@ -1534,7 +1534,7 @@ def _project_uninstall(platform_name: str, project_dir: Path | None = None) -> N
|
||||
if platform_name in ("claude", "windows"):
|
||||
_remove_skill_file(platform_name, project=True, project_dir=project_dir)
|
||||
_remove_claude_skill_registration(project_dir)
|
||||
claude_uninstall(project_dir)
|
||||
claude_uninstall(project_dir, project=True)
|
||||
elif platform_name == "gemini":
|
||||
gemini_uninstall(project_dir, project=True)
|
||||
elif platform_name == "cursor":
|
||||
@@ -1764,9 +1764,16 @@ def uninstall_all(project_dir: Path | None = None, purge: bool = False) -> None:
|
||||
print("\nDone. Run 'pip uninstall graphifyy' to remove the package itself.")
|
||||
|
||||
|
||||
def claude_uninstall(project_dir: Path | None = None) -> None:
|
||||
"""Remove the graphify section from the local CLAUDE.md."""
|
||||
target = (project_dir or Path(".")) / "CLAUDE.md"
|
||||
def claude_uninstall(project_dir: Path | None = None, *, project: bool = False) -> None:
|
||||
"""Remove the graphify skill tree (SKILL.md + references/) and the CLAUDE.md section.
|
||||
|
||||
Mirrors gemini_uninstall: the bare `graphify uninstall` and `graphify claude
|
||||
uninstall` must remove the installed skill, not just strip CLAUDE.md, or the
|
||||
progressive-disclosure tree (SKILL.md + references/) is orphaned (#1121).
|
||||
"""
|
||||
project_dir = project_dir or Path(".")
|
||||
_remove_skill_file("claude", project=project, project_dir=project_dir)
|
||||
target = project_dir / "CLAUDE.md"
|
||||
|
||||
if not target.exists():
|
||||
print("No CLAUDE.md found in current directory - nothing to do")
|
||||
|
||||
Reference in New Issue
Block a user