@opengsd/gsd-core 1.13.0 → 1.14.0

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 (257) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/agents/gsd-advisor-researcher.compact.md +85 -0
  4. package/agents/gsd-ai-researcher.compact.md +96 -0
  5. package/agents/gsd-assumptions-analyzer.compact.md +81 -0
  6. package/agents/gsd-code-fixer.compact.md +458 -0
  7. package/agents/gsd-code-fixer.md +5 -5
  8. package/agents/gsd-code-reviewer.compact.md +269 -0
  9. package/agents/gsd-code-reviewer.md +15 -3
  10. package/agents/gsd-codebase-mapper.compact.md +760 -0
  11. package/agents/gsd-debug-session-manager.compact.md +345 -0
  12. package/agents/gsd-doc-classifier.compact.md +192 -0
  13. package/agents/gsd-doc-synthesizer.compact.md +200 -0
  14. package/agents/gsd-doc-verifier.compact.md +143 -0
  15. package/agents/gsd-doc-writer.compact.md +440 -0
  16. package/agents/gsd-dom-verifier.compact.md +138 -0
  17. package/agents/gsd-domain-researcher.compact.md +141 -0
  18. package/agents/gsd-eval-auditor.compact.md +160 -0
  19. package/agents/gsd-eval-planner.compact.md +137 -0
  20. package/agents/gsd-framework-selector.compact.md +82 -0
  21. package/agents/gsd-integration-checker.compact.md +245 -0
  22. package/agents/gsd-intel-updater.compact.md +226 -0
  23. package/agents/gsd-mempalace-curator.compact.md +45 -0
  24. package/agents/gsd-nyquist-auditor.compact.md +179 -0
  25. package/agents/gsd-pattern-mapper.compact.md +275 -0
  26. package/agents/gsd-project-researcher.compact.md +587 -0
  27. package/agents/gsd-research-synthesizer.compact.md +212 -0
  28. package/agents/gsd-roadmapper.compact.md +454 -0
  29. package/agents/gsd-roadmapper.md +13 -0
  30. package/agents/gsd-security-auditor.compact.md +162 -0
  31. package/agents/gsd-ui-auditor.compact.md +404 -0
  32. package/agents/gsd-ui-checker.compact.md +277 -0
  33. package/agents/gsd-ui-researcher.compact.md +282 -0
  34. package/agents/gsd-user-profiler.compact.md +108 -0
  35. package/bin/install.js +206 -68
  36. package/commands/gsd/cleanup.md +1 -0
  37. package/commands/gsd/code-review.md +2 -1
  38. package/commands/gsd/complete-milestone.md +1 -0
  39. package/commands/gsd/config.md +1 -0
  40. package/commands/gsd/debug.md +1 -0
  41. package/commands/gsd/graphify.md +1 -0
  42. package/commands/gsd/health.md +1 -0
  43. package/commands/gsd/mempalace-capture.md +1 -0
  44. package/commands/gsd/mempalace-recall.md +1 -0
  45. package/commands/gsd/new-milestone.md +1 -0
  46. package/commands/gsd/new-project.md +1 -0
  47. package/commands/gsd/next.md +1 -0
  48. package/commands/gsd/pause-work.md +1 -0
  49. package/commands/gsd/phase.md +1 -0
  50. package/commands/gsd/pr-branch.md +1 -0
  51. package/commands/gsd/resume-work.md +1 -0
  52. package/commands/gsd/review-backlog.md +1 -0
  53. package/commands/gsd/settings.md +2 -1
  54. package/commands/gsd/stats.md +1 -0
  55. package/commands/gsd/thread.md +1 -0
  56. package/commands/gsd/workspace.md +1 -0
  57. package/commands/gsd/workstreams.md +1 -0
  58. package/gsd-core/bin/check-latest-version.cjs +8 -3
  59. package/gsd-core/bin/gsd-tools.cjs +338 -125
  60. package/gsd-core/bin/lib/adr-parser.cjs +1 -1
  61. package/gsd-core/bin/lib/artifacts.cjs +2 -1
  62. package/gsd-core/bin/lib/audit.cjs +39 -22
  63. package/gsd-core/bin/lib/broken-windows.cjs +168 -49
  64. package/gsd-core/bin/lib/capability-lifecycle.cjs +10 -6
  65. package/gsd-core/bin/lib/capability-loader.cjs +135 -1
  66. package/gsd-core/bin/lib/capability-registry.cjs +79 -67
  67. package/gsd-core/bin/lib/capability-source.cjs +19 -2
  68. package/gsd-core/bin/lib/capability-validator.cjs +14 -1
  69. package/gsd-core/bin/lib/check-command-router.cjs +113 -36
  70. package/gsd-core/bin/lib/code-review-depth.cjs +2 -2
  71. package/gsd-core/bin/lib/commands.cjs +650 -72
  72. package/gsd-core/bin/lib/config-loader.cjs +1 -0
  73. package/gsd-core/bin/lib/config.cjs +153 -38
  74. package/gsd-core/bin/lib/coverage.cjs +1 -1
  75. package/gsd-core/bin/lib/decisions.cjs +137 -34
  76. package/gsd-core/bin/lib/external-descriptor-trust.cjs +29 -14
  77. package/gsd-core/bin/lib/gsd2-import.cjs +1 -2
  78. package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +12 -1
  79. package/gsd-core/bin/lib/health-diagnostic-rules/worktree-health.cjs +1 -1
  80. package/gsd-core/bin/lib/init.cjs +409 -47
  81. package/gsd-core/bin/lib/install-engine.cjs +16 -3
  82. package/gsd-core/bin/lib/install-profiles.cjs +14 -0
  83. package/gsd-core/bin/lib/installer-migrations.cjs +33 -4
  84. package/gsd-core/bin/lib/loop-resolver.cjs +50 -31
  85. package/gsd-core/bin/lib/mcp-catalog.cjs +2 -2
  86. package/gsd-core/bin/lib/milestone.cjs +19 -8
  87. package/gsd-core/bin/lib/model-resolver.cjs +101 -10
  88. package/gsd-core/bin/lib/phase-command-router.cjs +7 -1
  89. package/gsd-core/bin/lib/phase-id.cjs +161 -22
  90. package/gsd-core/bin/lib/phase-lifecycle.cjs +61 -0
  91. package/gsd-core/bin/lib/phase.cjs +167 -63
  92. package/gsd-core/bin/lib/planning-inspect.cjs +34 -18
  93. package/gsd-core/bin/lib/planning-snapshot.cjs +61 -12
  94. package/gsd-core/bin/lib/planning-workspace.cjs +50 -1
  95. package/gsd-core/bin/lib/pristine-baseline.cjs +182 -0
  96. package/gsd-core/bin/lib/prohibition-enforcement.cjs +91 -4
  97. package/gsd-core/bin/lib/quick-batch.cjs +1 -1
  98. package/gsd-core/bin/lib/refactor-trigger-command-router.cjs +61 -2
  99. package/gsd-core/bin/lib/research-store.cjs +11 -12
  100. package/gsd-core/bin/lib/review-lane-invocation.cjs +23 -0
  101. package/gsd-core/bin/lib/reviewer-step-dispatch.cjs +337 -0
  102. package/gsd-core/bin/lib/roadmap-parser.cjs +56 -15
  103. package/gsd-core/bin/lib/roadmap.cjs +108 -14
  104. package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +27 -10
  105. package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +12 -3
  106. package/gsd-core/bin/lib/runtime-artifact-layout.cjs +13 -5
  107. package/gsd-core/bin/lib/runtime-hooks-surface.cjs +193 -4
  108. package/gsd-core/bin/lib/security.cjs +126 -7
  109. package/gsd-core/bin/lib/state-document.cjs +130 -28
  110. package/gsd-core/bin/lib/state-md-schema.cjs +21 -14
  111. package/gsd-core/bin/lib/state-transition.cjs +142 -28
  112. package/gsd-core/bin/lib/state.cjs +223 -27
  113. package/gsd-core/bin/lib/surface.cjs +60 -2
  114. package/gsd-core/bin/lib/task-command-router.cjs +12 -6
  115. package/gsd-core/bin/lib/uat.cjs +1 -1
  116. package/gsd-core/bin/lib/update-context.cjs +30 -24
  117. package/gsd-core/bin/lib/vendor/js-yaml.cjs +11 -3
  118. package/gsd-core/bin/lib/verification.cjs +47 -15
  119. package/gsd-core/bin/lib/verify-command-grounding.cjs +1 -1
  120. package/gsd-core/bin/lib/verify.cjs +188 -23
  121. package/gsd-core/bin/lib/workstream-inventory.cjs +1 -0
  122. package/gsd-core/bin/lib/worktree-safety.cjs +13 -7
  123. package/gsd-core/bin/shared/config-defaults.manifest.json +1 -0
  124. package/gsd-core/bin/shared/config-schema.manifest.json +5 -0
  125. package/gsd-core/bin/verify-reapply-patches.cjs +439 -80
  126. package/gsd-core/references/compact-content-gate.md +66 -0
  127. package/gsd-core/references/loop-hook-dispatch.md +18 -0
  128. package/gsd-core/references/model-profiles.md +12 -3
  129. package/gsd-core/references/planning-config.md +3 -0
  130. package/gsd-core/references/tdd.md +5 -2
  131. package/gsd-core/references/thinking-models-planning.md +18 -2
  132. package/gsd-core/references/verification-patterns.md +17 -4
  133. package/gsd-core/references/worktree-path-safety.md +112 -2
  134. package/gsd-core/templates/README.md +7 -1
  135. package/gsd-core/templates/state.md +6 -3
  136. package/gsd-core/templates/summary.compact.md +212 -0
  137. package/gsd-core/templates/user-setup.compact.md +199 -0
  138. package/gsd-core/templates/user-setup.md +0 -9
  139. package/gsd-core/workflows/add-todo.md +3 -2
  140. package/gsd-core/workflows/autonomous.md +13 -10
  141. package/gsd-core/workflows/check-todos.md +4 -2
  142. package/gsd-core/workflows/cleanup.md +3 -1
  143. package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +7 -0
  144. package/gsd-core/workflows/code-review-fix.md +3 -3
  145. package/gsd-core/workflows/code-review.md +156 -30
  146. package/gsd-core/workflows/complete-milestone/detail/elaboration.md +274 -0
  147. package/gsd-core/workflows/complete-milestone.md +39 -262
  148. package/gsd-core/workflows/docs-update/detail/elaboration.md +179 -0
  149. package/gsd-core/workflows/docs-update.md +14 -155
  150. package/gsd-core/workflows/execute-phase/detail/elaboration.md +124 -0
  151. package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +18 -3
  152. package/gsd-core/workflows/execute-phase/steps/completion-reconciliation.md +56 -0
  153. package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +7 -2
  154. package/gsd-core/workflows/execute-phase/steps/executor-progress-policy.md +43 -0
  155. package/gsd-core/workflows/execute-phase/steps/sequential-root-pin.md +35 -0
  156. package/gsd-core/workflows/execute-phase.md +53 -152
  157. package/gsd-core/workflows/execute-plan.md +20 -7
  158. package/gsd-core/workflows/help/modes/full.compact.md +398 -0
  159. package/gsd-core/workflows/help.md +1 -1
  160. package/gsd-core/workflows/map-codebase.md +50 -3
  161. package/gsd-core/workflows/new-milestone.md +54 -12
  162. package/gsd-core/workflows/new-project/detail/elaboration.md +216 -0
  163. package/gsd-core/workflows/new-project.md +32 -202
  164. package/gsd-core/workflows/plan-phase/detail/elaboration.md +209 -0
  165. package/gsd-core/workflows/plan-phase.md +22 -181
  166. package/gsd-core/workflows/pr-branch.md +19 -7
  167. package/gsd-core/workflows/quick.md +8 -1
  168. package/gsd-core/workflows/reapply-patches.md +77 -3
  169. package/gsd-core/workflows/settings.md +18 -5
  170. package/gsd-core/workflows/update.md +7 -5
  171. package/gsd-core/workflows/verify-work/detail/elaboration.md +230 -0
  172. package/gsd-core/workflows/verify-work.md +20 -180
  173. package/hooks/dist/gsd-agent-isolation-guard.js +42 -16
  174. package/hooks/dist/gsd-context-monitor.js +88 -15
  175. package/hooks/dist/gsd-cursor-subagent-start.js +34 -14
  176. package/hooks/dist/gsd-secret-read-guard.js +44 -18
  177. package/hooks/dist/gsd-statusline.js +11 -7
  178. package/hooks/dist/gsd-validate-commit.sh +34 -4
  179. package/hooks/dist/gsd-worktree-path-guard.js +25 -14
  180. package/hooks/dist/gsd-write-guard.js +46 -1
  181. package/hooks/dist/lib/dispatch-identity.js +187 -0
  182. package/hooks/dist/lib/filename-classification.js +64 -0
  183. package/hooks/dist/lib/isolation-deny-reason.js +53 -1
  184. package/hooks/dist/lib/isolation-sentinel.js +58 -19
  185. package/hooks/gsd-agent-isolation-guard.js +42 -16
  186. package/hooks/gsd-context-monitor.js +88 -15
  187. package/hooks/gsd-cursor-subagent-start.js +34 -14
  188. package/hooks/gsd-secret-read-guard.js +44 -18
  189. package/hooks/gsd-statusline.js +11 -7
  190. package/hooks/gsd-validate-commit.sh +34 -4
  191. package/hooks/gsd-worktree-path-guard.js +25 -14
  192. package/hooks/gsd-write-guard.js +46 -1
  193. package/hooks/lib/dispatch-identity.js +187 -0
  194. package/hooks/lib/filename-classification.js +64 -0
  195. package/hooks/lib/isolation-deny-reason.js +53 -1
  196. package/hooks/lib/isolation-sentinel.js +58 -19
  197. package/package.json +10 -6
  198. package/scripts/benchmark-compact-content-variants.cjs +298 -0
  199. package/scripts/benchmark-compact-content.cjs +368 -0
  200. package/scripts/check-contract-drift.cjs +4 -1
  201. package/scripts/check-env.cjs +36 -8
  202. package/scripts/check-glossary-refs.cjs +25 -21
  203. package/scripts/ci-next-health.cjs +271 -0
  204. package/scripts/ci-prepare-test-scope.cjs +7 -7
  205. package/scripts/ci-test-scope.cjs +126 -20
  206. package/scripts/ci-timeout-report.cjs +1 -1
  207. package/scripts/diff-touches-shipped-paths.cjs +1 -1
  208. package/scripts/docs-guard-registry.cjs +7 -2
  209. package/scripts/gen-adr-index.cjs +8 -2
  210. package/scripts/gen-inventory-manifest.cjs +12 -0
  211. package/scripts/gen-platform-conformance-tier.cjs +557 -0
  212. package/scripts/lib/drift-scan.cjs +1 -1
  213. package/scripts/lib/macos-conformance-tier.generated.cjs +210 -0
  214. package/scripts/lib/npm-version-check-diagnosis.cjs +59 -0
  215. package/scripts/lib/platform-conformance-tier.generated.cjs +276 -0
  216. package/scripts/lib/suite-detection.cjs +32 -0
  217. package/scripts/lint-allowed-tools-parity.cjs +221 -0
  218. package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +19 -2
  219. package/scripts/lint-phase-id-drift.cjs +338 -13
  220. package/scripts/lint-response-language-coverage.cjs +9 -3
  221. package/scripts/lint-source-test-name-collision.cjs +1 -1
  222. package/scripts/lint-test-file-count.allowlist.json +1 -0
  223. package/scripts/lint-vendored-deps.cjs +128 -17
  224. package/scripts/lint-workflow-shellcheck-baseline.json +85 -0
  225. package/scripts/prompt-injection-scan.sh +14 -0
  226. package/scripts/workflow-size.cjs +139 -0
  227. package/skills/gsd-cleanup/SKILL.md +1 -0
  228. package/skills/gsd-code-review/SKILL.md +2 -1
  229. package/skills/gsd-complete-milestone/SKILL.md +1 -0
  230. package/skills/gsd-config/SKILL.md +1 -0
  231. package/skills/gsd-debug/SKILL.md +1 -0
  232. package/skills/gsd-graphify/SKILL.md +1 -0
  233. package/skills/gsd-health/SKILL.md +1 -0
  234. package/skills/gsd-mempalace-capture/SKILL.md +1 -0
  235. package/skills/gsd-mempalace-recall/SKILL.md +1 -0
  236. package/skills/gsd-new-milestone/SKILL.md +1 -0
  237. package/skills/gsd-new-project/SKILL.md +1 -0
  238. package/skills/gsd-next/SKILL.md +1 -0
  239. package/skills/gsd-pause-work/SKILL.md +1 -0
  240. package/skills/gsd-phase/SKILL.md +1 -0
  241. package/skills/gsd-pr-branch/SKILL.md +1 -0
  242. package/skills/gsd-resume-work/SKILL.md +1 -0
  243. package/skills/gsd-review-backlog/SKILL.md +1 -0
  244. package/skills/gsd-settings/SKILL.md +2 -1
  245. package/skills/gsd-stats/SKILL.md +1 -0
  246. package/skills/gsd-thread/SKILL.md +1 -0
  247. package/skills/gsd-workspace/SKILL.md +1 -0
  248. package/skills/gsd-workstreams/SKILL.md +1 -0
  249. package/vscode/package.json +1 -1
  250. package/gsd-core/templates/claude-md.md +0 -145
  251. package/gsd-core/templates/codebase/concerns.md +0 -310
  252. package/gsd-core/templates/codebase/conventions.md +0 -307
  253. package/gsd-core/templates/codebase/integrations.md +0 -280
  254. package/gsd-core/templates/codebase/structure.md +0 -285
  255. package/gsd-core/templates/codebase/testing.md +0 -480
  256. package/gsd-core/templates/debug-subagent-prompt.md +0 -91
  257. package/gsd-core/templates/discovery.md +0 -146
