gsd-pi 2.14.4 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/cli.js +17 -7
  2. package/dist/resource-loader.d.ts +1 -0
  3. package/dist/resource-loader.js +10 -1
  4. package/dist/resources/GSD-WORKFLOW.md +70 -68
  5. package/dist/resources/extensions/bg-shell/index.ts +38 -1644
  6. package/dist/resources/extensions/bg-shell/interaction.ts +198 -0
  7. package/dist/resources/extensions/bg-shell/output-formatter.ts +259 -0
  8. package/dist/resources/extensions/bg-shell/overlay.ts +432 -0
  9. package/dist/resources/extensions/bg-shell/process-manager.ts +404 -0
  10. package/dist/resources/extensions/bg-shell/readiness-detector.ts +126 -0
  11. package/dist/resources/extensions/bg-shell/types.ts +251 -0
  12. package/dist/resources/extensions/bg-shell/utilities.ts +55 -0
  13. package/dist/resources/extensions/gsd/activity-log.ts +22 -9
  14. package/dist/resources/extensions/gsd/auto-dashboard.ts +443 -0
  15. package/dist/resources/extensions/gsd/auto-dispatch.ts +258 -0
  16. package/dist/resources/extensions/gsd/auto-prompts.ts +797 -0
  17. package/dist/resources/extensions/gsd/auto-recovery.ts +510 -0
  18. package/dist/resources/extensions/gsd/auto-supervisor.ts +59 -0
  19. package/dist/resources/extensions/gsd/auto-worktree.ts +40 -3
  20. package/dist/resources/extensions/gsd/auto.ts +256 -1750
  21. package/dist/resources/extensions/gsd/cache.ts +27 -0
  22. package/dist/resources/extensions/gsd/commands.ts +310 -6
  23. package/dist/resources/extensions/gsd/crash-recovery.ts +4 -3
  24. package/dist/resources/extensions/gsd/dashboard-overlay.ts +5 -1
  25. package/dist/resources/extensions/gsd/dispatch-guard.ts +26 -15
  26. package/dist/resources/extensions/gsd/docs/preferences-reference.md +2 -2
  27. package/dist/resources/extensions/gsd/errors.ts +31 -0
  28. package/dist/resources/extensions/gsd/export.ts +100 -0
  29. package/dist/resources/extensions/gsd/git-service.ts +8 -1
  30. package/dist/resources/extensions/gsd/guided-flow.ts +4 -2
  31. package/dist/resources/extensions/gsd/history.ts +162 -0
  32. package/dist/resources/extensions/gsd/index.ts +2 -2
  33. package/dist/resources/extensions/gsd/metrics.ts +17 -0
  34. package/dist/resources/extensions/gsd/notifications.ts +88 -0
  35. package/dist/resources/extensions/gsd/preferences.ts +144 -16
  36. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +8 -0
  37. package/dist/resources/extensions/gsd/prompts/complete-slice.md +10 -0
  38. package/dist/resources/extensions/gsd/prompts/execute-task.md +6 -2
  39. package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  40. package/dist/resources/extensions/gsd/prompts/guided-research-slice.md +3 -1
  41. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +10 -0
  42. package/dist/resources/extensions/gsd/prompts/plan-slice.md +11 -1
  43. package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +10 -0
  44. package/dist/resources/extensions/gsd/prompts/replan-slice.md +4 -0
  45. package/dist/resources/extensions/gsd/prompts/research-milestone.md +17 -8
  46. package/dist/resources/extensions/gsd/prompts/research-slice.md +31 -3
  47. package/dist/resources/extensions/gsd/prompts/run-uat.md +4 -0
  48. package/dist/resources/extensions/gsd/prompts/system.md +17 -7
  49. package/dist/resources/extensions/gsd/provider-error-pause.ts +12 -0
  50. package/dist/resources/extensions/gsd/templates/plan.md +0 -7
  51. package/dist/resources/extensions/gsd/templates/reassessment.md +3 -2
  52. package/dist/resources/extensions/gsd/templates/research.md +38 -5
  53. package/dist/resources/extensions/gsd/templates/state.md +0 -1
  54. package/dist/resources/extensions/gsd/tests/agent-end-provider-error.test.ts +29 -0
  55. package/dist/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +33 -0
  56. package/dist/resources/extensions/gsd/tests/auto-dashboard.test.ts +153 -0
  57. package/dist/resources/extensions/gsd/tests/auto-draft-pause.test.ts +20 -14
  58. package/dist/resources/extensions/gsd/tests/auto-recovery.test.ts +272 -0
  59. package/dist/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +43 -0
  60. package/dist/resources/extensions/gsd/tests/complete-milestone.test.ts +7 -5
  61. package/dist/resources/extensions/gsd/tests/crash-recovery.test.ts +134 -0
  62. package/dist/resources/extensions/gsd/tests/dispatch-guard.test.ts +34 -20
  63. package/dist/resources/extensions/gsd/tests/draft-promotion.test.ts +5 -6
  64. package/dist/resources/extensions/gsd/tests/notifications.test.ts +67 -0
  65. package/dist/resources/extensions/gsd/tests/preferences-git.test.ts +25 -18
  66. package/dist/resources/extensions/gsd/tests/preferences-models.test.ts +208 -0
  67. package/dist/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +176 -0
  68. package/dist/resources/extensions/gsd/tests/reassess-prompt.test.ts +3 -0
  69. package/dist/resources/extensions/gsd/tests/replan-slice.test.ts +3 -0
  70. package/dist/resources/extensions/gsd/tests/run-uat.test.ts +1 -0
  71. package/dist/resources/extensions/gsd/tests/undo.test.ts +136 -0
  72. package/dist/resources/extensions/gsd/types.ts +13 -0
  73. package/dist/resources/extensions/gsd/undo.ts +220 -0
  74. package/dist/update-check.js +3 -6
  75. package/package.json +1 -1
  76. package/packages/pi-ai/dist/providers/google-shared.d.ts +3 -0
  77. package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
  78. package/packages/pi-ai/dist/providers/google-shared.js +63 -5
  79. package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
  80. package/packages/pi-ai/src/providers/google-shared.ts +66 -6
  81. package/packages/pi-coding-agent/dist/config.d.ts +0 -6
  82. package/packages/pi-coding-agent/dist/config.d.ts.map +1 -1
  83. package/packages/pi-coding-agent/dist/config.js +9 -6
  84. package/packages/pi-coding-agent/dist/config.js.map +1 -1
  85. package/packages/pi-coding-agent/src/config.ts +10 -6
  86. package/packages/pi-tui/dist/components/__tests__/cancellable-loader.test.d.ts +2 -0
  87. package/packages/pi-tui/dist/components/__tests__/cancellable-loader.test.d.ts.map +1 -0
  88. package/packages/pi-tui/dist/components/__tests__/cancellable-loader.test.js +38 -0
  89. package/packages/pi-tui/dist/components/__tests__/cancellable-loader.test.js.map +1 -0
  90. package/packages/pi-tui/dist/components/__tests__/input.test.d.ts +2 -0
  91. package/packages/pi-tui/dist/components/__tests__/input.test.d.ts.map +1 -0
  92. package/packages/pi-tui/dist/components/__tests__/input.test.js +29 -0
  93. package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -0
  94. package/packages/pi-tui/dist/components/__tests__/loader.test.d.ts +2 -0
  95. package/packages/pi-tui/dist/components/__tests__/loader.test.d.ts.map +1 -0
  96. package/packages/pi-tui/dist/components/__tests__/loader.test.js +37 -0
  97. package/packages/pi-tui/dist/components/__tests__/loader.test.js.map +1 -0
  98. package/packages/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -1
  99. package/packages/pi-tui/dist/components/cancellable-loader.js +2 -0
  100. package/packages/pi-tui/dist/components/cancellable-loader.js.map +1 -1
  101. package/packages/pi-tui/dist/components/editor.d.ts +1 -0
  102. package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
  103. package/packages/pi-tui/dist/components/editor.js +13 -1
  104. package/packages/pi-tui/dist/components/editor.js.map +1 -1
  105. package/packages/pi-tui/dist/components/input.d.ts +3 -1
  106. package/packages/pi-tui/dist/components/input.d.ts.map +1 -1
  107. package/packages/pi-tui/dist/components/input.js +11 -1
  108. package/packages/pi-tui/dist/components/input.js.map +1 -1
  109. package/packages/pi-tui/dist/components/loader.d.ts +1 -0
  110. package/packages/pi-tui/dist/components/loader.d.ts.map +1 -1
  111. package/packages/pi-tui/dist/components/loader.js +7 -0
  112. package/packages/pi-tui/dist/components/loader.js.map +1 -1
  113. package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
  114. package/packages/pi-tui/dist/terminal.js +4 -1
  115. package/packages/pi-tui/dist/terminal.js.map +1 -1
  116. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  117. package/packages/pi-tui/dist/tui.js +7 -0
  118. package/packages/pi-tui/dist/tui.js.map +1 -1
  119. package/packages/pi-tui/src/components/__tests__/cancellable-loader.test.ts +45 -0
  120. package/packages/pi-tui/src/components/__tests__/input.test.ts +35 -0
  121. package/packages/pi-tui/src/components/__tests__/loader.test.ts +45 -0
  122. package/packages/pi-tui/src/components/cancellable-loader.ts +2 -0
  123. package/packages/pi-tui/src/components/editor.ts +14 -1
  124. package/packages/pi-tui/src/components/input.ts +11 -1
  125. package/packages/pi-tui/src/components/loader.ts +8 -0
  126. package/packages/pi-tui/src/terminal.ts +4 -1
  127. package/packages/pi-tui/src/tui.ts +9 -0
  128. package/src/resources/GSD-WORKFLOW.md +70 -68
  129. package/src/resources/extensions/bg-shell/index.ts +38 -1644
  130. package/src/resources/extensions/bg-shell/interaction.ts +198 -0
  131. package/src/resources/extensions/bg-shell/output-formatter.ts +259 -0
  132. package/src/resources/extensions/bg-shell/overlay.ts +432 -0
  133. package/src/resources/extensions/bg-shell/process-manager.ts +404 -0
  134. package/src/resources/extensions/bg-shell/readiness-detector.ts +126 -0
  135. package/src/resources/extensions/bg-shell/types.ts +251 -0
  136. package/src/resources/extensions/bg-shell/utilities.ts +55 -0
  137. package/src/resources/extensions/gsd/activity-log.ts +22 -9
  138. package/src/resources/extensions/gsd/auto-dashboard.ts +443 -0
  139. package/src/resources/extensions/gsd/auto-dispatch.ts +258 -0
  140. package/src/resources/extensions/gsd/auto-prompts.ts +797 -0
  141. package/src/resources/extensions/gsd/auto-recovery.ts +510 -0
  142. package/src/resources/extensions/gsd/auto-supervisor.ts +59 -0
  143. package/src/resources/extensions/gsd/auto-worktree.ts +40 -3
  144. package/src/resources/extensions/gsd/auto.ts +256 -1750
  145. package/src/resources/extensions/gsd/cache.ts +27 -0
  146. package/src/resources/extensions/gsd/commands.ts +310 -6
  147. package/src/resources/extensions/gsd/crash-recovery.ts +4 -3
  148. package/src/resources/extensions/gsd/dashboard-overlay.ts +5 -1
  149. package/src/resources/extensions/gsd/dispatch-guard.ts +26 -15
  150. package/src/resources/extensions/gsd/docs/preferences-reference.md +2 -2
  151. package/src/resources/extensions/gsd/errors.ts +31 -0
  152. package/src/resources/extensions/gsd/export.ts +100 -0
  153. package/src/resources/extensions/gsd/git-service.ts +8 -1
  154. package/src/resources/extensions/gsd/guided-flow.ts +4 -2
  155. package/src/resources/extensions/gsd/history.ts +162 -0
  156. package/src/resources/extensions/gsd/index.ts +2 -2
  157. package/src/resources/extensions/gsd/metrics.ts +17 -0
  158. package/src/resources/extensions/gsd/notifications.ts +88 -0
  159. package/src/resources/extensions/gsd/preferences.ts +144 -16
  160. package/src/resources/extensions/gsd/prompts/complete-milestone.md +8 -0
  161. package/src/resources/extensions/gsd/prompts/complete-slice.md +10 -0
  162. package/src/resources/extensions/gsd/prompts/execute-task.md +6 -2
  163. package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  164. package/src/resources/extensions/gsd/prompts/guided-research-slice.md +3 -1
  165. package/src/resources/extensions/gsd/prompts/plan-milestone.md +10 -0
  166. package/src/resources/extensions/gsd/prompts/plan-slice.md +11 -1
  167. package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +10 -0
  168. package/src/resources/extensions/gsd/prompts/replan-slice.md +4 -0
  169. package/src/resources/extensions/gsd/prompts/research-milestone.md +17 -8
  170. package/src/resources/extensions/gsd/prompts/research-slice.md +31 -3
  171. package/src/resources/extensions/gsd/prompts/run-uat.md +4 -0
  172. package/src/resources/extensions/gsd/prompts/system.md +17 -7
  173. package/src/resources/extensions/gsd/provider-error-pause.ts +12 -0
  174. package/src/resources/extensions/gsd/templates/plan.md +0 -7
  175. package/src/resources/extensions/gsd/templates/reassessment.md +3 -2
  176. package/src/resources/extensions/gsd/templates/research.md +38 -5
  177. package/src/resources/extensions/gsd/templates/state.md +0 -1
  178. package/src/resources/extensions/gsd/tests/agent-end-provider-error.test.ts +29 -0
  179. package/src/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +33 -0
  180. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +153 -0
  181. package/src/resources/extensions/gsd/tests/auto-draft-pause.test.ts +20 -14
  182. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +272 -0
  183. package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +43 -0
  184. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +7 -5
  185. package/src/resources/extensions/gsd/tests/crash-recovery.test.ts +134 -0
  186. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +34 -20
  187. package/src/resources/extensions/gsd/tests/draft-promotion.test.ts +5 -6
  188. package/src/resources/extensions/gsd/tests/notifications.test.ts +67 -0
  189. package/src/resources/extensions/gsd/tests/preferences-git.test.ts +25 -18
  190. package/src/resources/extensions/gsd/tests/preferences-models.test.ts +208 -0
  191. package/src/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +176 -0
  192. package/src/resources/extensions/gsd/tests/reassess-prompt.test.ts +3 -0
  193. package/src/resources/extensions/gsd/tests/replan-slice.test.ts +3 -0
  194. package/src/resources/extensions/gsd/tests/run-uat.test.ts +1 -0
  195. package/src/resources/extensions/gsd/tests/undo.test.ts +136 -0
  196. package/src/resources/extensions/gsd/types.ts +13 -0
  197. package/src/resources/extensions/gsd/undo.ts +220 -0
