@opengsd/gsd-core 1.12.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 (455) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.opencode/plugins/gsd-core.js +12 -0
  4. package/agents/gsd-advisor-researcher.compact.md +85 -0
  5. package/agents/gsd-ai-researcher.compact.md +96 -0
  6. package/agents/gsd-assumptions-analyzer.compact.md +81 -0
  7. package/agents/gsd-code-fixer.compact.md +458 -0
  8. package/agents/gsd-code-fixer.md +5 -5
  9. package/agents/gsd-code-reviewer.compact.md +269 -0
  10. package/agents/gsd-code-reviewer.md +15 -3
  11. package/agents/gsd-codebase-mapper.compact.md +760 -0
  12. package/agents/gsd-debug-session-manager.compact.md +345 -0
  13. package/agents/gsd-doc-classifier.compact.md +192 -0
  14. package/agents/gsd-doc-synthesizer.compact.md +200 -0
  15. package/agents/gsd-doc-verifier.compact.md +143 -0
  16. package/agents/gsd-doc-writer.compact.md +440 -0
  17. package/agents/gsd-dom-verifier.compact.md +138 -0
  18. package/agents/gsd-domain-researcher.compact.md +141 -0
  19. package/agents/gsd-eval-auditor.compact.md +160 -0
  20. package/agents/gsd-eval-planner.compact.md +137 -0
  21. package/agents/gsd-executor.md +63 -35
  22. package/agents/gsd-framework-selector.compact.md +82 -0
  23. package/agents/gsd-integration-checker.compact.md +245 -0
  24. package/agents/gsd-intel-updater.compact.md +226 -0
  25. package/agents/gsd-mempalace-curator.compact.md +45 -0
  26. package/agents/gsd-nyquist-auditor.compact.md +179 -0
  27. package/agents/gsd-pattern-mapper.compact.md +275 -0
  28. package/agents/gsd-plan-checker.md +76 -57
  29. package/agents/gsd-planner.md +14 -0
  30. package/agents/gsd-project-researcher.compact.md +587 -0
  31. package/agents/gsd-research-synthesizer.compact.md +212 -0
  32. package/agents/gsd-roadmapper.compact.md +454 -0
  33. package/agents/gsd-roadmapper.md +13 -0
  34. package/agents/gsd-security-auditor.compact.md +162 -0
  35. package/agents/gsd-ui-auditor.compact.md +404 -0
  36. package/agents/gsd-ui-checker.compact.md +277 -0
  37. package/agents/gsd-ui-checker.md +19 -3
  38. package/agents/gsd-ui-researcher.compact.md +282 -0
  39. package/agents/gsd-ui-researcher.md +29 -0
  40. package/agents/gsd-user-profiler.compact.md +108 -0
  41. package/agents/gsd-verifier.md +23 -1
  42. package/bin/install.js +444 -134
  43. package/commands/gsd/cleanup.md +1 -0
  44. package/commands/gsd/code-review.md +2 -1
  45. package/commands/gsd/complete-milestone.md +1 -0
  46. package/commands/gsd/config.md +1 -0
  47. package/commands/gsd/debug.md +1 -0
  48. package/commands/gsd/execute-phase.md +1 -1
  49. package/commands/gsd/graphify.md +1 -0
  50. package/commands/gsd/health.md +1 -0
  51. package/commands/gsd/mempalace-capture.md +1 -0
  52. package/commands/gsd/mempalace-recall.md +1 -0
  53. package/commands/gsd/new-milestone.md +1 -0
  54. package/commands/gsd/new-project.md +1 -0
  55. package/commands/gsd/next.md +1 -0
  56. package/commands/gsd/ns-workflow.md +2 -1
  57. package/commands/gsd/pause-work.md +1 -0
  58. package/commands/gsd/phase.md +2 -1
  59. package/commands/gsd/pr-branch.md +1 -0
  60. package/commands/gsd/quick-batch.md +105 -0
  61. package/commands/gsd/resume-work.md +1 -0
  62. package/commands/gsd/review-backlog.md +1 -0
  63. package/commands/gsd/settings.md +2 -1
  64. package/commands/gsd/stats.md +1 -0
  65. package/commands/gsd/surface.md +18 -8
  66. package/commands/gsd/thread.md +1 -0
  67. package/commands/gsd/workspace.md +1 -0
  68. package/commands/gsd/workstreams.md +1 -0
  69. package/gsd-core/bin/check-latest-version.cjs +8 -3
  70. package/gsd-core/bin/gsd-tools.cjs +532 -174
  71. package/gsd-core/bin/lib/adr-parser.cjs +1 -1
  72. package/gsd-core/bin/lib/artifacts.cjs +2 -1
  73. package/gsd-core/bin/lib/audit.cjs +39 -22
  74. package/gsd-core/bin/lib/broken-windows.cjs +168 -49
  75. package/gsd-core/bin/lib/capability-activation.cjs +27 -0
  76. package/gsd-core/bin/lib/capability-lifecycle.cjs +10 -6
  77. package/gsd-core/bin/lib/capability-loader.cjs +135 -1
  78. package/gsd-core/bin/lib/capability-registry.cjs +528 -116
  79. package/gsd-core/bin/lib/capability-source.cjs +19 -2
  80. package/gsd-core/bin/lib/capability-state.cjs +7 -1
  81. package/gsd-core/bin/lib/capability-validator.cjs +134 -5
  82. package/gsd-core/bin/lib/capability-writer.cjs +14 -4
  83. package/gsd-core/bin/lib/check-command-router.cjs +198 -38
  84. package/gsd-core/bin/lib/claude-orchestration.cjs +10 -25
  85. package/gsd-core/bin/lib/clusters.cjs +1 -0
  86. package/gsd-core/bin/lib/code-review-depth.cjs +2 -2
  87. package/gsd-core/bin/lib/command-aliases.cjs +16 -0
  88. package/gsd-core/bin/lib/commands.cjs +981 -79
  89. package/gsd-core/bin/lib/config-loader.cjs +4 -0
  90. package/gsd-core/bin/lib/config.cjs +153 -38
  91. package/gsd-core/bin/lib/core-utils.cjs +34 -7
  92. package/gsd-core/bin/lib/coverage.cjs +1 -1
  93. package/gsd-core/bin/lib/decisions.cjs +343 -28
  94. package/gsd-core/bin/lib/edge-probe.cjs +14 -1
  95. package/gsd-core/bin/lib/external-descriptor-trust.cjs +29 -14
  96. package/gsd-core/bin/lib/file-overlap-partitioner.cjs +74 -0
  97. package/gsd-core/bin/lib/frontmatter.cjs +137 -23
  98. package/gsd-core/bin/lib/gap-checker.cjs +22 -13
  99. package/gsd-core/bin/lib/git-base-branch.cjs +10 -2
  100. package/gsd-core/bin/lib/gsd2-import.cjs +1 -2
  101. package/gsd-core/bin/lib/health-diagnostic-rules/phase-structure.cjs +8 -2
  102. package/gsd-core/bin/lib/health-diagnostic-rules/roadmap-disk-consistency.cjs +54 -11
  103. package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +87 -23
  104. package/gsd-core/bin/lib/health-diagnostic-rules/worktree-health.cjs +1 -1
  105. package/gsd-core/bin/lib/host-integration.cjs +57 -5
  106. package/gsd-core/bin/lib/init-command-router.cjs +14 -0
  107. package/gsd-core/bin/lib/init.cjs +539 -60
  108. package/gsd-core/bin/lib/install-engine.cjs +199 -14
  109. package/gsd-core/bin/lib/install-model-override-resolver.cjs +45 -0
  110. package/gsd-core/bin/lib/install-profiles.cjs +36 -14
  111. package/gsd-core/bin/lib/installer-migration-report.cjs +1 -0
  112. package/gsd-core/bin/lib/installer-migrations.cjs +33 -4
  113. package/gsd-core/bin/lib/io.cjs +35 -0
  114. package/gsd-core/bin/lib/loop-resolver.cjs +64 -39
  115. package/gsd-core/bin/lib/markdown-table.cjs +123 -0
  116. package/gsd-core/bin/lib/mcp-catalog.cjs +2 -2
  117. package/gsd-core/bin/lib/milestone.cjs +41 -10
  118. package/gsd-core/bin/lib/model-resolver.cjs +101 -10
  119. package/gsd-core/bin/lib/phase-command-router.cjs +20 -7
  120. package/gsd-core/bin/lib/phase-id.cjs +412 -31
  121. package/gsd-core/bin/lib/phase-lifecycle.cjs +61 -0
  122. package/gsd-core/bin/lib/phase.cjs +941 -98
  123. package/gsd-core/bin/lib/plan-document.cjs +10 -0
  124. package/gsd-core/bin/lib/planning-inspect.cjs +34 -18
  125. package/gsd-core/bin/lib/planning-snapshot.cjs +206 -30
  126. package/gsd-core/bin/lib/planning-workspace.cjs +153 -29
  127. package/gsd-core/bin/lib/pristine-baseline.cjs +182 -0
  128. package/gsd-core/bin/lib/prohibition-enforcement.cjs +91 -4
  129. package/gsd-core/bin/lib/quick-batch-command-router.cjs +285 -0
  130. package/gsd-core/bin/lib/quick-batch-dispatch.cjs +250 -0
  131. package/gsd-core/bin/lib/quick-batch.cjs +840 -0
  132. package/gsd-core/bin/lib/refactor-trigger-command-router.cjs +61 -2
  133. package/gsd-core/bin/lib/research-store.cjs +11 -12
  134. package/gsd-core/bin/lib/review-lane-descriptor.cjs +53 -5
  135. package/gsd-core/bin/lib/review-lane-invocation.cjs +96 -1
  136. package/gsd-core/bin/lib/review-lane-runner.cjs +136 -10
  137. package/gsd-core/bin/lib/reviewer-step-dispatch.cjs +337 -0
  138. package/gsd-core/bin/lib/roadmap-parser.cjs +555 -41
  139. package/gsd-core/bin/lib/roadmap.cjs +292 -69
  140. package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +260 -43
  141. package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +28 -20
  142. package/gsd-core/bin/lib/runtime-artifact-layout.cjs +294 -108
  143. package/gsd-core/bin/lib/runtime-hooks-surface.cjs +408 -47
  144. package/gsd-core/bin/lib/security.cjs +126 -7
  145. package/gsd-core/bin/lib/shell-command-projection.cjs +4 -0
  146. package/gsd-core/bin/lib/smart-entry.cjs +7 -9
  147. package/gsd-core/bin/lib/state-document.cjs +159 -32
  148. package/gsd-core/bin/lib/state-md-schema.cjs +44 -27
  149. package/gsd-core/bin/lib/state-transition.cjs +465 -62
  150. package/gsd-core/bin/lib/state.cjs +906 -151
  151. package/gsd-core/bin/lib/surface.cjs +83 -10
  152. package/gsd-core/bin/lib/task-command-router.cjs +12 -6
  153. package/gsd-core/bin/lib/tdd-red-evidence.cjs +133 -0
  154. package/gsd-core/bin/lib/uat.cjs +1420 -516
  155. package/gsd-core/bin/lib/update-context.cjs +36 -26
  156. package/gsd-core/bin/lib/validate.cjs +230 -12
  157. package/gsd-core/bin/lib/vendor/js-yaml.cjs +11 -3
  158. package/gsd-core/bin/lib/verification-command-router.cjs +2 -1
  159. package/gsd-core/bin/lib/verification.cjs +316 -23
  160. package/gsd-core/bin/lib/verify-command-grounding.cjs +1 -1
  161. package/gsd-core/bin/lib/verify-command-router.cjs +1 -0
  162. package/gsd-core/bin/lib/verify.cjs +531 -36
  163. package/gsd-core/bin/lib/workstream-inventory.cjs +21 -2
  164. package/gsd-core/bin/lib/worktree-safety.cjs +21 -7
  165. package/gsd-core/bin/shared/config-defaults.manifest.json +1 -0
  166. package/gsd-core/bin/shared/config-schema.manifest.json +13 -0
  167. package/gsd-core/bin/verify-reapply-patches.cjs +507 -81
  168. package/gsd-core/references/agent-contracts.md +3 -3
  169. package/gsd-core/references/compact-content-gate.md +66 -0
  170. package/gsd-core/references/edge-probe.md +17 -13
  171. package/gsd-core/references/execute-mvp-tdd.md +18 -16
  172. package/gsd-core/references/execute-phase-response-language.md +6 -0
  173. package/gsd-core/references/executor-examples.md +42 -0
  174. package/gsd-core/references/few-shot-examples/plan-checker.md +15 -15
  175. package/gsd-core/references/loop-hook-dispatch.md +18 -0
  176. package/gsd-core/references/model-profiles.md +12 -3
  177. package/gsd-core/references/mvp-concepts.md +2 -2
  178. package/gsd-core/references/plan-checker-examples.md +41 -0
  179. package/gsd-core/references/planner-antipatterns.md +25 -0
  180. package/gsd-core/references/planner-chunked.md +5 -1
  181. package/gsd-core/references/planner-coupling.md +42 -0
  182. package/gsd-core/references/planner-quick-batch.md +71 -0
  183. package/gsd-core/references/planner-reviews.md +47 -0
  184. package/gsd-core/references/planner-revision.md +75 -2
  185. package/gsd-core/references/planning-config.md +5 -1
  186. package/gsd-core/references/response-language-directive.md +9 -0
  187. package/gsd-core/references/revision-loop.md +118 -11
  188. package/gsd-core/references/tdd.md +17 -9
  189. package/gsd-core/references/thinking-models-planning.md +18 -2
  190. package/gsd-core/references/verification-patterns.md +17 -4
  191. package/gsd-core/references/verifier-evidence-gate.md +160 -0
  192. package/gsd-core/references/worktree-path-safety.md +112 -2
  193. package/gsd-core/templates/README.md +7 -1
  194. package/gsd-core/templates/phase-prompt.md +4 -0
  195. package/gsd-core/templates/state.md +6 -3
  196. package/gsd-core/templates/summary.compact.md +212 -0
  197. package/gsd-core/templates/user-setup.compact.md +199 -0
  198. package/gsd-core/templates/user-setup.md +0 -9
  199. package/gsd-core/templates/verification-report.md +5 -0
  200. package/gsd-core/workflows/add-backlog.md +2 -0
  201. package/gsd-core/workflows/add-phase.md +2 -0
  202. package/gsd-core/workflows/add-tests.md +1 -1
  203. package/gsd-core/workflows/add-todo.md +4 -3
  204. package/gsd-core/workflows/ai-integration-phase.md +1 -1
  205. package/gsd-core/workflows/analyze-dependencies.md +2 -0
  206. package/gsd-core/workflows/audit-fix.md +2 -0
  207. package/gsd-core/workflows/audit-milestone.md +2 -0
  208. package/gsd-core/workflows/audit-uat.md +2 -0
  209. package/gsd-core/workflows/autonomous.md +15 -10
  210. package/gsd-core/workflows/check-todos.md +5 -3
  211. package/gsd-core/workflows/cleanup.md +4 -2
  212. package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +22 -13
  213. package/gsd-core/workflows/code-review-fix.md +5 -3
  214. package/gsd-core/workflows/code-review.md +211 -43
  215. package/gsd-core/workflows/complete-milestone/detail/elaboration.md +274 -0
  216. package/gsd-core/workflows/complete-milestone.md +40 -254
  217. package/gsd-core/workflows/debug.md +1 -1
  218. package/gsd-core/workflows/diagnose-issues.md +5 -1
  219. package/gsd-core/workflows/discuss-phase/modes/advisor.md +2 -0
  220. package/gsd-core/workflows/discuss-phase/modes/all.md +2 -0
  221. package/gsd-core/workflows/discuss-phase/modes/analyze.md +2 -0
  222. package/gsd-core/workflows/discuss-phase/modes/auto.md +2 -0
  223. package/gsd-core/workflows/discuss-phase/modes/batch.md +2 -0
  224. package/gsd-core/workflows/discuss-phase/modes/chain.md +2 -0
  225. package/gsd-core/workflows/discuss-phase/modes/default.md +2 -0
  226. package/gsd-core/workflows/discuss-phase/modes/power.md +2 -0
  227. package/gsd-core/workflows/discuss-phase/modes/text.md +2 -0
  228. package/gsd-core/workflows/discuss-phase/templates/context.md +2 -0
  229. package/gsd-core/workflows/discuss-phase/templates/discussion-log.md +2 -0
  230. package/gsd-core/workflows/discuss-phase-assumptions.md +1 -1
  231. package/gsd-core/workflows/discuss-phase-power.md +2 -0
  232. package/gsd-core/workflows/discuss-phase.md +1 -1
  233. package/gsd-core/workflows/do.md +43 -13
  234. package/gsd-core/workflows/docs-update/detail/elaboration.md +179 -0
  235. package/gsd-core/workflows/docs-update.md +15 -156
  236. package/gsd-core/workflows/edit-phase.md +2 -0
  237. package/gsd-core/workflows/eval-review.md +1 -1
  238. package/gsd-core/workflows/execute-phase/detail/elaboration.md +124 -0
  239. package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +20 -3
  240. package/gsd-core/workflows/execute-phase/steps/completion-reconciliation.md +56 -0
  241. package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +24 -3
  242. package/gsd-core/workflows/execute-phase/steps/executor-progress-policy.md +43 -0
  243. package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +8 -2
  244. package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +2 -0
  245. package/gsd-core/workflows/execute-phase/steps/sequential-root-pin.md +35 -0
  246. package/gsd-core/workflows/execute-phase/steps/tdd-applicability-resolution.md +25 -0
  247. package/gsd-core/workflows/execute-phase/steps/worktree-recovery-policy.md +2 -0
  248. package/gsd-core/workflows/execute-phase.md +78 -159
  249. package/gsd-core/workflows/execute-plan.md +28 -15
  250. package/gsd-core/workflows/explore.md +2 -0
  251. package/gsd-core/workflows/extract-learnings.md +2 -0
  252. package/gsd-core/workflows/fast.md +6 -0
  253. package/gsd-core/workflows/forensics.md +2 -0
  254. package/gsd-core/workflows/graduation.md +1 -1
  255. package/gsd-core/workflows/health.md +1 -1
  256. package/gsd-core/workflows/help/modes/brief.md +2 -0
  257. package/gsd-core/workflows/help/modes/default.md +2 -0
  258. package/gsd-core/workflows/help/modes/full.compact.md +398 -0
  259. package/gsd-core/workflows/help/modes/full.md +12 -0
  260. package/gsd-core/workflows/help/modes/topic.md +2 -0
  261. package/gsd-core/workflows/help.md +3 -1
  262. package/gsd-core/workflows/import.md +3 -3
  263. package/gsd-core/workflows/inbox.md +1 -1
  264. package/gsd-core/workflows/ingest-docs.md +1 -1
  265. package/gsd-core/workflows/insert-phase.md +2 -0
  266. package/gsd-core/workflows/list-phase-assumptions.md +2 -0
  267. package/gsd-core/workflows/list-seeds.md +2 -0
  268. package/gsd-core/workflows/list-workspaces.md +2 -0
  269. package/gsd-core/workflows/manager.md +3 -3
  270. package/gsd-core/workflows/map-codebase.md +52 -3
  271. package/gsd-core/workflows/milestone-summary.md +2 -0
  272. package/gsd-core/workflows/mvp-phase.md +1 -1
  273. package/gsd-core/workflows/new-milestone.md +55 -13
  274. package/gsd-core/workflows/new-project/detail/elaboration.md +216 -0
  275. package/gsd-core/workflows/new-project.md +37 -205
  276. package/gsd-core/workflows/new-workspace.md +1 -1
  277. package/gsd-core/workflows/next.md +2 -0
  278. package/gsd-core/workflows/node-repair.md +2 -0
  279. package/gsd-core/workflows/note.md +2 -0
  280. package/gsd-core/workflows/onboard.md +1 -1
  281. package/gsd-core/workflows/pause-work.md +19 -4
  282. package/gsd-core/workflows/plan-phase/detail/elaboration.md +209 -0
  283. package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +100 -18
  284. package/gsd-core/workflows/plan-phase/steps/prd-express-path.md +2 -0
  285. package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +9 -0
  286. package/gsd-core/workflows/plan-phase.md +144 -185
  287. package/gsd-core/workflows/plan-review-convergence.md +102 -10
  288. package/gsd-core/workflows/plant-seed.md +1 -1
  289. package/gsd-core/workflows/pr-branch.md +30 -10
  290. package/gsd-core/workflows/profile-user.md +1 -1
  291. package/gsd-core/workflows/progress/steps/forensic-audit.md +1 -1
  292. package/gsd-core/workflows/progress.md +25 -3
  293. package/gsd-core/workflows/quick/steps/plan-checker-loop.md +37 -2
  294. package/gsd-core/workflows/quick/steps/research-phase.md +3 -3
  295. package/gsd-core/workflows/quick-batch/steps/batch-init.md +55 -0
  296. package/gsd-core/workflows/quick-batch/steps/completion.md +65 -0
  297. package/gsd-core/workflows/quick-batch/steps/merge-wave.md +100 -0
  298. package/gsd-core/workflows/quick-batch/steps/plan-checker-loop.md +147 -0
  299. package/gsd-core/workflows/quick-batch/steps/planner-wave.md +158 -0
  300. package/gsd-core/workflows/quick-batch/steps/research-phase.md +95 -0
  301. package/gsd-core/workflows/quick-batch/steps/resume-mode.md +49 -0
  302. package/gsd-core/workflows/quick-batch/steps/verification-wave.md +73 -0
  303. package/gsd-core/workflows/quick-batch/steps/worktree-dispatch.md +169 -0
  304. package/gsd-core/workflows/quick-batch.md +203 -0
  305. package/gsd-core/workflows/quick.md +21 -4
  306. package/gsd-core/workflows/reapply-patches.md +79 -3
  307. package/gsd-core/workflows/remove-phase.md +2 -0
  308. package/gsd-core/workflows/remove-workspace.md +1 -1
  309. package/gsd-core/workflows/resume-project.md +6 -2
  310. package/gsd-core/workflows/review.md +215 -10
  311. package/gsd-core/workflows/scan.md +2 -0
  312. package/gsd-core/workflows/section-manifest.json +12 -0
  313. package/gsd-core/workflows/secure-phase.md +1 -1
  314. package/gsd-core/workflows/session-report.md +2 -0
  315. package/gsd-core/workflows/settings-advanced.md +2 -0
  316. package/gsd-core/workflows/settings-integrations.md +9 -8
  317. package/gsd-core/workflows/settings.md +19 -6
  318. package/gsd-core/workflows/ship.md +10 -10
  319. package/gsd-core/workflows/sketch-wrap-up.md +2 -0
  320. package/gsd-core/workflows/sketch.md +1 -1
  321. package/gsd-core/workflows/smart-entry.md +1 -1
  322. package/gsd-core/workflows/spec-phase.md +24 -19
  323. package/gsd-core/workflows/spike-wrap-up.md +2 -0
  324. package/gsd-core/workflows/spike.md +1 -1
  325. package/gsd-core/workflows/stats.md +2 -0
  326. package/gsd-core/workflows/sync-skills.md +12 -4
  327. package/gsd-core/workflows/thread.md +2 -0
  328. package/gsd-core/workflows/transition.md +2 -0
  329. package/gsd-core/workflows/ui-phase.md +26 -5
  330. package/gsd-core/workflows/ui-review.md +1 -1
  331. package/gsd-core/workflows/ultraplan-phase.md +2 -0
  332. package/gsd-core/workflows/undo.md +1 -1
  333. package/gsd-core/workflows/update.md +48 -43
  334. package/gsd-core/workflows/validate-phase.md +1 -1
  335. package/gsd-core/workflows/verify-work/detail/elaboration.md +230 -0
  336. package/gsd-core/workflows/verify-work.md +68 -182
  337. package/hooks/dist/gsd-agent-isolation-guard.js +42 -16
  338. package/hooks/dist/gsd-check-update-worker.js +19 -2
  339. package/hooks/dist/gsd-context-monitor.js +371 -27
  340. package/hooks/dist/gsd-cursor-subagent-start.js +34 -14
  341. package/hooks/dist/gsd-node-runner.sh +1 -0
  342. package/hooks/dist/gsd-prompt-guard.js +30 -5
  343. package/hooks/dist/gsd-read-guard.js +2 -0
  344. package/hooks/dist/gsd-read-injection-scanner.js +5 -5
  345. package/hooks/dist/gsd-secret-read-guard.js +1105 -0
  346. package/hooks/dist/gsd-statusline.js +18 -10
  347. package/hooks/dist/gsd-validate-commit.sh +474 -7
  348. package/hooks/dist/gsd-workflow-guard.js +2 -1
  349. package/hooks/dist/gsd-worktree-path-guard.js +25 -14
  350. package/hooks/dist/gsd-write-guard.js +46 -1
  351. package/hooks/dist/lib/dispatch-identity.js +187 -0
  352. package/hooks/dist/lib/filename-classification.js +64 -0
  353. package/hooks/dist/lib/git-cmd.js +210 -1
  354. package/hooks/dist/lib/injection-patterns.js +36 -6
  355. package/hooks/dist/lib/isolation-deny-reason.js +53 -1
  356. package/hooks/dist/lib/isolation-sentinel.js +58 -19
  357. package/hooks/dist/managed-hooks-registry.cjs +1 -0
  358. package/hooks/gsd-agent-isolation-guard.js +42 -16
  359. package/hooks/gsd-check-update-worker.js +19 -2
  360. package/hooks/gsd-context-monitor.js +371 -27
  361. package/hooks/gsd-cursor-subagent-start.js +34 -14
  362. package/hooks/gsd-node-runner.sh +1 -0
  363. package/hooks/gsd-prompt-guard.js +30 -5
  364. package/hooks/gsd-read-guard.js +2 -0
  365. package/hooks/gsd-read-injection-scanner.js +5 -5
  366. package/hooks/gsd-secret-read-guard.js +1105 -0
  367. package/hooks/gsd-statusline.js +18 -10
  368. package/hooks/gsd-validate-commit.sh +474 -7
  369. package/hooks/gsd-workflow-guard.js +2 -1
  370. package/hooks/gsd-worktree-path-guard.js +25 -14
  371. package/hooks/gsd-write-guard.js +46 -1
  372. package/hooks/hooks.json +6 -0
  373. package/hooks/lib/dispatch-identity.js +187 -0
  374. package/hooks/lib/filename-classification.js +64 -0
  375. package/hooks/lib/git-cmd.js +210 -1
  376. package/hooks/lib/injection-patterns.js +36 -6
  377. package/hooks/lib/isolation-deny-reason.js +53 -1
  378. package/hooks/lib/isolation-sentinel.js +58 -19
  379. package/hooks/managed-hooks-registry.cjs +1 -0
  380. package/package.json +13 -9
  381. package/scripts/benchmark-compact-content-variants.cjs +298 -0
  382. package/scripts/benchmark-compact-content.cjs +368 -0
  383. package/scripts/build-hooks.js +11 -4
  384. package/scripts/check-contract-drift.cjs +4 -1
  385. package/scripts/check-env.cjs +36 -8
  386. package/scripts/check-glossary-refs.cjs +25 -21
  387. package/scripts/ci-next-health.cjs +271 -0
  388. package/scripts/ci-prepare-test-scope.cjs +7 -7
  389. package/scripts/ci-test-scope.cjs +133 -20
  390. package/scripts/ci-timeout-report.cjs +1 -1
  391. package/scripts/diff-touches-shipped-paths.cjs +1 -1
  392. package/scripts/docs-guard-registry.cjs +17 -2
  393. package/scripts/gen-adr-index.cjs +8 -2
  394. package/scripts/gen-inventory-manifest.cjs +12 -0
  395. package/scripts/gen-loop-host-contract.cjs +67 -15
  396. package/scripts/gen-platform-conformance-tier.cjs +557 -0
  397. package/scripts/lib/drift-scan.cjs +1 -1
  398. package/scripts/lib/macos-conformance-tier.generated.cjs +210 -0
  399. package/scripts/lib/npm-version-check-diagnosis.cjs +59 -0
  400. package/scripts/lib/platform-conformance-tier.generated.cjs +276 -0
  401. package/scripts/lib/shellcheck-fetch.cjs +247 -0
  402. package/scripts/lib/suite-detection.cjs +32 -0
  403. package/scripts/lint-allow-test-rule-refs.allowlist.json +0 -6
  404. package/scripts/lint-allow-test-rule-refs.effective-ceiling.json +1 -1
  405. package/scripts/lint-allow-test-rule-refs.unverified-ceiling.json +1 -1
  406. package/scripts/lint-allowed-tools-parity.cjs +221 -0
  407. package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +24 -2
  408. package/scripts/lint-phase-enumeration-drift.cjs +24 -6
  409. package/scripts/lint-phase-id-drift.cjs +465 -15
  410. package/scripts/lint-portable-grep.cjs +176 -0
  411. package/scripts/lint-response-language-coverage.cjs +530 -0
  412. package/scripts/lint-source-test-name-collision.cjs +1 -1
  413. package/scripts/lint-test-file-count.allowlist.json +4 -1
  414. package/scripts/lint-vendored-deps.cjs +128 -17
  415. package/scripts/lint-workflow-shellcheck-baseline.json +1112 -0
  416. package/scripts/lint-workflow-shellcheck.cjs +614 -0
  417. package/scripts/npm-audit-baseline.cjs +376 -0
  418. package/scripts/prompt-injection-scan.sh +22 -0
  419. package/scripts/require-issue-link-policy.cjs +16 -1
  420. package/scripts/workflow-size.cjs +139 -0
  421. package/skills/gsd-cleanup/SKILL.md +1 -0
  422. package/skills/gsd-code-review/SKILL.md +2 -1
  423. package/skills/gsd-complete-milestone/SKILL.md +1 -0
  424. package/skills/gsd-config/SKILL.md +1 -0
  425. package/skills/gsd-debug/SKILL.md +1 -0
  426. package/skills/gsd-execute-phase/SKILL.md +1 -1
  427. package/skills/gsd-graphify/SKILL.md +1 -0
  428. package/skills/gsd-health/SKILL.md +1 -0
  429. package/skills/gsd-mempalace-capture/SKILL.md +1 -0
  430. package/skills/gsd-mempalace-recall/SKILL.md +1 -0
  431. package/skills/gsd-new-milestone/SKILL.md +1 -0
  432. package/skills/gsd-new-project/SKILL.md +1 -0
  433. package/skills/gsd-next/SKILL.md +1 -0
  434. package/skills/gsd-ns-workflow/SKILL.md +1 -0
  435. package/skills/gsd-pause-work/SKILL.md +1 -0
  436. package/skills/gsd-phase/SKILL.md +2 -1
  437. package/skills/gsd-pr-branch/SKILL.md +1 -0
  438. package/skills/gsd-quick-batch/SKILL.md +105 -0
  439. package/skills/gsd-resume-work/SKILL.md +1 -0
  440. package/skills/gsd-review-backlog/SKILL.md +1 -0
  441. package/skills/gsd-settings/SKILL.md +2 -1
  442. package/skills/gsd-stats/SKILL.md +1 -0
  443. package/skills/gsd-surface/SKILL.md +18 -8
  444. package/skills/gsd-thread/SKILL.md +1 -0
  445. package/skills/gsd-workspace/SKILL.md +1 -0
  446. package/skills/gsd-workstreams/SKILL.md +1 -0
  447. package/vscode/package.json +1 -1
  448. package/gsd-core/templates/claude-md.md +0 -145
  449. package/gsd-core/templates/codebase/concerns.md +0 -310
  450. package/gsd-core/templates/codebase/conventions.md +0 -307
  451. package/gsd-core/templates/codebase/integrations.md +0 -280
  452. package/gsd-core/templates/codebase/structure.md +0 -285
  453. package/gsd-core/templates/codebase/testing.md +0 -480
  454. package/gsd-core/templates/debug-subagent-prompt.md +0 -91
  455. package/gsd-core/templates/discovery.md +0 -146
