From cd47d9d31764a2a35dba8394f90e7b260519f81b Mon Sep 17 00:00:00 2001 From: Joe Slitzker Date: Sat, 20 Jun 2026 13:40:29 -0500 Subject: [PATCH] fix(#1477): scope .gsd-source marker write to claude global; add PR ref to changeset Address review on #1487: - Scope the marker write to runtime === 'claude' && isGlobal, matching issue #1477. The Claude global skills layout is the only install path that ships the skills layout without a commands/gsd source tree; every other runtime/scope deploys commands/gsd, so walk-up already resolves. - Add the trailing (#1487) reference to the changeset body per PRED.k329.body. Claude-Session: https://claude.ai/code/session_01XNT3SWgzjmEycNuweURDme --- .changeset/brave-hawks-fly.md | 2 +- bin/install.js | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.changeset/brave-hawks-fly.md b/.changeset/brave-hawks-fly.md index c87926d19..a2f75e972 100644 --- a/.changeset/brave-hawks-fly.md +++ b/.changeset/brave-hawks-fly.md @@ -2,4 +2,4 @@ type: Fixed pr: 1487 --- -**`/gsd-surface` works on Claude Code global installs** — the installer now writes a `.gsd-source` marker and install-exports resolve in the deployed layout, so `list`/`status` and `profile`/`enable`/`disable`/`reset` no longer throw `could not locate commands/gsd` or `MODULE_NOT_FOUND`. +**`/gsd-surface` works on Claude Code global installs** — the installer now writes a `.gsd-source` marker and install-exports resolve in the deployed layout, so `list`/`status` and `profile`/`enable`/`disable`/`reset` no longer throw `could not locate commands/gsd` or `MODULE_NOT_FOUND`. (#1487) diff --git a/bin/install.js b/bin/install.js index 51987bdf6..3f82cbbf0 100755 --- a/bin/install.js +++ b/bin/install.js @@ -10035,13 +10035,19 @@ function install(isGlobal, runtime = 'claude', options = {}) { // the writer half of the marker that runtime-artifact-layout.cjs's finders // already read (the reader landed in #1476). It points at the package's own // commands/gsd source, whose parent also holds bin/install.js — the path - // loadInstallExports derives the installer exports from. Guarded on source - // presence so a half-published package never writes a dangling marker. - const gsdSourceCommands = path.join(src, 'commands', 'gsd'); - if (fs.existsSync(gsdSourceCommands)) { - try { - fs.writeFileSync(path.join(targetDir, '.gsd-source'), gsdSourceCommands + '\n', 'utf8'); - } catch (_) { /* non-fatal: surface degrades to walk-up resolution */ } + // loadInstallExports derives the installer exports from. Scoped to the + // Claude-global layout (issue #1477) — the only install path that ships the + // skills layout without a commands/gsd source tree; every other runtime/scope + // deploys commands/gsd, so its walk-up already resolves and needs no marker. + // Guarded on source presence so a half-published package never writes a + // dangling marker. + if (runtime === 'claude' && isGlobal) { + const gsdSourceCommands = path.join(src, 'commands', 'gsd'); + if (fs.existsSync(gsdSourceCommands)) { + try { + fs.writeFileSync(path.join(targetDir, '.gsd-source'), gsdSourceCommands + '\n', 'utf8'); + } catch (_) { /* non-fatal: surface degrades to walk-up resolution */ } + } } // Copy shared manifests into the gsd-core payload