@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
@@ -0,0 +1,239 @@
1
+ ---
2
+ name: wr-itil:mitigate-incident
3
+ description: Record a mitigation attempt against an incident — transitions an investigating incident to mitigating on the first attempt, appends subsequent attempts to the Mitigation attempts timeline. Evidence-first gate enforced per the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule.
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input, Skill
5
+ ---
6
+
7
+ <!-- Generated from the runtime-neutral skill source. Do not edit. -->
8
+
9
+ > Codex runtime note: use `request_user_input` only where this contract
10
+ > explicitly requires a human decision. Resolve `<itil-plugin-root>` from
11
+ > this installed `SKILL.md`: it is two directories above the skill
12
+ > directory. Run bundled commands from `<itil-plugin-root>/bin/`; do not
13
+ > search the adopter repository or rely on those commands being on `PATH`.
14
+ > Spawn `wr-itil:hang-off-check` with the native Codex subagent tool, wait
15
+ > for it, and close that same agent.
16
+
17
+
18
+ # Mitigate Incident
19
+
20
+ Record a mitigation attempt against an active incident and transition its lifecycle. The first mitigation attempt moves the file from `.investigating.md` to `.mitigating.md`; subsequent attempts append to the existing `.mitigating.md` without re-transitioning. Every attempt (successful or not) is recorded so the post-incident audit trail is complete (the "Restore Service Fast with an Audit Trail" user outcome).
21
+
22
+ This skill is the "Problem 071: Argument-based skill subcommands are not discoverable in Codex autocomplete" problem phased-landing split of `/wr-itil:manage-incident <I> mitigate <action>` per the "Rename `wr-problem` Plugin to `wr-itil`" architecture rule amended Skill Granularity rule: one skill per distinct user intent. The arguments `<I>` (incident ID) and `<action>` (mitigation description) are data parameters, permitted under the amendment — only word-verb-arguments must be split out. The original `/wr-itil:manage-incident <I> mitigate <action>` subcommand route remains as a thin-router forwarder during the deprecation window but is scheduled for removal in `@windyroad/itil`'s next major version.
23
+
24
+ ## Arguments
25
+
26
+ `/wr-itil:mitigate-incident <I###> <action>` — both positional:
27
+
28
+ - `<I###>` — the incident ID (e.g. `I007` or bare `007`). Resolves to `docs/incidents/<I###>-*.{investigating,mitigating}.md`.
29
+ - `<action>` — free-text description of the mitigation being applied (e.g. `rollback checkout service to 1.2.4`, `feature flag checkout.fast-path off`, `restart ingest worker pool`). Prefer **reversible** actions — see "Reversible preference" below.
30
+
31
+ If `$ARGUMENTS` is empty or malformed, fail-fast with a usage message and exit (per the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule Framework-Mediated Surface; matches the `transition-problem` / `work-problem` precedent). Argument malformation is a typo-class signal, not a decision — the slash command is the input contract; re-typing is faster than a multi-turn `request_user_input` dialogue, and the user-memory direction `feedback_act_on_obvious_decisions.md` pins this. The exact usage block is in Step 1.
32
+
33
+ ## Reversible preference (the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule)
34
+
35
+ Prefer **reversible** mitigations over forward fixes:
36
+
37
+ 1. Rollback to a known-good version
38
+ 2. Feature flag off
39
+ 3. Restart / cycle the affected component
40
+ 4. Route traffic away
41
+ 5. Scale up
42
+ 6. Only after reversibles are exhausted: forward fix
43
+
44
+ Record every attempt, successful or not. Failed mitigations are as important to the audit trail as successful ones — they narrow hypothesis space for future investigation.
45
+
46
+ **Mitigation SELECTION is agent-owned — do NOT defer "which mitigation" to the user (the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule framework-mediated surface; category-4 silent-framework family).** Choosing *which* mitigation to attempt — traversing the reversible-preference ladder above, backed by cited evidence, within risk appetite — is the agent's call. The framework has already resolved it: the ladder IS the selection mechanism, the evidence-first gate (below) is the quality bar, and RISK-POLICY appetite is the bound. Do NOT surface "which mitigation should I attempt?" as a user-authority decision via `request_user_input` **or** a prose-ask ("I'll wait for your direction on which mitigation to attempt", "let me know which option you'd prefer"). That deferral re-asks a decision the framework mediated and adds latency to the very job this skill exists to accelerate. Authority: the "Structured User Interaction for Governance-Skill Decisions" architecture rule Rule 5 (policy-authorised silent proceed for within-appetite reversible actions); the "Restore Service Fast with an Audit Trail" user outcome ("Reversible mitigations [...] are preferred"); user direction 2026-05-10 — *"mitigations don't belong to me. You are empowered."* (the "Agent defers mitigation selection to user during active incident — surfaces mitigation choice as user-authority when SKILL contract empowers agent-driven reversible mitigations" problem). The genuine user-authority surfaces are unchanged and remain interactive: the evidence-first gate bypass (the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule category-2 deviation-approval, Step 3) and the risk-above-appetite commit (category-3 one-time-override, Step 8). Select-and-act; the audit trail (every attempt recorded) is the oversight surface, not a pre-action consent gate.
47
+
48
+ ## Evidence-first gate (the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule; the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule category-2 deviation-approval)
49
+
50
+ **Pre-flight check before the first mitigation attempt**: the incident file must contain at least one hypothesis with cited evidence in the `## Hypotheses` section. If not, block the transition and ask via `request_user_input`. This is the **the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule category-2 (deviation-approval)** surface: the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule's evidence-first rule is the existing decision; "Record anyway" is the user-approved deviation in this specific case (the rule isn't being amended; this case is being excepted with audit trail). The user IS the right authority for the bypass shape.
51
+
52
+ The 3-option prompt:
53
+
54
+ > "Incident `<I###>` has no hypothesis with cited evidence. Per the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule, mitigation requires at least one ranked hypothesis backed by a log, repro, diff, or metric reference. (a) Add a hypothesis + evidence now and retry, (b) Record the mitigation anyway with an evidence-skipped justification (requires audit-trail note), (c) Cancel."
55
+
56
+ This gate is the **cool-headed commitment**: it blocks "try this and see" actions during the high-adrenaline phase of an incident unless evidence is cited. The gate runs only on the first mitigation (the `.investigating.md → .mitigating.md` transition); subsequent mitigations on an already-`.mitigating.md` file append directly without re-gating.
57
+
58
+ ## Steps
59
+
60
+ ### 1. Parse arguments (fail-fast on typos — the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule Surface 1)
61
+
62
+ Extract `<I###>` and `<action>` from `$ARGUMENTS`. Normalise `<I###>`:
63
+
64
+ - Accept `I007`, `i007`, `007`, `7` → canonicalise to `I007` (uppercase I + zero-padded 3 digits).
65
+ - If missing, malformed, or unrecognisable, emit the usage block below and exit. **Do not** fire `request_user_input` for argument backfill — argument shape is a typo-class signal, not a decision. The framework-mediated answer per the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule is fail-fast + exit; the user re-types in 1 second. Matches the `transition-problem` Step 1 + `work-problem` singular precedent for consistency across the suite (the "Extend the Suite with New Plugins" user outcome — clear patterns).
66
+
67
+ Extract `<action>` as everything after the incident ID. If missing or trivially short (< 8 chars), apply the same fail-fast pattern: emit the usage block below and exit; the user re-invokes with a complete action.
68
+
69
+ **Usage block** (emitted on any malformed-argument case; copy verbatim so adopters get a consistent shape):
70
+
71
+ ```
72
+ Usage: /wr-itil:mitigate-incident <I###> <action>
73
+ <I###> — incident ID (e.g. I007 or bare 007); must resolve to docs/incidents/<I###>-*.{investigating,mitigating}.md
74
+ <action> — descriptive mitigation (8+ chars), e.g. "rollback checkout service to 1.2.4", "feature flag checkout.fast-path off", "restart ingest worker pool"
75
+
76
+ Prefer reversible mitigations (see "Reversible preference" in this skill). Run /wr-itil:list-incidents to see active incidents if you don't know the ID.
77
+ ```
78
+
79
+ ### 2. Locate the incident file
80
+
81
+ ```bash
82
+ ls docs/incidents/<I###>-*.investigating.md docs/incidents/<I###>-*.mitigating.md 2>/dev/null
83
+ ```
84
+
85
+ - If neither exists, report "No active incident `<I###>` found. Check `/wr-itil:list-incidents` for the active backlog or `/wr-itil:manage-incident` to declare a new one." and exit.
86
+ - If exactly one file matches, record its current suffix (`investigating` or `mitigating`) — this drives the transition decision in Step 4.
87
+ - If multiple files match (should not happen under the `<ID>-<title>.<status>.md` naming convention), report the ambiguity and exit.
88
+
89
+ ### 3. Pre-flight: evidence gate (first mitigation only) — the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule category-2 deviation-approval
90
+
91
+ If the file suffix is `.investigating.md` (i.e. this is the first mitigation), read the `## Hypotheses` section and check for at least one line containing `Evidence:` followed by a non-empty reference. The shape per the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule:
92
+
93
+ ```
94
+ - [ranked] <hypothesis> — Evidence: <log/repro/diff/metric reference>. Confidence: <low|med|high>.
95
+ ```
96
+
97
+ - If at least one hypothesis has a cited evidence reference, proceed to Step 4.
98
+ - If no hypothesis carries evidence, invoke `request_user_input` with the three-option prompt from "Evidence-first gate" above. This is the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule **category-2 (deviation-approval)** surface — the user is the right authority for the bypass; the gate's behaviour is preserved verbatim post-the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule because deviation-approval is a kept-request_user_input category in the 6-class taxonomy. Branch:
99
+ - (a) User adds a hypothesis + evidence now — re-read the file and re-check; if satisfied, proceed. If still missing, report the gate failure and exit.
100
+ - (b) User records anyway (deviation approved) — append an `## Audit trail` note to the file: `[<timestamp> UTC] Evidence-gate bypassed by user — reason: <justification>`. Then proceed to Step 4.
101
+ - (c) User cancels — exit without change.
102
+
103
+ If the file suffix is already `.mitigating.md`, skip the gate (it only runs on the transition).
104
+
105
+ ### 4. Record the mitigation and transition if needed
106
+
107
+ Compute a UTC timestamp (e.g. `2026-04-21T14:37Z`). Then:
108
+
109
+ **Case A — first mitigation (`.investigating.md` → `.mitigating.md`)**:
110
+
111
+ 1. `git mv docs/incidents/<I###>-<title>.investigating.md docs/incidents/<I###>-<title>.mitigating.md`
112
+ 2. Update the `**Status**:` field from `Investigating` to `Mitigating` via `Edit`.
113
+ 3. Append to the `## Mitigation attempts` section:
114
+
115
+ ```markdown
116
+ - [<timestamp> UTC] <action> → pending verification
117
+ ```
118
+
119
+ If the `## Mitigation attempts` section contains `*(none yet)*`, replace that placeholder with the first attempt row. Otherwise append below the last attempt.
120
+
121
+ 4. Append to the `## Timeline` section:
122
+
123
+ ```markdown
124
+ - [<timestamp> UTC] Mitigation attempt: <action>
125
+ ```
126
+
127
+ **Case B — subsequent mitigation (`.mitigating.md` stays `.mitigating.md`)**:
128
+
129
+ 1. No `git mv` needed.
130
+ 2. Do not touch the `**Status**:` field.
131
+ 3. Append to the `## Mitigation attempts` section:
132
+
133
+ ```markdown
134
+ - [<timestamp> UTC] <action> → pending verification
135
+ ```
136
+
137
+ 4. Append to the `## Timeline` section:
138
+
139
+ ```markdown
140
+ - [<timestamp> UTC] Mitigation attempt: <action>
141
+ ```
142
+
143
+ The outcome text starts at `pending verification` because verification signals (error-rate recovery, synthetic-probe passing, user report) usually arrive after the mitigation. The `/wr-itil:manage-incident <I###> restored` flow updates the outcome to the final verification signal when service is restored. Failed mitigations should be updated in place (via a subsequent `/wr-itil:manage-incident <I###>` update call or a future `/wr-itil:mitigate-incident` re-record) with the observed outcome — do not delete the original row.
144
+
145
+ ### 5. Low-severity lightweight path (the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule Step 12 edge case)
146
+
147
+ For **Sev 4-5** incidents, the Hypotheses section may be skipped if the user confirmed no investigation was needed at declare time. In that case:
148
+
149
+ - The evidence-first gate in Step 3 does not apply (there are no hypotheses to check).
150
+ - The Mitigation attempts append in Step 4 remains mandatory — Timeline, Observations, and at least one mitigation attempt are always required per the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule.
151
+ - Do not upgrade a skipped-hypotheses incident's severity silently; if the user decides mid-incident that investigation IS needed, they should update the incident via `/wr-itil:manage-incident <I###>` and add the hypothesis explicitly.
152
+
153
+ Detect "lightweight path" by reading the Severity label from the incident frontmatter: if Impact × Likelihood resolves to Sev 4 or Sev 5, the gate defaults to bypass with an audit-trail note unless the user has populated Hypotheses explicitly.
154
+
155
+ ### 6. Quality checks
156
+
157
+ After any mitigation record, verify:
158
+
159
+ - **Status consistency**: `**Status**:` field matches the filename suffix (Investigating + `.investigating.md` OR Mitigating + `.mitigating.md`).
160
+ - **Timeline monotonicity**: the new timeline entry's timestamp is ≥ the last existing timeline entry's timestamp.
161
+ - **Mitigation attempts section exists**: if somehow missing from an older incident file, create it before appending.
162
+ - **No evidence-gate silent bypass**: if the gate was bypassed in Step 3, the `## Audit trail` note must be present.
163
+
164
+ ### 7. Report
165
+
166
+ Report:
167
+
168
+ - The file path created/modified.
169
+ - The incident ID and title.
170
+ - The transition (Investigating → Mitigating, or Mitigating → Mitigating).
171
+ - The recorded action and the `pending verification` outcome.
172
+ - Any quality-check warnings.
173
+ - A pointer: "Run `/wr-itil:manage-incident <I###> restored` when the verification signal confirms service is restored, or re-invoke `/wr-itil:mitigate-incident <I###> <next-action>` to record another mitigation attempt."
174
+
175
+ ### 8. Commit the completed work (the "Governance Skills Commit Their Own Completed Work" architecture rule; risk-above-appetite is the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule category-3 one-time-override)
176
+
177
+ Per the "Governance Skills Commit Their Own Completed Work" architecture rule, governance skills commit their own work.
178
+
179
+ 1. `git add` the renamed / modified incident file.
180
+ 2. Delegate to `wr-risk-scorer:pipeline` (subagent_type: `wr-risk-scorer:pipeline`) to assess the staged changes and create a bypass marker. If the subagent type is not available (spawned subagent surface), invoke `/wr-risk-scorer:assess-release` via the installed skill invocation instead — per the "On-Demand Assessment Skills for Governance Plugins" architecture rule it wraps the same pipeline subagent.
181
+ 3. `git commit -m "docs(incidents): I<NNN> mitigated — <action summary>"`.
182
+ 4. If commit risk is above appetite: this is **framework-mediated, NOT a category-3 one-time-override ask** (the "Skills, agents, and hooks override RISK-POLICY appetite instead of applying it" problem/the ": Apply RISK-POLICY appetite faithfully across all surfaces" release design — no incident carve-out). Per **the "Auto-apply scorer remediations to reach within appetite — open action-class vocabulary" architecture rule Rule 1b (incident-context scoring)**: an active incident is a risk being realised (Likelihood already 5); score the mitigation against that live realised-risk baseline — P(increases impact) vs P(reduces impact & likelihood / restores service) + P(introduces a new incident). Net risk-reducing → it takes the risk-reducing path (`RISK_BYPASS: reducing`) and proceeds, no ask — exactly the restore-service-fast (the "Restore Service Fast with an Audit Trail" user outcome) case, cleared via scoring not a consent gate. Not net-reducing → auto-remediate (the "Auto-apply scorer remediations to reach within appetite — open action-class vocabulary" architecture rule Rule 1) or halt (Rule 5). **MUST NOT commit above appetite; MUST NOT `request_user_input` "commit anyway".** If `request_user_input` is unavailable, the "Structured User Interaction for Governance-Skill Decisions" architecture rule Rule 6 fail-safe — skip + report.
183
+
184
+ ### 9. Auto-release when changesets are queued (the "Governance skills auto-release when changesets are queued" architecture rule)
185
+
186
+ **Skip this step if the skill is running inside an AFK orchestrator.** Orchestrators handle release cadence themselves per the "Inter-iteration release cadence for AFK loops" architecture rule (Step 6.5). When in doubt, defer to the orchestrator by skipping this step.
187
+
188
+ Otherwise, after the commit in step 8 lands, drain the release queue so the fix actually lands on npm without requiring manual user action.
189
+
190
+ **Mechanism — delegate, do not re-implement scoring (per the "On-Demand Assessment Skills for Governance Plugins" architecture rule):**
191
+
192
+ 1. Invoke the release scorer. Two paths are valid:
193
+ - **Primary**: delegate to subagent type `wr-risk-scorer:pipeline` via the native Codex subagent tool.
194
+ - **Fallback**: if that subagent type is not available, invoke skill `/wr-risk-scorer:assess-release` via the installed skill invocation.
195
+ 2. Read the returned `RISK_SCORES: commit=X push=Y release=Z` line.
196
+ 3. **Drain condition**: if `push` and `release` are both within appetite (≤ 4/25, "Low" band per `RISK-POLICY.md`), AND `.changeset/` is non-empty, proceed to the drain action. Otherwise, skip the drain and report the unreleased state.
197
+
198
+ **Drain action (non-interactive, policy-authorised per the "Structured User Interaction for Governance-Skill Decisions" architecture rule Rule 6):**
199
+
200
+ 1. Run `npm run push:watch` (push + wait for CI to pass).
201
+ 2. If `.changeset/` remains non-empty after push (i.e. a release PR is pending), run `npm run release:watch` (merge the release PR + wait for npm publish).
202
+ 3. Report the release: "Released <package>@<version>. Mitigation record is now live on npm."
203
+
204
+ **Failure handling**: if `release:watch` fails (CI failure, publish failure), stop and report the failure clearly. Do not retry non-interactively — the user must intervene.
205
+
206
+ **Above-appetite branch**: if push/release risk is above appetite, skip the drain and report: "Release skipped — risk above appetite. Run `npm run push:watch` and `npm run release:watch` manually when ready."
207
+
208
+ ## Ownership boundary
209
+
210
+ `mitigate-incident` writes the Mitigation attempts timeline, the Status field, and the file rename on the first-attempt transition. It does NOT:
211
+
212
+ - Restore the incident to `.restored.md` (that is `/wr-itil:manage-incident <I###> restored` — slice 6b of the "Problem 071: Argument-based skill subcommands are not discoverable in Codex autocomplete" problem phased plan will split this out).
213
+ - Close the incident (that is `/wr-itil:manage-incident <I###> close` — slice 6c).
214
+ - Create or link problems (that is the restore handoff; mitigate-incident does not touch problem state).
215
+ - Add or edit Hypotheses or Observations. Those belong to `/wr-itil:manage-incident <I###>` update flow.
216
+
217
+ If the user wants any of the above, the skill reports the appropriate sibling and exits.
218
+
219
+ ## Related
220
+
221
+ - **the "Problem 071: Argument-based skill subcommands are not discoverable in Codex autocomplete" problem** (`docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md`) — originating ticket. This skill is slice 6a of the "Problem 071: Argument-based skill subcommands are not discoverable in Codex autocomplete" problem phased-landing plan.
222
+ - **the "alignment audit — sweep all unaudited skills/hooks/agents/ADRs/JTBDs/READMEs against the framework-resolution boundary (master ticket)" problem** (`docs/problems/136-adr-044-alignment-audit-master.open.md`) — the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule alignment audit master. This skill is the second high-ask SKILL audited under Phase 2 (after work-problem singular).
223
+ - **the "Rename `wr-problem` Plugin to `wr-itil`" architecture rule amended** (`docs/decisions/010-rename-wr-problem-to-wr-itil.proposed.md` — Skill Granularity section) — canonical skill-split naming + forwarder contract + `deprecated-arguments: true` frontmatter flag.
224
+ - **the "Add `manage-incident` Skill to `wr-itil` Plugin" architecture rule** (`docs/decisions/011-manage-incident-skill-wrapping.proposed.md`) — incident lifecycle file-suffix conventions (`.investigating.md` / `.mitigating.md` / `.restored.md` / `.closed.md`) + evidence-first rule + reversible-mitigation preference + Sev 4-5 lightweight path.
225
+ - **the "Structured User Interaction for Governance-Skill Decisions" architecture rule amended Rule 1** — structured user interaction; narrowed in the "Decision-delegation contract — agents over-apply Rule 1's interactive default to framework-resolved decisions; codify the framework-resolution boundary + AFK loop's batched-questions-as-deliverable + lazy-request_user_input measurement" problem to defer to the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule for framework-resolution boundary. Surface 1 (argument-backfill) no longer fires `request_user_input` (framework-mediated); Surfaces 2 + 3 retain it under the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule categories 2 + 3.
226
+ - **the "Structured User Interaction for Governance-Skill Decisions" architecture rule** Rule 6 — policy-within-appetite non-interactive actions (release drain). Step 9 unchanged.
227
+ - **the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule** (`docs/decisions/044-decision-delegation-contract.proposed.md`) — Decision-Delegation Contract. Surface 1 (argument-backfill) is framework-mediated per the ADR; Surface 2 (evidence-first gate) is category-2 (deviation-approval); Surface 3 (risk-above-appetite commit) is category-3 (one-time-override); **Surface 4 (mitigation SELECTION within the reversible-preference ladder) is framework-mediated / category-4 silent-framework family — agent-owned, no request_user_input and no prose-ask (the "Agent defers mitigation selection to user during active incident — surfaces mitigation choice as user-authority when SKILL contract empowers agent-driven reversible mitigations" problem; see "Reversible preference").**
228
+ - **the "Agent defers mitigation selection to user during active incident — surfaces mitigation choice as user-authority when SKILL contract empowers agent-driven reversible mitigations" problem** (`docs/problems/.../180-agent-defers-mitigation-selection-to-user-during-active-incident.md`) — agent deferred mitigation selection to the user during I002 ("I'll wait for your direction on which mitigation to attempt"); user correction "mitigations don't belong to me. You are empowered." The "Reversible preference" empowerment annotation is the declarative-layer fix (sibling of the "Agents over-ask in interactive sessions — conflating mechanical-stages with user-interactive-stages of multi-stage skill contracts (inverse-)" problem's closed inverse-the "Problem 078: Assistant does not offer to capture a problem ticket when the user delivers strong-signal correction" problem over-ask class on the mitigation-selection surface).
229
+ - **the "Governance Skills Commit Their Own Completed Work" architecture rule** — governance skills commit their own work.
230
+ - **the "On-Demand Assessment Skills for Governance Plugins" architecture rule** — release scorer delegation pattern.
231
+ - **the "Governance skills auto-release when changesets are queued" architecture rule** — auto-release when changesets are queued.
232
+ - **the "Skill testing strategy — contract-assertion bats companion to" architecture rule** (`docs/decisions/037-skill-testing-strategy.proposed.md`) — contract-assertion bats pattern applied to this skill.
233
+ - **the ": Enforce Governance Without Slowing Down" user outcome** (`docs/jtbd/developer/the ": Enforce Governance Without Slowing Down" user outcome-enforce-governance.proposed.md`) — discoverable surface via `/wr-itil:` autocomplete.
234
+ - **the "Extend the Suite with New Plugins" user outcome** (`docs/jtbd/plugin-developer/the "Extend the Suite with New Plugins" user outcome-extend-suite.proposed.md`) — one skill per distinct user intent.
235
+ - **the "Restore Service Fast with an Audit Trail" user outcome** (`docs/jtbd/tech-lead/the "Restore Service Fast with an Audit Trail" user outcome-restore-service-fast.proposed.md`) — evidence-first audit trail preserved post-split.
236
+ - `<itil-plugin-root>/skills/manage-incident/SKILL.md` — hosts the thin-router forwarder for the deprecated `manage-incident <I###> mitigate <action>` form.
237
+ - `<itil-plugin-root>/skills/list-incidents/SKILL.md` — slice 5 precedent; the split-skill shape this slice mirrors.
238
+
239
+ $ARGUMENTS
@@ -0,0 +1,3 @@
1
+ interface:
2
+ display_name: "WR ITIL: Mitigate Incident"
3
+ short_description: "Record mitigation and transition an incident."
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: wr-itil:reconcile-readme
3
+ description: Detect and correct drift between docs/problems/README.md and the on-disk ticket inventory. Wraps the diagnose-only `<itil-plugin-root>/scripts/reconcile-readme.sh` script with an agent-applied-edits pattern that preserves narrative content (the "Last reviewed" prose paragraph and Closed-section closure-via free text). Use when README WSJF Rankings, Verification Queue, or Closed sections drift from filesystem state — typically detected by manage-problem Step 0 preflight or work-problems Step 0 preflight.
4
+ allowed-tools: Read, Edit, Write, Bash, Grep, Glob
5
+ ---
6
+
7
+ <!-- Generated from the runtime-neutral skill source. Do not edit. -->
8
+
9
+ > Codex runtime note: use `request_user_input` only where this contract
10
+ > explicitly requires a human decision. Resolve `<itil-plugin-root>` from
11
+ > this installed `SKILL.md`: it is two directories above the skill
12
+ > directory. Run bundled commands from `<itil-plugin-root>/bin/`; do not
13
+ > search the adopter repository or rely on those commands being on `PATH`.
14
+ > Spawn `wr-itil:hang-off-check` with the native Codex subagent tool, wait
15
+ > for it, and close that same agent.
16
+
17
+
18
+ # Reconcile Problem Backlog README
19
+
20
+ Reconcile `docs/problems/README.md` against on-disk ticket state when drift is detected. This is the cross-session robustness layer ON TOP of the "Problem 094: `/wr-itil:manage-problem` does not refresh `docs/problems/README.md` on ticket creation" problem (refresh-on-create) and the "Problem 062: `manage-problem` does not refresh `docs/problems/README.md` on single-ticket transitions; fast-path cache goes stale silently" problem (refresh-on-transition). Both per-operation contracts hold their per-session evidence — but if any past session committed a ticket change without staging the README refresh, the next session inherits a stale README that no per-operation contract retroactively fixes.
21
+
22
+ This skill closes that gap. It runs the diagnose-only mechanical drift detector, then applies the corrections to the README in a way that preserves human-curated narrative content.
23
+
24
+ ## Scope
25
+
26
+ Reconcile drift between `docs/problems/README.md` and these on-disk ticket states:
27
+
28
+ | File suffix | Belongs in README section | Drift class |
29
+ |------------|---------------------------|-------------|
30
+ | `*.open.md` / `*.known-error.md` | WSJF Rankings | MISSING (file exists, row absent) or DRIFT (row claims wrong status) |
31
+ | `*.verifying.md` | Verification Queue | MISSING (file exists, row absent) or DRIFT (WSJF Rankings row stale) |
32
+ | `*.closed.md` | Closed (curated, not exhaustive) | MISMATCH (Closed row points to wrong-status file) or STALE (still in WSJF / VQ) |
33
+ | `*.parked.md` | Parked (own section) | not enforced — Parked is its own narrative table |
34
+
35
+ Out of scope:
36
+ - Re-rating WSJF or Effort. The script trusts each ticket file's stored values; re-ranking happens in `/wr-itil:review-problems`.
37
+ - Editing ticket file bodies. Reconciliation is README-only.
38
+ - Migrating between status suffixes. That belongs in `/wr-itil:transition-problem`.
39
+
40
+ ## When invoked
41
+
42
+ Three invocation surfaces, all routed through this skill so the agent-applied-edits logic stays single-sourced:
43
+
44
+ 1. **Direct user invocation**: `/wr-itil:reconcile-readme` — interactive when the user spots drift in the README.
45
+ 2. **Manage-problem Step 0 preflight halt**: when `/wr-itil:manage-problem` Step 0 detects drift via the script, it halts with a directive to invoke this skill (interactive) or auto-applies via this skill in non-interactive mode (AFK orchestrator per the "Structured User Interaction for Governance-Skill Decisions" architecture rule Rule 6).
46
+ 3. **Work-problems Step 0 preflight halt**: when `/wr-itil:work-problems` Step 0 detects drift via the script, the same halt-with-directive / auto-apply behaviour applies.
47
+
48
+ ## Steps
49
+
50
+ ### Step 1. Run the diagnose-only script
51
+
52
+ Invoke the mechanical drift detector:
53
+
54
+ ```bash
55
+ <itil-plugin-root>/bin/wr-itil-reconcile-readme docs/problems
56
+ ```
57
+
58
+ The `<itil-plugin-root>/bin/wr-itil-reconcile-readme` command is a `$PATH`-resolved shim shipped in `<itil-plugin-root>/bin/` that dispatches the canonical `<itil-plugin-root>/scripts/reconcile-readme.sh` body. the "Plugin-bundled scripts invoked from SKILL.md resolve via `bin/` on `$PATH`" architecture rule — never invoke the canonical script via repo-relative path; the path does not resolve in adopter trees.
59
+
60
+ Exit codes:
61
+ - `0` — clean. No drift; nothing to do. Report "Reconciliation: clean (0 drift entries)" and exit.
62
+ - `1` — drift detected. The script prints one structured row per drift entry to stdout (each ≤ 150 bytes per the "Progressive disclosure + once-per-session budget for UserPromptSubmit governance prose" architecture rule progressive-disclosure budget). Continue to Step 2.
63
+ - `2` — parse error. README is missing, malformed, or section headers are absent. Halt with the parse-error message; this is a deeper repair that needs investigation, not mechanical reconciliation. In AFK mode (the "Structured User Interaction for Governance-Skill Decisions" architecture rule Rule 6), halt-with-report; do not attempt edits.
64
+
65
+ ### Step 2. Bucket the drift entries by section
66
+
67
+ Each drift line is one of four shapes:
68
+
69
+ | Marker | Meaning | Required edit |
70
+ |--------|---------|---------------|
71
+ | `DRIFT P<NNN> wsjf-rankings: claims=open actual=<X>` | README WSJF Rankings row claims Open but file is `<X>` | REMOVE the row from WSJF Rankings; if `<X>=verifying`, ADD to Verification Queue; if `<X>=closed`, optionally ADD to Closed |
72
+ | `MISSING P<NNN> wsjf-rankings: actual=<X>` | File exists as `.open.md` / `.known-error.md`; row absent from WSJF Rankings | ADD a row to WSJF Rankings, sourced from the ticket file's `**WSJF**`, `**Priority**`, `**Effort**`, `**Status**`, and `# Problem <NNN>: <title>` line |
73
+ | `MISSING P<NNN> verification-queue: actual=verifying` | File exists as `.verifying.md`; row absent from Verification Queue | ADD a row to Verification Queue, sourced from the ticket file's `## Fix Released` marker (release marker + date) and title |
74
+ | `STALE P<NNN> verification-queue: actual=<X>` | Row in Verification Queue but file is `<X>` (typically `closed`) | REMOVE the row from Verification Queue |
75
+ | `MISMATCH P<NNN> closed: actual=<X>` | Row in Closed section names a non-`.closed.md` file | REMOVE the row from Closed (or fix the ID — investigate) |
76
+
77
+ ### Step 3. Read the affected ticket files for ADD edits
78
+
79
+ For each `MISSING` entry, read the ticket file to extract the row data:
80
+
81
+ ```bash
82
+ # For WSJF Rankings ADD:
83
+ grep -E '^\*\*(Status|Priority|Effort|WSJF)\*\*:' docs/problems/open/<NNN>-*.md
84
+ grep -E '^# Problem <NNN>:' docs/problems/open/<NNN>-*.md
85
+ ```
86
+
87
+ Render the WSJF Rankings row in the existing format:
88
+
89
+ ```
90
+ | <WSJF> | P<NNN> | <title> | <severity> | <status> | <effort> |
91
+ ```
92
+
93
+ For each `MISSING` Verification Queue entry, read the `## Fix Released` block:
94
+
95
+ ```bash
96
+ sed -n '/^## Fix Released/,/^## /p' docs/problems/verifying/<NNN>-*.md
97
+ ```
98
+
99
+ Render the Verification Queue row in the existing format. The `Likely verified?` cell carries an **evidence-first** value per the "VQ `Likely verified?` column uses age-based heuristic (≥14 days = yes) instead of session-observed evidence — sibling proxy-for-evidence anti-pattern to" problem (supersedes the original the "Problem 048: manage-problem does not surface Fix Released problems as verification candidates when the fix path has been exercised" problem Candidate 4 14-day heuristic). <!-- LIKELY-VERIFIED-CELL-SHAPE: evidence-based per the "VQ `Likely verified?` column uses age-based heuristic (≥14 days = yes) instead of session-observed evidence — sibling proxy-for-evidence anti-pattern to" problem --> When reconcile-readme synthesises a missing row, default the cell to `no — not observed` — the row is being added because some prior session committed the `.verifying.md` transition without staging the README refresh; reconcile-readme has no session-observed evidence to cite. Subsequent `/wr-itil:review-problems` Step 4 or `run-retro` Step 4a passes populate `yes — observed: <evidence>` when the user verifies. Drift on the cell shape re-opens the "VQ `Likely verified?` column uses age-based heuristic (≥14 days = yes) instead of session-observed evidence — sibling proxy-for-evidence anti-pattern to" problem.
100
+
101
+ ```
102
+ | P<NNN> | <title> | <release marker> | no — not observed |
103
+ ```
104
+
105
+ ### Step 4. Apply edits via Edit tool — preserve narrative
106
+
107
+ This is the load-bearing step. Use the `Edit` tool to apply each row-level change. DO NOT regenerate the entire README from scratch — the per-Closed-row free-text closure-via column is human-curated narrative that a full regeneration would destroy. (The "Last reviewed:" line is now subject to the **Last-reviewed line discipline (the "`docs/problems/README.md` line 3 narrative-blob accumulator bloat — sibling to (briefing tier 3) on a different surface" problem)** described in Step 5 below — it carries only the most-recent fragment, not an ever-growing prose paragraph; the displaced history lives in `docs/problems/README-history.md`. Step 5 owns the line-3 update; Step 4 leaves it untouched.)
108
+
109
+ For each REMOVE: `Edit` with the existing row as `old_string`, and remove it (replace with empty string) or replace with a re-positioned row in another section (REMOVE-from-WSJF-Rankings + ADD-to-Verification-Queue is two Edit operations: one to delete the WSJF row, one to insert the VQ row).
110
+
111
+ For each ADD to WSJF Rankings: locate the correct WSJF position by descending order. Use `Edit` to insert the new row immediately above the next-lower-WSJF row (or append at the bottom of the table if the new row's WSJF is the lowest). The Edit's `old_string` is the line that the new row inserts above; the `new_string` is the new row + the same line below.
112
+
113
+ For each ADD to Verification Queue: insert the new row in `Released date ASC` position (oldest at row 1; same-day releases tiebreak by ID ASC) per the canonical VQ sort direction. <!-- VQ-SORT-DIRECTION: oldest-first per the "Problem lifecycle — add a Verification Pending status between Known Error and Closed" architecture rule --> Recent releases land at the bottom; oldest-pending verifications surface at the top so the user lands on actionable closure candidates first per the "Problem 048: manage-problem does not surface Fix Released problems as verification candidates when the fix path has been exercised" problem user-task semantics. Drift here re-opens the "docs/problems/README.md Verification Queue rendered newest-first contradicts section header "Ranked by release age, oldest first"" problem. The synthesised cell defaults to `no — not observed` per the "VQ `Likely verified?` column uses age-based heuristic (≥14 days = yes) instead of session-observed evidence — sibling proxy-for-evidence anti-pattern to" problem evidence-first cell shape — see the "Render the Verification Queue row" block above. <!-- LIKELY-VERIFIED-CELL-SHAPE: evidence-based per the "VQ `Likely verified?` column uses age-based heuristic (≥14 days = yes) instead of session-observed evidence — sibling proxy-for-evidence anti-pattern to" problem -->
114
+
115
+ After all edits, re-run `<itil-plugin-root>/scripts/reconcile-readme.sh docs/problems` to confirm exit 0. If the second run still reports drift, investigate the residual edits — do NOT re-run reconciliation in a loop, as that hides systematic edit failures.
116
+
117
+ ### Step 5. Update the "Last reviewed" annotation per the "`docs/problems/README.md` line 3 narrative-blob accumulator bloat — sibling to (briefing tier 3) on a different surface" problem truncation discipline
118
+
119
+ Apply the **Last-reviewed line discipline (the "`docs/problems/README.md` line 3 narrative-blob accumulator bloat — sibling to (briefing tier 3) on a different surface" problem)** contract documented in `manage-problem` SKILL.md Step 5 — line 3 carries ONE most-recent fragment naming this reconciliation; the prior content rotates to `docs/problems/README-history.md` (forward-chronology archive, soft cap ≤ 1024 bytes per fragment, hard ceiling 5120 bytes per the "Session-start briefing surface — SessionStart hook over tiered directory + indexed README" architecture rule Tier 3 envelope, surfaced advisory-only by `<itil-plugin-root>/scripts/check-problems-readme-budget.sh`).
120
+
121
+ **Mechanism**:
122
+
123
+ 1. Read the current line 3 of `docs/problems/README.md` (e.g. `awk 'NR==3' docs/problems/README.md`).
124
+ 2. If the current line 3 is non-empty and not a same-day reconciliation duplicate, append it to `docs/problems/README-history.md` under a `## YYYY-MM-DD` heading (creating the heading on first append for that date).
125
+ 3. Replace line 3 of README.md with the new fragment of the form:
126
+
127
+ > Last reviewed: 2026-MM-DD **README reconciled** — (N) drift entries corrected: <comma-separated ID list>. Reconciliation contract per the "`docs/problems/README.md` drifts from filesystem truth across sessions despite (refresh-on-create) and (refresh-on-transition) both Closed" problem + the "Governance Skills Commit Their Own Completed Work" architecture rule amended ("Reconciliation as preflight robustness layer").
128
+
129
+ Keep the new fragment ≤ 1024 bytes (soft cap) and certainly ≤ 5120 bytes (hard ceiling). Do NOT prepend `Prior:` segments. Do NOT re-write the existing prose inline — the displaced content lives in `README-history.md` going forward; truncation is the contract, not a side effect.
130
+
131
+ **Rationale (the "`docs/problems/README.md` line 3 narrative-blob accumulator bloat — sibling to (briefing tier 3) on a different surface" problem)**: this skill previously documented the line as "an ever-growing prose paragraph". That convention is what produced the 76-KB line-3 that broke the Read tool entirely. The reconcile path was a load-bearing site of the bloat — every reconcile that happened under the old convention re-wrote line 3 unbounded. The new discipline closes the surface for reconcile parity with `manage-problem` Step 5 the "Problem 094: `/wr-itil:manage-problem` does not refresh `docs/problems/README.md` on ticket creation" problem, Step 6 the "Problem 094: `/wr-itil:manage-problem` does not refresh `docs/problems/README.md` on ticket creation" problem, Step 7 the "Problem 062: `manage-problem` does not refresh `docs/problems/README.md` on single-ticket transitions; fast-path cache goes stale silently" problem, and the sibling `transition-problem`, `transition-problems`, `review-problems` skills.
132
+
133
+ ### Step 6. Commit
134
+
135
+ Commit the reconciled README in a dedicated single-purpose commit — unconditionally, regardless of interactive vs AFK invocation mode, per the "Governance Skills Commit Their Own Completed Work" architecture rule ("governance skills commit their own work"):
136
+
137
+ ```bash
138
+ git add docs/problems/README.md
139
+ git commit -m "chore(problems): reconcile README against filesystem (the "`docs/problems/README.md` drifts from filesystem truth across sessions despite (refresh-on-create) and (refresh-on-transition) both Closed" problem)"
140
+ ```
141
+
142
+ The reconciled state should always be staged together (no partial reconciliation) — when the agent has applied N edits in Step 4, all N belong in the same commit. Interactive and AFK invocations behave identically: the commit decision is **framework-mediated** per the "Governance Skills Commit Their Own Completed Work" architecture rule (the policy already decided governance skills commit their own work), NOT user direction-setting per the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule's authority taxonomy. A per-invocation consent surface here would re-ask a decision the framework has already resolved (the "Skill contract "interactive vs AFK" commit-gating anti-pattern contradicts" problem + lazy-request_user_input under the "— Decision-Delegation Contract: when agents act on the framework vs ask the user" architecture rule).
143
+
144
+ The "Structured User Interaction for Governance-Skill Decisions" architecture rule Rule 6 fail-safe is **risk-gated** (above-appetite + `request_user_input` unavailable → skip commit), not **mode-gated** (interactive vs AFK). Reconciliation is pure mechanical README refresh with no risk-above-appetite branch, so Rule 6 simply does not fire here.
145
+
146
+ ## ADR alignment
147
+
148
+ - **the "Governance Skills Commit Their Own Completed Work" architecture rule** (governance skills commit their own work) — amended to add "Reconciliation as preflight robustness layer" sub-rule. the "Problem 094: `/wr-itil:manage-problem` does not refresh `docs/problems/README.md` on ticket creation" problem and the "Problem 062: `manage-problem` does not refresh `docs/problems/README.md` on single-ticket transitions; fast-path cache goes stale silently" problem cover per-operation refresh; this skill covers cross-session drift detection + correction.
149
+ - **the "Problem lifecycle — add a Verification Pending status between Known Error and Closed" architecture rule** (Verification Pending lifecycle status conventions) — Confirmation criterion 3 extended to "and matches the Verification Queue table in `README.md` modulo narrative content".
150
+ - **the "Progressive disclosure + once-per-session budget for UserPromptSubmit governance prose" architecture rule** (Progressive disclosure for governance tooling context) — script output is per-row terse (≤150 bytes per drift entry); the agent expands narrative-aware edits on demand.
151
+ - **the "Plugin Testing Strategy" architecture rule** (Plugin testing strategy) — script-level bats lives at `<itil-plugin-root>/scripts/test/reconcile-readme.bats`; the "Skill testing strategy — contract-assertion bats companion to" architecture rule (skill testing) governs this skill's own contract bats.
152
+ - **the "Structured User Interaction for Governance-Skill Decisions" architecture rule** (Structured interaction) — Rule 6 (non-interactive fail-safe) governs the parse-error halt in Step 1 (exit code 2). Rule 6 is risk-gated, not mode-gated; reconciliation's Step 6 commit fires unconditionally per the "Governance Skills Commit Their Own Completed Work" architecture rule (the "Skill contract "interactive vs AFK" commit-gating anti-pattern contradicts" problem). Rule 6 does NOT carve out the Step 6 commit on mode grounds.
153
+
154
+ ## Confirmation
155
+
156
+ This skill's contract holds when:
157
+ 1. The script `<itil-plugin-root>/scripts/reconcile-readme.sh` is read-only — no live README mutation in the script layer (mutation only in this skill's Step 4, via the Edit tool).
158
+ 2. Each agent-applied edit preserves the README's narrative content (prose paragraph at top, Closed section free text).
159
+ 3. After Step 4 + Step 5, a re-run of the script reports exit 0 (clean).
160
+ 4. The reconciled README rides a single commit (Step 6 single-purpose commit) regardless of invocation mode — interactive and AFK behave identically per the "Governance Skills Commit Their Own Completed Work" architecture rule governance-skill commit contract (the "Skill contract "interactive vs AFK" commit-gating anti-pattern contradicts" problem).
161
+ 5. The skill is invoked from `/wr-itil:manage-problem` Step 0, `/wr-itil:work-problems` Step 0, AND direct user invocation — no other invocation surface (e.g., `/wr-itil:transition-problem` does NOT call this skill; per architect verdict the "Problem 062: `manage-problem` does not refresh `docs/problems/README.md` on single-ticket transitions; fast-path cache goes stale silently" problem already covers transition-time refresh inside the same commit, redundant preflight here would pay the cost on every transition).
162
+
163
+ ## Related
164
+
165
+ - `<itil-plugin-root>/scripts/reconcile-readme.sh` — the diagnose-only mechanical drift detector.
166
+ - `<itil-plugin-root>/scripts/test/reconcile-readme.bats` — script-level bats per the "Plugin Testing Strategy" architecture rule.
167
+ - `<itil-plugin-root>/skills/manage-problem/SKILL.md` — invokes this skill from Step 0 preflight.
168
+ - `<itil-plugin-root>/skills/work-problems/SKILL.md` — invokes the script (not the skill) from Step 0 preflight; halts with directive on drift.
169
+ - `docs/problems/118-readme-drifts-from-filesystem-truth-despite-refresh-contracts-closed.open.md` — the originating problem ticket.
170
+ - `docs/decisions/014-governance-skills-commit-their-own-work.proposed.md` — amended Reconciliation sub-rule.
171
+ - `docs/decisions/022-problem-lifecycle-verification-pending-status.proposed.md` — Confirmation criterion 3 extension.
172
+ - **the "Problem 094: `/wr-itil:manage-problem` does not refresh `docs/problems/README.md` on ticket creation" problem** (`docs/problems/094-...closed.md`) — refresh-on-create. Composes; this skill is robustness on top, not supersession.
173
+ - **the "Problem 062: `manage-problem` does not refresh `docs/problems/README.md` on single-ticket transitions; fast-path cache goes stale silently" problem** (`docs/problems/062-...closed.md`) — refresh-on-transition. Composes; same.
174
+ - **the "Skill contract "interactive vs AFK" commit-gating anti-pattern contradicts" problem** (`docs/problems/open/172-skill-contract-interactive-vs-afk-commit-gating-anti-pattern-contradicts-adr-014.md`) — removed the Step 6 interactive-vs-AFK commit-gating carve-out 2026-06-09. The carve-out contradicted the "Governance Skills Commit Their Own Completed Work" architecture rule and produced uncommitted reconciliations across months of AFK-equivalent sessions before the FFS-grade correction surfaced it.
175
+ - `docs/decisions/044-decision-delegation-contract.proposed.md` — framework-resolution boundary; the commit decision is framework-mediated (the "Governance Skills Commit Their Own Completed Work" architecture rule), not user direction-setting.
@@ -0,0 +1,3 @@
1
+ interface:
2
+ display_name: "WR ITIL: Reconcile README"
3
+ short_description: "Reconcile the problem index with ticket state."
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: wr-itil:reconcile-stories
3
+ description: Detect and correct drift between docs/stories/README.md and the on-disk story inventory. Wraps the diagnose-only <itil-plugin-root>/scripts/reconcile-stories.sh script with an agent-applied-edits pattern that preserves narrative content (the "Last reviewed" prose paragraph). Use when docs/stories/README.md Story Rankings or Done sections drift from filesystem state — typically detected by manage-story Step 0 preflight or work-problems preflight on RFC iters with story-tier traces.
4
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob
5
+ ---
6
+
7
+ <!-- Generated from the runtime-neutral skill source. Do not edit. -->
8
+
9
+ > Codex runtime note: use `request_user_input` only where this contract
10
+ > explicitly requires a human decision. Resolve `<itil-plugin-root>` from
11
+ > this installed `SKILL.md`: it is two directories above the skill
12
+ > directory. Run bundled commands from `<itil-plugin-root>/bin/`; do not
13
+ > search the adopter repository or rely on those commands being on `PATH`.
14
+ > Spawn `wr-itil:hang-off-check` with the native Codex subagent tool, wait
15
+ > for it, and close that same agent.
16
+
17
+
18
+ # Reconcile Stories Skill
19
+
20
+ Sibling to `/wr-itil:reconcile-readme` (the "`docs/problems/README.md` drifts from filesystem truth across sessions despite (refresh-on-create) and (refresh-on-transition) both Closed" problem / the "Governance Skills Commit Their Own Completed Work" architecture rule) and `/wr-itil:reconcile-rfcs` (the "Problem-RFC-Story framework with mandatory problem-trace and unified problem ontology" architecture rule Phase 1 item 5), applied at the story tier per the "Problem tickets strain as fixes decompose into multiple coordinated changes — need an RFC framework that ties all changes back to problems (and unifies technical with user/business problems)" problem Phase 2 Slice 9.
21
+
22
+ **Diagnose-only mechanic** — wraps `<itil-plugin-root>/scripts/reconcile-stories.sh` (resolved via `<itil-plugin-root>/bin/wr-itil-reconcile-stories` `$PATH` shim per the "Plugin-bundled scripts invoked from SKILL.md resolve via `bin/` on `$PATH`" architecture rule). The script reads `docs/stories/<state>/STORY-NNN-*.md` files across all 5 lifecycle subdirs (draft, accepted, in-progress, done, archived), parses `docs/stories/README.md`'s Story Rankings + Done tables, and reports each disagreement. Exit codes: `0` clean, `1` drift detected (structured stdout), `2` parse error.
23
+
24
+ **Reverse-trace pass** — when the parent directories exist, the reconciler checks auto-maintained `## Stories` sections on problem, JTBD and legacy RFC files. For an the "A release row is the RFC, and the map is the approval surface" architecture rule row-backed RFC, it checks the map row instead: the RFC must resolve and the row must contain the story card.
25
+ - `MISSING_REVERSE_TRACE STORY-NNN in <PARENT-ID> ## Stories` — story claims parent but parent's `## Stories` table doesn't list the story
26
+ - `STALE_REVERSE_TRACE STORY-NNN in <PARENT-ID> ## Stories` — parent lists the story but story no longer claims the parent
27
+ - `STATUS_MISMATCH STORY-NNN in <PARENT-ID> ## Stories claims=<X> actual=<Y>` — parent's row claims one lifecycle status; story's filesystem subdir is a different state
28
+ - `UNRESOLVED_RFC_TRACE STORY-NNN claims=RFC-NNN` — neither a legacy RFC file nor a story-map release row exists
29
+ - `MISSING_REVERSE_TRACE STORY-NNN in RFC-NNN release row` — the release row exists but does not contain the story card
30
+
31
+ ## When to invoke
32
+
33
+ - **Drift detected by another skill's preflight** — `/wr-itil:manage-story` or `/wr-itil:work-problems` Step 0 preflight may surface `docs/stories/README.md` drift; this skill is the recovery path.
34
+ - **Manual drift recovery** — user notices the README is stale (e.g. story moved between lifecycle subdirs without README refresh; reverse-trace `## Stories` section out of date on a problem ticket).
35
+ - **CI drift gate** — a CI step running `<itil-plugin-root>/bin/wr-itil-reconcile-stories` against the merge target would surface drift before merge; this skill is the in-repo recovery path.
36
+
37
+ ## Composition with manage-story
38
+
39
+ `manage-story` (the "Problem tickets strain as fixes decompose into multiple coordinated changes — need an RFC framework that ties all changes back to problems (and unifies technical with user/business problems)" problem Phase 2 Slice 8) owns the inline the "Problem 094: `/wr-itil:manage-problem` does not refresh `docs/problems/README.md` on ticket creation" problem / the "Problem 062: `manage-problem` does not refresh `docs/problems/README.md` on single-ticket transitions; fast-path cache goes stale silently" problem README refresh on every lifecycle transition (draft → accepted → in-progress → done). When the inline refresh is satisfied, the README stays current and `reconcile-stories` reports clean. The reconcile skill is the *recovery* path when inline refresh was missed (typically when story files are moved manually, or when frontmatter trace edits don't ride through `manage-story`).
40
+
41
+ ## Steps
42
+
43
+ ### 1. Run the diagnose script
44
+
45
+ ```bash
46
+ <itil-plugin-root>/bin/wr-itil-reconcile-stories docs/stories docs/problems docs/rfcs docs/jtbd docs/story-maps > /tmp/wr-itil-stories-drift-$$.txt
47
+ reconcile_exit=$?
48
+ ```
49
+
50
+ - **Exit 0**: README is clean. Report "no drift detected" and exit.
51
+ - **Exit 1**: drift detected. Continue to Step 2.
52
+ - **Exit 2**: parse error (README missing or malformed). Halt; the README needs structural repair which this skill doesn't own (the `manage-story review` flow handles structural-rebuild semantics).
53
+
54
+ ### 2. Read drift entries + plan edits
55
+
56
+ Read `/tmp/wr-itil-stories-drift-$$.txt` line by line. Each line is one of:
57
+ - `DRIFT STORY-NNN rankings: claims=<X> actual=<Y>` — Story Rankings row has wrong Status; update the row.
58
+ - `STALE STORY-NNN rankings: actual=<state>` — Story Rankings table is missing a row; add it.
59
+ - `MISMATCH STORY-NNN done: actual=<state>` — Done table has wrong row OR an extra row; remove/adjust.
60
+ - `MISSING_REVERSE_TRACE STORY-NNN in <PARENT-ID> ## Stories` — parent's `## Stories` section needs the story added; call `update-<parent-kind>-references-section.sh <parent-file> "Stories"` to refresh.
61
+ - `STALE_REVERSE_TRACE STORY-NNN in <PARENT-ID> ## Stories` — parent's `## Stories` section needs the story removed; same helper call (idempotent, lazy-empty discipline removes when no traces remain).
62
+ - `STATUS_MISMATCH STORY-NNN in <PARENT-ID> ## Stories claims=<X> actual=<Y>` — same helper call refreshes the status column.
63
+ - `UNRESOLVED_RFC_TRACE` / row `MISSING_REVERSE_TRACE` — repair the map's release row or card through `/wr-itil:manage-story-map`; do not create an empty RFC file.
64
+
65
+ ### 3. Apply edits
66
+
67
+ For README drift entries — edit `docs/stories/README.md` in-place preserving the "Last reviewed" prose paragraph at the top. Use the Edit tool with narrow `old_string` / `new_string` pairs targeting only the table row(s) affected.
68
+
69
+ For reverse-trace drift entries — invoke the appropriate Slice 2a/2b helper for each parent file:
70
+
71
+ ```bash
72
+ # Problem parent
73
+ <itil-plugin-root>/bin/wr-itil-update-problem-references-section "$problem_file" "Stories"
74
+ # RFC parent
75
+ <itil-plugin-root>/bin/wr-itil-update-rfc-references-section "$rfc_file" "Stories"
76
+ # JTBD parent
77
+ <itil-plugin-root>/bin/wr-itil-update-jtbd-references-section "$jtbd_file" "Stories"
78
+ ```
79
+
80
+ ### 4. Verify + commit
81
+
82
+ Re-run `<itil-plugin-root>/bin/wr-itil-reconcile-stories` after edits. Exit 0 expected. Stage all modified files (README + parent files) and commit per the "Governance Skills Commit Their Own Completed Work" architecture rule single-commit grain.
83
+
84
+ Commit message:
85
+
86
+ ```
87
+ docs(stories): reconcile docs/stories/README.md drift (N entries)
88
+
89
+ Refs: <relevant problem/RFC/story IDs derived from the drift entries>
90
+ ```
91
+
92
+ The "Governance Skills Commit Their Own Completed Work" architecture rule commit grain is "one reconciliation pass per commit" — covers README + N parent files all in one commit since they're all reconciling to filesystem truth, a single coherent action.
93
+
94
+ ### 5. Report
95
+
96
+ After commit, report:
97
+ - Number of drift entries reconciled.
98
+ - Files modified (README + each parent reverse-trace surface touched).
99
+ - Commit SHA.
100
+ - Trailing pointer: `Run /wr-itil:manage-story review next to refresh story rankings + INVEST scoring if any stories crossed the accepted gate during the reconciliation window.`
101
+
102
+ ## Ownership boundary
103
+
104
+ `reconcile-stories` owns drift DETECTION and MECHANICAL REPAIR of `docs/stories/README.md` + reverse-trace sections. It does NOT:
105
+ - Move story files between lifecycle subdirs (that's `manage-story` § Status transitions).
106
+ - Edit story frontmatter (that's `manage-story` at lifecycle transitions OR `capture-story` at capture-time).
107
+ - Refresh story body sections (User value / Acceptance criteria / Implementation notes are owned by `manage-story` lifecycle transitions per I10 INVEST gates).
108
+ - Run WSJF computation (I11 invariant: stories MUST NOT carry a WSJF field in Phase 2 per the "Problem-RFC-Story framework with mandatory problem-trace and unified problem ontology" architecture rule line 253).
109
+
110
+ ## Related
111
+
112
+ - **the "Problem tickets strain as fixes decompose into multiple coordinated changes — need an RFC framework that ties all changes back to problems (and unifies technical with user/business problems)" problem** — driver problem ticket.
113
+ - **the "Problem-RFC-Story framework with mandatory problem-trace and unified problem ontology" architecture rule** — Problem-RFC-Story framework. Phase 2 amendment 2026-05-10 introduces the story tier; line 270 names the auto-maintained `## Stories` reverse-trace section contract.
114
+ - **the "Plugin-bundled scripts invoked from SKILL.md resolve via `bin/` on `$PATH`" architecture rule** — plugin-bundled scripts via `bin/` on `$PATH`. `<itil-plugin-root>/bin/wr-itil-reconcile-stories` shim follows this grammar.
115
+ - **the "Governance Skills Commit Their Own Completed Work" architecture rule** — single-commit grain. The reconciliation pass is a single coherent action; one commit per pass.
116
+ - **the "Behavioural-tests-default for skill testing" architecture rule** — behavioural-tests default. Bats coverage at `<itil-plugin-root>/scripts/test/reconcile-stories.bats` (the "Problem tickets strain as fixes decompose into multiple coordinated changes — need an RFC framework that ties all changes back to problems (and unifies technical with user/business problems)" problem Phase 2 Slice 9).
117
+ - **the "Session-start briefing surface — SessionStart hook over tiered directory + indexed README" architecture rule** — diagnose-only advisory-exit contract. `reconcile-stories.sh` is exit-1 on drift, exit-0 on clean, exit-2 on parse error.
118
+ - **the "`docs/problems/README.md` drifts from filesystem truth across sessions despite (refresh-on-create) and (refresh-on-transition) both Closed" problem** / `reconcile-readme.sh` — sibling at the problems tier.
119
+ - **the "Problem-RFC-Story framework with mandatory problem-trace and unified problem ontology" architecture rule Phase 1 item 5** / `reconcile-rfcs.sh` — sibling at the RFC tier.
120
+ - **Slice 2a/2b helpers** — `update-problem-references-section.sh`, `update-rfc-references-section.sh`, `update-jtbd-references-section.sh` are the load-bearing reverse-trace refresh helpers this skill invokes; all three accept `"Stories"` as a section-name token per their lookup tables.
121
+ - **the ": Enforce Governance Without Slowing Down" user outcome** — Enforce Governance Without Slowing Down. Drift detection is an automated governance enforcement surface; mechanical repair preserves the spirit while removing manual toil.
122
+ - **the ": Decompose a Fix Into Coordinated Changes" user outcome** — Decompose a Fix Into Coordinated Changes. Story tier reverse-trace integrity is load-bearing for the working-the-problem flow's per-story dispatch (Slice 13 traversal).
123
+
124
+ $ARGUMENTS
@@ -0,0 +1,3 @@
1
+ interface:
2
+ display_name: "WR ITIL: Reconcile Stories"
3
+ short_description: "Reconcile the story index with story state."