@@ -0,0 +1,71 @@
1
+ # Quick-Batch Mode — Planner Reference
2
+
3
+ Triggered when `<planning_context>` declares `**Mode:** quick-batch`
4
+ (#3676, epic #3344, ADR-1239 "Quick-batch binding"). One dispatch = one
5
+ item's plan — the SAME single-plan, 1-3-task scope as `/gsd:quick`'s own
6
+ `quick`/`quick-full` modes, with one fixed difference: **`depends_on` and
7
+ `files_modified` frontmatter are ALWAYS required, regardless of whether
8
+ `--validate` was requested.** This reuses the EXISTING frontmatter grammar
9
+ (the same keys full phase planning already emits — see the frontmatter
10
+ schema table above); it is not a new schema.
11
+
12
+ **Why always, not gated on `--validate`.** The coordinating workflow
13
+ (`gsd-core/workflows/quick-batch.md`) recomputes every item's execution wave
14
+ from these two fields after each DAG layer's planners return (`quick-batch
15
+ update`, wrapping `updateBatchItems`) — without them, every item stays in
16
+ wave 0 forever and the batch cannot parallelize independent items or
17
+ sequence dependent ones correctly. This is load-bearing dispatch input, not
18
+ an optional quality signal.
19
+
20
+ ### `depends_on` — reference SIBLING items by `quick_id`, never invent one
21
+
22
+ The `<planning_context>` you receive includes a **full batch task catalog** —
23
+ every item's `quick_id` + description, not just your own. When your item's
24
+ implementation genuinely requires another item's item to land first (shared
25
+ file, prerequisite API, sequencing the user implied), declare it:
26
+
27
+ ```yaml
28
+ depends_on: ["260101-abc"] # a quick_id from the task catalog
29
+ ```
30
+
31
+ - Reference ONLY `quick_id`s from the task catalog you were given. Never
32
+ reference a plan id from a phase, another batch, or a value you invented.
33
+ - Empty array (`depends_on: []`) is the correct, common answer when your item
34
+ is genuinely independent — do not manufacture a dependency to seem
35
+ thorough.
36
+ - A dependency on your OWN `quick_id` (self-reference) or on an id outside
37
+ the catalog is rejected by `quick-batch update` and blocks the whole
38
+ layer's persistence — when uncertain, prefer `[]` over a guess.
39
+
40
+ ### `files_modified` — every path your plan's tasks will touch
41
+
42
+ ```yaml
43
+ files_modified: ["src/foo.ts", "tests/foo.test.ts"]
44
+ ```
45
+
46
+ Used two ways downstream, both from THIS field (never re-derived from your
47
+ plan's prose): (1) `partitionByFileOverlap` splits same-wave items that
48
+ would touch the same file into separate waves, so two isolated worktrees
49
+ never race on one path; (2) at merge time the coordinator reads it FRESH from
50
+ your PLAN.md (not from what you declared here at planning time — keep the
51
+ frontmatter accurate if you revise the plan) for the advisory scope-
52
+ conformance check.
53
+
54
+ ### `files_deleted` — only if your plan removes a file
55
+
56
+ ```yaml
57
+ files_deleted: ["legacy/old-module.ts"]
58
+ ```
59
+
60
+ Optional; omit entirely when your plan deletes nothing. If your plan DOES
61
+ delete a file and you omit this, the merge's deletions guard blocks that
62
+ deletion as undeclared — there is no "authorize everything" fallback.
63
+
64
+ ### What quick-batch mode does NOT need
65
+
66
+ Same exclusions as `/gsd:quick`'s own modes: no `requirements` (no ROADMAP
67
+ linkage — a quick-batch item is not a phase), no `estimate` block, no
68
+ `user_setup` unless genuinely needed. `must_haves` is required only when the
69
+ calling prompt's own `<constraints>` says so (mirrors `--validate`'s
70
+ existing quick-full behavior) — that instruction rides the prompt, not this
71
+ reference.
@@ -40,3 +40,50 @@ Use standard PLANNING COMPLETE return format, adding a reviews section:
40
40
  |---------|--------|
41
41
  | {concern} | {why — out of scope, disagree, etc.} |
42
42
  ```
43
+
44
+ ### Step 5: Write the ledger into PLAN.md (#3806)
45
+
46
+ The two tables above are not only the planner's return payload — they are also the **canonical
47
+ Review Dispositions Ledger**, and they belong in the affected PLAN.md itself, in this exact shape.
48
+ `gsd-core/workflows/plan-phase.md` (`<review_incorporation_contract>`) and
49
+ `agents/gsd-plan-checker.md` (Review Incorporation dimension) both point back to this section for
50
+ the ledger's shape rather than restating it — this is the one place it is defined.
51
+
52
+ ## Review Dispositions Ledger
53
+
54
+ Add or extend a `## Review Dispositions Ledger` section in the affected PLAN.md, containing one
55
+ `### Round {N} — {REVIEWS_sha}` subsection per reviews-mode round that touched this plan, where
56
+ `{REVIEWS_sha}` is the commit that wrote the REVIEWS.md snapshot being ruled on (the short sha from
57
+ `git log -1 --format=%h -- <phase_dir>/<NN>-REVIEWS.md`, after `workflows/review.md`'s REVIEWS.md
58
+ commit step). Under each round heading, use the two tables from Step 4 above, unchanged in shape:
59
+
60
+ ```markdown
61
+ ## Review Dispositions Ledger
62
+
63
+ ### Round 1 — a1b2c3d
64
+
65
+ ### Review Feedback Addressed
66
+ | Concern | Severity | How Addressed |
67
+ |---------|----------|---------------|
68
+ | {concern} | HIGH | Plan {N}, Task {M}: {how} |
69
+
70
+ ### Review Feedback Deferred
71
+ | Concern | Reason |
72
+ |---------|--------|
73
+ | {concern} | {why — out of scope, disagree, etc.} |
74
+ ```
75
+
76
+ **Anchoring.** Any reference to a specific REVIEWS.md line cites `L##@{REVIEWS_sha}` (e.g.
77
+ `L32@a1b2c3d`) — a bare line number is meaningless once the next round rewrites REVIEWS.md
78
+ wholesale. `{Concern}` and `{Reason}` stay free text; do not invent a reviewer/severity enum — the
79
+ reviewer roster is capability-owned and open to third-party additions (see each capability's
80
+ `reviewer.reviewsSection`).
81
+
82
+ **Append-only.** A later round never edits or deletes a prior round's tables. To overturn a prior
83
+ round's verdict, add a new row in the current round's table whose Reason/How Addressed names the
84
+ round and concern it supersedes (e.g. "Supersedes Round 1 Deferred: {concern} — now addressed in
85
+ Plan 3").
86
+
87
+ **Out of scope for this contract.** A deterministic lint/check verb that mechanically enforces this
88
+ shape is a separate, later addition (#3806 part 2) — this section defines the format only. Legacy
89
+ PLAN.md content written before this convention existed is not migrated or flagged by it.
@@ -21,12 +21,43 @@ issues:
21
21
  - plan: "16-01"
22
22
  dimension: "task_completeness"
23
23
  severity: "blocker"
24
+ required_property: "Every `auto` task has a `<verify>` separating pass from fail"
24
25
  description: "Task 2 missing <verify> element"
25
26
  fix_hint: "Add verification command for build output"
26
27
  ```
27
28
 
28
29
  Group by plan, dimension, severity.
29
30
 
31
+ **What binds and what does not.** `required_property` (the invariant that must hold),
32
+ `description` (the evidence it does not) and `severity` are binding. `fix_hint` is **one
33
+ example** of a route to that property — an illustration, never an instruction. You address an
34
+ issue by making `required_property` true; the hint's own mechanism is optional.
35
+
36
+ An older checker may return an issue with no `required_property`. Derive it from `dimension`
37
+ + `description` and state the derived property in your revision summary. Never treat the
38
+ absence of the field as licence to apply `fix_hint` literally.
39
+
40
+ **Prefer the smallest sufficient mechanism.** If a smaller change than the hint makes
41
+ `required_property` true, take it — that fully addresses the issue and must be reported as
42
+ addressed, naming the property satisfied and the mechanism used.
43
+
44
+ ### Step 2.5: Constraint Re-check (before any edit)
45
+
46
+ Before editing, re-read the constraints already in force:
47
+
48
+ - Locked decisions in CONTEXT.md (`## Decisions`) and deferred ideas (`## Deferred Ideas`)
49
+ - Active capability / project guidance (CLAUDE.md, `.claude/skills/`, `.agents/skills/`)
50
+ - Constraints the existing plans already encode (chosen mechanism, scope boundary, must_haves)
51
+
52
+ A `fix_hint` conflicts when applying it would contradict any of those. Applying it anyway is
53
+ a contract violation, not a judgement call. When a hint conflicts — or when the property is
54
+ unreachable without breaking a constraint — do NOT edit around it and do NOT burn a revision
55
+ iteration on it: emit `## REVISION_CONFLICT` (Step 7) for that issue, apply every
56
+ non-conflicting issue normally, and return.
57
+
58
+ A hint that merely proposes a *bigger* mechanism than needed is not a conflict. Take the
59
+ smaller route under Step 2 and report it as addressed.
60
+
30
61
  ### Step 3: Revision Strategy
31
62
 
32
63
  | Dimension | Strategy |
@@ -38,15 +69,25 @@ Group by plan, dimension, severity.
38
69
  | scope_sanity | Split into multiple plans |
39
70
  | must_haves_derivation | Derive and add must_haves to frontmatter |
40
71
 
72
+ Each strategy is the usual route, not the only one. Any change that makes the issue's
73
+ `required_property` true is a valid strategy.
74
+
41
75
  ### Step 4: Make Targeted Updates
42
76
 
43
77
  **DO:** Edit specific flagged sections, preserve working parts, update waves if dependencies change.
78
+ Choose the smallest mechanism that makes each issue's `required_property` true — explicitly
79
+ including a mechanism smaller than, or different from, the one its `fix_hint` names.
44
80
 
45
- **DO NOT:** Rewrite entire plans for minor issues, add unnecessary tasks, break existing working plans.
81
+ **DO NOT:** Rewrite entire plans for minor issues, add unnecessary tasks, break existing working
82
+ plans, or apply a `fix_hint` that contradicts a constraint from Step 2.5 — that one goes to
83
+ `## REVISION_CONFLICT` instead.
46
84
 
47
85
  ### Step 5: Validate Changes
48
86
 
49
- - [ ] All flagged issues addressed
87
+ - [ ] Every flagged issue's `required_property` now holds — reached by its `fix_hint` OR by a
88
+ smaller/different mechanism (both count as addressed), OR raised as `## REVISION_CONFLICT`
89
+ - [ ] No `fix_hint` applied that contradicts a locked decision, capability guidance, or an
90
+ existing plan constraint (Step 2.5)
50
91
  - [ ] No new issues introduced
51
92
  - [ ] Wave numbers still valid
52
93
  - [ ] Dependencies still correct
@@ -85,3 +126,35 @@ gsd_run query commit "fix($PHASE): revise plans based on checker feedback" --fil
85
126
  |-------|--------|
86
127
  | {issue} | {why - needs user input, architectural change, etc.} |
87
128
  ```
129
+
130
+ ### Step 7b: Return Revision Conflict (when Step 2.5 found one)
131
+
132
+ Emit this INSTEAD OF `## REVISION COMPLETE` when at least one issue could not be addressed
133
+ without contradicting a constraint. Non-conflicting issues you already fixed stay listed under
134
+ `### Changes Made` so the work is not lost. The orchestrator routes this to the user or to the
135
+ configured plan-review convergence loop; it does not count as a failed revision iteration.
136
+
137
+ ```markdown
138
+ ## REVISION_CONFLICT
139
+
140
+ **Conflicts:** {N} | **Issues addressed anyway:** {M}
141
+
142
+ | Issue | required_property | Conflicts with | Why the hint cannot be applied |
143
+ |-------|-------------------|----------------|-------------------------------|
144
+ | {dimension}/{plan} | {property} | {locked decision D-nn / CLAUDE.md rule / plan constraint} | {one line} |
145
+
146
+ ### Alternatives Considered
147
+
148
+ | Issue | Alternative | Satisfies required_property? | Cost of adopting |
149
+ |-------|-------------|------------------------------|------------------|
150
+ | {dimension}/{plan} | {smaller or different mechanism} | {yes / partially — how} | {what it changes} |
151
+
152
+ ### Changes Made
153
+
154
+ {table of the non-conflicting issues you DID address, same shape as REVISION COMPLETE}
155
+ ```
156
+
157
+ **Every field is one line of plain text.** No newlines inside a cell, and never begin a field with
158
+ `#`, `-`, `|` or a code fence. These fields are appended to a shared markdown file that a later
159
+ reader scans by heading; a field that starts a heading truncates that scan and hides conflicts
160
+ below it.
@@ -289,6 +289,7 @@ Set via `workflow.*` namespace in config.json (e.g., `"workflow": { "research":
289
289
  | `workflow.ui_phase` | boolean | `true` | `true`, `false` | Generate UI-SPEC.md for frontend phases |
290
290
  | `workflow.ui_safety_gate` | boolean | `true` | `true`, `false` | Require safety gate approval for UI changes |
291
291
  | `workflow.text_mode` | boolean | `false` | `true`, `false` | Use plain-text numbered lists instead of AskUserQuestion menus |
292
+ | `workflow.compact_content` | boolean | `false` | `true`, `false` | Compact content mode (#4139, ADR-4139) — per-project boolean selecting terser payloads. Six workflows branch on it via spine+detail: `plan-phase` (#4402, pilot), `execute-phase`, `docs-update`, `new-project`, `verify-work`, `complete-milestone` (#4405). The rest of the eager-window corpus was reviewed and recorded as not worth splitting (`docs/PARTITION-RULES.md`). Lazily-`Read` workflow fragments and `gsd-core/templates/**` templates use a `.compact.md` sibling instead (#4406, `gsd-core/references/compact-content-gate.md` § "Streams 1b and 4") — wired today for `help --full` and the sequential-execution `SUMMARY.md`/`USER-SETUP.md` reads. Agent-skill payloads (#4407, § "Stream 2") use the same `.compact.md` sibling shape, resolved in code by the `gsd_run query agent-skills` CLI seam rather than prose, for the non-Claude persona fallback only |
292
293
  | `workflow.research_before_questions` | boolean | `false` | `true`, `false` | Run research before interactive questions in discuss phase (also honored on the `/gsd:quick` path, #3894). _Alias:_ `research_before_questions` is the flat-key form used in `CONFIG_DEFAULTS`; `workflow.research_before_questions` is the canonical namespaced form. |
293
294
  | `workflow.discuss_mode` | string | `"discuss"` | `"discuss"`, `"assumptions"` | Default mode for discuss-phase: `"discuss"` runs interactive questioning; `"assumptions"` analyzes codebase and surfaces assumptions instead |
294
295
  | `workflow.skip_discuss` | boolean | `false` | `true`, `false` | Skip discuss phase entirely |
@@ -299,7 +300,7 @@ Set via `workflow.*` namespace in config.json (e.g., `"workflow": { "research":
299
300
  | `workflow.build_command` | string\|null | `null` | Any shell command | Build gate command run by the post-merge gate. Unset → build step auto-detected/skipped. |
300
301
  | `workflow.mvp_mode` | boolean | `false` | `true`, `false` | Persist the MVP-mode flag in config so every phase defaults to MVP framing without requiring `--mvp` on the CLI. Resolved via the chain: `--mvp` CLI flag → ROADMAP.md `**Mode:** mvp` field → this config value → `false`. When `true`, the planner, executor, verifier, and discovery surfaces (progress, stats, graphify) all treat the phase as an MVP vertical slice (UI → API → DB) of one user-visible capability. |
301
302
  | `workflow.context_guard_mode` | string | `"warn"` | `"auto"`, `"warn"`, `"off"` | Context exhaustion guard mode for `execute-phase`. Before each wave, the orchestrator self-assesses context pressure using degradation signals from `context-budget.md`. `"warn"` (default): emit a warning and recommend `/gsd:pause-work` when POOR tier is detected. `"auto"`: automatically invoke `/gsd:pause-work` before the next wave when POOR tier is detected. `"off"`: disable the guard. The guard is heuristic — no programmatic context-% API exists. |
302
- | `workflow.plan_chunked` | boolean | `false` | `true`, `false` | Enable chunked planning mode. When `true`, the plan-phase orchestrator splits the single long-lived planner Task into a short outline Task followed by N short per-plan Tasks (~3–5 min each). Each plan is committed individually for crash resilience. Particularly useful on Windows where long-lived Tasks may hang on stdio. Also activated by the `--chunked` flag. |
303
+ | `workflow.plan_chunked` | boolean | `false` | `true`, `false` | Enable chunked planning mode. When `true`, the plan-phase orchestrator splits the single long-lived planner Task into a short outline Task followed by N short per-plan Tasks (~3–5 min each). Each plan is committed individually for crash resilience. Particularly useful on Windows where long-lived Tasks may hang on stdio. Also activated by the `--chunked` flag. See `planning.chunked_parallel` below for concurrent per-plan dispatch. |
303
304
  | `workflow.specless_probe_fallback` | boolean | `true` | `true`, `false` | Gate the SPEC-less probe fallback in `plan-phase`. When `true` (default), a phase that did not supply a `## Edge Coverage` / `## Prohibitions` SPEC section (header absent or present-but-empty) runs the existing probe protocol — the deterministic `edge-probe.cjs` for edges and an in-planner LLM recall pass for prohibitions — and authors the resulting predicates into PLAN.md `must_haves` (section-level precedence: a SPEC-supplied section is never re-run or overwritten). When `false`, the fallback is skipped but the skip is recorded: plan-phase emits a visible "probe fallback disabled" marker, never a silent skip. |
304
305
  | `workflow.code_review_command` | string\|null | `null` | Any shell command | External code-review command integrated into `/gsd:ship`. The diff is piped to the command via stdin; the command must output JSON with a `verdict` field (`"APPROVED"` or `"REVISE"`). Non-zero exit or `"REVISE"` verdict blocks the ship workflow. When unset, the built-in review flow runs. Example: `my-review-tool --review`. |
305
306
  | `workflow.inline_plan_threshold` | number | `2` | `0`–`10` | Plans with ≤N tasks execute inline instead of spawning a subagent |
@@ -360,6 +361,8 @@ Set via `hooks.*` namespace (e.g., `"hooks": { "context_warnings": true }`).
360
361
  | Key | Type | Default | Allowed Values | Description |
361
362
  |-----|------|---------|----------------|-------------|
362
363
  | `hooks.context_warnings` | boolean | `true` | `true`, `false` | Show warnings when context budget is exceeded |
364
+ | `hooks.context_warning_threshold` | number | `35` | Greater than 0 and at most 100, and strictly greater than `hooks.context_critical_threshold`. `config-set` refuses 0: nothing is below it, so no critical value could satisfy the pair | Percent of context window REMAINING at or below which the monitor emits CONTEXT WARNING. An out-of-domain value falls back **per key**; both keys revert to their defaults only when the RESOLVED pair violates `critical < warning`. Read from the root project config — a workstream-scoped `config-set` does not reach this hook. Inert on a runtime with no context-monitor hook installed, Codex among them (#2586); see [context-monitor.md](../../docs/context-monitor.md) (#4285) |
365
+ | `hooks.context_critical_threshold` | number | `25` | At least 0 and less than 100, and strictly less than `hooks.context_warning_threshold`. `config-set` refuses 100: nothing is above it, so no warning value could satisfy the pair | Percent of context window REMAINING at or below which the monitor escalates to CONTEXT CRITICAL. Setting only one of the pair is checked against the other's default, so tune both when moving either past the other. Same root-config scope, and the same installed-monitor prerequisite, as the key above (#4285) |
363
366
 
364
367
  ### Learnings Fields
365
368
 
@@ -404,6 +407,7 @@ These can be set at top level or nested under `planning.*` (e.g., `"planning": {
404
407
  |-----|------|---------|----------------|-------------|
405
408
  | `planning.commit_docs` | boolean | `true` | `true`, `false` | Alias for top-level `commit_docs` |
406
409
  | `planning.search_gitignored` | boolean | `false` | `true`, `false` | Alias for top-level `search_gitignored` |
410
+ | `planning.chunked_parallel` | boolean | `false` | `true`, `false` | Opt-in for `workflow.plan_chunked`'s per-plan loop (§8.5.2 of `chunked-planning-mode.md`, #3777). When `true`, the runnable per-plan planners within one outline Wave are dispatched concurrently (one message, `run_in_background=true` each) instead of one at a time, honoring the outline's Wave column as the schedule (`Depends On` is expected to name only an earlier Wave and is not separately parsed — batching strictly by Wave already respects it). Gated on the negotiated `dispatch-capacity` query (#3673): a host that declares no `maxConcurrency` (capacity resolves to `1`) stays serial regardless of this setting. Default `false` is byte-identical to the pre-#3777 serial loop. Trade-off: per-plan commits interleave within a batch instead of strictly one-at-a-time, and a stalled plan's retry no longer blocks sibling plans in the same batch from having already committed. |
407
411
 
408
412
  ---
409
413
 
@@ -0,0 +1,9 @@
1
+ # Response-Language Directive (#2529)
2
+
3
+ **If `response_language` is set** (in the init JSON this workflow parses, or in `.planning/config.json`): ALL user-facing output of this workflow MUST be in that language — narration between tool calls, status updates, progress notes, findings, banners, report prose, questions (AskUserQuestion or plain text), and summaries. Technical terms, code, file paths, commands, and identifiers stay in English.
4
+
5
+ Literal English report/banner templates embedded in a workflow are a structural SOURCE, not literal output to copy verbatim — render their prose translated into `{response_language}` while keeping headings' structural markers, table columns, IDs, commands, and file paths unchanged. Exception: blocks a workflow explicitly requires to be emitted byte-for-byte (e.g. pre-rendered checkpoints) are output exactly as rendered.
6
+
7
+ Pass `response_language: {value}` into every spawned subagent prompt so any user-facing output they produce stays in the configured language.
8
+
9
+ Workflows take this contract in one of three forms (REQ-LANG-03): an `@`-reference to this file; their own inline directive naming the same narration class; or, for a fragment loaded by a covered parent, inheritance from that parent. Coverage is enforced by `scripts/lint-response-language-coverage.cjs` — a new workflow cannot ship without one of the three, and the lint checks this file's own wording too, so a weakened directive here uncovers every workflow that imports it rather than passing silently. Workflow-specific directives (e.g. `execute-phase-response-language.md`) take precedence where present.
@@ -16,6 +16,8 @@ This pattern applies whenever:
16
16
  ```
17
17
  prev_issue_count = Infinity
18
18
  iteration = 0
19
+ previous_conflict_property = null
20
+ conflict_return_count = 0
19
21
 
20
22
  LOOP:
21
23
  1. Run checker/validator on current output
@@ -23,15 +25,30 @@ LOOP:
23
25
  3. If PASSED or only INFO-level issues:
24
26
  -> Accept output, exit loop
25
27
  4. If BLOCKER or WARNING issues found:
26
- a. iteration += 1
27
- b. If iteration > 3:
28
+ a. If iteration + 1 > 3:
28
29
  -> Escalate to user (see "After 3 Iterations" below)
29
- c. Parse issue count from checker output
30
- d. If issue_count >= prev_issue_count:
30
+ b. Parse issue count from checker output
31
+ c. If issue_count >= prev_issue_count:
31
32
  -> Escalate to user: "Revision loop stalled (issue count not decreasing)"
32
- e. prev_issue_count = issue_count
33
- f. Re-spawn the producing agent with checker feedback appended
34
- g. After revision completes, go to LOOP
33
+ d. prev_issue_count = issue_count
34
+ e. Re-spawn the producing agent with checker feedback appended
35
+ f. If the agent returns REVISION_CONFLICT:
36
+ -> conflict_return_count += 1
37
+ -> If conflict_return_count >= 3:
38
+ escalate through the iteration-cap gate
39
+ -> If it names the same required_property as the previous conflict:
40
+ escalate as a stall (the resolution did not take)
41
+ Else: previous_conflict_property = current required_property
42
+ resolve it (see "Conflict Return" below) and go to step e.
43
+ Do NOT increment iteration -- the conflict was not a failed attempt.
44
+ Else: previous_conflict_property = null (a normal revision ends the conflict chain --
45
+ a LATER, unrelated conflict on the same property must not be misread as a repeat)
46
+ g. iteration += 1
47
+ h. After revision completes, go to LOOP
48
+
49
+ The increment is step g, AFTER the producing agent returns. An iteration counted at step a is
50
+ already spent by the time a REVISION_CONFLICT comes back, so it cannot then be withheld, and the
51
+ cap would punish the agent for correctly refusing to apply incompatible advice.
35
52
  ```
36
53
 
37
54
  ### Issue Count Tracking
@@ -45,19 +62,38 @@ Display iteration progress before each revision spawn:
45
62
 
46
63
  When re-spawning the producing agent for revision, pass the checker's YAML-formatted issues. The checker's output contains a `## Issues` heading followed by a YAML block. Parse this block and pass it verbatim to the revision agent.
47
64
 
65
+ The field names are the plan-checker's schema (`agents/gsd-plan-checker.md` → `<issue_structure>`):
66
+ `plan`, `dimension`, `severity`, `required_property`, `description`, `task`, `fix_hint`. There is no
67
+ `suggested_fix` field and no `finding` or `affected_field` field — those names were drift, and every
68
+ producer now emits the schema above.
69
+
48
70
  ```
49
71
  <checker_issues>
50
- The issues below are in YAML format. Each has: dimension, severity, finding,
51
- affected_field, suggested_fix. Address ALL BLOCKER issues. Address WARNING
52
- issues where feasible.
72
+ The issues below are in YAML format. Each has: dimension, severity,
73
+ required_property, description, fix_hint.
74
+
75
+ BINDING: required_property (the invariant that must hold), description (the
76
+ evidence it does not), severity. NON-BINDING: fix_hint -- ONE example route to
77
+ the property, never an instruction.
78
+
79
+ Satisfy the required_property of ALL BLOCKER issues. Satisfy WARNING issues
80
+ where feasible.
53
81
 
54
82
  {YAML issues block from checker output -- passed verbatim}
55
83
  </checker_issues>
56
84
 
57
85
  <revision_instructions>
58
86
  Address ALL BLOCKER and WARNING issues identified above.
59
- - For each BLOCKER: make the required change
87
+ - For each BLOCKER: make required_property true. Its fix_hint is one example
88
+ route; a smaller or different mechanism that makes the same property true
89
+ addresses the issue in full -- report which mechanism you used.
60
90
  - For each WARNING: address or explain why it's acceptable
91
+ - Before editing, re-check locked decisions, active capability guidance, and
92
+ constraints the existing output already encodes. If a fix_hint would
93
+ contradict one of those, or the property is unreachable without breaking one,
94
+ do NOT apply it and do NOT work around it: return REVISION_CONFLICT naming
95
+ the conflict and the alternatives considered, having addressed every
96
+ non-conflicting issue.
61
97
  - Do NOT introduce new issues while fixing existing ones
62
98
  - Preserve all content not flagged by the checker
63
99
  This is revision iteration {N} of max 3. Previous iteration had {prev_count}
@@ -65,6 +101,75 @@ issues. You must reduce the count or the loop will terminate.
65
101
  </revision_instructions>
66
102
  ```
67
103
 
104
+ ### Conflict Return (REVISION_CONFLICT)
105
+
106
+ A revision agent that returns `REVISION_CONFLICT` has not failed and has not stalled. Handle it
107
+ BEFORE the iteration counter and the stall check — a conflict is not resolvable by re-running the
108
+ same loop, so spending retry budget on it only exhausts the cap:
109
+
110
+ **This protocol is shared.** Every revision-bearing workflow follows it — `plan-phase`, `quick`,
111
+ `ui-phase`, and `verify-work`'s gap-plan loop. `plan-phase` @-imports this reference and states
112
+ only its own bindings (counter name, artifact path, next step). The other three do not import it,
113
+ so they restate the operative rules inline; this section is the authority they must agree with.
114
+
115
+ 1. **Do not spend budget.** Do NOT increment the iteration counter and do NOT update
116
+ `prev_issue_count`. Do NOT re-spawn the checker yet — the conflict is not a revised output.
117
+ 2. **Record**, where the host has a channel an arbitration loop reads. `review.md` emits one
118
+ fixed writer-owned slot immediately after the artifact title, between
119
+ `<!-- gsd:plan-revision-conflicts:begin -->` and
120
+ `<!-- gsd:plan-revision-conflicts:end -->`. When `workflow.plan_review_convergence` is enabled
121
+ and the phase `*-REVIEWS.md` already exists, `plan-phase` appends one line per conflict under
122
+ `## Plan-Revision Conflicts` inside that slot:
123
+
124
+ ```markdown
125
+ - [ ] REVISION_CONFLICT {dimension}/{plan} — required_property: {property} | conflicts with: {locked decision D-nn / CLAUDE.md rule / plan constraint} | alternatives: {the agent's alternatives}
126
+ ```
127
+
128
+ A checkbox, not a table row: `- [ ] REVISION_CONFLICT` is open and `- [x] REVISION_CONFLICT`
129
+ is resolved. The reader counts matching open lines only inside the first fixed slot after the
130
+ artifact title; an identical marker in reviewer output is not state. An open line in the owned
131
+ slot blocks convergence even if this run is abandoned.
132
+ A workflow with no such channel (`quick` has no phase and no REVIEWS.md) skips this step.
133
+
134
+ Before appending, reuse the existing open line instead of appending a duplicate when its
135
+ sanitized fields identify the same conflict. This makes persisted conflict state idempotent.
136
+
137
+ **Sanitize before writing — the conflict text is agent-authored.** Every field comes from the
138
+ producing agent. Before appending, for EACH field: collapse every newline and tab to a single
139
+ space, and strip any leading `#`, `-`, `|` or backtick-fence run. Otherwise an embedded
140
+ newline can forge an extra conflict-shaped record inside the owned slot. One conflict is exactly
141
+ one line beginning `- [ ]`. Never append agent text verbatim, and never append a fenced block.
142
+ 3. **Resolve** — present the conflict and its alternatives to the user and ask which to take
143
+ (pattern: `gsd-core/references/gate-prompts.md`): adopt a named alternative / override the
144
+ named constraint and apply the hint / amend the constraint itself. Each option resolves the
145
+ conflict. Accepting the output with the blocker still open is NOT offered here — the blocking
146
+ `required_property` still fails, and that choice belongs to the cap escalation.
147
+ 4. **Close** — the workflow that wrote the line owns flipping it to `- [x]` once the resolution
148
+ has been applied, appending ` | resolved: {chosen resolution}`. Readers only read. A line left
149
+ open is a live blocker, never a stale artifact.
150
+ 5. **Re-spawn** with the chosen resolution, then re-evaluate the return from the top of this
151
+ handler — never fall through to the checker spawn. A second conflict is still a conflict, not
152
+ a revised output, and handing it to the checker would check the conflict message.
153
+
154
+ **Bounded — two ways, because one is evadable.** Not incrementing must not make this path
155
+ unbounded:
156
+
157
+ - **Repeat.** A conflict naming the SAME `required_property` twice in a row means the chosen
158
+ resolution did not take. Stop re-spawning; escalate as a stall.
159
+ - **Total.** Count every conflict return in this revision loop, whatever property each names. On
160
+ the THIRD, stop and escalate — an agent that alternates property names never trips the repeat
161
+ rule, so the repeat rule alone leaves the loop unbounded. This total is what actually bounds the
162
+ path; the repeat rule just catches the common case sooner.
163
+
164
+ Both escalate through the same gate the iteration cap uses. A conflict still never consumes a
165
+ revision iteration — the cap on conflicts is separate from, and additional to, the cap on
166
+ revisions.
167
+
168
+ **No workflow hands a conflict to a loop and returns.** Asking the user is the route everywhere;
169
+ recording is in addition to asking, never instead of it. `plan-phase` in particular never invokes
170
+ `/gsd:plan-review-convergence` — it runs *inside* that loop, so invoking it would be a cycle, and
171
+ "was I invoked by convergence?" is not a question the orchestrator can answer at runtime.
172
+
68
173
  ### After 3 Iterations
69
174
 
70
175
  If issues persist after 3 revision cycles:
@@ -95,3 +200,5 @@ If issues persist after 3 revision cycles:
95
200
  - **Each iteration gets a fresh agent spawn** -- don't try to continue in the same context
96
201
  - **Checker feedback must be inlined** -- the revision agent needs to see exactly what failed
97
202
  - **Don't silently swallow issues** -- always present the final state to the user after exiting the loop
203
+ - **A remediation hint is an example, not an order** -- an issue satisfied through a smaller valid
204
+ mechanism is addressed, and counts as resolved for the issue-count and stall checks
@@ -94,9 +94,10 @@ After completion, create SUMMARY.md with:
94
94
  **RED - Write failing test:**
95
95
  1. Create test file following project conventions
96
96
  2. Write test describing expected behavior (from `<behavior>` element)
97
- 3. Run test - it MUST fail
98
- 4. If test passes: feature exists or test is wrong. Investigate.
99
- 5. Commit: `test({phase}-{plan}): add failing test for [feature]`
97
+ 3. Run test - it MUST fail **intentionally** (#3770): the TARGET test you named must be the test that fails, on an assertion for the planned behavior. A nonzero exit alone is NOT RED — syntax errors, zero-test discovery, fixture crashes, parser errors, and unrelated assertions are INVALID_RED and must not authorize GREEN.
98
+ 4. Persist the RED evidence record (command, exit code, failing test, expected result, actual result) and verify it: `gsd_run check tdd-red-evidence <record.json>`. Only verdict `RED_EVIDENCE_OK` satisfies the RED gate; `INVALID_RED` blocks GREEN until the RED phase is fixed.
99
+ 5. If test passes: feature exists or test is wrong. Investigate.
100
+ 6. Commit: `test({phase}-{plan}): add failing test for [feature]`
100
101
 
101
102
  **GREEN - Implement to pass:**
102
103
  1. Write minimal code to make test pass
@@ -256,26 +257,33 @@ When `workflow.tdd_mode` is enabled in config, the RED/GREEN/REFACTOR gate seque
256
257
 
257
258
  | Gate | Required | Commit Pattern | Validation |
258
259
  |------|----------|---------------|------------|
259
- | RED | Yes | `test({phase}-{plan}): ...` | Test exists AND fails before implementation |
260
+ | RED | Yes | `test({phase}-{plan}): ...` | Test exists AND fails before implementation — intentionally: `check tdd-red-evidence` returns `RED_EVIDENCE_OK` (target test failed on an assertion for the behavior; anything else is INVALID_RED) |
260
261
  | GREEN | Yes | `feat({phase}-{plan}): ...` | Test passes after implementation |
261
262
  | REFACTOR | No | `refactor({phase}-{plan}): ...` | Tests still pass after cleanup |
262
263
 
263
264
  ### Fail-Fast Rules
264
265
 
265
266
  1. **Unexpected GREEN in RED phase:** If the test passes before any implementation code is written, STOP. The feature may already exist or the test is wrong. Investigate before proceeding.
266
- 2. **Missing RED commit:** If no `test(...)` commit precedes the `feat(...)` commit, the TDD discipline was violated. Flag in SUMMARY.md.
267
- 3. **REFACTOR breaks tests:** Undo the refactor immediately. Commit was premature — refactor in smaller steps.
267
+ 2. **INVALID_RED in RED phase (#3770):** A nonzero exit is not RED by itself. Zero-test discovery, fixture/load crashes, nonzero exits with no failing test, unrelated failing tests, and unexpected greens all classify as INVALID_RED (`gsd_run check tdd-red-evidence`). STOP and fix the RED phase — do NOT proceed to GREEN.
268
+ 3. **Missing RED commit:** If no `test(...)` commit precedes the `feat(...)` commit, the TDD discipline was violated. Flag in SUMMARY.md.
269
+ 4. **REFACTOR breaks tests:** Undo the refactor immediately. Commit was premature — refactor in smaller steps.
268
270
 
269
271
  ### Executor Gate Validation
270
272
 
271
273
  After completing a `type: tdd` plan, the executor validates the git log:
272
274
  ```bash
275
+ # The commit protocol promises no zero-padding for ${PHASE}/${PLAN} — strip both and
276
+ # match the commit-scope position anchored (#4003). #4619: PHASE may be decimal/
277
+ # N-segment; zero-strip only the leading integer segment, escape the rest.
278
+ PHASE_INT=${PHASE%%.*}; PHASE_FRAC=${PHASE#"$PHASE_INT"}
279
+ PHASE_N="$((10#$PHASE_INT))${PHASE_FRAC//./\\.}"
280
+ PLAN_N=$((10#${PLAN}))
273
281
  # Check for RED gate commit
274
- git log --oneline --grep="^test(${PHASE}-${PLAN})" | head -1
282
+ git log --oneline -E --grep="^test\((0*${PHASE_N})-(0*${PLAN_N})\):" | head -1
275
283
  # Check for GREEN gate commit
276
- git log --oneline --grep="^feat(${PHASE}-${PLAN})" | head -1
284
+ git log --oneline -E --grep="^feat\((0*${PHASE_N})-(0*${PLAN_N})\):" | head -1
277
285
  # Check for optional REFACTOR gate commit
278
- git log --oneline --grep="^refactor(${PHASE}-${PLAN})" | head -1
286
+ git log --oneline -E --grep="^refactor\((0*${PHASE_N})-(0*${PLAN_N})\):" | head -1
279
287
  ```
280
288
 
281
289
  If RED or GREEN gate commits are missing, add a `## TDD Gate Compliance` section to SUMMARY.md with the violation details.
@@ -34,13 +34,29 @@ For each significant decision in this plan, ask what undoing it would cost three
34
34
 
35
35
  This is the reasoning step that produces the rating. The taxonomy itself, the emission rules, and the anti-patterns live in @~/.claude/gsd-core/references/planner-reversibility.md — do not maintain a second classification here.
36
36
 
37
- ## 5. Curse of Knowledge Counter
37
+ ## 5. Occam's Razor
38
+
39
+ **Counters:** Plans that prescribe avoidable dependencies, abstractions, files, or speculative flexibility before execution begins.
40
+
41
+ This check complements the planner's RESEARCH.md `dont_hand_roll` guidance and the plan checker's Dimension 12 (Pattern Compliance): those sources identify capabilities and established patterns, while this check orders otherwise sufficient implementation choices. The executor applies the related check later in `thinking-models-execution.md`, after the plan has already selected an approach.
42
+
43
+ After preserving locked user decisions and complete requirement coverage, choose the first option that is demonstrably sufficient for the task's `<done>` condition:
44
+
45
+ 1. Existing project behavior, helper, or established pattern
46
+ 2. Standard-library capability
47
+ 3. Native platform capability
48
+ 4. Already-installed dependency
49
+ 5. Minimum new implementation
50
+
51
+ This ordering is a sufficiency check, not permission to make the task smaller. It must never reduce requested scope or override locked user decisions, requirement coverage, security, validation, accessibility, error handling, or verification. The planner uses it when choosing implementation actions; the plan checker flags a new abstraction or dependency only when a higher rung is demonstrably sufficient.
52
+
53
+ ## 6. Curse of Knowledge Counter
38
54
 
39
55
  **Counters:** Plan-to-executor ambiguity from compressed instructions.
40
56
 
41
57
  For each `<action>` step, re-read it as if you have NEVER seen this codebase. Is every noun unambiguous (which file? which function? which endpoint?)? Is every verb specific (add WHERE? modify HOW?)? If a step could be interpreted two ways, rewrite it. Include file paths, function names, and expected behavior in every action step.
42
58
 
43
- ## 6. Base Rate Neglect Counter
59
+ ## 7. Base Rate Neglect Counter
44
60
 
45
61
  **Counters:** Planners ignoring low-confidence research caveats.
46
62
 
@@ -309,14 +309,17 @@ grep -r "$hook_name()" src/ --include="*.tsx" --include="*.ts" | grep -v "$hook_
309
309
  # .env file exists
310
310
  [ -f ".env" ] || [ -f ".env.local" ]
311
311
 
312
- # Required variable is defined
313
- grep -E "^$VAR_NAME=" .env .env.local 2>/dev/null
312
+ # Required variable is defined (in the environment: dotenv/direnv/the framework has loaded it)
313
+ printenv "$VAR_NAME" >/dev/null
314
314
  ```
315
315
 
316
316
  **Substantive check:**
317
317
  ```bash
318
- # Variable has actual value (not placeholder)
319
- grep -E "^$VAR_NAME=.+" .env .env.local 2>/dev/null | grep -v "your-.*-here|xxx|placeholder|TODO" -i
318
+ # Variable has an actual value (not a placeholder) -- tests the shape, never prints the value;
319
+ # exit 0 = real value, exit 1 = missing or placeholder (case-insensitive)
320
+ v=$(printenv "$VAR_NAME"); case "$(printf %s "$v" | tr '[:upper:]' '[:lower:]')" in
321
+ ""|*your-*-here*|*xxx*|*placeholder*|*todo*) exit 1;;
322
+ esac
320
323
 
321
324
  # Value looks valid for type:
322
325
  # - URLs should start with http
@@ -324,6 +327,16 @@ grep -E "^$VAR_NAME=.+" .env .env.local 2>/dev/null | grep -v "your-.*-here|xxx|
324
327
  # - Booleans should be true/false
325
328
  ```
326
329
 
330
+ When the variable is not present in the agent's own environment (a framework that loads
331
+ `.env.local` itself at runtime does not export it to the shell that runs these checks),
332
+ ask the user to confirm it is set rather than reading `.env` directly. Variable NAMES can
333
+ still be checked against `.env.example`, which the secret-read guard exempts from its
334
+ protected-file patterns.
335
+
336
+ One guard-matching note worth knowing when auditing docs for `.env` mentions: the guard
337
+ treats a grep PATTERN whose last path segment is a secret file name as a file operand, so
338
+ `grep -n "\.env" file.md` is denied while `grep -n "\.env\b" file.md` is allowed.
339
+
327
340
  **Stub patterns specific to env:**
328
341
  ```bash
329
342
  # RED FLAGS - These are stubs: