* library: a skill copied into an agent where it can't be linked is copied again when the library's changes
Where magpie can't make a link (Windows without Developer Mode, where
os.Symlink needs a privilege), link() gives the agent a copy of the
library's skill instead, marked as magpie's. syncSkills then took any
entry of its own as done, so the copy stayed as it was first made: an
update of a skill from GitHub (UpdateSkill, Update all), or a change to
the skill's files in the library's folder, never reached Claude Code,
Codex or any other agent on such a machine, while a link shows the new
files at once. The project skills already keep their copies up with the
library's (Project.place compares hashDir and copies again).
syncSkills now does the same for an agent's copy: when hashDir of the
copy differs from the library's skill, a new copy is made beside it and
put in its place. A link, or a library skill that can't be read, is left
as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* library: move the old copy of a skill aside before putting the new one in
copyIn removed the agent's old copy in place and then renamed the new
one in. When a file in the old copy can't be removed (held open by an
antivirus, an editor or the agent on Windows), the removal fails
part-way and leaves a copy with no SKILL.md and no marker; magpie then
no longer knows it for its own and every later sync refuses the skill.
Rename an old copy aside to .<name>.magpie-old, rename the new copy into
place, and remove the old one best effort. If the new copy can't go in,
the old one is put back. A link is still replaced in one step. Leftovers
are removed on the next sync and when the skill is taken away.
* library: test the swap for a WSL agent's copy too
A t.Copy target (an agent in WSL) gets its copy made again through the
same move-aside swap: with a file in the old copy that can't be removed,
the agent still gets the whole new copy that magpie knows for its own,
and the leftover is cleared by a later sync. Fails with an unlink-first
swap.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>