@@ -274,6 +274,26 @@
274
274
  "code": "2086",
275
275
  "message": "Double quote to prevent globbing and word splitting."
276
276
  },
277
+ {
278
+ "file": "gsd-core/workflows/complete-milestone/detail/elaboration.md",
279
+ "code": "2001",
280
+ "message": "See if you can use ${variable//search/replace} instead."
281
+ },
282
+ {
283
+ "file": "gsd-core/workflows/complete-milestone/detail/elaboration.md",
284
+ "code": "2001",
285
+ "message": "See if you can use ${variable//search/replace} instead."
286
+ },
287
+ {
288
+ "file": "gsd-core/workflows/complete-milestone/detail/elaboration.md",
289
+ "code": "2086",
290
+ "message": "Double quote to prevent globbing and word splitting."
291
+ },
292
+ {
293
+ "file": "gsd-core/workflows/complete-milestone/detail/elaboration.md",
294
+ "code": "2086",
295
+ "message": "Double quote to prevent globbing and word splitting."
296
+ },
277
297
  {
278
298
  "file": "gsd-core/workflows/debug.md",
279
299
  "code": "2010",
@@ -369,6 +389,11 @@
369
389
  "code": "2086",
370
390
  "message": "Double quote to prevent globbing and word splitting."
371
391
  },
