@windyroad/itil 1.2.0 → 2.0.0-preview.1111

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 (266) hide show
  1. package/.agents/plugins/marketplace.json +12 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +42 -0
  4. package/README.md +34 -25
  5. package/agents/hang-off-check.md +34 -34
  6. package/bin/install.mjs +71 -5
  7. package/bin/wr-itil-catchup-scan +4 -4
  8. package/bin/wr-itil-check-deferred-placeholder-staleness +4 -4
  9. package/bin/wr-itil-check-fail-soft-skip-discipline +4 -4
  10. package/bin/wr-itil-check-fix-rfc-trace +4 -4
  11. package/bin/wr-itil-check-locale-discipline +4 -4
  12. package/bin/wr-itil-check-outbound-responses-staleness +4 -4
  13. package/bin/wr-itil-check-problems-readme-budget +4 -4
  14. package/bin/wr-itil-check-rfc-has-stories +4 -4
  15. package/bin/wr-itil-check-rfc-stories-ratified +4 -4
  16. package/bin/wr-itil-check-ticket-jtbd-ratification +4 -4
  17. package/bin/wr-itil-check-upstream-cache-staleness +4 -4
  18. package/bin/wr-itil-check-upstream-responses +4 -4
  19. package/bin/wr-itil-classify-readme-drift +4 -4
  20. package/bin/wr-itil-derive-release-vehicle +4 -4
  21. package/bin/wr-itil-detect-unratified-stories-maps +4 -4
  22. package/bin/wr-itil-effort-tally +4 -4
  23. package/bin/wr-itil-enumerate-postrelease-kv-candidates +4 -4
  24. package/bin/wr-itil-evaluate-relevance +4 -4
  25. package/bin/wr-itil-mark-create-gate +4 -4
  26. package/bin/wr-itil-mark-story-oversight-confirmed +4 -4
  27. package/bin/wr-itil-migrate-problems-layout +4 -4
  28. package/bin/wr-itil-migrate-story-status-mirror +4 -4
  29. package/bin/wr-itil-next-rfc-id +4 -4
  30. package/bin/wr-itil-plugin-exercise-index +4 -4
  31. package/bin/wr-itil-plugin-maturity-populate +4 -4
  32. package/bin/wr-itil-plugin-maturity-render +4 -4
  33. package/bin/wr-itil-plugin-validate-ci-gate +4 -4
  34. package/bin/wr-itil-reconcile-readme +4 -4
  35. package/bin/wr-itil-reconcile-rfcs +4 -4
  36. package/bin/wr-itil-reconcile-stories +4 -4
  37. package/bin/wr-itil-reconcile-story-maps +4 -4
  38. package/bin/wr-itil-render-story-map +4 -4
  39. package/bin/wr-itil-resolve-governance-plugin-dirs +4 -4
  40. package/bin/wr-itil-skill-invocations +4 -4
  41. package/bin/wr-itil-story-map-edit +4 -4
  42. package/bin/wr-itil-story-map-query +4 -4
  43. package/bin/wr-itil-update-jtbd-references-section +4 -4
  44. package/bin/wr-itil-update-problem-references-section +4 -4
  45. package/bin/wr-itil-update-problem-rfcs-section +4 -4
  46. package/bin/wr-itil-update-rfc-commits-section +4 -4
  47. package/bin/wr-itil-update-rfc-references-section +4 -4
  48. package/bin/wr-itil-verify-iter-summary +4 -4
  49. package/hooks/itil-assistant-output-gate.sh +3 -3
  50. package/hooks/itil-assistant-output-review.sh +5 -5
  51. package/hooks/itil-bash-polling-antipattern-detect.sh +11 -11
  52. package/hooks/itil-changeset-discipline.sh +24 -24
  53. package/hooks/itil-claude-space-protection.sh +21 -14
  54. package/hooks/itil-codex-dispatch.sh +164 -0
  55. package/hooks/itil-commit-trailer-transition-advisory.sh +11 -11
  56. package/hooks/itil-correction-detect.sh +8 -8
  57. package/hooks/itil-deferral-cadence-gate.sh +23 -23
  58. package/hooks/itil-fictional-defer-detect.sh +16 -16
  59. package/hooks/itil-fix-title-lifecycle-advisory.sh +11 -11
  60. package/hooks/itil-mid-loop-ask-detect.sh +14 -14
  61. package/hooks/itil-no-implement-draft-gate.sh +18 -18
  62. package/hooks/itil-pending-questions-surface.sh +11 -11
  63. package/hooks/itil-readme-refresh-discipline.sh +27 -27
  64. package/hooks/itil-rfc-oversight-nudge.sh +7 -7
  65. package/hooks/itil-rfc-trailer-advisory.sh +28 -28
  66. package/hooks/itil-runtime-sid-marker.sh +11 -11
  67. package/hooks/itil-story-mirror-migration-nudge.sh +7 -7
  68. package/hooks/lib/block-list.sh +17 -17
  69. package/hooks/lib/changeset-detect.sh +27 -27
  70. package/hooks/lib/claude-space-gate.sh +23 -15
  71. package/hooks/lib/command-detect.sh +12 -12
  72. package/hooks/lib/create-gate.sh +9 -39
  73. package/hooks/lib/detectors.sh +12 -12
  74. package/hooks/lib/readme-refresh-detect.sh +51 -51
  75. package/hooks/lib/runtime-sid.sh +12 -12
  76. package/hooks/lib/session-id.sh +28 -28
  77. package/hooks/lib/session-marker.sh +1 -1
  78. package/hooks/lib/staging-detect.sh +13 -13
  79. package/hooks/manage-problem-enforce-create.sh +16 -27
  80. package/hooks/p057-staging-trap-detect.sh +18 -18
  81. package/hooks/pre-publish-intake-gate.sh +5 -5
  82. package/hooks/staleness-check.sh +6 -6
  83. package/hooks-codex/hooks.json +57 -0
  84. package/lib/check-deferred-placeholder-staleness.sh +10 -10
  85. package/lib/check-outbound-responses-staleness.sh +2 -2
  86. package/lib/check-upstream-cache-staleness.sh +2 -2
  87. package/lib/derive-first-dispatch.sh +19 -19
  88. package/lib/enumerate-postrelease-kv-candidates.sh +18 -18
  89. package/lib/migrate-problems-layout.sh +12 -12
  90. package/lib/story-oversight.sh +27 -27
  91. package/package.json +16 -3
  92. package/scripts/catchup-scan.sh +25 -25
  93. package/scripts/check-fail-soft-skip-discipline.sh +10 -10
  94. package/scripts/check-fix-rfc-trace.sh +8 -8
  95. package/scripts/check-locale-discipline.sh +13 -13
  96. package/scripts/check-problems-readme-budget.sh +12 -12
  97. package/scripts/check-rfc-has-stories.sh +7 -7
  98. package/scripts/check-rfc-rejected-alternatives.sh +11 -11
  99. package/scripts/check-rfc-stories-ratified.sh +9 -9
  100. package/scripts/check-ticket-jtbd-ratification.sh +10 -10
  101. package/scripts/check-upstream-responses.sh +22 -22
  102. package/scripts/classify-readme-drift.sh +13 -13
  103. package/scripts/codex-agent.mjs +104 -0
  104. package/scripts/derive-release-vehicle.sh +23 -23
  105. package/scripts/detect-unoversighted-rfcs.sh +3 -3
  106. package/scripts/detect-unratified-stories-maps.sh +5 -5
  107. package/scripts/effort-tally.sh +10 -10
  108. package/scripts/evaluate-relevance.sh +16 -16
  109. package/scripts/mark-create-gate.sh +4 -4
  110. package/scripts/mark-story-oversight-confirmed.sh +14 -14
  111. package/scripts/migrate-story-status-mirror.sh +6 -6
  112. package/scripts/next-rfc-id.sh +5 -5
  113. package/scripts/plugin-exercise-index.sh +26 -26
  114. package/scripts/plugin-maturity-populate.sh +38 -38
  115. package/scripts/plugin-maturity-render.sh +26 -26
  116. package/scripts/plugin-validate-ci-gate.sh +14 -14
  117. package/scripts/reconcile-readme.sh +23 -23
  118. package/scripts/reconcile-rfcs.sh +13 -13
  119. package/scripts/reconcile-stories.sh +12 -12
  120. package/scripts/reconcile-story-maps.sh +6 -6
  121. package/scripts/render-story-map.mjs +24 -24
  122. package/scripts/render-story-map.sh +3 -3
  123. package/scripts/resolve-governance-plugin-dirs.sh +10 -10
  124. package/scripts/run-check-deferred-placeholder-staleness.sh +3 -3
  125. package/scripts/run-check-outbound-responses-staleness.sh +3 -3
  126. package/scripts/run-check-upstream-cache-staleness.sh +3 -3
  127. package/scripts/run-enumerate-postrelease-kv-candidates.sh +3 -3
  128. package/scripts/run-migrate-problems-layout.sh +3 -3
  129. package/scripts/skill-invocations.sh +29 -29
  130. package/scripts/story-map-edit.mjs +6 -6
  131. package/scripts/story-map-edit.sh +3 -3
  132. package/scripts/story-map-query.mjs +8 -8
  133. package/scripts/story-map-query.sh +3 -3
  134. package/scripts/update-jtbd-references-section.sh +8 -8
  135. package/scripts/update-problem-references-section.sh +12 -12
  136. package/scripts/update-problem-rfcs-section.sh +9 -9
  137. package/scripts/update-rfc-commits-section.sh +7 -7
  138. package/scripts/update-rfc-references-section.sh +3 -3
  139. package/scripts/update-story-references-section.sh +5 -5
  140. package/scripts/verify-iter-summary.sh +3 -3
  141. package/skills/capture-problem/REFERENCE.md +33 -33
  142. package/skills/capture-problem/SKILL.md +108 -108
  143. package/skills/capture-problem/agents/openai.yaml +3 -0
  144. package/skills/capture-rfc/SKILL.md +21 -323
  145. package/skills/capture-rfc/agents/openai.yaml +3 -0
  146. package/skills/capture-story/SKILL.md +65 -65
  147. package/skills/capture-story/agents/openai.yaml +3 -0
  148. package/skills/capture-story-map/SKILL.md +31 -31
  149. package/skills/capture-story-map/agents/openai.yaml +3 -0
  150. package/skills/check-upstream-responses/SKILL.md +38 -38
  151. package/skills/check-upstream-responses/agents/openai.yaml +3 -0
  152. package/skills/close-incident/SKILL.md +25 -25
  153. package/skills/close-incident/agents/openai.yaml +3 -0
  154. package/skills/link-incident/SKILL.md +22 -22
  155. package/skills/link-incident/agents/openai.yaml +3 -0
  156. package/skills/list-incidents/SKILL.md +9 -9
  157. package/skills/list-incidents/agents/openai.yaml +3 -0
  158. package/skills/list-problems/SKILL.md +17 -17
  159. package/skills/list-problems/agents/openai.yaml +3 -0
  160. package/skills/list-stories/SKILL.md +23 -23
  161. package/skills/list-stories/agents/openai.yaml +3 -0
  162. package/skills/list-story-maps/SKILL.md +9 -9
  163. package/skills/list-story-maps/agents/openai.yaml +3 -0
  164. package/skills/manage-incident/SKILL.md +59 -59
  165. package/skills/manage-incident/agents/openai.yaml +3 -0
  166. package/skills/manage-problem/SKILL.md +222 -222
  167. package/skills/manage-problem/agents/openai.yaml +3 -0
  168. package/skills/manage-rfc/SKILL.md +62 -62
  169. package/skills/manage-rfc/agents/openai.yaml +3 -0
  170. package/skills/manage-story/SKILL.md +49 -49
  171. package/skills/manage-story/agents/openai.yaml +3 -0
  172. package/skills/manage-story-map/SKILL.md +30 -30
  173. package/skills/manage-story-map/agents/openai.yaml +3 -0
  174. package/skills/mitigate-incident/SKILL.md +40 -40
  175. package/skills/mitigate-incident/agents/openai.yaml +3 -0
  176. package/skills/reconcile-readme/SKILL.md +28 -28
  177. package/skills/reconcile-readme/agents/openai.yaml +3 -0
  178. package/skills/reconcile-stories/SKILL.md +17 -17
  179. package/skills/reconcile-stories/agents/openai.yaml +3 -0
  180. package/skills/reconcile-story-maps/SKILL.md +11 -11
  181. package/skills/reconcile-story-maps/agents/openai.yaml +3 -0
  182. package/skills/report-upstream/SKILL.md +73 -73
  183. package/skills/report-upstream/agents/openai.yaml +3 -0
  184. package/skills/restore-incident/SKILL.md +28 -28
  185. package/skills/restore-incident/agents/openai.yaml +3 -0
  186. package/skills/review-problems/SKILL.md +129 -129
  187. package/skills/review-problems/agents/openai.yaml +3 -0
  188. package/skills/scaffold-intake/SKILL.md +26 -26
  189. package/skills/scaffold-intake/agents/openai.yaml +3 -0
  190. package/skills/transition-problem/SKILL.md +85 -85
  191. package/skills/transition-problem/agents/openai.yaml +3 -0
  192. package/skills/transition-problems/SKILL.md +69 -69
  193. package/skills/transition-problems/agents/openai.yaml +3 -0
  194. package/skills/update-upstream/SKILL.md +97 -97
  195. package/skills/update-upstream/agents/openai.yaml +3 -0
  196. package/skills/work-problem/SKILL.md +42 -42
  197. package/skills/work-problem/agents/openai.yaml +3 -0
  198. package/skills/work-problems/SKILL.md +327 -327
  199. package/skills/work-problems/agents/openai.yaml +3 -0
  200. package/skills-codex/capture-problem/REFERENCE.md +139 -0
  201. package/skills-codex/capture-problem/SKILL.md +438 -0
  202. package/skills-codex/capture-problem/agents/openai.yaml +3 -0
  203. package/skills-codex/capture-rfc/SKILL.md +45 -0
  204. package/skills-codex/capture-rfc/agents/openai.yaml +3 -0
  205. package/skills-codex/capture-story/SKILL.md +407 -0
  206. package/skills-codex/capture-story/agents/openai.yaml +3 -0
  207. package/skills-codex/capture-story-map/SKILL.md +286 -0
  208. package/skills-codex/capture-story-map/agents/openai.yaml +3 -0
  209. package/skills-codex/check-upstream-responses/SKILL.md +160 -0
  210. package/skills-codex/check-upstream-responses/agents/openai.yaml +3 -0
  211. package/skills-codex/close-incident/SKILL.md +192 -0
  212. package/skills-codex/close-incident/agents/openai.yaml +3 -0
  213. package/skills-codex/link-incident/SKILL.md +173 -0
  214. package/skills-codex/link-incident/agents/openai.yaml +3 -0
  215. package/skills-codex/list-incidents/SKILL.md +92 -0
  216. package/skills-codex/list-incidents/agents/openai.yaml +3 -0
  217. package/skills-codex/list-problems/SKILL.md +126 -0
  218. package/skills-codex/list-problems/agents/openai.yaml +3 -0
  219. package/skills-codex/list-stories/SKILL.md +170 -0
  220. package/skills-codex/list-stories/agents/openai.yaml +3 -0
  221. package/skills-codex/list-story-maps/SKILL.md +104 -0
  222. package/skills-codex/list-story-maps/agents/openai.yaml +3 -0
  223. package/skills-codex/manage-incident/SKILL.md +378 -0
  224. package/skills-codex/manage-incident/agents/openai.yaml +3 -0
  225. package/skills-codex/manage-problem/SKILL.md +1180 -0
  226. package/skills-codex/manage-problem/agents/openai.yaml +3 -0
  227. package/skills-codex/manage-rfc/SKILL.md +314 -0
  228. package/skills-codex/manage-rfc/agents/openai.yaml +3 -0
  229. package/skills-codex/manage-story/SKILL.md +284 -0
  230. package/skills-codex/manage-story/agents/openai.yaml +3 -0
  231. package/skills-codex/manage-story-map/SKILL.md +198 -0
  232. package/skills-codex/manage-story-map/agents/openai.yaml +3 -0
  233. package/skills-codex/mitigate-incident/SKILL.md +239 -0
  234. package/skills-codex/mitigate-incident/agents/openai.yaml +3 -0
  235. package/skills-codex/reconcile-readme/SKILL.md +175 -0
  236. package/skills-codex/reconcile-readme/agents/openai.yaml +3 -0
  237. package/skills-codex/reconcile-stories/SKILL.md +124 -0
  238. package/skills-codex/reconcile-stories/agents/openai.yaml +3 -0
  239. package/skills-codex/reconcile-story-maps/SKILL.md +81 -0
  240. package/skills-codex/reconcile-story-maps/agents/openai.yaml +3 -0
  241. package/skills-codex/report-upstream/SKILL.md +716 -0
  242. package/skills-codex/report-upstream/agents/openai.yaml +3 -0
  243. package/skills-codex/restore-incident/SKILL.md +216 -0
  244. package/skills-codex/restore-incident/agents/openai.yaml +3 -0
  245. package/skills-codex/review-problems/SKILL.md +524 -0
  246. package/skills-codex/review-problems/agents/openai.yaml +3 -0
  247. package/skills-codex/scaffold-intake/SKILL.md +209 -0
  248. package/skills-codex/scaffold-intake/agents/openai.yaml +3 -0
  249. package/skills-codex/scaffold-intake/templates/CONTRIBUTING.md.tmpl +31 -0
  250. package/skills-codex/scaffold-intake/templates/SECURITY.md.tmpl +39 -0
  251. package/skills-codex/scaffold-intake/templates/SUPPORT.md.tmpl +32 -0
  252. package/skills-codex/scaffold-intake/templates/config.yml.tmpl +8 -0
  253. package/skills-codex/scaffold-intake/templates/problem-report.yml.tmpl +114 -0
  254. package/skills-codex/transition-problem/SKILL.md +371 -0
  255. package/skills-codex/transition-problem/agents/openai.yaml +3 -0
  256. package/skills-codex/transition-problems/SKILL.md +310 -0
  257. package/skills-codex/transition-problems/agents/openai.yaml +3 -0
  258. package/skills-codex/update-upstream/SKILL.md +583 -0
  259. package/skills-codex/update-upstream/agents/openai.yaml +3 -0
  260. package/skills-codex/work-problem/SKILL.md +160 -0
  261. package/skills-codex/work-problem/agents/openai.yaml +3 -0
  262. package/skills-codex/work-problems/SKILL.md +58 -0
  263. package/skills-codex/work-problems/agents/openai.yaml +3 -0
  264. package/templates/story-map.css +1 -1
  265. package/bin/wr-itil-mark-rfc-capture-gate +0 -51
  266. package/scripts/mark-rfc-capture-gate.sh +0 -32
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -4,7 +4,7 @@
4
4
  # shim files in packages/*/bin/wr-* directly; edit the template + run
