fix(#4002): rewrite zcode command @-refs to the zcode runtime home (#4188)

* test(#4002): zcode commands must rewrite at-refs to the zcode home

* fix(#4002): add the missing zcode case to the runtime rewrite engine

* chore(#4002): add ZCode to the bug-report runtime dropdown and drop the changeset

* fix(#4002): attribute zcode command and skill ripples to the rewrite engine

* fix(#4002): attribute zcode nested-skill ripples to the rewrite engine

* chore(#4002): backfill changeset pr number

* fix: bump qs past GHSA-x5fp-wj9c-mxmx (transitive, advisory reddened next)

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-02 12:19:41 -04:00
committed by GitHub
parent acb903c2e8
commit dce40eeb6e
6 changed files with 123 additions and 16 deletions

View File

@@ -3177,6 +3177,21 @@ function _applyRuntimeRewrites(content, runtime, pathPrefix, isGlobal = false, a
content = processAttribution(content, attribution);
break;
case 'zcode':
// #4002: ZCode is a Claude-Code-shaped host (dot-home `.zcode`, `@~`-ref
// expansion, `~/.zcode/...` documented paths) whose commands install with
// `converter: null` — this pass is their only chance to receive
// runtime-correct paths. Same shape as `claude`, including the tilde
// restore: the tilde form is what ZCode expands and what its docs use.
// `${_GSD_RUNTIME_ROOT}/.claude/…` matches none of these regexes and
// survives as the project-local fallback, exactly as on every sibling.
content = content.replace(/~\/\.claude\//g, pathPrefix);
content = content.replace(/\$HOME\/\.claude\//g, pathPrefix);
content = content.replace(/\.\/\.claude\//g, `./${dirName}/`);
content = restoreClaudeGlobalAtRefTilde(content, pathPrefix);
content = processAttribution(content, attribution);
break;
default:
// Unknown runtime — no rewrites (OpenCode/Kilo handled by their own install path).
break;