392
+ {
393
+ "file": "gsd-core/workflows/execute-phase/detail/elaboration.md",
394
+ "code": "2086",
395
+ "message": "Double quote to prevent globbing and word splitting."
396
+ },
372
397
  {
373
398
  "file": "gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md",
374
399
  "code": "2016",
@@ -469,6 +494,56 @@
469
494
  "code": "2012",
470
495
  "message": "Use find instead of ls to better handle non-alphanumeric filenames."
471
496
  },
497
+ {
498
+ "file": "gsd-core/workflows/new-milestone.md",
499
+ "code": "2086",
500
+ "message": "Double quote to prevent globbing and word splitting."
501
+ },
502
+ {
503
+ "file": "gsd-core/workflows/new-milestone.md",
504
+ "code": "2086",
505
+ "message": "Double quote to prevent globbing and word splitting."
506
+ },
507
+ {
508
+ "file": "gsd-core/workflows/new-milestone.md",
509
+ "code": "2086",
510
+ "message": "Double quote to prevent globbing and word splitting."
511
+ },
512
+ {
513
+ "file": "gsd-core/workflows/new-milestone.md",
514
+ "code": "2086",
515
+ "message": "Double quote to prevent globbing and word splitting."
516
+ },
517
+ {
518
+ "file": "gsd-core/workflows/new-milestone.md",
519
+ "code": "2086",
520
+ "message": "Double quote to prevent globbing and word splitting."
521
+ },
522
+ {
523
+ "file": "gsd-core/workflows/new-milestone.md",
524
+ "code": "2086",
525
+ "message": "Double quote to prevent globbing and word splitting."
526
+ },
527
+ {
528
+ "file": "gsd-core/workflows/new-milestone.md",
529
+ "code": "2086",
530
+ "message": "Double quote to prevent globbing and word splitting."
531
+ },
532
+ {
533
+ "file": "gsd-core/workflows/new-milestone.md",
534
+ "code": "2086",
535
+ "message": "Double quote to prevent globbing and word splitting."
536
+ },
537
+ {
538
+ "file": "gsd-core/workflows/new-milestone.md",
539
+ "code": "2086",
540
+ "message": "Double quote to prevent globbing and word splitting."
541
+ },
542
+ {
543
+ "file": "gsd-core/workflows/new-milestone.md",
544
+ "code": "2086",
545
+ "message": "Double quote to prevent globbing and word splitting."
546
+ },
472
547
  {
473
548
  "file": "gsd-core/workflows/new-project.md",
474
549
  "code": "2012",
@@ -479,6 +554,16 @@
479
554
  "code": "2012",
480
555
  "message": "Use find instead of ls to better handle non-alphanumeric filenames."
481
556
  },