5
5
  # `npm run sync:shim-wrappers` to regenerate.
6
6
  #
7
- # Resolution (ADR-080):
7
+ # Resolution (highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule):
8
8
  # 1. If the wrapper's parent dir is semver-shaped, treat as installed-
9
9
  # cache execution and resolve to the highest-version sibling's
10
10
  # scripts/ entry below.
@@ -15,9 +15,9 @@
15
15
  # 3. If the cache parent contains zero semver-shaped siblings, exit
16
16
  # 127 with a stderr message naming the cache parent (per SQ-080-2).
17
17
  #
18
- # @adr ADR-080 (highest-version-wins shim wrapper plugin scaffold)
19
- # @adr ADR-049 (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
- # @problem P343 (mid-session staleness window)
18
+ # @adr highest-version-wins-shim-wrapper-for-plugin-scaffold-template-shims-architecture-rule (highest-version-wins shim wrapper plugin scaffold)
19
+ # @adr plugin-bundled-scripts-invoked-from-skill-md-resolve-via-bin-on-path-architecture-rule (plugin-bundled scripts resolve via bin/ on $PATH — amended)
20
+ # @problem install-updates-refreshes-the-global-plugin-cache-but-does-not-fix-path-ordering-stale-plugin-version-shims-stay-first-on-path-so-subsequent-shim-invocations-run-old-code-problem (mid-session staleness window)
21
21
 
