fix: remove marketing text from runtime prompt, fix #1656 and #1657 (#1672)

* chore: ignore .worktrees directory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(install): remove marketing taglines from runtime selection prompt

Closes #1654

The runtime selection menu had promotional copy appended to some
entries ("open source, the #1 AI coding platform on OpenRouter",
"open source, free models"). Replaced with just the name and path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(kilo): update test to assert marketing tagline is removed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(tests): use process.execPath so tests pass in shells without node on PATH

Three test patterns called bare `node` via shell, which fails in Claude Code
sessions where `node` is not on PATH:

- helpers.cjs string branch: execSync(`node ...`) → execFileSync(process.execPath)
  with a shell-style tokenizer that handles quoted args and inner-quote stripping
- hooks-opt-in.test.cjs: spawnSync('bash', ...) for hooks that call `node`
  internally → spawnHook() wrapper that injects process.execPath dir into PATH
- concurrency-safety.test.cjs: exec(`node ...`) for concurrent patch test
  → exec(`"${process.execPath}" ...`)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: resolve #1656 and #1657 — bash hooks missing from dist, SDK install prompt

#1656: Community bash hooks (gsd-session-state.sh, gsd-validate-commit.sh,
gsd-phase-boundary.sh) were never included in HOOKS_TO_COPY in build-hooks.js,
so hooks/dist/ never contained them and the installer could not copy them to
user machines. Fixed by adding the three .sh files to the copy array with
chmod +x preservation and skipping JS syntax validation for shell scripts.

#1657: promptSdk() called installSdk() which ran `npm install -g @gsd-build/sdk`
— a package that does not exist on npm, causing visible errors during interactive
installs. Removed promptSdk(), installSdk(), --sdk flag, and all call sites.

Regression tests in tests/bugs-1656-1657.test.cjs guard both fixes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: sort runtime list alphabetically after Claude Code

- Claude Code stays pinned at position 1
- Remaining 10 runtimes sorted A-Z: Antigravity(2), Augment(3), Codex(4),
  Copilot(5), Cursor(6), Gemini(7), Kilo(8), OpenCode(9), Trae(10), Windsurf(11)
- Updated runtimeMap, allRuntimes, and prompt display in promptRuntime()
- Updated multi-runtime-select, kilo-install, copilot-install tests to match

Also fix #1656 regression test: run build-hooks.js in before() hook so
hooks/dist/ is populated on CI (directory is gitignored; build runs via
prepublishOnly before publish, not during npm ci).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-04 14:15:30 -04:00
committed by GitHub
parent e66f7e889e
commit ca6a273685
9 changed files with 194 additions and 173 deletions

View File

@@ -18,6 +18,18 @@ const { spawnSync } = require('child_process');
const HOOKS_DIR = path.join(__dirname, '..', 'hooks');
const isWindows = process.platform === 'win32';
// Ensure the running node binary is on PATH so bash hooks can call `node`
// (Claude Code shell sessions do not have `node` on PATH).
const hookEnv = {
...process.env,
PATH: `${path.dirname(process.execPath)}:${process.env.PATH || '/usr/local/bin:/usr/bin:/bin'}`,
};
// Wrapper that always injects hookEnv so bash hooks can find `node`.
function spawnHook(hookPath, options) {
return spawnSync('bash', [hookPath], { ...options, env: hookEnv });
}
// ─── Helpers ────────────────────────────────────────────────────────────────
function createTempProject(prefix = 'gsd-hook-test-') {
@@ -212,7 +224,7 @@ describe('opt-in gating behavior', { skip: isWindows ? 'bash hooks require unix
tool_input: { command: 'git commit -m "WIP save"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -231,7 +243,7 @@ describe('opt-in gating behavior', { skip: isWindows ? 'bash hooks require unix
});
try {
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: bareDir,
@@ -248,7 +260,7 @@ describe('opt-in gating behavior', { skip: isWindows ? 'bash hooks require unix
writeMinimalStateMd(tmpDir);
const hookPath = path.join(HOOKS_DIR, 'gsd-session-state.sh');
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input: '',
encoding: 'utf-8',
cwd: tmpDir,
@@ -269,7 +281,7 @@ describe('opt-in gating behavior', { skip: isWindows ? 'bash hooks require unix
tool_input: { file_path: '.planning/STATE.md' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -305,7 +317,7 @@ describe('hook execution when enabled', { skip: isWindows ? 'bash hooks require
tool_input: { command: 'git commit -m "fix(core): add locking mechanism"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -320,7 +332,7 @@ describe('hook execution when enabled', { skip: isWindows ? 'bash hooks require
tool_input: { command: 'git commit -m "WIP save"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -337,7 +349,7 @@ describe('hook execution when enabled', { skip: isWindows ? 'bash hooks require
tool_input: { command: 'git push origin main' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -350,7 +362,7 @@ describe('hook execution when enabled', { skip: isWindows ? 'bash hooks require
writeMinimalStateMd(tmpDir);
const hookPath = path.join(HOOKS_DIR, 'gsd-session-state.sh');
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input: '',
encoding: 'utf-8',
cwd: tmpDir,
@@ -371,7 +383,7 @@ describe('hook execution when enabled', { skip: isWindows ? 'bash hooks require
const hookPath = path.join(HOOKS_DIR, 'gsd-session-state.sh');
try {
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input: '',
encoding: 'utf-8',
cwd: noStateDir,
@@ -393,7 +405,7 @@ describe('hook execution when enabled', { skip: isWindows ? 'bash hooks require
tool_input: { file_path: '.planning/STATE.md' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -429,7 +441,7 @@ describe('hook security tests', { skip: isWindows ? 'bash hooks require unix she
tool_input: { command: 'git commit -m "$(rm -rf /)"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -445,7 +457,7 @@ describe('hook security tests', { skip: isWindows ? 'bash hooks require unix she
tool_input: { command: 'git commit -m "`whoami`"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -461,7 +473,7 @@ describe('hook security tests', { skip: isWindows ? 'bash hooks require unix she
tool_input: { command: 'git commit -m "fix(api/v2): handle edge case"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -474,7 +486,7 @@ describe('hook security tests', { skip: isWindows ? 'bash hooks require unix she
const hookPath = path.join(HOOKS_DIR, 'gsd-phase-boundary.sh');
const input = 'not json at all';
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,
@@ -495,7 +507,7 @@ describe('hook security tests', { skip: isWindows ? 'bash hooks require unix she
tool_input: { command: 'git commit -m "WIP save"' }
});
const result = spawnSync('bash', [hookPath], {
const result = spawnHook(hookPath, {
input,
encoding: 'utf-8',
cwd: tmpDir,