557
+ {
558
+ "file": "gsd-core/workflows/new-project/detail/elaboration.md",
559
+ "code": "2012",
560
+ "message": "Use find instead of ls to better handle non-alphanumeric filenames."
561
+ },
562
+ {
563
+ "file": "gsd-core/workflows/new-project/detail/elaboration.md",
564
+ "code": "2012",
565
+ "message": "Use find instead of ls to better handle non-alphanumeric filenames."
566
+ },
482
567
  {
483
568
  "file": "gsd-core/workflows/new-workspace.md",
484
569
  "code": "2164",
@@ -179,6 +179,20 @@ ALLOWLIST=(
179
179
  # rendering, never a command. Same DEFECT.PROMPT-INJECTION-SCAN-COLLISION
180
180
  # class as the input-validator fixtures above.
181
181
  'tests/quick-batch.test.cjs'
182
+ # #4209 — the regression test pinning gsd-code-reviewer.md's untrusted-evidence
183
+ # contract discusses the injection attack it defends against (embedded
184
+ # redirection, "act as an instruction") without performing it. gsd-code-reviewer.md
185
+ # ITSELF is deliberately NOT allowlisted — R2 (#4209 review): a production prompt
186
+ # that ingests untrusted third-party output should stay in-scope for this scanner,
187
+ # not be exempted wholesale; its defense-contract wording was reworded instead to
188
+ # avoid literally spelling out the trigger phrase (see git blame on that section).
189
+ # Same DEFECT.PROMPT-INJECTION-SCAN-COLLISION class as the entries above.
190
+ 'tests/code-review-pipeline-regression.test.cjs'
191
+ # #4209 agy-F1 regression test — a crafted-filename fixture containing the literal
192
+ # phrase "Ignore all prior instructions." to prove validatePaths rejects it before
193
+ # it ever reaches an external-reviewer prompt. Discusses/detects the attack pattern
194
+ # as test data, never performs it. Same class as the entries above.
195
+ 'tests/reviewer-step-dispatch.test.cjs'
182
196
  )
183
197
 
184
198
  is_allowlisted() {
@@ -89,10 +89,149 @@ function measureWorkflows(dir = WORKFLOWS_DIR) {
89
89
  return measureMdFiles(dir);
90
90
  }
91
91
 
92
+ /**
93
+ * #4261: the reserved margin, as a fraction of a tier's hard cap.
94
+ *
95
+ * The hard caps are red lines and stay exactly where they are. This is the
96
+ * second, softer level the caps never had: `execute-phase.md` already carries
97
+ * a hand-rolled version of this shape (a hard `< 93600` plus a `<= 93400`
98
+ * margin whose own message says it exists "so minor future edits don't
99
+ * re-trip the gate"), and it is the only capped file that does. Everywhere
100
+ * else a file is either fine or already over, with nothing in between — so
101
+ * the first signal a contributor gets is a failure, and by then the cheap
102
+ * moment to extract has passed.
103
+ *
104
+ * 95% is deliberately not derived from anything. It is the round number the
105
+ * issue proposed, and the census below is what makes it reviewable: if it
106
+ * turns out to name too many or too few files, that is visible in one table
107
+ * rather than argued from first principles.
108
+ */
109
+ const MARGIN_RATIO = 0.95;
110
+
111
+ /**
112
+ * The reserved-margin threshold for a hard cap, in bytes.
113
+ *
114
+ * Floor, not round: the margin must never land ON or above the cap it is
115
+ * meant to sit under, however small the cap.
116
+ *
117
+ * @param {number} cap - Tier hard cap in bytes.
118
+ * @returns {number} Margin threshold in bytes.
119
+ */
120
+ function marginFor(cap) {
121
+ return Math.floor(cap * MARGIN_RATIO);
122
+ }
123
+
124
+ /**
125
+ * Build the headroom census for a set of measured files.
126
+ *
127
+ * Sorted by pressure (least headroom first) because that is the reading
128
+ * order that matters: the top row is the file that will break next.
129
+ *
130
+ * @param {Object<string, number>} sizes - Map of filename -> LF byte size.
131
+ * @param {function(string): {tier: string, cap: number}} capFor - Tier lookup, keyed by stem.
132
+ * @returns {Array<{name: string, tier: string, bytes: number, cap: number, margin: number, headroom: number, usedPct: number, overMargin: boolean}>}
133
+ */
134
+ function buildHeadroomRows(sizes, capFor) {
135
+ return Object.entries(sizes)
136
+ .map(([file, bytes]) => {
137
+ const name = file.replace(/\.md$/, '');
138
+ const { tier, cap } = capFor(name);
139
+ const margin = marginFor(cap);
140
+ return {
141
+ name,
142
+ tier,
143
+ bytes,
144
+ cap,
145
+ margin,
146
+ headroom: cap - bytes,
147
+ usedPct: (bytes / cap) * 100,
148
+ overMargin: bytes > margin,
149
+ };
150
+ })
151
+ .sort((a, b) => a.headroom - b.headroom || a.name.localeCompare(b.name));
152
+ }
153
+
154
+ /**
155
+ * Render the census as a fixed-width text table for the test diagnostics.
156
+ *
157
+ * @param {ReturnType<typeof buildHeadroomRows>} rows
158
+ * @param {{limit?: number}} [opts] - How many rows to render (default: all).
159
+ * @returns {string[]} Lines, ready to hand to `t.diagnostic` one at a time.
160
+ */
161
+ function formatHeadroomTable(rows, { limit = Infinity } = {}) {
162
+ const shown = rows.slice(0, limit);
163
+ const width = Math.max(4, ...shown.map((r) => r.name.length));
164
+ const head = `${'file'.padEnd(width)} ${'tier'.padEnd(7)} ${'bytes'.padStart(7)} ${'cap'.padStart(7)} ${'margin'.padStart(7)} ${'headroom'.padStart(8)} ${'used'.padStart(6)}`;
165
+ const body = shown.map(
166
+ (r) =>
167
+ `${r.name.padEnd(width)} ${r.tier.padEnd(7)} ${String(r.bytes).padStart(7)} ${String(r.cap).padStart(7)} ${String(r.margin).padStart(7)} ${String(r.headroom).padStart(8)} ${r.usedPct.toFixed(1).padStart(5)}%`,
168
+ );
169
+ return [head, ...body];
170
+ }
171
+
172
+ /**
173
+ * Render the census as a GitHub job-summary markdown table.
174
+ *
175
+ * Only the rows over the reserved margin: a job summary that lists all 124
176
+ * capped files is a log dump nobody reads, and every row below the margin is
177
+ * by definition not the problem. The count of the rest is still reported so
178
+ * an empty table cannot be mistaken for an unmeasured one.
179
+ *
180
+ * @param {string} title - Section heading (e.g. `'Agent size headroom'`).
181
+ * @param {ReturnType<typeof buildHeadroomRows>} rows
182
+ * @returns {string} Markdown block.
183
+ */
184
+ function buildHeadroomSummaryMarkdown(title, rows) {
185
+ const pressured = rows.filter((r) => r.overMargin);
186
+ const lines = [`### ${title}`, ''];
187
+ if (pressured.length === 0) {
188
+ lines.push(`All ${rows.length} files are under the ${Math.round(MARGIN_RATIO * 100)}% reserved margin.`);
189
+ return `${lines.join('\n')}\n`;
190
+ }
191
+ lines.push(
192
+ `**${pressured.length} of ${rows.length}** files are over the ${Math.round(MARGIN_RATIO * 100)}% reserved margin.`,
193
+ '',
194
+ '| file | tier | bytes | cap | headroom | used |',
195
+ '| --- | --- | ---: | ---: | ---: | ---: |',
196
+ );
197
+ for (const r of pressured) {
198
+ lines.push(`| \`${r.name}\` | ${r.tier} | ${r.bytes} | ${r.cap} | ${r.headroom} | ${r.usedPct.toFixed(1)}% |`);
199
+ }
200
+ return `${lines.join('\n')}\n`;
201
+ }
202
+
203
+ /**
204
+ * Append a census block to `$GITHUB_STEP_SUMMARY` when running in CI.
205
+ *
206
+ * No-op off CI, and never throws: this is reporting, and a test suite must
207
+ * not go red because a summary file was not writable.
208
+ *
209
+ * @param {string} title - Section heading.
210
+ * @param {ReturnType<typeof buildHeadroomRows>} rows
211
+ * @param {NodeJS.ProcessEnv} [env]
212
+ * @returns {boolean} Whether anything was written.
213
+ */
214
+ function appendHeadroomStepSummary(title, rows, env = process.env) {
215
+ if (!env.GITHUB_STEP_SUMMARY) return false;
216
+ try {
217
+ fs.appendFileSync(env.GITHUB_STEP_SUMMARY, `${buildHeadroomSummaryMarkdown(title, rows)}\n`);
218
+ return true;
219
+ } catch (err) {
220
+ process.stderr.write(`workflow-size: could not write GITHUB_STEP_SUMMARY: ${err.message}\n`);
221
+ return false;
222
+ }
223
+ }
224
+
92
225
  module.exports = {
93
226
  WORKFLOWS_DIR,
227
+ MARGIN_RATIO,
94
228
  lfByteCount,
95
229
  listWorkflowStems,
96
230
  measureMdFiles,
97
231
  measureWorkflows,
232
+ marginFor,
233
+ buildHeadroomRows,
234
+ formatHeadroomTable,
235
+ buildHeadroomSummaryMarkdown,
236
+ appendHeadroomStepSummary,
98
237
  };
@@ -5,6 +5,7 @@ allowed-tools:
5
5
  - Read
6
6
  - Write
7
7
  - Bash
8
+ - Grep
8
9
  - AskUserQuestion
9
10
  ---
10
11
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: gsd-code-review
3
3
  description: "Review source files changed during a phase for bugs, security issues, and code quality problems"
4
- argument-hint: "<phase-number> [--depth=quick|standard|deep] [--files file1,file2,...] [--fix [--all] [--auto]]"
4
+ argument-hint: "<phase-number> [--depth=quick|standard|deep] [--files file1,file2,...] [--fix [--all] [--auto]] [reviewer-lane flags]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
@@ -26,6 +26,7 @@ Arguments:
26
26
  - `--fix` (optional) — after review completes (or if REVIEW.md already exists), auto-apply fixes found. Spawns gsd-code-fixer agent. Accepts sub-flags:
27
27
  - `--all` — include Info findings in fix scope (default: Critical + Warning only)
28
28
  - `--auto` — enable fix + re-review iteration loop, capped at 3 iterations
29
+ - Optional reviewer-lane flags (#4209) — any flag returned by `gsd_run review-lane flags` (the canonical reviewer-lane roster; e.g. `--codex`, `--agy`) requests that lane independently review the same already-resolved scope alongside the internal `gsd-code-reviewer` agent. Its findings are corroborating evidence only — `gsd-code-reviewer` alone verifies each claim against the actual source and writes REVIEW.md; there is exactly one REVIEW.md schema. No reviewer-lane flag (the default) reviews with only the internal agent, byte-for-byte unchanged from before #4209.
29
30
 
30
31
  Output: {padded_phase}-REVIEW.md in phase directory + inline summary of findings
31
32
  </objective>
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  ---
10
11
 
11
12
 
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  - AskUserQuestion
10
11
  ---
11
12
 
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  - Agent
10
11
  - AskUserQuestion
11
12
  ---
@@ -5,6 +5,7 @@ argument-hint: "[build|query <term>|status|diff]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
8
+ - Grep
8
9
  ---
9
10
 
10
11
 
@@ -5,6 +5,7 @@ argument-hint: "[--repair] [--context]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
8
+ - Grep
8
9
  - Write
9
10
  - AskUserQuestion
10
11
  ---
@@ -5,6 +5,7 @@ argument-hint: "[CONTEXT.md|PLAN.md|SUMMARY.md]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
8
+ - Grep
8
9
  ---
9
10
 
10
11
 
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  ---
10
11
 
11
12
 
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  - Agent
10
11
  - AskUserQuestion
11
12
  ---
@@ -5,6 +5,7 @@ argument-hint: "[--auto]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
8
+ - Grep
8
9
  - Write
9
10
  - Agent
10
11
  - AskUserQuestion
@@ -5,6 +5,7 @@ allowed-tools:
5
5
  - Read
6
6
  - Bash
7
7
  - Glob
8
+ - Grep
8
9
  - SlashCommand
9
10
  - AskUserQuestion
10
11
  ---
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  ---
10
11
 
11
12
 
@@ -7,6 +7,7 @@ allowed-tools:
7
7
  - Write
8
8
  - Bash
9
9
  - Glob
10
+ - Grep
10
11
  ---
11
12
 
12
13
 
@@ -4,6 +4,7 @@ description: "Create a clean PR branch by filtering out .planning/ commits — r
4
4
  argument-hint: "[target branch, default: main]"
5
5
  allowed-tools:
6
6
  - Bash
7
+ - Grep
7
8
  - Read
8
9
  - AskUserQuestion
9
10
  ---
@@ -4,6 +4,7 @@ description: "Resume work from previous session with full context restoration"
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
7
+ - Grep
7
8
  - Write
8
9
  - AskUserQuestion
9
10
  - SlashCommand
@@ -5,6 +5,7 @@ allowed-tools:
5
5
  - Read
6
6
  - Write
7
7
  - Bash
8
+ - Grep
8
9
  - AskUserQuestion
9
10
  ---
10
11
 
@@ -5,6 +5,7 @@ allowed-tools:
5
5
  - Read
6
6
  - Write
7
7
  - Bash
8
+ - Grep
8
9
  - AskUserQuestion
9
10
  ---
10
11
 
@@ -15,7 +16,7 @@ Interactive configuration of GSD workflow agents and model profile via multi-que
15
16
  Routes to the settings workflow which handles:
16
17
  - Config existence ensuring
17
18
  - Current settings reading and parsing
18
- - Interactive 5-question prompt (model, research, plan_check, verifier, branching)
19
+ - Interactive multi-question prompt covering model profile and workflow toggles (research, plan_check, verifier, drift guard, TDD, code review, worktrees, compact content, and more — see `gsd-core/workflows/settings.md` for the current set)
19
20
  - Config merging and writing
20
21
  - Confirmation display with quick command references
21
22
  </objective>
@@ -4,6 +4,7 @@ description: "Display project statistics — phases, plans, requirements, git me
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
7
+ - Grep
7
8
  ---
8
9
 
9
10
  <objective>
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  ---
10
11
 
11
12
 
@@ -6,6 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
+ - Grep
9
10
  - AskUserQuestion
10
11
  ---
11
12
 
@@ -4,6 +4,7 @@ description: "Manage parallel workstreams — list, create, switch, status, prog
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
7
+ - Grep
7
8
  ---
8
9
 
9
10
 
@@ -2,7 +2,7 @@
2
2
  "name": "gsd-core-vscode",
3
3
  "displayName": "GSD Core",
4
4
  "description": "GSD orchestration engine embedded in VS Code (ADR-1239 IDE profile).",
5
- "version": "1.13.0",
5
+ "version": "1.14.0",
6
6
  "publisher": "opengsd",
7
7
  "engines": {
8
8
  "vscode": "^1.105.0"
@@ -1,145 +0,0 @@
1
- # CLAUDE.md Template
2
-
3
- Template for project-root `CLAUDE.md` — auto-generated by `gsd-tools generate-claude-md`.
4
-
5
- Contains 7 marker-bounded sections. Each section is independently updatable.
6
- The `generate-claude-md` subcommand manages 6 sections (project, stack, conventions, architecture, skills, workflow enforcement).
7
- The profile section is managed exclusively by `generate-claude-profile`.
8
-
9
- ---
10
-
11
- ## Section Templates
12
-
13
- ### Project Section
14
- ```
15
- <!-- GSD:project-start source:PROJECT.md -->
16
- ## Project
17
-
18
- {{project_content}}
19
- <!-- GSD:project-end -->
20
- ```
21
-
22
- **Fallback text:**
23
- ```
24
- Project not yet initialized. Run /gsd:new-project to set up.
25
- ```
26
-
27
- ### Stack Section
28
- ```
29
- <!-- GSD:stack-start source:STACK.md -->
30
- ## Technology Stack
31
-
32
- {{stack_content}}
33
- <!-- GSD:stack-end -->
34
- ```
35
-
36
- **Fallback text:**
37
- ```
38
- Technology stack not yet documented. Will populate after codebase mapping or first phase.
39
- ```
40
-
41
- ### Conventions Section
42
- ```
43
- <!-- GSD:conventions-start source:CONVENTIONS.md -->
44
- ## Conventions
45
-
46
- {{conventions_content}}
47
- <!-- GSD:conventions-end -->
48
- ```
49
-
50
- **Fallback text:**
51
- ```
52
- Conventions not yet established. Will populate as patterns emerge during development.
53
- ```
54
-
55
- ### Architecture Section
56
- ```
57
- <!-- GSD:architecture-start source:ARCHITECTURE.md -->
58
- ## Architecture
59
-
60
- {{architecture_content}}
61
- <!-- GSD:architecture-end -->
62
- ```
63
-
64
- **Fallback text:**
65
- ```
66
- Architecture not yet mapped. Follow existing patterns found in the codebase.
67
- ```
68
-
69
- ### Skills Section
70
- ```
71
- <!-- GSD:skills-start source:skills/ -->
72
- ## Project Skills
73
-
74
- | Skill | Description | Path |
75
- | -------------- | --------------------- | ------------------------- |
76
- | {{skill_name}} | {{skill_description}} | `{{skill_path}}/SKILL.md` |
77
- <!-- GSD:skills-end -->
78
- ```
79
-
80
- **Fallback text:**
81
- ```
82
- No project skills found. Add skills to any of: `.claude/skills/`, `.agents/skills/`, `.cursor/skills/`, or `.github/skills/` with a `SKILL.md` index file.
83
- ```
84
-
85
- **Discovery behavior:**
86
- - Scans `.claude/skills/`, `.agents/skills/`, `.cursor/skills/`, `.github/skills/` for subdirectories containing `SKILL.md`
87
- - Extracts `name` and `description` from YAML frontmatter (supports multi-line descriptions)
88
- - Skips GSD's own installed skills (directories starting with `gsd-`)
89
- - Deduplicates by skill name across directories
90
-
91
- ### Workflow Enforcement Section
92
- ```
93
- <!-- GSD:workflow-start source:GSD defaults -->
94
- ## GSD Workflow Enforcement
95
-
96
- Before using Edit, Write, or other file-changing tools, start work through a GSD command so planning artifacts and execution context stay in sync.
97
-
98
- Use these entry points:
99
- - `/gsd:quick` for small fixes, doc updates, and ad-hoc tasks
100
- - `/gsd:debug` for investigation and bug fixing
101
- - `/gsd:execute-phase` for planned phase work
102
-
103
- Do not make direct repo edits outside a GSD workflow unless the user explicitly asks to bypass it.
104
- <!-- GSD:workflow-end -->
105
- ```
106
-
107
- ### Profile Section (Placeholder Only)
108
- ```
109
- <!-- GSD:profile-start -->
110
- ## Developer Profile
111
-
112
- > Profile not yet configured. Run `/gsd:profile-user` to generate your developer profile.
113
- > This section is managed by `generate-claude-profile` — do not edit manually.
114
- <!-- GSD:profile-end -->
115
- ```
116
-
117
- **Note:** This section is NOT managed by `generate-claude-md`. It is managed exclusively
118
- by `generate-claude-profile`. The placeholder above is only used when creating a new
119
- CLAUDE.md file and no profile section exists yet.
120
-
121
- ---
122
-
123
- ## Section Ordering
124
-
125
- 1. **Project** — Identity and purpose (what this project is)
126
- 2. **Stack** — Technology choices (what tools are used)
127
- 3. **Conventions** — Code patterns and rules (how code is written)
128
- 4. **Architecture** — System structure (how components fit together)
129
- 5. **Skills** — Discovered project skills with name and description (what domain knowledge is available)
130
- 6. **Workflow Enforcement** — Default GSD entry points for file-changing work
131
- 7. **Profile** — Developer behavioral preferences (how to interact)
132
-
133
- ## Marker Format
134
-
135
- - Start: `<!-- GSD:{name}-start source:{file} -->`
136
- - End: `<!-- GSD:{name}-end -->`
137
- - Source attribute enables targeted updates when source files change
138
- - Partial match on start marker (without closing `-->`) for detection
139
-
140
- ## Fallback Behavior
141
-
142
- When a source file is missing, fallback text provides Claude-actionable guidance:
143
- - Guides Claude's behavior in the absence of data
144
- - Not placeholder ads or "missing" notices
145
- - Each fallback tells Claude what to do, not just what's absent