22
22
  set -euo pipefail
23
23
 
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # P085 / ADR-013 / ADR-038: itil UserPromptSubmit gate.
2
+ # problem-085-assistant-asks-for-input-when-the-next-step-is-obvious-and-uses-prose-asks-instead-of-askuserquestion-when-input-is-actually-needed-problem / structured-user-interaction-for-governance-skill-decisions-architecture-rule / progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule: itil UserPromptSubmit gate.
3
3
  #
4
4
  # When the incoming user prompt contains a direction-pinning signal
5
5
  # (yes / go ahead / just do it / act now / proceed / ...), inject a
@@ -29,7 +29,7 @@ fi
29
29
 
30
30
  if has_announced "itil-assistant-gate" "$SESSION_ID"; then
31
31
  cat <<'HOOK_OUTPUT'
32
- MANDATORY: direction pinned. Act on obvious next step; use AskUserQuestion tool for genuine ambiguity; NEVER prose-ask. See ADR-013.
32
+ MANDATORY: direction pinned. Act on obvious next step; use AskUserQuestion tool for genuine ambiguity; NEVER prose-ask. See structured-user-interaction-for-governance-skill-decisions-architecture-rule.
33
33
  HOOK_OUTPUT
34
34
  else
35
35
  cat <<'HOOK_OUTPUT'