package/dist/cli.js CHANGED
@@ -7,6 +7,7 @@ import { ensureManagedTools } from './tool-bootstrap.js';
7
7
  import { loadStoredEnvKeys } from './wizard.js';
8
8
  import { getPiDefaultModelAndProvider, migratePiCredentials } from './pi-migration.js';
9
9
  import { shouldRunOnboarding, runOnboarding } from './onboarding.js';
10
+ import chalk from 'chalk';
10
11
  import { checkForUpdates } from './update-check.js';
11
12
  function exitIfManagedResourcesAreNewer(currentAgentDir) {
12
13
  const currentVersion = process.env.GSD_VERSION || '0.0.0';
@@ -14,13 +15,9 @@ function exitIfManagedResourcesAreNewer(currentAgentDir) {
14
15
  if (!managedVersion) {
15
16
  return;
16
17
  }
17
- const yellow = '\x1b[33m';
18
- const dim = '\x1b[2m';
19
- const reset = '\x1b[0m';
20
- const bold = '\x1b[1m';
21
- process.stderr.write(`[gsd] ${yellow}Version mismatch detected${reset}\n` +
22
- `[gsd] Synced resources are from ${bold}v${managedVersion}${reset}, but this \`gsd\` binary is ${dim}v${currentVersion}${reset}.\n` +
23
- `[gsd] Run ${bold}npm install -g gsd-pi@latest${reset} or ${bold}gsd update${reset}, then try again.\n`);
18
+ process.stderr.write(`[gsd] ${chalk.yellow('Version mismatch detected')}\n` +
19
+ `[gsd] Synced resources are from ${chalk.bold(`v${managedVersion}`)}, but this \`gsd\` binary is ${chalk.dim(`v${currentVersion}`)}.\n` +
20
+ `[gsd] Run ${chalk.bold('npm install -g gsd-pi@latest')} or ${chalk.bold('gsd update')}, then try again.\n`);
24
21
  process.exit(1);
25
22
  }
26
23
  function parseCliArgs(argv) {
@@ -111,11 +108,24 @@ migratePiCredentials(authStorage);
111
108
  // Run onboarding wizard on first launch (no LLM provider configured)
112
109
  if (!isPrintMode && shouldRunOnboarding(authStorage)) {
113
110
  await runOnboarding(authStorage);
111
+ // Clean up stdin state left by @clack/prompts.
112
+ // readline.emitKeypressEvents() adds a permanent data listener and
113
+ // readline.createInterface() may leave stdin paused. Remove stale
114
+ // listeners and pause stdin so the TUI can start with a clean slate.
115
+ process.stdin.removeAllListeners('data');
116
+ process.stdin.removeAllListeners('keypress');
117
+ if (process.stdin.setRawMode)
118
+ process.stdin.setRawMode(false);
119
+ process.stdin.pause();
114
120
  }
115
121
  // Non-blocking update check — runs at most once per 24h, fire-and-forget
116
122
  if (!isPrintMode) {
117
123
  checkForUpdates().catch(() => { });
118
124
  }
125
+ // Warn if terminal is too narrow for readable output
126
+ if (!isPrintMode && process.stdout.columns && process.stdout.columns < 40) {
127
+ process.stderr.write(chalk.yellow(`[gsd] Terminal width is ${process.stdout.columns} columns (minimum recommended: 40). Output may be unreadable.\n`));
128
+ }
119
129
  const modelRegistry = new ModelRegistry(authStorage);
120
130
  const settingsManager = SettingsManager.create(agentDir);
121
131
  // --list-models: print available models and exit (no TTY needed)
@@ -1,6 +1,7 @@
1
1
  import { DefaultResourceLoader } from '@gsd/pi-coding-agent';
2
2
  export declare function discoverExtensionEntryPaths(extensionsDir: string): string[];
3
3
  export declare function readManagedResourceVersion(agentDir: string): string | null;
4
+ export declare function readManagedResourceSyncedAt(agentDir: string): number | null;
4
5
  export declare function getNewerManagedResourceVersion(agentDir: string, currentVersion: string): string | null;
5
6
  /**
6
7
  * Syncs all bundled resources to agentDir (~/.gsd/agent/) on every launch.
@@ -85,7 +85,7 @@ function getBundledGsdVersion() {
85
85
  }
86
86
  }
87
87
  function writeManagedResourceManifest(agentDir) {
88
- const manifest = { gsdVersion: getBundledGsdVersion() };
88
+ const manifest = { gsdVersion: getBundledGsdVersion(), syncedAt: Date.now() };
89
89
  writeFileSync(getManagedResourceManifestPath(agentDir), JSON.stringify(manifest));
90
90
  }
91
91
  export function readManagedResourceVersion(agentDir) {
@@ -97,6 +97,15 @@ export function readManagedResourceVersion(agentDir) {
97
97
  return null;
98
98
  }
99
99
  }
100
+ export function readManagedResourceSyncedAt(agentDir) {
101
+ try {
102
+ const manifest = JSON.parse(readFileSync(getManagedResourceManifestPath(agentDir), 'utf-8'));
103
+ return typeof manifest?.syncedAt === 'number' ? manifest.syncedAt : null;
104
+ }
105
+ catch {
106
+ return null;
107
+ }
108
+ }
100
109
  export function getNewerManagedResourceVersion(agentDir, currentVersion) {
101
110
  const managedVersion = readManagedResourceVersion(agentDir);
102
111
  if (!managedVersion) {
@@ -4,8 +4,8 @@
4
4
  >
5
5
  > **When to read this:** At the start of any session working on GSD-managed work, or when loaded by `/gsd`.
6
6
  >
7
- > **After reading this, always read `.gsd/state.md` to find out what's next.**
8
- > If the milestone has a `context.md`, read that too — it contains project-specific decisions, reference paths, and implementation guidance that this generic methodology doc does not.
7
+ > **After reading this, always read `.gsd/STATE.md` to find out what's next.**
8
+ > If the milestone has a `M###-CONTEXT.md`, read that too. If the active slice has an `S##-CONTEXT.md`, read that as well these files contain project-specific decisions, reference paths, and implementation guidance that this generic methodology doc does not.
9
9
 
10
10
  ---
11
11
 
@@ -13,13 +13,14 @@
13
13
 
14
14
  Read these files in order and act on what they say:
15
15
 
16
- 1. **`.gsd/state.md`** — Where are we? What's the next action?
17
- 2. **`.gsd/milestones/<active>/roadmap.md`** — What's the plan? Which slices are done? (state.md tells you which milestone is active)
18
- 3. **`.gsd/milestones/<active>/context.md`** — Project-specific decisions, reference paths, constraints. Read this before doing implementation work.
19
- 4. If a slice is active, read its **`plan.md`** — Which tasks exist? Which are done?
20
- 5. If a task was interrupted, check for **`continue.md`** in the active slice directory Resume from there.
16
+ 1. **`.gsd/STATE.md`** — Where are we? What's the next action?
17
+ 2. **`.gsd/milestones/<active>/M###-ROADMAP.md`** — What's the plan? Which slices are done? (`STATE.md` tells you which milestone is active)
18
+ 3. **`.gsd/milestones/<active>/M###-CONTEXT.md`** — Milestone-level project decisions, reference paths, constraints. Read this before doing implementation work.
19
+ 4. If a slice is active and has one, read **`S##-CONTEXT.md`** — Slice-specific decisions and constraints.
20
+ 5. If a slice is active, read its **`S##-PLAN.md`** Which tasks exist? Which are done?
21
+ 6. If a task was interrupted, check for **`continue.md`** in the active slice directory — Resume from there.
21
22
 
22
- Then do the thing `state.md` says to do next.
23
+ Then do the thing `STATE.md` says to do next.
23
24
 
24
25
  ---
25
26
 
@@ -41,32 +42,32 @@ All artifacts live in `.gsd/` at the project root:
41
42
 
42
43
  ```
43
44
  .gsd/
44
- state.md # Dashboard — always read first
45
- decisions.md # Append-only decisions register
45
+ STATE.md # Dashboard — always read first (derived cache; runtime, gitignored)
46
+ DECISIONS.md # Append-only decisions register
46
47
  milestones/
47
48
  M001/
48
- roadmap.md # Milestone plan (checkboxes = state)
49
- context.md # Optional: user decisions from discuss phase
50
- research.md # Optional: codebase/tech research
51
- summary.md # Milestone rollup (updated as slices complete)
49
+ M001-ROADMAP.md # Milestone plan (checkboxes = state)
50
+ M001-CONTEXT.md # Optional: user decisions from discuss phase
51
+ M001-RESEARCH.md # Optional: codebase/tech research
52
+ M001-SUMMARY.md # Milestone rollup (updated as slices complete)
52
53
  slices/
53
54
  S01/
54
- plan.md # Task decomposition for this slice
55
- context.md # Optional: slice-level user decisions
56
- research.md # Optional: slice-level research
57
- summary.md # Slice summary (written on completion)
58
- uat.md # Non-blocking human test script (written on completion)
55
+ S01-PLAN.md # Task decomposition for this slice
56
+ S01-CONTEXT.md # Optional: slice-level user decisions
57
+ S01-RESEARCH.md # Optional: slice-level research
58
+ S01-SUMMARY.md # Slice summary (written on completion)
59
+ S01-UAT.md # Non-blocking human test script (written on completion)
59
60
  continue.md # Ephemeral: resume point if interrupted
60
61
  tasks/
61
- T01-plan.md # Individual task plan
62
- T01-summary.md # Task summary with frontmatter
62
+ T01-PLAN.md # Individual task plan
63
+ T01-SUMMARY.md # Task summary with frontmatter
63
64
  ```
64
65
 
65
66
  ---
66
67
 
67
68
  ## File Format Reference
68
69
 
69
- ### `roadmap.md`
70
+ ### `M###-ROADMAP.md`
70
71
 
71
72
  ```markdown
72
73
  # M001: Title of the Milestone
@@ -93,7 +94,7 @@ All artifacts live in `.gsd/` at the project root:
93
94
 
94
95
  **Parsing rules:** `- [x]` = done, `- [ ]` = not done. The `risk:` and `depends:[]` tags are inline metadata parsed from the line. `depends:[]` lists slice IDs this slice requires to be complete first.
95
96
 
96
- **Boundary Map** (required section in roadmap.md):
97
+ **Boundary Map** (required section in M###-ROADMAP.md):
97
98
 
98
99
  After the slices section, include a `## Boundary Map` that shows what each slice produces and consumes:
99
100
 
@@ -123,7 +124,7 @@ The boundary map is a **planning artifact** — not runnable code. It:
123
124
  - Enables deterministic verification that slices actually connect
124
125
  - Gets updated during slice planning if new interfaces emerge
125
126
 
126
- ### `plan.md` (slice-level)
127
+ ### `S##-PLAN.md` (slice-level)
127
128
 
128
129
  ```markdown
129
130
  # S01: Slice Title
@@ -148,7 +149,7 @@ The boundary map is a **planning artifact** — not runnable code. It:
148
149
  - path/to/another.ts
149
150
  ```
150
151
 
151
- ### `TNN-plan.md` (task-level)
152
+ ### `T##-PLAN.md` (task-level)
152
153
 
153
154
  ```markdown
154
155
  # T01: Task Title
@@ -188,7 +189,7 @@ Critical wiring between artifacts:
188
189
 
189
190
  **Must-haves are what make verification mechanically checkable.** Truths are checked by running commands or reading output. Artifacts are checked by confirming files exist with real content. Key links are checked by confirming imports/references actually connect the pieces.
190
191
 
191
- ### `state.md`
192
+ ### `STATE.md`
192
193
 
193
194
  ```markdown
194
195
  # GSD State
@@ -209,10 +210,10 @@ Critical wiring between artifacts:
209
210
  Exact next thing to do.
210
211
  ```
211
212
 
212
- ### `context.md` (from discuss phase)
213
+ ### `M###-CONTEXT.md` / `S##-CONTEXT.md` (from discuss phase)
213
214
 
214
215
  ```markdown
215
- # S01: Slice Title — Context
216
+ # M001: Milestone or Slice Title — Context
216
217
 
217
218
  **Gathered:** 2026-03-07
218
219
  **Status:** Ready for planning
@@ -228,7 +229,7 @@ Exact next thing to do.
228
229
  - Ideas that came up but belong in other slices
229
230
  ```
230
231
 
231
- ### `decisions.md` (append-only register)
232
+ ### `DECISIONS.md` (append-only register)
232
233
 
233
234
  ```markdown
234
235
  # Decisions Register
@@ -265,7 +266,7 @@ Work flows through these phases. Each phase produces a file.
265
266
  ### Phase 1: Discuss (Optional)
266
267
 
267
268
  **Purpose:** Capture user decisions on gray areas before planning.
268
- **Produces:** `context.md` at milestone or slice level.
269
+ **Produces:** `M###-CONTEXT.md` for milestone-level discussion or `S##-CONTEXT.md` for slice-level discussion.
269
270
  **When to use:** When the scope has ambiguities the user should weigh in on.
270
271
  **When to skip:** When the user already knows exactly what they want, or told you to just go.
271
272
 
@@ -273,18 +274,18 @@ Work flows through these phases. Each phase produces a file.
273
274
  1. Read the roadmap to understand the scope.
274
275
  2. Identify 3-5 gray areas — implementation decisions the user cares about.
275
276
  3. Use `ask_user_questions` to discuss each area.
276
- 4. Write decisions to `context.md`.
277
+ 4. Write decisions to the appropriate context file (`M###-CONTEXT.md` or `S##-CONTEXT.md`).
277
278
  5. Do NOT discuss how to implement — only what the user wants.
278
279
 
279
280
  ### Phase 2: Research (Optional)
280
281
 
281
282
  **Purpose:** Scout the codebase and relevant docs before planning.
282
- **Produces:** `research.md` at milestone or slice level.
283
+ **Produces:** `M###-RESEARCH.md` at milestone level or `S##-RESEARCH.md` at slice level.
283
284
  **When to use:** When working in unfamiliar code, with unfamiliar libraries, or on complex integrations.
284
285
  **When to skip:** When the codebase is familiar and the work is straightforward.
285
286
 
286
287
  **How to do it manually:**
287
- 1. Read `context.md` if it exists — know what decisions are locked.
288
+ 1. Read `M###-CONTEXT.md` and/or `S##-CONTEXT.md` if they exist — know what decisions are locked.
288
289
  2. Scout relevant code: `rg`, `find`, read key files.
289
290
  3. Use `resolve_library` / `get_library_docs` if needed.
290
291
  4. Write findings to `research.md` with these sections:
@@ -324,24 +325,24 @@ The **Don't Hand-Roll** and **Common Pitfalls** sections prevent the most expens
324
325
  ### Phase 3: Plan
325
326
 
326
327
  **Purpose:** Decompose work into context-window-sized tasks with must-haves.
327
- **Produces:** `plan.md` + individual `T01-plan.md` files.
328
+ **Produces:** `S##-PLAN.md` + individual `T01-PLAN.md` files.
328
329
 
329
330
  **For a milestone (roadmap):**
330
- 1. Read `context.md`, `research.md`, and `.gsd/decisions.md` if they exist.
331
+ 1. Read `M###-CONTEXT.md`, `M###-RESEARCH.md`, and `.gsd/DECISIONS.md` if they exist.
331
332
  2. Decompose the vision into 4-10 demoable vertical slices.
332
333
  3. Order by risk (high-risk first to validate feasibility early).
333
- 4. Write `roadmap.md` with checkboxes, risk levels, dependencies, demo sentences.
334
+ 4. Write `M###-ROADMAP.md` with checkboxes, risk levels, dependencies, demo sentences.
334
335
  5. **Write the boundary map** — for each slice, specify what it produces (functions, types, interfaces, endpoints) and what it consumes from upstream slices. This forces interface thinking before implementation and enables deterministic verification that slices actually connect.
335
336
 
336
337
  **For a slice (task decomposition):**
337
- 1. Read the slice's entry in `roadmap.md` **and its boundary map section** — know what interfaces this slice must produce and consume.
338
- 2. Read `context.md`, `research.md`, and `.gsd/decisions.md` if they exist for this slice.
338
+ 1. Read the slice's entry in `M###-ROADMAP.md` **and its boundary map section** — know what interfaces this slice must produce and consume.
339
+ 2. Read `M###-CONTEXT.md`, `S##-CONTEXT.md`, `M###-RESEARCH.md`, `S##-RESEARCH.md`, and `.gsd/DECISIONS.md` if they exist for this slice.
339
340
  3. Read summaries from dependency slices (check `depends:[]` in roadmap).
340
341
  4. Verify that upstream slices' actual outputs match what the boundary map says this slice consumes. If they diverge, update the boundary map.
341
342
  5. Decompose into 1-7 tasks, each fitting one context window.
342
343
  6. Each task needs: title, description, steps (3-10), must-haves (observable verification criteria).
343
344
  7. Must-haves should reference boundary map contracts — e.g. "exports `generateToken()` as specified in boundary map S01→S02".
344
- 8. Write `plan.md` and individual `TNN-plan.md` files.
345
+ 8. Write `S##-PLAN.md` and individual `T##-PLAN.md` files.
345
346
 
346
347
  ### Phase 4: Execute
347
348
 
@@ -349,10 +350,10 @@ The **Don't Hand-Roll** and **Common Pitfalls** sections prevent the most expens
349
350
  **Produces:** Code changes + `[DONE:n]` markers.
350
351
 
351
352
  **How to do it manually:**
352
- 1. Read the task's `TNN-plan.md`.
353
+ 1. Read the task's `T##-PLAN.md`.
353
354
  2. Read relevant summaries from prior tasks (for context on what's already built).
354
355
  3. Execute each step. Mark progress with `[DONE:n]` in responses.
355
- 4. If you made an architectural, pattern, or library decision, append it to `.gsd/decisions.md`.
356
+ 4. If you made an architectural, pattern, or library decision, append it to `.gsd/DECISIONS.md`.
356
357
  5. If interrupted or context is getting full, write `continue.md` (see below).
357
358
 
358
359
  ### Phase 5: Verify
@@ -400,7 +401,7 @@ When verification finds gaps, include a **Gaps** section with what's missing, im
400
401
  ### Phase 6: Summarize
401
402
 
402
403
  **Purpose:** Record what happened for downstream tasks.
403
- **Produces:** `TNN-summary.md`, and when slice completes, `summary.md`.
404
+ **Produces:** `T##-SUMMARY.md`, and when slice completes, `S##-SUMMARY.md`.
404
405
 
405
406
  **Task summary format:**
406
407
  ```markdown
@@ -421,7 +422,7 @@ key_decisions:
421
422
  patterns_established:
422
423
  - "Pattern name and where it lives"
423
424
  drill_down_paths:
424
- - .gsd/milestones/M001/slices/S01/tasks/T01-plan.md
425
+ - .gsd/milestones/M001/slices/S01/tasks/T01-PLAN.md
425
426
  duration: 15min
426
427
  verification_result: pass
427
428
  completed_at: 2026-03-07T16:00:00Z
@@ -445,7 +446,7 @@ What differed from the plan and why (or "None").
445
446
 
446
447
  The one-liner must be substantive: "JWT auth with refresh rotation using jose" not "Authentication implemented."
447
448
 
448
- **Slice summary:** Written when all tasks in a slice complete. Compresses all task summaries. Includes `drill_down_paths` to each task summary. During slice completion, review task summaries for `key_decisions` and ensure any significant ones are captured in `.gsd/decisions.md`.
449
+ **Slice summary:** Written when all tasks in a slice complete. Compresses all task summaries. Includes `drill_down_paths` to each task summary. During slice completion, review task summaries for `key_decisions` and ensure any significant ones are captured in `.gsd/DECISIONS.md`.
449
450
 
450
451
  **Milestone summary:** Updated each time a slice completes. Compresses all slice summaries. This is what gets injected into later slice planning instead of loading many individual summaries.
451
452
 
@@ -454,16 +455,16 @@ The one-liner must be substantive: "JWT auth with refresh rotation using jose" n
454
455
  **Purpose:** Mark work done and move to the next thing.
455
456
 
456
457
  **After a task completes:**
457
- 1. Mark the task done in `plan.md` (checkbox).
458
+ 1. Mark the task done in `S##-PLAN.md` (checkbox).
458
459
  2. Check if there's a next task in the slice → execute it.
459
- 3. If slice is complete → write slice summary, mark slice done in `roadmap.md`.
460
+ 3. If slice is complete → write slice summary, mark slice done in `M###-ROADMAP.md`.
460
461
 
461
462
  **After a slice completes:**
462
- 1. Write slice `summary.md` (compresses all task summaries).
463
- 2. Write slice `uat.md` — a non-blocking human test script derived from the slice's must-haves and demo sentence. The agent does NOT wait for UAT results.
464
- 3. Mark the slice checkbox in `roadmap.md` as `[x]`.
465
- 4. Update `state.md` with new position.
466
- 5. Update milestone `summary.md` with the completed slice's contributions.
463
+ 1. Write slice `S##-SUMMARY.md` (compresses all task summaries).
464
+ 2. Write slice `S##-UAT.md` — a non-blocking human test script derived from the slice's must-haves and demo sentence. The agent does NOT wait for UAT results.
465
+ 3. Mark the slice checkbox in `M###-ROADMAP.md` as `[x]`.
466
+ 4. Update `STATE.md` with new position.
467
+ 5. Update milestone `M###-SUMMARY.md` with the completed slice's contributions.
467
468
  6. Continue to next slice immediately. The user tests the UAT whenever convenient.
468
469
  7. If the user reports UAT failures later, create fix tasks in the current or a new slice.
469
470
  8. If all slices done → milestone complete.
@@ -513,17 +514,17 @@ The EXACT first thing to do when resuming. Not vague. Specific.
513
514
 
514
515
  ## State Management
515
516
 
516
- ### `state.md` is a derived cache
517
+ ### `STATE.md` is a derived cache
517
518
 
518
519
  It is NOT the source of truth. It's a convenience dashboard.
519
520
 
520
521
  **Sources of truth:**
521
- - `roadmap.md` → which slices exist and which are done
522
- - `plan.md` → which tasks exist within a slice
523
- - `TNN-summary.md` → what happened during a task
524
- - `summary.md` (slice/milestone) → compressed outcomes
522
+ - `M###-ROADMAP.md` → which slices exist and which are done
523
+ - `S##-PLAN.md` → which tasks exist within a slice
524
+ - `T##-SUMMARY.md` → what happened during a task
525
+ - `S##-SUMMARY.md` and `M###-SUMMARY.md` → compressed slice and milestone outcomes
525
526
 
526
- **Update `state.md`** after every significant action:
527
+ **Update `STATE.md`** after every significant action:
527
528
  - Active milestone/slice/task
528
529
  - Recent decisions (last 3-5)
529
530
  - Blockers
@@ -611,9 +612,9 @@ Tasks completed:
611
612
 
612
613
  When planning or executing a task, load relevant prior context:
613
614
 
614
- 1. Check the current slice's `depends:[]` in `roadmap.md`.
615
+ 1. Check the current slice's `depends:[]` in `M###-ROADMAP.md`.
615
616
  2. Load summaries from those dependency slices.
616
- 3. Start with the **highest available level** — milestone `summary.md` first.
617
+ 3. Start with the **highest available level** — milestone `M###-SUMMARY.md` first.
617
618
  4. Only drill down to slice/task summaries if you need specific detail.
618
619
  5. Stay within **~2500 tokens** of total injected summary context.
619
620
  6. If the dependency chain is too large, drop the oldest/least-relevant summaries first.
@@ -630,32 +631,33 @@ These are soft caps — exceed them when genuinely needed, but don't let summari
630
631
 
631
632
  ## Project-Specific Context
632
633
 
633
- This methodology doc is generic. Project-specific guidance belongs in the milestone's `context.md`:
634
+ This methodology doc is generic. Project-specific guidance belongs in the milestone and slice context files:
634
635
 
635
- - **`.gsd/milestones/<active>/context.md`** — Architecture decisions, reference file paths, per-slice doc reading guides, implementation constraints, and any project-specific protocols (worktrees, testing, etc.)
636
+ - **`.gsd/milestones/<active>/M###-CONTEXT.md`** — milestone-level architecture decisions, reference file paths, and implementation constraints
637
+ - **`.gsd/milestones/<active>/slices/S##/S##-CONTEXT.md`** — slice-level decisions, edge cases, and narrow implementation guidance when present
636
638
 
637
- **Always read the active milestone's `context.md` before starting implementation work.** It tells you what decisions are locked, what files to reference, and how to verify your work in this specific project.
639
+ **Always read the active milestone's `M###-CONTEXT.md` before starting implementation work.** If the active slice also has `S##-CONTEXT.md`, read that too. These files tell you what decisions are locked, what files to reference, and how to verify your work in this specific project.
638
640
 
639
641
  ---
640
642
 
641
643
  ## Checklist for a Fresh Session
642
644
 
643
- 1. Read `.gsd/state.md` — what's the next action?
645
+ 1. Read `.gsd/STATE.md` — what's the next action?
644
646
  2. Check for `continue.md` in the active slice — is there interrupted work?
645
647
  3. If resuming: read `continue.md`, delete it, pick up from "Next Action".
646
- 4. If starting fresh: read the active slice's `plan.md`, find the next incomplete task.
647
- 5. If in a planning or research phase, read `.gsd/decisions.md` — respect existing decisions.
648
+ 4. If starting fresh: read the active slice's `S##-PLAN.md`, find the next incomplete task.
649
+ 5. If in a planning or research phase, read `.gsd/DECISIONS.md` — respect existing decisions.
648
650
  6. Read relevant summaries from prior tasks/slices for context.
649
651
  7. Do the work.
650
652
  8. Verify the must-haves.
651
653
  9. Write the summary.
652
- 10. Mark done, update `state.md`, advance.
653
- 11. If context is getting full or you're done for now: write `continue.md` if mid-task, or update `state.md` with next action if between tasks.
654
+ 10. Mark done, update `STATE.md`, advance.
655
+ 11. If context is getting full or you're done for now: write `continue.md` if mid-task, or update `STATE.md` with next action if between tasks.
654
656
 
655
657
  ## When Context Gets Large
656
658
 
657
659
  If you sense context pressure (many files read, long execution, lots of tool output):
658
660
 
659
661
  1. **If mid-task:** Write `continue.md` with exact resume state. Tell the user: "Context is getting full. I've saved progress to continue.md. Start a new session and run `/gsd` to pick up where you left off, or `/gsd auto` to resume in auto-execution mode."
660
- 2. **If between tasks:** Just update `state.md` with the next action. No continue file needed — the next session will read state.md and pick up the next task cleanly.
662
+ 2. **If between tasks:** Just update `STATE.md` with the next action. No continue file needed — the next session will read STATE.md and pick up the next task cleanly.
661
663
  3. **Don't fight it.** The whole system is designed for this. A fresh session with the right files loaded is better than a stale session with degraded reasoning.