Skip to content

fix(skill): prevent re-install from wiping skills when source equals destination#5

Merged
aidenybai merged 1 commit into
mainfrom
fix/skill-reinstall-wipe
Jun 24, 2026
Merged

fix(skill): prevent re-install from wiping skills when source equals destination#5
aidenybai merged 1 commit into
mainfrom
fix/skill-reinstall-wipe

Conversation

@aidenybai

Copy link
Copy Markdown
Member

Summary

  • Re-running skill add could leave SKILL.md empty/stale because .agents/skills (the canonical install destination) is also a skill-discovery path. Discovery would select the already-installed copy as the source, then the installer rm'd the destination before copying — deleting the source and copying an empty dir.
  • Added a syncDirectory helper that no-ops when source and destination resolve to the same path, and stages overlapping sources to a temp dir before cleaning. Routed installByCopy, installBySymlink, and the symlink→copy fallback through it.
  • Normal updates (source != destination) still propagate edits as before.

Test plan

  • Added regression test: preserves content when the source path is the canonical destination
  • Reproduced the wipe before the fix; confirmed content preserved + agent symlink created after
  • Verified normal edit + re-run still updates installed SKILL.md
  • pnpm build && pnpm typecheck && pnpm lint && pnpm test all green (371 passing)
  • Changeset added (patch)

…destination

When a skill's discovered source path is the same as (or overlaps) the
install destination (e.g. authoring skills directly in .agents/skills),
the installer cleaned the destination before copying, deleting the source
and leaving an empty/stale SKILL.md.

Route all copy paths through a syncDirectory helper that no-ops when source
and destination resolve to the same path and stages overlapping sources
before cleaning. Add a regression test.
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-install-website Ready Ready Preview, Comment Jun 24, 2026 9:31am

@aidenybai aidenybai merged commit 34e52b2 into main Jun 24, 2026
4 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.

1 participant