@@ -46,7 +46,7 @@ NON-OPTIONAL RULES:
46
46
  2. If the decision is genuinely ambiguous (multiple-valid-paths, none
47
47
  clearly better per direction/policy), use the AskUserQuestion tool.
48
48
  Never prose-ask. Prose questions are unanswerable under AFK
49
- notifications and violate ADR-013 Rule 1.
49
+ notifications and violate structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1.
50
50
 
51
51
  3. Canonical prose-ask phrasings to AVOID in your next response:
52
52
  "Want me to", "Should I", "Would you like me to", "Shall we",
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # P085 / ADR-013: itil Stop hook.
2
+ # problem-085-assistant-asks-for-input-when-the-next-step-is-obvious-and-uses-prose-asks-instead-of-askuserquestion-when-input-is-actually-needed-problem / structured-user-interaction-for-governance-skill-decisions-architecture-rule: itil Stop hook.
3
3
  #
4
4
  # Reads the last assistant turn from transcript_path on stdin and scans
5
5
  # for canonical prose-ask phrasings. If a prose-ask is detected (and
@@ -62,23 +62,23 @@ if [ -n "$MATCH" ]; then
62
62
  "PROSE-ASK DETECTED in your last turn (pattern: \"" + $match + "\"). " +
63
63
  "If the decision is obvious from direction / policy / session context, ACT — do not ask. " +
