fix(symlinks): Clean git index when migrating directory to symlink#33
fix(symlinks): Clean git index when migrating directory to symlink#33
Conversation
When a real skills directory (e.g. .claude/skills/) contains files previously tracked by git, replacing it with a symlink causes git to error with "beyond a symbolic link". Run `git rm --cached` on the directory during migration to clear stale index entries. Co-Authored-By: Claude <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/uvNWVFn7VxnO_y4YuhSoZGROZ_CkZSN2imoRF7EvY6s
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| // Verify the skill was moved to .agents/skills/ | ||
| const agentsEntries = await readdir(join(agentsDir, "skills")); | ||
| expect(agentsEntries).toContain("my-skill"); | ||
| }); |
There was a problem hiding this comment.
Symlink tests now require git installed
Medium Severity
The new test invokes exec("git", ...) directly, so the suite fails in environments where git isn’t available on PATH (or is blocked by sandboxing). This introduces a new external dependency for running vitest that can break CI or downstream consumers running tests in minimal containers.
There was a problem hiding this comment.
False positive — the test suite already requires git. Four other test files (install.test.ts, update.test.ts, remove.test.ts, resolver.integration.test.ts) call exec("git", ...) directly.


When a user has a pre-existing skill committed as a real file (e.g.,
.claude/skills/writing-assistant/SKILL.md) and then runsdotagents install,the tool migrates the files to
.agents/skills/and replaces.claude/skills/with a symlink. However, git's index still references the old paths, causing:
This adds a best-effort
git rm -r --cached --ignore-unmatchcall during thedirectory-to-symlink migration to clear stale index entries. The call is wrapped
in a try/catch so it silently does nothing when not in a git repo or when git
isn't available.
Agent transcript: https://claudescope.sentry.dev/share/vQlVJtcuM0_Rd7Nt57nIDj-P25tfFxeMXzKe9exg_M8