Commit Graph

1642 Commits

Author SHA1 Message Date
Jeremy McSpadden
84de0cc760 fix(install): comprehensive audit cleanup of hook copy, uninstall, and manifest (#1755) (#1768)
- Add chmod +x for .sh hooks during install (fixes #1755 permission denied)
- Fix Codex hook: wrong path (get-shit-done/hooks/) and inverted filename (gsd-update-check.js → gsd-check-update.js)
- Fix cache invalidation path from ~/cache/ to ~/.cache/gsd/
- Track .sh hooks in writeManifest so saveLocalPatches detects modifications
- Add gsd-workflow-guard.js to uninstall file cleanup list
- Add community hooks (session-state, validate-commit, phase-boundary) to uninstall settings.json cleanup
- Remove phantom gsd-check-update.sh from uninstall list
- Remove dead isCursor/isWindsurf branches in uninstall (already handled by combined branch)
- Warn when expected .sh hooks are missing after verifyInstalled
- Add 15 regression tests in install-hooks-copy.test.cjs
- Update codex-config.test.cjs assertions for corrected hook filename

Fixes #1755
2026-04-05 11:37:27 -04:00
Tom Boucher
c7d25b183a fix(commands): replace undefined $GSD_TOOLS with resolved path (#1766) (#1769)
workstreams.md referenced $GSD_TOOLS (6 occurrences) which is never
defined anywhere in the system. All other 60+ command files use the
standard $HOME/.claude/get-shit-done/bin/gsd-tools.cjs path. The
undefined variable resolves to empty string, causing all workstream
commands to fail with module not found.

Fixes #1766

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 11:30:38 -04:00
Tom Boucher
cfff82dcd2 fix(workflow): protect orchestrator files during worktree merge (#1756) (#1764)
When a worktree branch outlives a milestone transition, git merge
silently overwrites STATE.md and ROADMAP.md with stale content and
resurrects archived phase directories. Fix by backing up orchestrator
files before merge, restoring after, and detecting resurrected files.

Fixes #1761

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 11:11:38 -04:00
Tom Boucher
17c65424ad ci: auto-close draft PRs with policy message (#1765)
- Add close-draft-prs.yml workflow that auto-closes draft PRs with
  explanatory comment directing contributors to submit completed PRs
- Update CONTRIBUTING.md with "No draft PRs" policy
- Update default PR template with draft PR warning

Closes #1762

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 11:11:16 -04:00
Tom Boucher
6bd786bf88 test: add stale /gsd: colon reference regression guard (#1753)
* test: add stale /gsd: colon reference regression guard

Fixes #1748

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

* fix: replace 39 stale /gsd: colon references with /gsd- hyphen format

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 10:23:41 -04:00
Tom Boucher
b34da909a3 Revert "test: add stale /gsd: colon reference regression guard"
This reverts commit f2c9b30529.
2026-04-05 10:03:04 -04:00
Tom Boucher
f2c9b30529 test: add stale /gsd: colon reference regression guard
Fixes #1748

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 09:58:02 -04:00
Tom Boucher
6317603d75 docs: add welcome back notice and update highlights to v1.33.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 09:38:57 -04:00
Tom Boucher
949da16dbc chore(release): v1.33.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v1.33.0
2026-04-05 09:25:43 -04:00
Tibsfox
89c2469ff2 feat(config): apply ~/.gsd/defaults.json as fallback for pre-project commands (#1738)
* feat(config): apply ~/.gsd/defaults.json as fallback for pre-project commands (#1683)

When .planning/config.json is missing (e.g., running GSD commands outside
a project), loadConfig() now checks ~/.gsd/defaults.json before returning
hardcoded defaults. This lets users set preferred model_profile,
context_window, subagent_timeout, and other settings globally.

Only whitelisted keys are merged — unknown keys in defaults.json are
silently ignored. If defaults.json is missing or contains invalid JSON,
the hardcoded defaults are returned as before.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): scope defaults.json fallback to pre-project context only

Only consult ~/.gsd/defaults.json when .planning/ does not exist (truly
pre-project). When .planning/ exists but config.json is missing, return
hardcoded defaults — avoids interference with tests and initialized
projects. Use GSD_HOME env var for test isolation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 09:15:41 -04:00
Tom Boucher
381b4584f8 fix: stale hooks scanner ignores orphaned files from removed features (#1751)
The stale hooks detector in gsd-check-update.js used a broad
`startsWith('gsd-') && endsWith('.js')` filter that matched every
gsd-*.js file in the hooks directory. Orphaned hooks from removed
features (e.g., gsd-intel-*.js) lacked version headers and were
permanently flagged as stale, with no way to clear the warning.

Replace the broad wildcard with a MANAGED_HOOKS allowlist of the 6
JS hooks GSD currently ships. Orphaned files are now ignored.

Regression test verifies: (1) no broad wildcard filter, (2) managed
list matches build-hooks.js HOOKS_TO_COPY, (3) orphaned filenames
are excluded.

Fixes #1750

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 09:15:19 -04:00
Jeremy McSpadden
931fef5425 fix: add Kilo path replacement in copyFlattenedCommands (#1710)
Fixes #1709

copyFlattenedCommands replaced ~/.opencode/ paths but had no
equivalent ~/.kilo/ replacement. Adds kiloDirRegex for symmetric
path handling between the OpenCode and Kilo install pipelines.
2026-04-04 16:17:11 -04:00
Jeremy McSpadden
771259597b refactor: deduplicate config defaults into CONFIG_DEFAULTS constant (#1708)
Fixes #1707

Extracts config defaults from loadConfig() into an exported
CONFIG_DEFAULTS constant in core.cjs. config.cjs and verify.cjs
now reference CONFIG_DEFAULTS instead of duplicating values,
preventing future divergence.
2026-04-04 16:17:09 -04:00
Jeremy McSpadden
323ba83e2b docs: add /gsd-secure-phase and /gsd-docs-update to COMMANDS.md (#1706)
Fixes #1705

Both commands have command files, workflows, and backing agents but
were missing from the user-facing command reference.
2026-04-04 16:17:07 -04:00
Jeremy McSpadden
30a8777623 docs: add 3 missing agents to AGENTS.md and fix stale counts (#1703)
Fixes #1702

- Title: 18 → 21 agents
- Categories table: added Doc Writers (2), Profilers (1), bumped
  Auditors from 2 → 3 (security-auditor)
- Added full detail sections for gsd-doc-writer, gsd-doc-verifier,
  gsd-security-auditor with roles, tools, spawn patterns, and
  key behaviors
- Added 3 agents to tool permissions summary table
2026-04-04 16:17:05 -04:00
Jeremy McSpadden
4e2682b671 docs: update ARCHITECTURE.md with current component counts and missing entries (#1701)
Fixes #1700

- Commands: 44 → 60, Workflows: 46 → 60, Agents: 16 → 21
- Lib modules: 15 → 19, added docs, workstream, schema-detect,
  profile-pipeline, profile-output to CLI Tools table
- Added missing agent categories: security-auditor, doc-writer,
  doc-verifier, user-profiler, assumptions-analyzer
- Fixed stale hook names (gsd-read-before-edit → gsd-read-guard),
  removed non-existent gsd-commit-docs, added shell hooks
- Expanded references section from 8 to all 25 reference files
- Updated file system layout counts to match actual state
2026-04-04 16:17:02 -04:00
Tom Boucher
24c1949986 test: add MODEL_ALIAS_MAP regression test for #1690 (#1698)
Ensures opus, sonnet, and haiku aliases map to current Claude model
IDs (4-6, 4-6, 4-5). Prevents future regressions where aliases
silently resolve to outdated model versions.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 15:52:13 -04:00
Jeremy McSpadden
8d29ecd02f fix: add missing 'act as' injection pattern to prompt guard hook (#1697)
Fixes #1696

The gsd-prompt-guard.js hook was missing the 'act as a/an/the' prompt
injection pattern that security.cjs includes. Adds the pattern with
the same (?!plan|phase|wave) negative lookahead exception to allow
legitimate GSD workflow references.
2026-04-04 15:50:04 -04:00
Jeremy McSpadden
fa57a14ec7 fix: resolve REG-04 — frontmatter inline array parser now respects quoted commas (#1695)
Fixes #1694

The inline array parser used .split(',') which ignored quote boundaries,
splitting "a, b" into two items. Replaced with a quote-aware splitter
that tracks single/double quote state.

Updated REG-04 test to assert correct behavior and added coverage for
single-quoted and mixed-quote inline arrays.
2026-04-04 15:50:01 -04:00
Jeremy McSpadden
839ea22d06 fix: replace shell sleep with cross-platform Atomics.wait in planning lock (#1693)
Fixes #1692

spawnSync('sleep', ['0.1']) fails silently on Windows (ENOENT),
causing a tight busy-loop during lock contention. Atomics.wait()
provides a cross-platform 100ms blocking wait available in Node 22+.
2026-04-04 15:49:59 -04:00
Jeremy McSpadden
ade67cf9f9 fix: update MODEL_ALIAS_MAP to current Claude model IDs (#1691)
Fixes #1690

- opus: claude-opus-4-0 → claude-opus-4-6
- sonnet: claude-sonnet-4-5 → claude-sonnet-4-6
- haiku: claude-haiku-3-5 → claude-haiku-4-5

Also updates the stale haiku reference in sdk/src/session-runner.ts
and documentation examples in CONFIGURATION.md (en, ja-JP, ko-KR).
2026-04-04 15:49:56 -04:00
Tom Boucher
f6d2cf2a4a docs: add Chore / Maintenance issue template (#1689)
Internal improvements (refactoring, CI/CD, test quality, dependency
updates, tech debt) had no dedicated template, forcing contributors
to misuse Enhancement or Feature Request forms. This adds a focused
template with appropriate fields and auto-labels (type: chore,
needs-triage).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 15:38:21 -04:00
Tom Boucher
7185803543 fix(install): apply path replacement in copyCommandsAsClaudeSkills (#1677)
* ci: drop Windows runner, add static hardcoded-path detection

Replace the Windows CI runner with a static analysis test that catches
the same class of platform-specific path bugs (C:\, /home/, /Users/,
/tmp/) without requiring an actual Windows machine.

- tests/hardcoded-paths.test.cjs: new static scanner that checks string
  literals in all source JS/CJS files for hardcoded platform paths;
  runs on Linux/macOS in <100ms and fires on every PR
- .github/workflows/test.yml: remove windows-latest from matrix; switch
  macOS smoke-test runner from Node 22 → Node 24 (the declared standard)
- package.json: bump engines.node from >=20.0.0 to >=22.0.0 (Node 20
  reached EOL April 2026)

Matrix goes from 4 runners → 3 runners per run:
  ubuntu/22  ubuntu/24  macos/24

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

* fix(install): apply path replacement in copyCommandsAsClaudeSkills (#1653)

copyCommandsAsClaudeSkills received pathPrefix as a parameter but never
used it — all 51 SKILL.md files kept hardcoded ~/.claude/ paths even on
local (per-project) installs, causing every skill's @-file references
to resolve to a nonexistent global directory.

Add the same three regex replacements that copyCommandsAsCodexSkills
already applies: ~/.claude/ → pathPrefix, $HOME/.claude/ → pathPrefix,
./.claude/ → ./getDirName(runtime)/.

Closes #1653

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 15:12:58 -04:00
Tom Boucher
a6457a7688 ci: drop Windows runner, add static hardcoded-path detection (#1676)
Replace the Windows CI runner with a static analysis test that catches
the same class of platform-specific path bugs (C:\, /home/, /Users/,
/tmp/) without requiring an actual Windows machine.

- tests/hardcoded-paths.test.cjs: new static scanner that checks string
  literals in all source JS/CJS files for hardcoded platform paths;
  runs on Linux/macOS in <100ms and fires on every PR
- .github/workflows/test.yml: remove windows-latest from matrix; switch
  macOS smoke-test runner from Node 22 → Node 24 (the declared standard)
- package.json: bump engines.node from >=20.0.0 to >=22.0.0 (Node 20
  reached EOL April 2026)

Matrix goes from 4 runners → 3 runners per run:
  ubuntu/22  ubuntu/24  macos/24

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:37:54 -04:00
Tom Boucher
2703422be8 refactor(tests): standardize to node:assert/strict and t.after() per CONTRIBUTING.md (#1675)
* refactor(tests): standardize to node:assert/strict and t.after() per CONTRIBUTING.md

- Replace require('node:assert') with require('node:assert/strict') across
  all 73 test files to enforce strict equality (no type coercion)
- Replace try/finally cleanup blocks with t.after() hooks in core.test.cjs
  and hooks-opt-in.test.cjs per the test lifecycle standards
- Utility functions in codex-config and security-scan retain try/finally
  as that is appropriate for per-function resource guards, not lifecycle hooks

Closes #1674

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

* perf(tests): add --test-concurrency=4 to test runner for parallel file execution

Node.js --test-concurrency controls how many test files run as parallel child
processes. Set to 4 by default, configurable via TEST_CONCURRENCY env var.
Fixes tests at a known level rather than inheriting os.availableParallelism()
which varies across CI environments.

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

* fix(security): allowlist verify.test.cjs in prompt-injection scanner

tests/verify.test.cjs uses <human>...</human> as GSD phase task-type
XML (meaning "a human should verify this step"), which matches the
scanner's fake-message-boundary pattern for LLM APIs. This is a
false positive — add it to the allowlist alongside the other test files
that legitimately contain injection-adjacent patterns.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:29:03 -04:00
Rezolv
9bf9fc295d feat(references): add shared behavioral docs and wire into workflows (#1658)
Add 6 shared reference docs that standardize agent behavior across all
GSD workflows:

- universal-anti-patterns.md: 27 behavioral rules across 8 categories
- context-budget.md: 4-tier system (PEAK/GOOD/DEGRADING/POOR) with
  read-depth rules based on context window size
- gate-prompts.md: 14 named prompt patterns for decision points
- revision-loop.md: Check-Revise-Escalate with stall detection (max 3)
- domain-probes.md: domain-specific follow-up questions for 10 domains
- agent-contracts.md: completion markers for all 21 GSD agents

Wire into existing workflows via @-reference includes:
- plan-phase.md: revision-loop, gate-prompts, agent-contracts
- execute-phase.md: agent-contracts, context-budget
- discuss-phase.md: domain-probes, gate-prompts, universal-anti-patterns
2026-04-04 14:16:27 -04:00
monokoo
840b9981d9 fix: add environment-based runtime detection for /gsd-review (#1463)
Replace AI self-identification with env var checks (ANTIGRAVITY_AGENT,
CLAUDE_CODE_ENTRYPOINT) to correctly determine which review CLI to skip.

Fixes incorrect skip behavior when running non-Claude models inside
the Antigravity client.
2026-04-04 14:15:56 -04:00
Tom Boucher
ca6a273685 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>
2026-04-04 14:15:30 -04:00
Tom Boucher
e66f7e889e docs: add typed contribution templates and tighten contributor guidelines (#1673)
Overhaul CONTRIBUTING.md and all GitHub issue/PR templates to enforce a
structured, approval-gated contribution process that cuts down on drive-by
feature submissions.

Changes:
- CONTRIBUTING.md: add Types of Contributions section defining Fix,
  Enhancement, and Feature with escalating requirements and explicit
  rejection criteria; add Issue-First Rule section making clear that
  enhancements require approved-enhancement and features require
  approved-feature label before any code is written; backport gsd-2
  testing standards (t.after() per-test cleanup, array join() fixture
  pattern, Node 24 as primary CI target, test requirements by change type,
  reviewer standards)

- .github/ISSUE_TEMPLATE/enhancement.yml: new template requiring current
  vs. proposed behavior, reason/benefit narrative, full scope of changes,
  and breaking changes assessment; cannot be clicked through

- .github/ISSUE_TEMPLATE/feature_request.yml: full rewrite requiring solo-
  developer problem statement, what is being added, full file-level scope,
  user stories, acceptance criteria, maintenance burden assessment, and
  alternatives considered; incomplete specs are closed, not revised

- .github/pull_request_template.md: converted from general template to a
  routing page directing contributors to the correct typed template;
  using the default template for a feature or enhancement is a rejection
  reason

- .github/PULL_REQUEST_TEMPLATE/fix.md: new typed template requiring
  confirmed-bug label on linked issue and regression test confirmation

- .github/PULL_REQUEST_TEMPLATE/enhancement.md: new typed template with
  hard gate on approved-enhancement label and scope confirmation section

- .github/PULL_REQUEST_TEMPLATE/feature.md: new typed template requiring
  file inventory, spec compliance checklist from the issue, and scope
  confirmation that nothing beyond the approved spec was added

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:03:56 -04:00
Tom Boucher
085f5b9c5b fix(install): remove marketing taglines from runtime selection prompt (#1655)
* 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>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 13:23:15 -04:00
Lex Christopherson
3d4b660cd1 docs: remove npm publish workaround from README
v1.32.0 is now live on npm, so the manual install warning is no longer needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:24:51 -06:00
Tom Boucher
8d6577d101 fix: update Discord invite link from vanity URL to permanent link (#1648)
The discord.gg/gsd vanity link was lost due to a drop in server boosts.
Updated all references to the permanent invite link discord.gg/mYgfVNfA2r
across READMEs, issue templates, install script, and join-discord command.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 09:04:13 -04:00
Tom Boucher
05c08fdd79 docs: restore npm install notice on README, update docs/README.md for v1.32.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:55:07 -04:00
Tom Boucher
c8d7ab3501 docs: fill documentation gaps from v1.32.0 audit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:54:14 -04:00
Tom Boucher
2c36244f08 docs: fill localized documentation gaps from v1.32.0 audit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:52:15 -04:00
Tom Boucher
f6eda30b19 docs: update localized documentation for v1.32.0 release
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:45:55 -04:00
Tom Boucher
acf82440e5 docs: update English documentation for v1.32.0 release
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:28:50 -04:00
Tom Boucher
bfef14bbf7 docs: update all READMEs for v1.32.0 release
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:28:04 -04:00
Tom Boucher
27bc736661 chore: release v1.32.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v1.32.0
2026-04-04 08:19:43 -04:00
Elwin
66368a42d9 feat: add Trae runtime install support (#1566)
* feat: add Trae runtime install support

- Add Trae as a supported runtime in bin/install.js
- Update README and ARCHITECTURE documentation for Trae support
- Add trae-install.test.cjs test file
- Update multi-runtime-select tests for Trae compatibility

* feat(trae): add TRAE_CONFIG_DIR environment variable support

Add support for TRAE_CONFIG_DIR environment variable as an additional way to specify the config directory for Trae runtime, following the same precedence pattern as other runtimes.

* fix(trae): improve slash command conversion and subagent type mapping

Update the slash command regex pattern to properly match and convert command names. Change subagent type mapping from "general-purpose" to "general_purpose_task" to match Trae's conventions. Also add comprehensive tests for Trae uninstall cleanup behavior.

* docs: add Trae and Windsurf to supported runtimes in translations

Update Korean, Japanese, and Portuguese README files to include Trae and Windsurf as supported runtimes in the documentation. Add installation and uninstallation instructions for Trae.

* fix: update runtime selection logic and path replacements

- Change 'All' shortcut from option 11 to 12 to accommodate new runtime
- Update path replacement regex to handle gsd- prefix more precisely
- Adjust test cases to reflect new runtime selection numbering
- Add configDir to trae install options for proper path resolution

* test(trae-install): add tests for getGlobalDir function

Add test cases to verify behavior of getGlobalDir function with different configurations:
- Default directory when no env var or explicit dir is provided
- Explicit directory takes priority
- Respects TRAE_CONFIG_DIR env var
- Priority of explicit dir over env var
- Compatibility with other runtimes
2026-04-04 08:13:15 -04:00
Tom Boucher
f26e1e1141 feat(state): add programmatic gates for STATE.md consistency (#1647)
* feat(state): add programmatic gates for STATE.md consistency

Adds four enforcement gates to prevent STATE.md drift:
- `state validate`: detects drift between STATE.md and filesystem
- `state sync`: reconstructs STATE.md from actual project state
- `state planned-phase`: records state after plan-phase completes
- Performance Metrics update in `phase complete`

Also fixes ghost `state update-position` command reference in
execute-phase.md (command didn't exist in CLI dispatcher).

Closes #1627

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

* fix(state): By Phase table regex ate next section when table body was empty

The lazy [\s\S]*? with a $ lookahead in byPhaseTablePattern would
match past blank lines and capture the next ## section header as table
body when no data rows existed. Replaced with a precise row-matching
pattern ((?:[ \t]*\|[^\n]*\n)*) that only captures pipe-delimited
lines. Added regression assertion to verify row placement.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:01:39 -04:00
Tom Boucher
1e43accd95 feat(autonomous): add --to N flag to stop after specific phase (#1646)
Allows users to run autonomous mode up to a specific phase number.
After the target phase completes, execution halts instead of advancing.

Closes #1644

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 07:58:27 -04:00
Tibsfox
dc2afa299b feat(i18n): add response_language config for cross-phase language consistency (#1412)
* feat(i18n): add response_language config for cross-phase language consistency

Adds `response_language` config key that propagates through all init
outputs via withProjectRoot(). Workflows read this field and instruct
agents to present user-facing questions in the configured language,
solving the problem of language preference resetting at phase boundaries.

Usage: gsd-tools config-set response_language "Portuguese"

Closes #1399

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(security): allowlist discuss-phase.md for size threshold

discuss-phase.md legitimately exceeds 50K chars due to power mode
and i18n directives — not prompt stuffing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:49:10 -04:00
Tom Boucher
9d626de5fa fix(hooks): add read-before-edit guard for non-Claude runtimes (#1645)
* fix(hooks): add read-before-edit guidance for non-Claude runtimes

When models that don't natively enforce read-before-edit hit the guard,
the error message now includes explicit instruction to Read first.
This prevents infinite retry loops that burn through usage.

Closes #1628

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

* fix(build): register gsd-read-guard.js in HOOKS_TO_COPY and harden tests

The hook was missing from scripts/build-hooks.js, so global installs
would never receive the hook file in hooks/dist/. Also adds tests for
build registration, install uninstall list, and non-string file_path.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 07:35:18 -04:00
Quang Do
d4767ac2e0 fix: replace /gsd: slash command format with /gsd- skill format in all user-facing content (#1579)
* fix: replace /gsd: command format with /gsd- skill format in all suggestions

All next-step suggestions shown to users were still using the old colon
format (/gsd:xxx) which cannot be copy-pasted as skills. Migrated all
occurrences across agents/, commands/, get-shit-done/, docs/, README files,
bin/install.js (hardcoded defaults for claude runtime), and
get-shit-done/bin/lib/*.cjs (generate-claude-md templates and error messages).
Updated tests to assert new hyphen format instead of old colon format.

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

* fix: migrate remaining /gsd: format to /gsd- in hooks, workflows, and sdk

Addresses remaining user-facing occurrences missed in the initial migration:

- hooks/: fix 4 user-facing messages (pause-work, update, fast, quick)
  and 2 comments in gsd-workflow-guard.js
- get-shit-done/workflows/: fix 21 Skill() literal calls that Claude
  executes directly (installer does not transform workflow content)
- sdk/prompt-sanitizer.ts: update regex to strip /gsd- format in addition
  to legacy /gsd: format; update JSDoc comment
- tests/: update autonomous-ui-steps, prompt-sanitizer to assert new format

Note: commands/gsd/*.md frontmatter (name: gsd:xxx) intentionally unchanged
— installer derives skillName from directory path, not the name field.

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

* fix(plan-phase): preserve --chain flag in auto-advance sync and handle ui-phase gate in chain mode

Bug 1: step 15 sync-flag check only guarded against --auto, causing
_auto_chain_active to be cleared when plan-phase is invoked without
--auto in ARGUMENTS even though a --chain pipeline was active. Added
--chain to the guard condition, matching discuss-phase behaviour.

Bug 2: UI Design Contract gate (step 5.6) always exited the workflow
when UI-SPEC was missing, breaking the discuss --chain pipeline
silently. When _auto_chain_active is true, the gate now auto-invokes
gsd-ui-phase --auto via Skill() and continues to step 6 without
prompting. Manual invocations retain the existing AskUserQuestion flow.

* fix: remove <sub>/clear</sub> pattern and duplicate old-format command in discuss-phase.md

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 07:24:31 -04:00
Tibsfox
05e35ac09a fix(workstreams): remove unnecessary Write from allowed-tools (#1637) (#1642)
The workstreams command only delegates to `node "$GSD_TOOLS"` via Bash
and formats JSON output. No Write calls appear anywhere in the command body.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:24:00 -04:00
Tibsfox
4645328e2e fix(verifier): filter gaps addressed in later milestone phases (#1624) (#1643)
The gsd-verifier was reporting false-positive gaps for items explicitly
scheduled in later phases of the milestone (e.g., reporting a Phase 5
item as a gap during Phase 1 verification). This adds Step 9b to
cross-reference gaps against later phases using `roadmap analyze` and
move matched items to a `deferred` list that does not affect status.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:23:36 -04:00
Tom Boucher
70d8bbcd17 fix(phase-resolution): use exact token matching instead of prefix matches (#1639)
* fix(phase-resolution): use exact token matching instead of prefix matches

Closes #1635

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

* fix(phase-resolution): add case-insensitive flag to project-code strip regex

The strip regex in phaseTokenMatches lacked the `i` flag, so lowercase
project-code prefixes (e.g. `ck-01-name`) were not stripped during the
fallback comparison. This made `phaseTokenMatches('ck-01-name', '01')`
return false when it should return true.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 07:14:55 -04:00
Tom Boucher
d790408aaa fix(roadmap): fall back to full ROADMAP.md for backlog phases (#1640)
* fix(roadmap): fall back to full ROADMAP.md for backlog and planned phases

Closes #1634

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

* fix(roadmap): prevent checklist-only match from blocking full header fallback

When the current milestone had a checklist reference to a phase (e.g.
`- [ ] **Phase 50: Cleanup**`) but the full `### Phase 50:` header
existed in a different milestone, the malformed_roadmap result from the
first searchPhaseInContent call short-circuited the `||` operator and
prevented the fallback to the full roadmap content.

Now a malformed_roadmap result is deferred so the full content search
can find the actual header match.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 07:14:24 -04:00
Tibsfox
4abcfa1e3a fix(execute): use sequential dispatch instead of timing-based stagger (#1541)
Address review feedback: LLMs cannot enforce timing between tool calls.
Replace "stagger by ~2 seconds" with concrete, enforceable pattern:
dispatch each Task() one at a time with run_in_background: true. The
round-trip latency of each tool call provides natural spacing for
worktree creation, while agents still run in parallel once created.
Explicitly warn against sending multiple Task() calls in a single
message (which causes simultaneous git worktree add).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:12:27 -04:00