64
64
  "If genuinely ambiguous, re-emit via the AskUserQuestion tool. " +
65
- "Never prose-ask. See ADR-013 Rule 1 + feedback_act_on_obvious_decisions.md."
65
+ "Never prose-ask. See structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1 + feedback_act_on_obvious_decisions.md."
66
66
  )
67
67
  }'
68
68
  exit 0
69
69
  fi
70
70
 
71
- # P403: scan for mechanical-step-framed-as-user-optional. When a skill
71
+ # agent-frames-skill-mandatory-mechanical-steps-as-user-optional-problem: scan for mechanical-step-framed-as-user-optional. When a skill
72
72
  # contract mandates a mechanical step, re-surfacing it as a user decision
73
73
  # (or a budget-caution skip) reintroduces the friction the mechanical-stage
74
- # carve-out (P132 / ADR-044) was engineered to remove.
74
+ # carve-out (agents-over-ask-in-interactive-sessions-conflating-mechanical-stages-with-user-interactive-stages-of-multi-stage-skill-contracts-inverse-problem / decision-delegation-contract-when-agents-act-on-the-framework-vs-ask-the-user-architecture-rule) was engineered to remove.
75
75
  MECH_MATCH=$(echo "$ASSISTANT_TEXT" | detect_mechanical_optional 2>/dev/null) || true
76
76
  if [ -n "$MECH_MATCH" ]; then
77
77
  jq -n --arg match "$MECH_MATCH" '{
78
78
  stopReason: (
79
79
  "MECHANICAL-STEP-FRAMED-AS-OPTIONAL detected in your last turn (closer: \"" + $match + "\"). " +
80
80
  "A skill contract that mandates a mechanical step has already resolved that decision — do not re-surface it as a user choice or skip it on budget-caution grounds. " +
81
- "Run the step, then report it done. See P132 / ADR-044 mechanical-stage carve-out."
81
+ "Run the step, then report it done. See agents-over-ask-in-interactive-sessions-conflating-mechanical-stages-with-user-interactive-stages-of-multi-stage-skill-contracts-inverse-problem / decision-delegation-contract-when-agents-act-on-the-framework-vs-ask-the-user-architecture-rule mechanical-stage carve-out."
82
82
  )
83
83
  }'
84
84
  exit 0
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # P232: PreToolUse:Bash hook — denies bash polling loops that
2
+ # bash-until-loop-with-pgrep-f-bats-recursive-self-references-the-polling-loop-s-own-command-line-new-variant-of-stuck-before-emit-deadlock-skill-md-prompt-warning-insufficient-problem: PreToolUse:Bash hook — denies bash polling loops that
3
3
  # self-reference via `pgrep -f` (parent class) or `pkill -0`
4
4
  # (sibling) and deadlock in AFK iters when the polling loop's
5
5
  # own command line matches the search pattern.
@@ -20,14 +20,14 @@
20
20
  # - parse failure on stdin (mirrors create-gate.sh fail-open)
21
21
  #
22
22
  # References:
23
- # ADR-005 — plugin testing strategy (hook bats live under hooks/test/).
24
- # ADR-013 Rule 1 — deny redirects with mechanical recovery.
25
- # ADR-038 — progressive disclosure / deny-message terseness budget.
26
- # ADR-045 — hook injection budget; deny-path band 200-700 bytes.
27
- # ADR-052 — behavioural tests default (positive + negative cases).
28
- # P146 — parent class (bash until-loop polls bats output with
23
+ # plugin-testing-strategy-architecture-rule — plugin testing strategy (hook bats live under hooks/test/).
24
+ # structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1 — deny redirects with mechanical recovery.
25
+ # progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — progressive disclosure / deny-message terseness budget.
26
+ # hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget; deny-path band 200-700 bytes.
27
+ # behavioural-tests-default-for-skill-testing-architecture-rule — behavioural tests default (positive + negative cases).
28
+ # afk-iteration-subprocess-bash-until-loop-polls-bats-output-file-with-bats-console-regex-against-tap-format-output-deadlocks-indefinitely-manual-sigterm-required-json-metadata-lost-problem — parent class (bash until-loop polls bats output with
29
29
  # bats-console-summary regex against TAP output).
