fix(cli): resolve the Windows skills junction against the link directory - #495
Open
blurrah wants to merge 3 commits into
Open
fix(cli): resolve the Windows skills junction against the link directory#495blurrah wants to merge 3 commits into
blurrah wants to merge 3 commits into
Conversation
…process installs create-vercel-shop already downloads the full repo tarball, so extract packages/plugin/skills into .agents/skills/ (with per-skill Claude Code symlinks in .claude/skills/, copy fallback) and packages/plugin/commands into .claude/commands/ from the same single fetch. - Removes the three post-scaffold 'npx plugins add' subprocesses, which ran even when the dependency install failed - Skills are now versioned with the scaffolded project and always as fresh as main at scaffold time - --no-template now inlines only the agent assets into an existing project and returns 1 cleanly when the download fails - Companion plugins (vercel/vercel-plugin, Shopify/shopify-ai-toolkit) are recommended via printed commands instead of auto-installed - Updated template AGENTS.md/README, init-vercel-shop, build-shop, and update-shop skills, and the docs pages describing the flow; ran the docs skill sync script Co-Authored-By: Boris Besemer <borisbesemer@gmail.com>
The `.claude/skills/<name>` link was created with a relative target (`../../.agents/skills/<name>`). Node resolves a relative target for a junction against `process.cwd()` rather than the link's own directory, so scaffolding from anywhere but the project's parent produced a junction aimed at a path that does not exist — silently, since the call succeeds. Resolve the target against the link's directory on Windows. POSIX symlinks keep the relative target so a scaffolded project stays movable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Boris Besemer <2852507+blurrah@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to @boris's review of #492 after #493 merged into that branch. Targets
blurra/inline-skills-scaffoldso the fix ships with #492 — that branch is where the junction is created (apps/cli/index.mjs).Problem
inlineAgentAssetslinked.claude/skills/<name>to the canonical copy with a bare relative target:POSIX symlinks resolve that against the link's own directory, so it works. Windows junctions are always absolute, and Node resolves a relative
targetwithpath.resolve(target)— againstprocess.cwd(), not the link's directory. Scaffolding from anywhere other than the project's parent therefore produced a junction pointing somewhere else entirely, andfs.symlinkstill succeeded, so nothing surfaced the problem: Claude Code just found no project skills.Simulating Node's junction handling with
path.win32, cwdC:\Users\me, projectD:\work\my-shop:Solution
New exported
skillLinkTarget(link, canonical, platform)computes the target from the link's own directory:dirname(link), so the junction is correct regardless of the working directory.The
catchfallback to a plain copy (Windows without Developer Mode) is unchanged.Tests
apps/cli/index.test.mjsgrows 3 cases (22 total, all passing):skillLinkTargetreturns../../.agents/skills/<name>on POSIX.skillLinkTargetreturns an absolute, link-relative path onwin32— this is the regression guard; it fails against the pre-fix behavior (verified by reverting the platform branch locally:not ok 21, 21 pass / 1 fail).inlineAgentAssetsrun withprocess.chdir()set to an unrelated directory still produces a link whose target resolves to.agents/skills/<name>from the link's directory.Docs
No change needed — the troubleshooting entry only says
.claude/skills/should link to.agents/skills/, which is now true on Windows too.🤖 Generated with Claude Code