math_milian (Discord #feedback, 11-06) still saw skills twice after
d487aaab7. That commit kept the library's link out of a reader's own
folder only when ~/.agents/skills held the same files under the same
folder name. Pi, Codex, Gemini, Kimi Code and the other readers of that
folder still got a second copy when the user's entry there:
- had other files (an update through `npx skills`, a local edit), or
- sat under another folder name with the same SKILL.md name (Pi goes by
the frontmatter name; real Pi 1.4.0 warns `name "hunk-review"
collision` for both cases with magpie's link beside it, and loads the
user's alone with no diagnostics once the link is gone).
readSharedOwn/sharedOwn.rival now finds the user's entry by folder
name or SKILL.md name. A same-tree one counts as the library's (as
before). A differing one gets no second copy: it raises the Own problem
("{agent} already has a skill of its own called X"), whose Use the
library's sets the shared entry aside with the backups and gives the
link, and whose Keep {agent}'s unticks it. Agents that don't read the
folder (Claude Code) keep their link. Old users' second links go on
the next sync (the GUI syncs at start), through the existing unlink.
TestKimiSweepLeavesTheUsersOwnSharedSkills and TestSkillsWhereShared
assumed a differing same-name user skill gave the library's again;
they now expect the Own problem and no second link.
Run (mote, at this tree on cd9c52c16):
- go test -tags nogui -count=1 ./internal/library ./internal/cli
./internal/gui: ok
- GOOS=linux/windows go vet -tags nogui ./internal/library, go vet: ok;
gofmt -l clean
- win-run: TestSharedCopy*, TestSharedOwn*, TestSkillsWhereShared,
TestKimiSweep*: ok
- probe in a sandbox HOME, skill ticked for claude, codex, pi, gemini,
opencode: same tree / other files / other folder name / shared link
elsewhere; before, the last-but-one two gave pi, codex, gemini a
second entry; after, none (OpenCode merges ~/.claude/skills with
~/.agents/skills by id, so it never shows two)
- real Pi 1.4.0 loader on mote for the two cases, before and after
Broken by hand:
- rival matching same-tree only: TestSharedCopyNotGivenTwice and
TestSharedOwnSettled red
- readSharedOwn keyed by folder name only: TestSharedCopyOtherFolderName
red (.pi, .codex, .gemini still have a second one)
Not tried: the reporter's own tree (asked for), the real GUI's Use/Keep
buttons on this problem, WSL/Linux runs, a Pi or omp of unknown version
(still given its own, in docs' Not covered).
Reported-by: math_milian