30
- # P232 — this hook; self-referential pgrep -f variant.
30
+ # bash-until-loop-with-pgrep-f-bats-recursive-self-references-the-polling-loop-s-own-command-line-new-variant-of-stuck-before-emit-deadlock-skill-md-prompt-warning-insufficient-problem — this hook; self-referential pgrep -f variant.
31
31
  # p057-staging-trap-detect.sh — sibling PreToolUse:Bash detect
32
32
  # hook; mirror the deny-message shape.
33
33
 
@@ -76,9 +76,9 @@ fi
76
76
 
77
77
  # Antipattern detected — emit deny with terse recovery.
78
78
  # Voice-tone target ~245 bytes (sibling p057-staging-trap-detect.sh
79
- # precedent). Cites P232, names BOTH recovery alternatives, fits
80
- # inside ADR-045 deny-path 200-700 byte band.
81
- REASON="BLOCKED: P232 self-referential polling antipattern. \\\`pgrep -f\\\` / \\\`pkill -0\\\` inside until/while loop matches the loop's own command line and deadlocks in AFK iters. Use \\\`wait \\\$bg_pid\\\` (shell-native) OR Bash-tool BashOutput polling (run_in_background=true) instead."
79
+ # precedent). Cites bash-until-loop-with-pgrep-f-bats-recursive-self-references-the-polling-loop-s-own-command-line-new-variant-of-stuck-before-emit-deadlock-skill-md-prompt-warning-insufficient-problem, names BOTH recovery alternatives, fits
80
+ # inside hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule deny-path 200-700 byte band.
81
+ REASON="BLOCKED: bash-until-loop-with-pgrep-f-bats-recursive-self-references-the-polling-loop-s-own-command-line-new-variant-of-stuck-before-emit-deadlock-skill-md-prompt-warning-insufficient-problem self-referential polling antipattern. \\\`pgrep -f\\\` / \\\`pkill -0\\\` inside until/while loop matches the loop's own command line and deadlocks in AFK iters. Use \\\`wait \\\$bg_pid\\\` (shell-native) OR Bash-tool BashOutput polling (run_in_background=true) instead."
82
82
 
83
83
  cat <<EOF
