Skip to content

fix(skills): delete side-loaded skills and name unnamed skills by directory - #549

Merged
huichen merged 4 commits into
mainfrom
claude/skill-delete-fix
Sep 10, 2026
Merged

huichen merged 4 commits into
mainfrom
claude/skill-delete-fix

Conversation

@huichen

@huichen huichen commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

The desktop Skills page could list a skill whose delete button silently did nothing, and unnamed skills all collapsed into one entry literally named SKILL.

First seen with side-loaded SKILL.md files that have no name: frontmatter:

~/.future/agent/skills/future-a/SKILL.md   ->  ---\nversion: 0.9\n---

Causes

  1. Agent discovery named unnamed skills after the entry file. extract_name fell back to path.file_stem(), and every skill entry file is called SKILL.md — so all unnamed skills became SKILL. discover_skills skips duplicate names, collapsing them into a single entry, and uninstall_skill then deleted the directory <scope>/SKILL, which never exists. Nothing the GUI could click would ever remove the real directories.
  2. Uninstall only tried <scope>/<id>. Any skill whose reported name differs from its directory (side-loaded, or nested one level below a scope root) was undeletable even once it had a distinct name.

Changes

  • agent/src/skills/mod.rs: the name fallback is now the skill directory (the install id), matching how the CLI and the desktop address a skill.
  • desktop/src-tauri/src/skills.rs: uninstall_skill sweeps every directory the agent would list under that name — the same two-level walk discovery uses — across every scope, and skill_name mirrors the agent's name resolution.
  • Home resolution: the CLI resolved ~/.future/agent through raw dirs::home_dir(), which on Windows reads the token profile and ignores a redirected HOME. Installs through future skills install could land outside the tree the agent discovers, and the CLI test suite wrote skill/auth/models fixtures into the developer's real profile (this is how the fixtures above ended up in a real ~/.future/agent/skills). cli (skills dir, image output dir, auth_file, doctor's agent dir) and the agent's own tilde expansion now use the agent's home policy (HOME, then USERPROFILE); shellexpand is dropped as it is the last user of the old resolution.

Tests

  • unnamed_skills_keep_distinct_names, extract_name_falls_back_to_the_skill_directory, expand_tilde_follows_the_redirected_home (agent)
  • skills_dir_follows_the_redirected_home (cli)
  • uninstall_removes_nameless_skills_by_directory_name, uninstall_removes_skills_whose_name_differs_from_their_directory, skill_name_falls_back_to_the_directory (desktop)

Verified: cargo test -p future-agent --lib skills::, cargo test -p future-cli --lib skills::, cargo test --manifest-path desktop/src-tauri/Cargo.toml --lib skills::, plus cargo fmt --check and cargo clippy --all-targets -- -D warnings for the touched crates. Remaining failures in the full local suites are pre-existing on Windows and unrelated (Expand-Archive exit codes, git/remote fixtures, macOS-only dead code under --all-targets); CI runs Linux/macOS.

The desktop Skills page could show a skill whose delete button did nothing,
and unnamed skills all collapsed into a single 'SKILL' entry.

Two independent causes:

* agent discovery fell back to the SKILL.md *file* name when frontmatter has
  no
ame:. Every skill entry file is called SKILL.md, so all unnamed skills
  were named 'SKILL'; duplicate names are skipped during discovery, collapsing
  them into one entry that no directory can satisfy.
* the desktop uninstall only removed <scope>/<id>, so any skill whose reported
  name differs from its directory (side-loaded, or one level deeper) could not
  be deleted at all.

Discovery now falls back to the skill directory (the install id), and
uninstall sweeps every directory the agent would list under that name, in every
scope, matching the two-level walk discovery uses.

Also stop the CLI resolving ~/.future/agent through raw dirs::home_dir(): on
Windows that reads the token profile and ignores a redirected HOME, so command
line installs landed outside the tree the agent discovers, and the test suite
wrote skill/auth/models fixtures into the developer's real profile. The CLI
(image output dir included) and the agent's own tilde expansion now use the
agent's home policy (HOME, then USERPROFILE).
@huichen
huichen enabled auto-merge (squash) September 10, 2026 14:29
@huichen
huichen merged commit 8ae54ff into main Sep 10, 2026
12 checks passed
@huichen
huichen deleted the claude/skill-delete-fix branch September 10, 2026 14:48
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.

1 participant