84
84
  {
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # P141: PreToolUse:Bash hook — denies `git commit` invocations whose
2
+ # afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem: PreToolUse:Bash hook — denies `git commit` invocations whose
3
3
  # staged set includes `packages/<plugin>/` source files but no
4
4
  # `.changeset/*.md` is staged. Hook-level enforcement replaces the
5
5
  # unreliable iter-prompt-time changeset reminder (40% miss rate
@@ -8,7 +8,7 @@
8
8
  # Detection delegates to `lib/changeset-detect.sh::detect_changeset_required`.
9
9
  # When the helper returns 1, this hook emits PreToolUse deny JSON
10
10
  # with the offending plugin slug inline and the literal `bun run
11
- # changeset` recovery command, satisfying ADR-013 Rule 1's "deny
11
+ # changeset` recovery command, satisfying structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1's "deny
12
12
  # redirects to a recovery path" contract via the mechanical-recovery
13
13
  # shape (no skill wrapper required — authoring a changeset is a
14
14
  # single command).
@@ -17,12 +17,12 @@
17
17
  # `lib/command-detect.sh::command_invokes_git_commit`, which strips
18
18
  # common prefix shapes (leading whitespace, env-var assignments,
19
19
  # `cd <path> &&`) and checks whether the residual leading token pair
20
- # is literally `git commit`. P272: replaced the prior substring match
20
+ # is literally `git commit`. itil-changeset-discipline-sh-hook-substring-matches-git-commit-anywhere-in-bash-command-sibling-problem: replaced the prior substring match
21
21
  # `*"git commit"*` that misfired on non-commit Bash whose argument
22
22
  # vectors merely mentioned the phrase (grep / sed / cat-heredoc /
23
23
  # echo / `git log --grep`).
24
24
  #
25
- # Allow paths (exit 0 silently per ADR-045 Pattern 1):
25
+ # Allow paths (exit 0 silently per hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule Pattern 1):
26
26
  # - tool_name != "Bash" (only Bash invocations are gated)
27
27
  # - command is not a `git commit` invocation by leading-executable
28
28
  # semantics (helper returns 1)
@@ -32,27 +32,27 @@
32
32
  # - parse failure on stdin (mirrors create-gate.sh fail-open)
33
33
  #
34
34
  # References:
35
- # ADR-005 — plugin testing strategy (hook bats live under hooks/test/).
36
- # ADR-009 — gate marker lifecycle (this hook deliberately does NOT
35
+ # plugin-testing-strategy-architecture-rule — plugin testing strategy (hook bats live under hooks/test/).
36
+ # gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule — gate marker lifecycle (this hook deliberately does NOT
37
37
  # use markers; detection is per-invocation deterministic
38
- # — same precedent as P125 `p057-staging-trap-detect.sh`).
39
- # ADR-013 Rule 1 — deny redirects with mechanical recovery.
40
- # ADR-014 — governance skills commit their own work (the hook keeps
38
+ # — same precedent as staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem `p057-staging-trap-detect.sh`).
39
+ # structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1 — deny redirects with mechanical recovery.
40
+ # governance-skills-commit-their-own-completed-work-architecture-rule — governance skills commit their own work (the hook keeps
41
41
  # iter commits self-contained — no orchestrator-main-turn
42
42
  # back-fill needed).
43
- # ADR-018 — inter-iteration release cadence (the hook strengthens
43
+ # inter-iteration-release-cadence-for-afk-loops-architecture-rule — inter-iteration release cadence (the hook strengthens
44
44
  # release-cadence integrity by ensuring every publishable
45
45
  # iter has a changeset to drain).
46
- # ADR-038 — progressive disclosure / deny-message terseness budget.
47
- # ADR-045 — hook injection budget (Pattern 1 silent-on-pass; deny
46
+ # progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — progressive disclosure / deny-message terseness budget.
47
+ # hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget (Pattern 1 silent-on-pass; deny
48
48
  # band ≤300 bytes for this hook).
49
- # P073 — sibling changeset author-time gate (Write/Edit on
49
+ # problem-073-no-voice-and-tone-check-or-risk-assessment-on-changeset-bodies-which-populate-changelog-md-release-prs-github-releases-and-npm-release-notes-problem — sibling changeset author-time gate (Write/Edit on
50
50
  # `.changeset/*.md`); composes-with as defence-in-depth.
51
- # P125 — sibling staging-trap hook (same enforcement-layer shape).
52
- # P141 — this hook.
53
- # P268 — shared `command_invokes_git_commit` helper landed for
51
+ # staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem — sibling staging-trap hook (same enforcement-layer shape).
52
+ # afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem — this hook.
53
+ # hook-substring-matches-git-commit-anywhere-in-bash-command-not-just-actual-git-commit-invocations-problem — shared `command_invokes_git_commit` helper landed for
54
54
  # `itil-readme-refresh-discipline.sh`; consumed here.
55
- # P272 — sibling-hook refactor: substring-match → helper here.
55
+ # itil-changeset-discipline-sh-hook-substring-matches-git-commit-anywhere-in-bash-command-sibling-problem — sibling-hook refactor: substring-match → helper here.
56
56
 
57
57
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
58
58
  # shellcheck source=lib/changeset-detect.sh
@@ -89,7 +89,7 @@ except:
89
89
  # `lib/command-detect.sh::command_invokes_git_commit`, which strips
90
90
  # common prefix shapes (leading whitespace, env-var assignments,
91
91
  # `cd <path> &&`) and checks whether the residual leading token pair
92
- # is literally `git commit`. P272: replaced the prior substring match
92
+ # is literally `git commit`. itil-changeset-discipline-sh-hook-substring-matches-git-commit-anywhere-in-bash-command-sibling-problem: replaced the prior substring match
93
93
  # `*"git commit"*` that misfired on non-commit Bash whose argument
94
94
  # vectors merely mentioned the phrase (grep / sed / cat-heredoc /
95
95
  # echo / `git log --grep`).
@@ -98,21 +98,21 @@ command_invokes_git_commit "$COMMAND" || exit 0
98
98
  # Run detection. Helper echoes offending plugin slug on stdout when
99
99
  # detected; returns 1 in that case. Returns 0 (allow) on no-trap,
100
100
  # bypass env, or fail-open (non-git tree, parse error). The COMMAND is
101
- # passed so Check 2b can change-scope to the commit's work-item ID (P387):
101
+ # passed so Check 2b can change-scope to the commit's work-item ID (changeset-discipline-check-2b-is-plugin-scoped-not-change-scoped-plugin-source-commits-ship-undocumented-when-a-sibling-changeset-already-targets-the-plugin-problem):
102
102
  # an in-scope changeset for an UNRELATED ticket no longer covers this commit.
103
103
  TRAPPED_SLUG=$(detect_changeset_required "$COMMAND" 2>/dev/null) && exit 0
104
104
 
105
105
  # Trap detected — emit deny with terse recovery.
106
- # Voice-tone budget per ADR-045 deny-band ≤300 bytes total. Names the
106
+ # Voice-tone budget per hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule deny-band ≤300 bytes total. Names the
107
107
  # plugin slug, the literal in-flight recovery command (`bun run
108
- # changeset` — staging ANY changeset satisfies the gate), and the P141
109
- # cite. P173: the deny no longer advertises BYPASS_CHANGESET_GATE=1 as an
108
+ # changeset` — staging ANY changeset satisfies the gate), and the afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem
109
+ # cite. bypass-gate-env-vars-do-not-propagate-from-bash-subshell-to-pretooluse-hook-context-problem: the deny no longer advertises BYPASS_CHANGESET_GATE=1 as an
110
110
  # in-flight escape — that env var only takes effect when set in Claude
111
111
  # Code's process env BEFORE the session started; a mid-session Bash
112
112
  # export/inline assignment never reaches the hook process. The deny
113
113
  # states the bypass is pre-session-only so maintainers stop wasting a
114
- # turn trying it mid-session (the original P173 cost).
115
- REASON="BLOCKED: P141 changeset discipline. packages/${TRAPPED_SLUG}/ source needs .changeset/*.md. Recovery: bun run changeset. Env bypass is pre-session only."
114
+ # turn trying it mid-session (the original bypass-gate-env-vars-do-not-propagate-from-bash-subshell-to-pretooluse-hook-context-problem cost).
115
+ REASON="BLOCKED: afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem changeset discipline. packages/${TRAPPED_SLUG}/ source needs .changeset/*.md. Recovery: bun run changeset. Env bypass is pre-session only."
116
116
 
117
117
  cat <<EOF
118
118
  {
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # P131: PreToolUse:Write|Edit enforcement hook for `.claude/` user-space.
2
+ # agents-write-project-generated-artefacts-under-claude-user-controlled-config-space-gate-exclusions-are-read-tolerance-not-write-permission-problem: PreToolUse:Write|Edit enforcement hook for `.claude/` user-space.
3
3
  #
4
4
  # DENIES Write|Edit to project-scoped `.claude/` paths that are NOT in the
5
5
  # user-space allow-list, unless the user has pre-authorized that specific
@@ -11,7 +11,7 @@
11
11
  # gate-exclusion list as "approved write zones" and write project-generated
12
12
  # content (plans, audits, scratch state) under `.claude/`, polluting user
13
13
  # space. Project-generated content belongs in `docs/` (plans, audits) or
14
- # inline in problem-ticket bodies. See P131 + project CLAUDE.md MANDATORY
14
+ # inline in problem-ticket bodies. See agents-write-project-generated-artefacts-under-claude-user-controlled-config-space-gate-exclusions-are-read-tolerance-not-write-permission-problem + project CLAUDE.md MANDATORY
15
15
  # rule.
16
16
  #
17
17
  # Allow-list (per is_protected_claude_path in lib/claude-space-gate.sh):
@@ -25,25 +25,25 @@
25
25
  # Bypass: user creates `.claude/.agent-write-approved-<sha256>` marker
26
26
  # (sha256 of project-relative path). Marker is persistent (no TTL); user
27
27
  # pre-authorizes once per path. Distinct from session-scoped review
28
- # markers (ADR-009) — this is the persistent in-tree shape used by
29
- # `.claude/.install-updates-consent` (ADR-030 / P120 precedent).
28
+ # markers (gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule) — this is the persistent in-tree shape used by
29
+ # `.claude/.install-updates-consent` (repo-local-skills-for-project-specific-workflow-tooling-architecture-rule / install-updates-consent-gate-fires-on-every-invocation-despite-the-answer-being-invariably-all-confirmed-siblings-problem precedent).
30
30
  #
31
31
  # Out of scope:
32
32
  # - Read|Glob|Grep on .claude/ paths — only Write|Edit gated
33
33
  # - Paths outside PWD project root (~/.claude/, other repos' .claude/)
34
- # - Empty session_id / file_path — fail-open (ADR-013 Rule 6 parity
34
+ # - Empty session_id / file_path — fail-open (structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6 parity
35
35
  # with sibling hooks like manage-problem-enforce-create.sh)
36
36
  #
37
37
  # References:
38
- # ADR-009 — gate marker lifecycle (this hook adds a NEW persistent
39
- # marker class; ADR-009's session-scoped /tmp markers
38
+ # gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule — gate marker lifecycle (this hook adds a NEW persistent
39
+ # marker class; gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule's session-scoped /tmp markers
40
40
  # unchanged)
41
- # ADR-013 Rule 6 — non-interactive fail-safe; deny via stdin JSON
42
- # ADR-030 — persistent in-tree consent marker precedent
43
- # ADR-038 — progressive disclosure (deny message <500 bytes)
44
- # ADR-045 — hook injection budget (silent on allow path)
45
- # P119 — manage-problem-enforce-create.sh hook shape precedent
46
- # P131 — driver
41
+ # structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6 — non-interactive fail-safe; deny via stdin JSON
42
+ # repo-local-skills-for-project-specific-workflow-tooling-architecture-rule — persistent in-tree consent marker precedent
43
+ # progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — progressive disclosure (deny message <500 bytes)
44
+ # hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget (silent on allow path)
45
+ # agent-bypasses-wr-itil-manage-problem-step-2-duplicate-check-by-writing-tickets-directly-to-docs-problems-problem — manage-problem-enforce-create.sh hook shape precedent
46
+ # agents-write-project-generated-artefacts-under-claude-user-controlled-config-space-gate-exclusions-are-read-tolerance-not-write-permission-problem — driver
47
47
 
48
48
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
49
49
  # shellcheck source=lib/claude-space-gate.sh
@@ -93,6 +93,13 @@ if has_approval_marker "$FILE_PATH" "$PWD"; then
93
93
  fi
94
94
 
95
95
  BASENAME=$(basename "$FILE_PATH")
96
+ REL_PATH="${FILE_PATH#"$PWD"/}"
97
+ CONFIG_DIR="${REL_PATH%%/*}"
96
98
 
97
- claude_space_deny "BLOCKED: Cannot Write|Edit '${BASENAME}' under .claude/. That directory is user-controlled config space — agents must not write project-generated artefacts there. Use docs/plans/ for plans, docs/audits/ for audit logs, or attach inline to the relevant problem ticket. To pre-authorize a specific .claude/ path, create marker '.claude/.agent-write-approved-<sha256-of-rel-path>' (P131; see project CLAUDE.md MANDATORY rule)."
99
+ if [ "$CONFIG_DIR" = ".claude" ]; then
100
+ INSTRUCTIONS="project CLAUDE.md MANDATORY rule"
101
+ else
102
+ INSTRUCTIONS="project AGENTS.md MANDATORY rule"
103
+ fi
104
+ claude_space_deny "BLOCKED: Cannot Write|Edit '${BASENAME}' under ${CONFIG_DIR}/. That directory is user-controlled config space — agents must not write project-generated artefacts there. Use docs/plans/ for plans, docs/audits/ for audit logs, or attach inline to the relevant problem ticket. To pre-authorize a specific ${CONFIG_DIR}/ path, create marker '${CONFIG_DIR}/.agent-write-approved-<sha256-of-rel-path>' (agents-write-project-generated-artefacts-under-claude-user-controlled-config-space-gate-exclusions-are-read-tolerance-not-write-permission-problem; see ${INSTRUCTIONS})."
98
105
  exit 0