@istmx/skills 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/README.md +141 -51
  2. package/RELEASE_v2.1.0.md +68 -0
  3. package/bin/cli.js +64 -86
  4. package/context/conversation_transcript.md +786 -0
  5. package/context/progress.md +129 -0
  6. package/istm/SKILL.md +20 -11
  7. package/istm-animate/SKILL.md +19 -11
  8. package/istm-architecture/SKILL.md +70 -14
  9. package/istm-architecture/templates/agents.md +21 -2
  10. package/istm-awwward-designer/SKILL.md +31 -7
  11. package/istm-design/SKILL.md +26 -12
  12. package/istm-design/anti-laziness/architectural-patterns.md +55 -0
  13. package/istm-design/anti-laziness/parameter-tuning.md +44 -0
  14. package/istm-design/anti-laziness/prompt-engineering.md +52 -0
  15. package/istm-design/anti-laziness/reference-prompts.md +79 -0
  16. package/istm-design/archetypes/brandkit/SKILL.md +798 -0
  17. package/istm-design/archetypes/brutalist/SKILL.md +92 -0
  18. package/istm-design/archetypes/minimalist/SKILL.md +85 -0
  19. package/istm-design/archetypes/soft/SKILL.md +98 -0
  20. package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +1 -1
  21. package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +1 -1
  22. package/istm-design/image-to-code/SKILL.md +1228 -0
  23. package/istm-design/imagegen/SKILL.md +987 -0
  24. package/istm-design/presets/airbnb/DESIGN.md +545 -0
  25. package/istm-design/presets/airbnb/README.md +5 -0
  26. package/istm-design/presets/airtable/DESIGN.md +554 -0
  27. package/istm-design/presets/airtable/README.md +5 -0
  28. package/istm-design/presets/apple/DESIGN.md +562 -0
  29. package/istm-design/presets/apple/README.md +5 -0
  30. package/istm-design/presets/binance/DESIGN.md +634 -0
  31. package/istm-design/presets/binance/README.md +5 -0
  32. package/istm-design/presets/bmw/DESIGN.md +544 -0
  33. package/istm-design/presets/bmw/README.md +5 -0
  34. package/istm-design/presets/bmw-m/DESIGN.md +503 -0
  35. package/istm-design/presets/bmw-m/README.md +5 -0
  36. package/istm-design/presets/bugatti/DESIGN.md +454 -0
  37. package/istm-design/presets/bugatti/README.md +5 -0
  38. package/istm-design/presets/cal/DESIGN.md +542 -0
  39. package/istm-design/presets/cal/README.md +5 -0
  40. package/istm-design/presets/catalog.md +127 -0
  41. package/istm-design/presets/claude/DESIGN.md +589 -0
  42. package/istm-design/presets/claude/README.md +5 -0
  43. package/istm-design/presets/clay/DESIGN.md +541 -0
  44. package/istm-design/presets/clay/README.md +5 -0
  45. package/istm-design/presets/clickhouse/DESIGN.md +544 -0
  46. package/istm-design/presets/clickhouse/README.md +5 -0
  47. package/istm-design/presets/cohere/DESIGN.md +451 -0
  48. package/istm-design/presets/cohere/README.md +5 -0
  49. package/istm-design/presets/coinbase/DESIGN.md +570 -0
  50. package/istm-design/presets/coinbase/README.md +5 -0
  51. package/istm-design/presets/composio/DESIGN.md +506 -0
  52. package/istm-design/presets/composio/README.md +5 -0
  53. package/istm-design/presets/cursor/DESIGN.md +537 -0
  54. package/istm-design/presets/cursor/README.md +5 -0
  55. package/istm-design/presets/dell-1996/DESIGN.md +632 -0
  56. package/istm-design/presets/dell-1996/README.md +5 -0
  57. package/istm-design/presets/elevenlabs/DESIGN.md +504 -0
  58. package/istm-design/presets/elevenlabs/README.md +5 -0
  59. package/istm-design/presets/expo/DESIGN.md +526 -0
  60. package/istm-design/presets/expo/README.md +5 -0
  61. package/istm-design/presets/ferrari/DESIGN.md +531 -0
  62. package/istm-design/presets/ferrari/README.md +5 -0
  63. package/istm-design/presets/figma/DESIGN.md +578 -0
  64. package/istm-design/presets/figma/README.md +5 -0
  65. package/istm-design/presets/framer/DESIGN.md +544 -0
  66. package/istm-design/presets/framer/README.md +5 -0
  67. package/istm-design/presets/hashicorp/DESIGN.md +575 -0
  68. package/istm-design/presets/hashicorp/README.md +5 -0
  69. package/istm-design/presets/hp/DESIGN.md +670 -0
  70. package/istm-design/presets/hp/README.md +5 -0
  71. package/istm-design/presets/ibm/DESIGN.md +550 -0
  72. package/istm-design/presets/ibm/README.md +5 -0
  73. package/istm-design/presets/intercom/DESIGN.md +546 -0
  74. package/istm-design/presets/intercom/README.md +5 -0
  75. package/istm-design/presets/kraken/DESIGN.md +125 -0
  76. package/istm-design/presets/kraken/README.md +5 -0
  77. package/istm-design/presets/lamborghini/DESIGN.md +288 -0
  78. package/istm-design/presets/lamborghini/README.md +5 -0
  79. package/istm-design/presets/linear/DESIGN.md +548 -0
  80. package/istm-design/presets/linear/README.md +5 -0
  81. package/istm-design/presets/lovable/DESIGN.md +298 -0
  82. package/istm-design/presets/lovable/README.md +5 -0
  83. package/istm-design/presets/mastercard/DESIGN.md +365 -0
  84. package/istm-design/presets/mastercard/README.md +5 -0
  85. package/istm-design/presets/meta/DESIGN.md +683 -0
  86. package/istm-design/presets/meta/README.md +5 -0
  87. package/istm-design/presets/minimax/DESIGN.md +746 -0
  88. package/istm-design/presets/minimax/README.md +5 -0
  89. package/istm-design/presets/mintlify/DESIGN.md +852 -0
  90. package/istm-design/presets/mintlify/README.md +5 -0
  91. package/istm-design/presets/miro/DESIGN.md +825 -0
  92. package/istm-design/presets/miro/README.md +5 -0
  93. package/istm-design/presets/mistral/DESIGN.md +773 -0
  94. package/istm-design/presets/mistral/README.md +5 -0
  95. package/istm-design/presets/mongodb/DESIGN.md +767 -0
  96. package/istm-design/presets/mongodb/README.md +5 -0
  97. package/istm-design/presets/nike/DESIGN.md +575 -0
  98. package/istm-design/presets/nike/README.md +5 -0
  99. package/istm-design/presets/nintendo-2001/DESIGN.md +649 -0
  100. package/istm-design/presets/nintendo-2001/README.md +5 -0
  101. package/istm-design/presets/notion/DESIGN.md +821 -0
  102. package/istm-design/presets/notion/README.md +5 -0
  103. package/istm-design/presets/nvidia/DESIGN.md +640 -0
  104. package/istm-design/presets/nvidia/README.md +5 -0
  105. package/istm-design/presets/ollama/DESIGN.md +539 -0
  106. package/istm-design/presets/ollama/README.md +5 -0
  107. package/istm-design/presets/opencode/DESIGN.md +521 -0
  108. package/istm-design/presets/opencode/README.md +5 -0
  109. package/istm-design/presets/pinterest/DESIGN.md +597 -0
  110. package/istm-design/presets/pinterest/README.md +5 -0
  111. package/istm-design/presets/playstation/DESIGN.md +661 -0
  112. package/istm-design/presets/playstation/README.md +5 -0
  113. package/istm-design/presets/posthog/DESIGN.md +690 -0
  114. package/istm-design/presets/posthog/README.md +5 -0
  115. package/istm-design/presets/raycast/DESIGN.md +669 -0
  116. package/istm-design/presets/raycast/README.md +5 -0
  117. package/istm-design/presets/renault/DESIGN.md +589 -0
  118. package/istm-design/presets/renault/README.md +5 -0
  119. package/istm-design/presets/replicate/DESIGN.md +616 -0
  120. package/istm-design/presets/replicate/README.md +5 -0
  121. package/istm-design/presets/resend/DESIGN.md +585 -0
  122. package/istm-design/presets/resend/README.md +5 -0
  123. package/istm-design/presets/revolut/DESIGN.md +636 -0
  124. package/istm-design/presets/revolut/README.md +5 -0
  125. package/istm-design/presets/runwayml/DESIGN.md +244 -0
  126. package/istm-design/presets/runwayml/README.md +5 -0
  127. package/istm-design/presets/sanity/DESIGN.md +357 -0
  128. package/istm-design/presets/sanity/README.md +5 -0
  129. package/istm-design/presets/sentry/DESIGN.md +551 -0
  130. package/istm-design/presets/sentry/README.md +5 -0
  131. package/istm-design/presets/shopify/DESIGN.md +516 -0
  132. package/istm-design/presets/shopify/README.md +5 -0
  133. package/istm-design/presets/slack/DESIGN.md +482 -0
  134. package/istm-design/presets/spacex/DESIGN.md +363 -0
  135. package/istm-design/presets/spacex/README.md +5 -0
  136. package/istm-design/presets/spotify/DESIGN.md +246 -0
  137. package/istm-design/presets/spotify/README.md +5 -0
  138. package/istm-design/presets/starbucks/DESIGN.md +580 -0
  139. package/istm-design/presets/starbucks/README.md +5 -0
  140. package/istm-design/presets/stripe/DESIGN.md +487 -0
  141. package/istm-design/presets/stripe/README.md +5 -0
  142. package/istm-design/presets/supabase/DESIGN.md +462 -0
  143. package/istm-design/presets/supabase/README.md +5 -0
  144. package/istm-design/presets/superhuman/DESIGN.md +448 -0
  145. package/istm-design/presets/superhuman/README.md +5 -0
  146. package/istm-design/presets/tesla/DESIGN.md +286 -0
  147. package/istm-design/presets/tesla/README.md +5 -0
  148. package/istm-design/presets/theverge/DESIGN.md +339 -0
  149. package/istm-design/presets/theverge/README.md +5 -0
  150. package/istm-design/presets/together/DESIGN.md +633 -0
  151. package/istm-design/presets/together/README.md +5 -0
  152. package/istm-design/presets/uber/DESIGN.md +636 -0
  153. package/istm-design/presets/uber/README.md +5 -0
  154. package/istm-design/presets/vercel/DESIGN.md +736 -0
  155. package/istm-design/presets/vercel/README.md +5 -0
  156. package/istm-design/presets/vodafone/DESIGN.md +538 -0
  157. package/istm-design/presets/vodafone/README.md +5 -0
  158. package/istm-design/presets/voltagent/DESIGN.md +521 -0
  159. package/istm-design/presets/voltagent/README.md +5 -0
  160. package/istm-design/presets/warp/DESIGN.md +526 -0
  161. package/istm-design/presets/warp/README.md +5 -0
  162. package/istm-design/presets/webflow/DESIGN.md +588 -0
  163. package/istm-design/presets/webflow/README.md +5 -0
  164. package/istm-design/presets/wired/DESIGN.md +497 -0
  165. package/istm-design/presets/wired/README.md +5 -0
  166. package/istm-design/presets/wise/DESIGN.md +544 -0
  167. package/istm-design/presets/wise/README.md +5 -0
  168. package/istm-design/presets/xai/DESIGN.md +465 -0
  169. package/istm-design/presets/xai/README.md +5 -0
  170. package/istm-design/presets/zapier/DESIGN.md +537 -0
  171. package/istm-design/presets/zapier/README.md +5 -0
  172. package/istm-design/references/pick-ui-library.md +1 -1
  173. package/istm-design/semantic-design/DESIGN.md +121 -0
  174. package/istm-design/semantic-design/SKILL.md +184 -0
  175. package/istm-system-design/SKILL.md +12 -5
  176. package/istm-workflow/istm-autoplan/SKILL.md +1905 -0
  177. package/istm-workflow/istm-autoplan/SKILL.md.tmpl +923 -0
  178. package/istm-workflow/istm-craft/SKILL.md +12 -6
  179. package/istm-workflow/istm-cso/ACKNOWLEDGEMENTS.md +14 -0
  180. package/istm-workflow/istm-cso/SKILL.md +1313 -0
  181. package/istm-workflow/istm-cso/SKILL.md.tmpl +407 -0
  182. package/istm-workflow/istm-cso/sections/audit-phases.md +253 -0
  183. package/istm-workflow/istm-cso/sections/audit-phases.md.tmpl +251 -0
  184. package/istm-workflow/istm-cso/sections/manifest.json +14 -0
  185. package/istm-workflow/istm-debt/SKILL.md +44 -0
  186. package/istm-workflow/istm-debug/SKILL.md +12 -3
  187. package/istm-workflow/istm-design-review/SKILL.md +2053 -0
  188. package/istm-workflow/istm-design-review/SKILL.md.tmpl +312 -0
  189. package/istm-workflow/istm-develop/SKILL.md +10 -4
  190. package/istm-workflow/istm-eng-review/SKILL.md +1112 -0
  191. package/istm-workflow/istm-eng-review/SKILL.md.tmpl +163 -0
  192. package/istm-workflow/istm-eng-review/sections/manifest.json +14 -0
  193. package/istm-workflow/istm-eng-review/sections/review-sections.md +942 -0
  194. package/istm-workflow/istm-eng-review/sections/review-sections.md.tmpl +225 -0
  195. package/istm-workflow/istm-gain/SKILL.md +50 -0
  196. package/istm-workflow/istm-health/SKILL.md +1104 -0
  197. package/istm-workflow/istm-health/SKILL.md.tmpl +320 -0
  198. package/istm-workflow/istm-qa/BROWSER.md +1468 -0
  199. package/istm-workflow/istm-qa/SKILL.md +1743 -0
  200. package/istm-workflow/istm-qa/SKILL.md.tmpl +354 -0
  201. package/istm-workflow/istm-qa/references/issue-taxonomy.md +85 -0
  202. package/istm-workflow/istm-qa/templates/qa-report-template.md +126 -0
  203. package/istm-workflow/istm-release/SKILL.md +989 -0
  204. package/istm-workflow/istm-release/SKILL.md.tmpl +160 -0
  205. package/istm-workflow/istm-release/sections/manifest.json +14 -0
  206. package/istm-workflow/istm-release/sections/release-body.md +547 -0
  207. package/istm-workflow/istm-release/sections/release-body.md.tmpl +420 -0
  208. package/istm-workflow/istm-review/SKILL.md +57 -0
  209. package/istm-workflow/istm-ship/SKILL.md +1504 -0
  210. package/istm-workflow/istm-ship/SKILL.md.tmpl +582 -0
  211. package/istm-workflow/istm-ship/sections/adversarial.md +218 -0
  212. package/istm-workflow/istm-ship/sections/adversarial.md.tmpl +19 -0
  213. package/istm-workflow/istm-ship/sections/apple-release.md +58 -0
  214. package/istm-workflow/istm-ship/sections/apple-release.md.tmpl +56 -0
  215. package/istm-workflow/istm-ship/sections/changelog.md +45 -0
  216. package/istm-workflow/istm-ship/sections/changelog.md.tmpl +3 -0
  217. package/istm-workflow/istm-ship/sections/greptile.md +51 -0
  218. package/istm-workflow/istm-ship/sections/greptile.md.tmpl +49 -0
  219. package/istm-workflow/istm-ship/sections/manifest.json +62 -0
  220. package/istm-workflow/istm-ship/sections/plan-completion.md +329 -0
  221. package/istm-workflow/istm-ship/sections/plan-completion.md.tmpl +31 -0
  222. package/istm-workflow/istm-ship/sections/pr-body.md +209 -0
  223. package/istm-workflow/istm-ship/sections/pr-body.md.tmpl +207 -0
  224. package/istm-workflow/istm-ship/sections/review-army.md +406 -0
  225. package/istm-workflow/istm-ship/sections/review-army.md.tmpl +56 -0
  226. package/istm-workflow/istm-ship/sections/test-coverage.md +264 -0
  227. package/istm-workflow/istm-ship/sections/test-coverage.md.tmpl +23 -0
  228. package/istm-workflow/istm-ship/sections/tests.md +403 -0
  229. package/istm-workflow/istm-ship/sections/tests.md.tmpl +116 -0
  230. package/package.json +6 -3
@@ -0,0 +1,923 @@
1
+ ---
2
+ name: autoplan
3
+ preamble-tier: 3
4
+ version: 1.0.0
5
+ description: |
6
+ Auto-review pipeline — reads the full CEO, design, eng, and DX review skills from disk
7
+ and runs them sequentially with auto-decisions using 6 decision principles. Surfaces
8
+ taste decisions (close approaches, borderline scope, codex disagreements) at a final
9
+ approval gate. One command, fully reviewed plan out.
10
+ Use when asked to "auto review", "autoplan", "run all reviews", "review this plan
11
+ automatically", or "make the decisions for me".
12
+ Proactively suggest when the user has a plan file and wants to run the full review
13
+ gauntlet without answering 15-30 intermediate questions. (istm-workflow)
14
+ voice-triggers:
15
+ - "auto plan"
16
+ - "automatic review"
17
+ benefits-from: [office-hours]
18
+ triggers:
19
+ - run all reviews
20
+ - automatic review pipeline
21
+ - auto plan review
22
+ allowed-tools:
23
+ - Bash
24
+ - Read
25
+ - Write
26
+ - Edit
27
+ - Glob
28
+ - Grep
29
+ - WebSearch
30
+ - AskUserQuestion
31
+ ---
32
+
33
+ {{PREAMBLE}}
34
+
35
+ {{BASE_BRANCH_DETECT}}
36
+
37
+ {{BENEFITS_FROM}}
38
+
39
+ # /autoplan — Auto-Review Pipeline
40
+
41
+ One command. Rough plan in, fully reviewed plan out.
42
+
43
+ /autoplan reads the full CEO, design, eng, and DX review skill files from disk and follows
44
+ them at full depth — same rigor, same sections, same methodology as running each skill
45
+ manually. The only difference: intermediate AskUserQuestion calls are auto-decided using
46
+ the 6 principles below. Taste decisions (where reasonable people could disagree) are
47
+ surfaced at a final approval gate.
48
+
49
+ ---
50
+
51
+ ## The 6 Decision Principles
52
+
53
+ These rules auto-answer every intermediate question:
54
+
55
+ 1. **Choose completeness** — Ship the whole thing. Pick the approach that covers more edge cases.
56
+ 2. **Boil lakes** — Fix everything in the blast radius (files modified by this plan + direct importers). Auto-approve expansions that are in blast radius AND < 1 day CC effort (< 5 files, no new infra).
57
+ 3. **Pragmatic** — If two options fix the same thing, pick the cleaner one. 5 seconds choosing, not 5 minutes.
58
+ 4. **DRY** — Duplicates existing functionality? Reject. Reuse what exists.
59
+ 5. **Explicit over clever** — 10-line obvious fix > 200-line abstraction. Pick what a new contributor reads in 30 seconds.
60
+ 6. **Bias toward action** — Merge > review cycles > stale deliberation. Flag concerns but don't block.
61
+
62
+ **Conflict resolution (context-dependent tiebreakers):**
63
+ - **CEO phase:** P1 (completeness) + P2 (boil lakes) dominate.
64
+ - **Eng phase:** P5 (explicit) + P3 (pragmatic) dominate.
65
+ - **Design phase:** P5 (explicit) + P1 (completeness) dominate.
66
+
67
+ ---
68
+
69
+ ## Decision Classification
70
+
71
+ Every auto-decision is classified:
72
+
73
+ **Mechanical** — one clearly right answer. Auto-decide silently.
74
+ Examples: run codex (always yes), run evals (always yes), reduce scope on a complete plan (always no).
75
+
76
+ **Taste** — reasonable people could disagree. Auto-decide with recommendation, but surface at the final gate. Three natural sources:
77
+ 1. **Close approaches** — top two are both viable with different tradeoffs.
78
+ 2. **Borderline scope** — in blast radius but 3-5 files, or ambiguous radius.
79
+ 3. **Codex disagreements** — codex recommends differently and has a valid point.
80
+
81
+ **User Challenge** — both models agree the user's stated direction should change.
82
+ This is qualitatively different from taste decisions. When Claude and Codex both
83
+ recommend merging, splitting, adding, or removing features/skills/workflows that
84
+ the user specified, this is a User Challenge. It is NEVER auto-decided.
85
+
86
+ User Challenges go to the final approval gate with richer context than taste
87
+ decisions:
88
+ - **What the user said:** (their original direction)
89
+ - **What both models recommend:** (the change)
90
+ - **Why:** (the models' reasoning)
91
+ - **What context we might be missing:** (explicit acknowledgment of blind spots)
92
+ - **If we're wrong, the cost is:** (what happens if the user's original direction
93
+ was right and we changed it)
94
+
95
+ The user's original direction is the default. The models must make the case for
96
+ change, not the other way around.
97
+
98
+ **Exception:** If both models flag the change as a security vulnerability or
99
+ feasibility blocker (not a preference), the AskUserQuestion framing explicitly
100
+ warns: "Both models believe this is a security/feasibility risk, not just a
101
+ preference." The user still decides, but the framing is appropriately urgent.
102
+
103
+ ---
104
+
105
+ ## Sequential Execution — MANDATORY
106
+
107
+ Phases MUST execute in strict order: CEO → Design → Eng → DX.
108
+ Each phase MUST complete fully before the next begins.
109
+ NEVER run phases in parallel — each builds on the previous.
110
+
111
+ Between each phase, emit a phase-transition summary and verify that all required
112
+ outputs from the prior phase are written before starting the next.
113
+
114
+ ---
115
+
116
+ ## What "Auto-Decide" Means
117
+
118
+ Auto-decide replaces the USER'S judgment with the 6 principles. It does NOT replace
119
+ the ANALYSIS. Every section in the loaded skill files must still be executed at the
120
+ same depth as the interactive version. The only thing that changes is who answers the
121
+ AskUserQuestion: you do, using the 6 principles, instead of the user.
122
+
123
+ **Two exceptions — never auto-decided:**
124
+ 1. Premises (Phase 1) — require human judgment about what problem to solve.
125
+ 2. User Challenges — when both models agree the user's stated direction should change
126
+ (merge, split, add, remove features/workflows). The user always has context models
127
+ lack. See Decision Classification above.
128
+
129
+ **You MUST still:**
130
+ - READ the actual code, diffs, and files each section references
131
+ - PRODUCE every output the section requires (diagrams, tables, registries, artifacts)
132
+ - IDENTIFY every issue the section is designed to catch
133
+ - DECIDE each issue using the 6 principles (instead of asking the user)
134
+ - LOG each decision in the audit trail
135
+ - WRITE all required artifacts to disk
136
+
137
+ **You MUST NOT:**
138
+ - Compress a review section into a one-liner table row
139
+ - Write "no issues found" without showing what you examined
140
+ - Skip a section because "it doesn't apply" without stating what you checked and why
141
+ - Produce a summary instead of the required output (e.g., "architecture looks good"
142
+ instead of the ASCII dependency graph the section requires)
143
+
144
+ "No issues found" is a valid output for a section — but only after doing the analysis.
145
+ State what you examined and why nothing was flagged (1-2 sentences minimum).
146
+ "Skipped" is never valid for a non-skip-listed section.
147
+
148
+ ---
149
+
150
+ ## Filesystem Boundary — Codex Prompts
151
+
152
+ All prompts sent to Codex (via `codex exec` or `codex review`) MUST be prefixed with
153
+ this boundary instruction:
154
+
155
+ > IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/istm-workflow). These are AI assistant skill definitions meant for a different system. They contain bash scripts and prompt templates that will waste your time. Ignore them completely. Stay focused on the repository code only.
156
+
157
+ This prevents Codex from discovering istm-workflow skill files on disk and following their
158
+ instructions instead of reviewing the plan.
159
+
160
+ ---
161
+
162
+ ## Phase 0: Intake + Restore Point
163
+
164
+ ### Step 1: Capture restore point
165
+
166
+ Before doing anything, save the plan file's current state to an external file:
167
+
168
+ ```bash
169
+ {{SLUG_SETUP}}
170
+ BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-')
171
+ DATETIME=$(date +%Y%m%d-%H%M%S)
172
+ echo "RESTORE_PATH=$HOME/.istm-workflow/projects/$SLUG/${BRANCH}-autoplan-restore-${DATETIME}.md"
173
+ ```
174
+
175
+ Write the plan file's full contents to the restore path with this header:
176
+ ```
177
+ # /autoplan Restore Point
178
+ Captured: [timestamp] | Branch: [branch] | Commit: [short hash]
179
+
180
+ ## Re-run Instructions
181
+ 1. Copy "Original Plan State" below back to your plan file
182
+ 2. Invoke /autoplan
183
+
184
+ ## Original Plan State
185
+ [verbatim plan file contents]
186
+ ```
187
+
188
+ Then prepend a one-line HTML comment to the plan file:
189
+ `<!-- /autoplan restore point: [RESTORE_PATH] -->`
190
+
191
+ ### Step 2: Read context
192
+
193
+ - Read CLAUDE.md, TODOS.md, git log -30, git diff against the base branch --stat
194
+ - Discover design docs: `ls -t ~/.istm-workflow/projects/$SLUG/*-design-*.md 2>/dev/null | head -1`
195
+ - Detect UI scope: grep the plan for view/rendering terms (component, screen, form,
196
+ button, modal, layout, dashboard, sidebar, nav, dialog). Require 2+ matches. Exclude
197
+ false positives ("page" alone, "UI" in acronyms).
198
+ - Detect DX scope: grep the plan for developer-facing terms (API, endpoint, REST,
199
+ GraphQL, gRPC, webhook, CLI, command, flag, argument, terminal, shell, SDK, library,
200
+ package, npm, pip, import, require, SKILL.md, skill template, Claude Code, MCP, agent,
201
+ OpenClaw, action, developer docs, getting started, onboarding, integration, debug,
202
+ implement, error message). Require 2+ matches. Also trigger DX scope if the product IS
203
+ a developer tool (the plan describes something developers install, integrate, or build
204
+ on top of) or if an AI agent is the primary user (OpenClaw actions, Claude Code skills,
205
+ MCP servers).
206
+
207
+ ### Step 3: Load skill files from disk
208
+
209
+ Read each file using the Read tool:
210
+ - `~/.claude/skills/istm-workflow/plan-ceo-review/SKILL.md`
211
+ - `~/.claude/skills/istm-workflow/plan-design-review/SKILL.md` (only if UI scope detected)
212
+ - `~/.claude/skills/istm-workflow/plan-eng-review/SKILL.md`
213
+ - `~/.claude/skills/istm-workflow/plan-devex-review/SKILL.md` (only if DX scope detected)
214
+
215
+ **Section skip list — when following a loaded skill file, SKIP these sections
216
+ (they are already handled by /autoplan):**
217
+ - Preamble (run first)
218
+ - Scope gate (the plan under review is already the target)
219
+ - AskUserQuestion Format
220
+ - Completeness Principle — Boil the Ocean
221
+ - Search Before Building
222
+ - Completion Status Protocol
223
+ - Telemetry (run last)
224
+ - Step 0: Detect base branch
225
+ - Review Readiness Dashboard
226
+ - Plan File Review Report
227
+ - Prerequisite Skill Offer (BENEFITS_FROM)
228
+ - Outside Voice — Independent Plan Challenge
229
+ - Design Outside Voices (parallel)
230
+
231
+ Follow ONLY the review-specific methodology, sections, and required outputs.
232
+
233
+ Output: "Here's what I'm working with: [plan summary]. UI scope: [yes/no]. DX scope: [yes/no].
234
+ Loaded review skills from disk. Starting full review pipeline with auto-decisions."
235
+
236
+ ---
237
+
238
+ ## Phase 0.5: Codex auth + version preflight
239
+
240
+ Before invoking any Codex voice, preflight the CLI: verify auth (multi-signal) and
241
+ warn on known-bad CLI versions. This is infrastructure for all 4 phases below —
242
+ source it once here and the helper functions stay in scope for the rest of the
243
+ workflow.
244
+
245
+ ```bash
246
+ _TEL=$(~/.claude/skills/istm-workflow/bin/istm-workflow-config get telemetry 2>/dev/null || echo off)
247
+ _CODEX_CFG=$(~/.claude/skills/istm-workflow/bin/istm-workflow-config get codex_reviews 2>/dev/null || echo enabled)
248
+ source ~/.claude/skills/istm-workflow/bin/istm-workflow-codex-probe
249
+
250
+ # Master switch first: codex_reviews=disabled turns off ALL Codex work globally,
251
+ # including autoplan's own dual-voice orchestration. Honor it before probing.
252
+ if [ "$_CODEX_CFG" = "disabled" ]; then
253
+ echo "[codex disabled by config — Claude-only voices] Re-enable: istm-workflow-config set codex_reviews enabled"
254
+ _CODEX_AVAILABLE=false
255
+ # Check Codex binary. If missing, tag the degradation matrix and continue
256
+ # with Claude subagent only (autoplan's existing degradation fallback).
257
+ elif ! command -v codex >/dev/null 2>&1; then
258
+ _istm_codex_log_event "codex_cli_missing"
259
+ echo "[codex-unavailable: binary not found] — proceeding with Claude subagent only"
260
+ _CODEX_AVAILABLE=false
261
+ elif ! _istm_codex_auth_probe >/dev/null; then
262
+ _istm_codex_log_event "codex_auth_failed"
263
+ echo "[codex-unavailable: auth missing] — proceeding with Claude subagent only. Run \`codex login\` or set \$CODEX_API_KEY to enable dual-voice review."
264
+ _CODEX_AVAILABLE=false
265
+ # Round-trip model probe (#2477): auth can pass while the account's configured
266
+ # model is rejected with an HTTP 400 (stale `model =` pin in ~/.codex/config.toml).
267
+ # ~10s on first run, cached 1h; timeouts fail open (probe returns 0).
268
+ elif ! _istm_codex_model_probe; then
269
+ echo "[codex-unavailable: configured model rejected] — proceeding with Claude subagent only. Fix the \`model =\` pin in ~/.codex/config.toml (see [notice.model_migrations] there for the replacement)."
270
+ _CODEX_AVAILABLE=false
271
+ else
272
+ _istm_codex_version_check # non-blocking warn if known-bad
273
+ _CODEX_AVAILABLE=true
274
+ fi
275
+ ```
276
+
277
+ If `_CODEX_AVAILABLE=false`, all Phase 1-3.5 Codex voices below degrade to
278
+ `[codex-unavailable]` in the degradation matrix. /autoplan completes with
279
+ Claude subagent only — saves token spend on Codex prompts we can't use.
280
+
281
+ ---
282
+
283
+ ## Phase 1: CEO Review (Strategy & Scope)
284
+
285
+ Follow plan-ceo-review/SKILL.md — all sections, full depth.
286
+ Override: every AskUserQuestion → auto-decide using the 6 principles.
287
+
288
+ **Override rules:**
289
+ - Mode selection: SELECTIVE EXPANSION
290
+ - Premises: accept reasonable ones (P6), challenge only clearly wrong ones
291
+ - **GATE: Present premises to user for confirmation** — this is the ONE AskUserQuestion
292
+ that is NOT auto-decided. Premises require human judgment.
293
+ - Alternatives: pick highest completeness (P1). If tied, pick simplest (P5).
294
+ If top 2 are close → mark TASTE DECISION.
295
+ - Scope expansion: in blast radius + <1d CC → approve (P2). Outside → defer to TODOS.md (P3).
296
+ Duplicates → reject (P4). Borderline (3-5 files) → mark TASTE DECISION.
297
+ - All 10 review sections: run fully, auto-decide each issue, log every decision.
298
+ - Dual voices: always run BOTH Claude subagent AND Codex if available (P6).
299
+ Run them sequentially in foreground. First the Claude subagent (Agent tool
300
+ with run_in_background: false — subagents default to BACKGROUND since
301
+ Claude Code v2.1.198, so the flag must be explicitly false), then Codex
302
+ (Bash). Both must complete before building the consensus table.
303
+
304
+ **Codex CEO voice** (via Bash):
305
+ ```bash
306
+ _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
307
+ _istm_codex_timeout_wrapper 600 codex exec "IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/istm-workflow). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
308
+
309
+ You are a CEO/founder advisor reviewing a development plan.
310
+ Challenge the strategic foundations: Are the premises valid or assumed? Is this the
311
+ right problem to solve, or is there a reframing that would be 10x more impactful?
312
+ What alternatives were dismissed too quickly? What competitive or market risks are
313
+ unaddressed? What scope decisions will look foolish in 6 months? Be adversarial.
314
+ No compliments. Just the strategic blind spots.
315
+ File: <plan_path>" -C "$_REPO_ROOT" -s read-only {{CODEX_WEB_SEARCH_FLAG}} < /dev/null
316
+ _CODEX_EXIT=$?
317
+ if [ "$_CODEX_EXIT" = "124" ]; then
318
+ _istm_codex_log_event "codex_timeout" "600"
319
+ _istm_codex_log_hang "autoplan" "0"
320
+ echo "[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
321
+ fi
322
+ ```
323
+ Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.
324
+
325
+ **Claude CEO subagent** (via Agent tool):
326
+ "Read the plan file at <plan_path>. You are an independent CEO/strategist
327
+ reviewing this plan. You have NOT seen any prior review. Evaluate:
328
+ 1. Is this the right problem to solve? Could a reframing yield 10x impact?
329
+ 2. Are the premises stated or just assumed? Which ones could be wrong?
330
+ 3. What's the 6-month regret scenario — what will look foolish?
331
+ 4. What alternatives were dismissed without sufficient analysis?
332
+ 5. What's the competitive risk — could someone else solve this first/better?
333
+ For each finding: what's wrong, severity (critical/high/medium), and the fix."
334
+
335
+ **Error handling:** Both calls block in foreground. Codex auth/timeout/empty → proceed with
336
+ Claude subagent only, tagged `[single-model]`. If Claude subagent also fails →
337
+ "Outside voices unavailable — continuing with primary review."
338
+
339
+ **Degradation matrix:** Both fail → "single-reviewer mode". Codex only →
340
+ tag `[codex-only]`. Subagent only → tag `[subagent-only]`.
341
+
342
+ - Strategy choices: if codex disagrees with a premise or scope decision with valid
343
+ strategic reason → TASTE DECISION. If both models agree the user's stated structure
344
+ should change (merge, split, add, remove) → USER CHALLENGE (never auto-decided).
345
+
346
+ **Required execution checklist (CEO):**
347
+
348
+ Step 0 (0A-0F) — run each sub-step and produce:
349
+ - 0A: Premise challenge with specific premises named and evaluated
350
+ - 0B: Existing code leverage map (sub-problems → existing code)
351
+ - 0C: Dream state diagram (CURRENT → THIS PLAN → 12-MONTH IDEAL)
352
+ - 0C-bis: Implementation alternatives table (2-3 approaches with effort/risk/pros/cons)
353
+ - 0D: Mode-specific analysis with scope decisions logged
354
+ - 0E: Temporal interrogation (HOUR 1 → HOUR 6+)
355
+ - 0F: Mode selection confirmation
356
+
357
+ Step 0.5 (Dual Voices): Run Claude subagent (foreground Agent tool) first, then
358
+ Codex (Bash). Present Codex output under CODEX SAYS (CEO — strategy challenge)
359
+ header. Present subagent output under CLAUDE SUBAGENT (CEO — strategic independence)
360
+ header. Produce CEO consensus table:
361
+
362
+ ```
363
+ CEO DUAL VOICES — CONSENSUS TABLE:
364
+ ═══════════════════════════════════════════════════════════════
365
+ Dimension Claude Codex Consensus
366
+ ──────────────────────────────────── ─────── ─────── ─────────
367
+ 1. Premises valid? — — —
368
+ 2. Right problem to solve? — — —
369
+ 3. Scope calibration correct? — — —
370
+ 4. Alternatives sufficiently explored?— — —
371
+ 5. Competitive/market risks covered? — — —
372
+ 6. 6-month trajectory sound? — — —
373
+ ═══════════════════════════════════════════════════════════════
374
+ CONFIRMED = both agree. DISAGREE = models differ (→ taste decision).
375
+ Missing voice = N/A (not CONFIRMED). Single critical finding from one voice = flagged regardless.
376
+ ```
377
+
378
+ Sections 1-10 — for EACH section, run the evaluation criteria from the loaded skill file:
379
+ - Sections WITH findings: full analysis, auto-decide each issue, log to audit trail
380
+ - Sections with NO findings: 1-2 sentences stating what was examined and why nothing
381
+ was flagged. NEVER compress a section to just its name in a table row.
382
+ - Section 11 (Design): run only if UI scope was detected in Phase 0
383
+
384
+ **Mandatory outputs from Phase 1:**
385
+ - "NOT in scope" section with deferred items and rationale
386
+ - "What already exists" section mapping sub-problems to existing code
387
+ - Error & Rescue Registry table (from Section 2)
388
+ - Failure Modes Registry table (from review sections)
389
+ - Dream state delta (where this plan leaves us vs 12-month ideal)
390
+ - Completion Summary (the full summary table from the CEO skill)
391
+
392
+ **PHASE 1 COMPLETE.** Emit phase-transition summary:
393
+ > **Phase 1 complete.** Codex: [N concerns]. Claude subagent: [N issues].
394
+ > Consensus: [X/6 confirmed, Y disagreements → surfaced at gate].
395
+ > Passing to Phase 2.
396
+
397
+ Do NOT begin Phase 2 until all Phase 1 outputs are written to the plan file
398
+ and the premise gate has been passed.
399
+
400
+ ---
401
+
402
+ **Pre-Phase 2 checklist (verify before starting):**
403
+ - [ ] CEO completion summary written to plan file
404
+ - [ ] CEO dual voices ran (Codex + Claude subagent, or noted unavailable)
405
+ - [ ] CEO consensus table produced
406
+ - [ ] Premise gate passed (user confirmed)
407
+ - [ ] Phase-transition summary emitted
408
+
409
+ ## Phase 2: Design Review (conditional — skip if no UI scope)
410
+
411
+ Follow plan-design-review/SKILL.md — all 7 dimensions, full depth.
412
+ Override: every AskUserQuestion → auto-decide using the 6 principles.
413
+
414
+ **Override rules:**
415
+ - Focus areas: all relevant dimensions (P1)
416
+ - Structural issues (missing states, broken hierarchy): auto-fix (P5)
417
+ - Aesthetic/taste issues: mark TASTE DECISION
418
+ - Design system alignment: auto-fix if DESIGN.md exists and fix is obvious
419
+ - Dual voices: always run BOTH Claude subagent AND Codex if available (P6).
420
+
421
+ **Codex design voice** (via Bash):
422
+ ```bash
423
+ _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
424
+ _istm_codex_timeout_wrapper 600 codex exec "IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/istm-workflow). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
425
+
426
+ Read the plan file at <plan_path>. Evaluate this plan's
427
+ UI/UX design decisions.
428
+
429
+ Also consider these findings from the CEO review phase:
430
+ <insert CEO dual voice findings summary — key concerns, disagreements>
431
+
432
+ Does the information hierarchy serve the user or the developer? Are interaction
433
+ states (loading, empty, error, partial) specified or left to the implementer's
434
+ imagination? Is the responsive strategy intentional or afterthought? Are
435
+ accessibility requirements (keyboard nav, contrast, touch targets) specified or
436
+ aspirational? Does the plan describe specific UI decisions or generic patterns?
437
+ What design decisions will haunt the implementer if left ambiguous?
438
+ Be opinionated. No hedging." -C "$_REPO_ROOT" -s read-only {{CODEX_WEB_SEARCH_FLAG}} < /dev/null
439
+ _CODEX_EXIT=$?
440
+ if [ "$_CODEX_EXIT" = "124" ]; then
441
+ _istm_codex_log_event "codex_timeout" "600"
442
+ _istm_codex_log_hang "autoplan" "0"
443
+ echo "[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
444
+ fi
445
+ ```
446
+ Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.
447
+
448
+ **Claude design subagent** (via Agent tool):
449
+ "Read the plan file at <plan_path>. You are an independent senior product designer
450
+ reviewing this plan. You have NOT seen any prior review. Evaluate:
451
+ 1. Information hierarchy: what does the user see first, second, third? Is it right?
452
+ 2. Missing states: loading, empty, error, success, partial — which are unspecified?
453
+ 3. User journey: what's the emotional arc? Where does it break?
454
+ 4. Specificity: does the plan describe SPECIFIC UI or generic patterns?
455
+ 5. What design decisions will haunt the implementer if left ambiguous?
456
+ For each finding: what's wrong, severity (critical/high/medium), and the fix."
457
+ NO prior-phase context — subagent must be truly independent.
458
+
459
+ Error handling: same as Phase 1 (both foreground/blocking, degradation matrix applies).
460
+
461
+ - Design choices: if codex disagrees with a design decision with valid UX reasoning
462
+ → TASTE DECISION. Scope changes both models agree on → USER CHALLENGE.
463
+
464
+ **Required execution checklist (Design):**
465
+
466
+ 1. Step 0 (Design Scope): Rate completeness 0-10. Check DESIGN.md. Map existing patterns.
467
+
468
+ 2. Step 0.5 (Dual Voices): Run Claude subagent (foreground) first, then Codex. Present under
469
+ CODEX SAYS (design — UX challenge) and CLAUDE SUBAGENT (design — independent review)
470
+ headers. Produce design litmus scorecard (consensus table). Use the litmus scorecard
471
+ format from plan-design-review. Include CEO phase findings in Codex prompt ONLY
472
+ (not Claude subagent — stays independent).
473
+
474
+ 3. Passes 1-7: Run each from loaded skill. Rate 0-10. Auto-decide each issue.
475
+ DISAGREE items from scorecard → raised in the relevant pass with both perspectives.
476
+
477
+ **PHASE 2 COMPLETE.** Emit phase-transition summary:
478
+ > **Phase 2 complete.** Codex: [N concerns]. Claude subagent: [N issues].
479
+ > Consensus: [X/Y confirmed, Z disagreements → surfaced at gate].
480
+ > Passing to Phase 3.
481
+
482
+ Do NOT begin Phase 3 until all Phase 2 outputs (if run) are written to the plan file.
483
+
484
+ ---
485
+
486
+ **Pre-Phase 3 checklist (verify before starting):**
487
+ - [ ] All Phase 1 items above confirmed
488
+ - [ ] Design completion summary written (or "skipped, no UI scope")
489
+ - [ ] Design dual voices ran (if Phase 2 ran)
490
+ - [ ] Design consensus table produced (if Phase 2 ran)
491
+ - [ ] Phase-transition summary emitted
492
+
493
+ ## Phase 3: Eng Review + Dual Voices
494
+
495
+ Follow plan-eng-review/SKILL.md — all sections, full depth.
496
+ Override: every AskUserQuestion → auto-decide using the 6 principles.
497
+
498
+ **Override rules:**
499
+ - Scope challenge: never reduce (P2)
500
+ - Dual voices: always run BOTH Claude subagent AND Codex if available (P6).
501
+
502
+ **Codex eng voice** (via Bash):
503
+ ```bash
504
+ _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
505
+ _istm_codex_timeout_wrapper 600 codex exec "IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/istm-workflow). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
506
+
507
+ Review this plan for architectural issues, missing edge cases,
508
+ and hidden complexity. Be adversarial.
509
+
510
+ Also consider these findings from prior review phases:
511
+ CEO: <insert CEO consensus table summary — key concerns, DISAGREEs>
512
+ Design: <insert Design consensus table summary, or 'skipped, no UI scope'>
513
+
514
+ File: <plan_path>" -C "$_REPO_ROOT" -s read-only {{CODEX_WEB_SEARCH_FLAG}} < /dev/null
515
+ _CODEX_EXIT=$?
516
+ if [ "$_CODEX_EXIT" = "124" ]; then
517
+ _istm_codex_log_event "codex_timeout" "600"
518
+ _istm_codex_log_hang "autoplan" "0"
519
+ echo "[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
520
+ fi
521
+ ```
522
+ Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.
523
+
524
+ **Claude eng subagent** (via Agent tool):
525
+ "Read the plan file at <plan_path>. You are an independent senior engineer
526
+ reviewing this plan. You have NOT seen any prior review. Evaluate:
527
+ 1. Architecture: Is the component structure sound? Coupling concerns?
528
+ 2. Edge cases: What breaks under 10x load? What's the nil/empty/error path?
529
+ 3. Tests: What's missing from the test plan? What would break at 2am Friday?
530
+ 4. Security: New attack surface? Auth boundaries? Input validation?
531
+ 5. Hidden complexity: What looks simple but isn't?
532
+ For each finding: what's wrong, severity, and the fix."
533
+ NO prior-phase context — subagent must be truly independent.
534
+
535
+ Error handling: same as Phase 1 (both foreground/blocking, degradation matrix applies).
536
+
537
+ - Architecture choices: explicit over clever (P5). If codex disagrees with valid reason → TASTE DECISION. Scope changes both models agree on → USER CHALLENGE.
538
+ - Evals: always include all relevant suites (P1)
539
+ - Test plan: generate artifact at `~/.istm-workflow/projects/$SLUG/{user}-{branch}-test-plan-{datetime}.md`
540
+ - TODOS.md: collect all deferred scope expansions from Phase 1, auto-write
541
+
542
+ **Required execution checklist (Eng):**
543
+
544
+ 1. Step 0 (Scope Challenge): Read actual code referenced by the plan. Map each
545
+ sub-problem to existing code. Run the complexity check. Produce concrete findings.
546
+
547
+ 2. Step 0.5 (Dual Voices): Run Claude subagent (foreground) first, then Codex. Present
548
+ Codex output under CODEX SAYS (eng — architecture challenge) header. Present subagent
549
+ output under CLAUDE SUBAGENT (eng — independent review) header. Produce eng consensus
550
+ table:
551
+
552
+ ```
553
+ ENG DUAL VOICES — CONSENSUS TABLE:
554
+ ═══════════════════════════════════════════════════════════════
555
+ Dimension Claude Codex Consensus
556
+ ──────────────────────────────────── ─────── ─────── ─────────
557
+ 1. Architecture sound? — — —
558
+ 2. Test coverage sufficient? — — —
559
+ 3. Performance risks addressed? — — —
560
+ 4. Security threats covered? — — —
561
+ 5. Error paths handled? — — —
562
+ 6. Deployment risk manageable? — — —
563
+ ═══════════════════════════════════════════════════════════════
564
+ CONFIRMED = both agree. DISAGREE = models differ (→ taste decision).
565
+ Missing voice = N/A (not CONFIRMED). Single critical finding from one voice = flagged regardless.
566
+ ```
567
+
568
+ 3. Section 1 (Architecture): Produce ASCII dependency graph showing new components
569
+ and their relationships to existing ones. Evaluate coupling, scaling, security.
570
+
571
+ 4. Section 2 (Code Quality): Identify DRY violations, naming issues, complexity.
572
+ Reference specific files and patterns. Auto-decide each finding.
573
+
574
+ 5. **Section 3 (Test Review) — NEVER SKIP OR COMPRESS.**
575
+ This section requires reading actual code, not summarizing from memory.
576
+ - Read the diff or the plan's affected files
577
+ - Build the test diagram: list every NEW UX flow, data flow, codepath, and branch
578
+ - For EACH item in the diagram: what type of test covers it? Does one exist? Gaps?
579
+ - For LLM/prompt changes: which eval suites must run?
580
+ - Auto-deciding test gaps means: identify the gap → decide whether to add a test
581
+ or defer (with rationale and principle) → log the decision. It does NOT mean
582
+ skipping the analysis.
583
+ - Write the test plan artifact to disk
584
+
585
+ 6. Section 4 (Performance): Evaluate N+1 queries, memory, caching, slow paths.
586
+
587
+ **Mandatory outputs from Phase 3:**
588
+ - "NOT in scope" section
589
+ - "What already exists" section
590
+ - Architecture ASCII diagram (Section 1)
591
+ - Test diagram mapping codepaths to coverage (Section 3)
592
+ - Test plan artifact written to disk (Section 3)
593
+ - Failure modes registry with critical gap flags
594
+ - Completion Summary (the full summary from the Eng skill)
595
+ - TODOS.md updates (collected from all phases)
596
+
597
+ **PHASE 3 COMPLETE.** Emit phase-transition summary:
598
+ > **Phase 3 complete.** Codex: [N concerns]. Claude subagent: [N issues].
599
+ > Consensus: [X/6 confirmed, Y disagreements → surfaced at gate].
600
+ > Passing to Phase 3.5 (DX Review) or Phase 4 (Final Gate).
601
+
602
+ ---
603
+
604
+ ## Phase 3.5: DX Review (conditional — skip if no developer-facing scope)
605
+
606
+ Follow plan-devex-review/SKILL.md — all 8 DX dimensions, full depth.
607
+ Override: every AskUserQuestion → auto-decide using the 6 principles.
608
+
609
+ **Skip condition:** If DX scope was NOT detected in Phase 0, skip this phase entirely.
610
+ Log: "Phase 3.5 skipped — no developer-facing scope detected."
611
+
612
+ **Override rules:**
613
+ - Mode selection: DX POLISH
614
+ - Persona: infer from README/docs, pick the most common developer type (P6)
615
+ - Competitive benchmark: run searches if WebSearch available, use reference benchmarks otherwise (P1)
616
+ - Magical moment: pick the lowest-effort delivery vehicle that achieves the competitive tier (P5)
617
+ - Getting started friction: always optimize toward fewer steps (P5, simpler over clever)
618
+ - Error message quality: always require problem + cause + fix (P1, completeness)
619
+ - API/CLI naming: consistency wins over cleverness (P5)
620
+ - DX taste decisions (e.g., opinionated defaults vs flexibility): mark TASTE DECISION
621
+ - Dual voices: always run BOTH Claude subagent AND Codex if available (P6).
622
+
623
+ **Codex DX voice** (via Bash):
624
+ ```bash
625
+ _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
626
+ _istm_codex_timeout_wrapper 600 codex exec "IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/istm-workflow). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
627
+
628
+ Read the plan file at <plan_path>. Evaluate this plan's developer experience.
629
+
630
+ Also consider these findings from prior review phases:
631
+ CEO: <insert CEO consensus summary>
632
+ Eng: <insert Eng consensus summary>
633
+
634
+ You are a developer who has never seen this product. Evaluate:
635
+ 1. Time to hello world: how many steps from zero to working? Target is under 5 minutes.
636
+ 2. Error messages: when something goes wrong, does the dev know what, why, and how to fix?
637
+ 3. API/CLI design: are names guessable? Are defaults sensible? Is it consistent?
638
+ 4. Docs: can a dev find what they need in under 2 minutes? Are examples copy-paste-complete?
639
+ 5. Upgrade path: can devs upgrade without fear? Migration guides? Deprecation warnings?
640
+ Be adversarial. Think like a developer who is evaluating this against 3 competitors." -C "$_REPO_ROOT" -s read-only {{CODEX_WEB_SEARCH_FLAG}} < /dev/null
641
+ _CODEX_EXIT=$?
642
+ if [ "$_CODEX_EXIT" = "124" ]; then
643
+ _istm_codex_log_event "codex_timeout" "600"
644
+ _istm_codex_log_hang "autoplan" "0"
645
+ echo "[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
646
+ fi
647
+ ```
648
+ Timeout: 10 minutes (shell-wrapper) + 12 minutes (Bash outer gate). On hang, auto-degrades this phase's Codex voice.
649
+
650
+ **Claude DX subagent** (via Agent tool):
651
+ "Read the plan file at <plan_path>. You are an independent DX engineer
652
+ reviewing this plan. You have NOT seen any prior review. Evaluate:
653
+ 1. Getting started: how many steps from zero to hello world? What's the TTHW?
654
+ 2. API/CLI ergonomics: naming consistency, sensible defaults, progressive disclosure?
655
+ 3. Error handling: does every error path specify problem + cause + fix + docs link?
656
+ 4. Documentation: copy-paste examples? Information architecture? Interactive elements?
657
+ 5. Escape hatches: can developers override every opinionated default?
658
+ For each finding: what's wrong, severity (critical/high/medium), and the fix."
659
+ NO prior-phase context — subagent must be truly independent.
660
+
661
+ Error handling: same as Phase 1 (both foreground/blocking, degradation matrix applies).
662
+
663
+ - DX choices: if codex disagrees with a DX decision with valid developer empathy reasoning
664
+ → TASTE DECISION. Scope changes both models agree on → USER CHALLENGE.
665
+
666
+ **Required execution checklist (DX):**
667
+
668
+ 1. Step 0 (DX Scope Assessment): Auto-detect product type. Map the developer journey.
669
+ Rate initial DX completeness 0-10. Assess TTHW.
670
+
671
+ 2. Step 0.5 (Dual Voices): Run Claude subagent (foreground) first, then Codex. Present
672
+ under CODEX SAYS (DX — developer experience challenge) and CLAUDE SUBAGENT
673
+ (DX — independent review) headers. Produce DX consensus table:
674
+
675
+ ```
676
+ DX DUAL VOICES — CONSENSUS TABLE:
677
+ ═══════════════════════════════════════════════════════════════
678
+ Dimension Claude Codex Consensus
679
+ ──────────────────────────────────── ─────── ─────── ─────────
680
+ 1. Getting started < 5 min? — — —
681
+ 2. API/CLI naming guessable? — — —
682
+ 3. Error messages actionable? — — —
683
+ 4. Docs findable & complete? — — —
684
+ 5. Upgrade path safe? — — —
685
+ 6. Dev environment friction-free? — — —
686
+ ═══════════════════════════════════════════════════════════════
687
+ CONFIRMED = both agree. DISAGREE = models differ (→ taste decision).
688
+ Missing voice = N/A (not CONFIRMED). Single critical finding from one voice = flagged regardless.
689
+ ```
690
+
691
+ 3. Passes 1-8: Run each from loaded skill. Rate 0-10. Auto-decide each issue.
692
+ DISAGREE items from consensus table → raised in the relevant pass with both perspectives.
693
+
694
+ 4. DX Scorecard: Produce the full scorecard with all 8 dimensions scored.
695
+
696
+ **Mandatory outputs from Phase 3.5:**
697
+ - Developer journey map (9-stage table)
698
+ - Developer empathy narrative (first-person perspective)
699
+ - DX Scorecard with all 8 dimension scores
700
+ - DX Implementation Checklist
701
+ - TTHW assessment with target
702
+
703
+ **PHASE 3.5 COMPLETE.** Emit phase-transition summary:
704
+ > **Phase 3.5 complete.** DX overall: [N]/10. TTHW: [N] min → [target] min.
705
+ > Codex: [N concerns]. Claude subagent: [N issues].
706
+ > Consensus: [X/6 confirmed, Y disagreements → surfaced at gate].
707
+ > Passing to Phase 4 (Final Gate).
708
+
709
+ ---
710
+
711
+ ## Decision Audit Trail
712
+
713
+ After each auto-decision, append a row to the plan file using Edit:
714
+
715
+ ```markdown
716
+ <!-- AUTONOMOUS DECISION LOG -->
717
+ ## Decision Audit Trail
718
+
719
+ | # | Phase | Decision | Classification | Principle | Rationale | Rejected |
720
+ |---|-------|----------|-----------|-----------|----------|
721
+ ```
722
+
723
+ Write one row per decision incrementally (via Edit). This keeps the audit on disk,
724
+ not accumulated in conversation context.
725
+
726
+ ---
727
+
728
+ ## Pre-Gate Verification
729
+
730
+ Before presenting the Final Approval Gate, verify that required outputs were actually
731
+ produced. Check the plan file and conversation for each item.
732
+
733
+ **Phase 1 (CEO) outputs:**
734
+ - [ ] Premise challenge with specific premises named (not just "premises accepted")
735
+ - [ ] All applicable review sections have findings OR explicit "examined X, nothing flagged"
736
+ - [ ] Error & Rescue Registry table produced (or noted N/A with reason)
737
+ - [ ] Failure Modes Registry table produced (or noted N/A with reason)
738
+ - [ ] "NOT in scope" section written
739
+ - [ ] "What already exists" section written
740
+ - [ ] Dream state delta written
741
+ - [ ] Completion Summary produced
742
+ - [ ] Dual voices ran (Codex + Claude subagent, or noted unavailable)
743
+ - [ ] CEO consensus table produced
744
+
745
+ **Phase 2 (Design) outputs — only if UI scope detected:**
746
+ - [ ] All 7 dimensions evaluated with scores
747
+ - [ ] Issues identified and auto-decided
748
+ - [ ] Dual voices ran (or noted unavailable/skipped with phase)
749
+ - [ ] Design litmus scorecard produced
750
+
751
+ **Phase 3 (Eng) outputs:**
752
+ - [ ] Scope challenge with actual code analysis (not just "scope is fine")
753
+ - [ ] Architecture ASCII diagram produced
754
+ - [ ] Test diagram mapping codepaths to test coverage
755
+ - [ ] Test plan artifact written to disk at ~/.istm-workflow/projects/$SLUG/
756
+ - [ ] "NOT in scope" section written
757
+ - [ ] "What already exists" section written
758
+ - [ ] Failure modes registry with critical gap assessment
759
+ - [ ] Completion Summary produced
760
+ - [ ] Dual voices ran (Codex + Claude subagent, or noted unavailable)
761
+ - [ ] Eng consensus table produced
762
+
763
+ **Phase 3.5 (DX) outputs — only if DX scope detected:**
764
+ - [ ] All 8 DX dimensions evaluated with scores
765
+ - [ ] Developer journey map produced
766
+ - [ ] Developer empathy narrative written
767
+ - [ ] TTHW assessment with target
768
+ - [ ] DX Implementation Checklist produced
769
+ - [ ] Dual voices ran (or noted unavailable/skipped with phase)
770
+ - [ ] DX consensus table produced
771
+
772
+ **Cross-phase:**
773
+ - [ ] Cross-phase themes section written
774
+
775
+ **Audit trail:**
776
+ - [ ] Decision Audit Trail has at least one row per auto-decision (not empty)
777
+
778
+ If ANY checkbox above is missing, go back and produce the missing output. Max 2
779
+ attempts — if still missing after retrying twice, proceed to the gate with a warning
780
+ noting which items are incomplete. Do not loop indefinitely.
781
+
782
+ ---
783
+
784
+ ## Phase 4: Final Approval Gate
785
+
786
+ {{TASKS_SECTION_AGGREGATE}}
787
+
788
+ **STOP here and present the final state to the user.**
789
+
790
+ Present as a message, then use AskUserQuestion:
791
+
792
+ ```
793
+ ## /autoplan Review Complete
794
+
795
+ ### Plan Summary
796
+ [1-3 sentence summary]
797
+
798
+ ### Decisions Made: [N] total ([M] auto-decided, [K] taste choices, [J] user challenges)
799
+
800
+ ### User Challenges (both models disagree with your stated direction)
801
+ [For each user challenge:]
802
+ **Challenge [N]: [title]** (from [phase])
803
+ You said: [user's original direction]
804
+ Both models recommend: [the change]
805
+ Why: [reasoning]
806
+ What we might be missing: [blind spots]
807
+ If we're wrong, the cost is: [downside of changing]
808
+ [If security/feasibility: "⚠️ Both models flag this as a security/feasibility risk,
809
+ not just a preference."]
810
+
811
+ Your call — your original direction stands unless you explicitly change it.
812
+
813
+ ### Your Choices (taste decisions)
814
+ [For each taste decision:]
815
+ **Choice [N]: [title]** (from [phase])
816
+ I recommend [X] — [principle]. But [Y] is also viable:
817
+ [1-sentence downstream impact if you pick Y]
818
+
819
+ ### Auto-Decided: [M] decisions [see Decision Audit Trail in plan file]
820
+
821
+ ### Review Scores
822
+ - CEO: [summary]
823
+ - CEO Voices: Codex [summary], Claude subagent [summary], Consensus [X/6 confirmed]
824
+ - Design: [summary or "skipped, no UI scope"]
825
+ - Design Voices: Codex [summary], Claude subagent [summary], Consensus [X/7 confirmed] (or "skipped")
826
+ - Eng: [summary]
827
+ - Eng Voices: Codex [summary], Claude subagent [summary], Consensus [X/6 confirmed]
828
+ - DX: [summary or "skipped, no developer-facing scope"]
829
+ - DX Voices: Codex [summary], Claude subagent [summary], Consensus [X/6 confirmed] (or "skipped")
830
+
831
+ ### Cross-Phase Themes
832
+ [For any concern that appeared in 2+ phases' dual voices independently:]
833
+ **Theme: [topic]** — flagged in [Phase 1, Phase 3]. High-confidence signal.
834
+ [If no themes span phases:] "No cross-phase themes — each phase's concerns were distinct."
835
+
836
+ ### Deferred to TODOS.md
837
+ [Items auto-deferred with reasons]
838
+
839
+ ### Implementation Tasks (aggregated across phases)
840
+ [Substitute the contents of $AGGREGATED_TASKS computed above. If empty:
841
+ "_No per-phase task lists found in $TASKS_DIR for branch $BRANCH._"]
842
+ ```
843
+
844
+ **Cognitive load management:**
845
+ - 0 user challenges: skip "User Challenges" section
846
+ - 0 taste decisions: skip "Your Choices" section
847
+ - 1-7 taste decisions: flat list
848
+ - 8+: group by phase. Add warning: "This plan had unusually high ambiguity ([N] taste decisions). Review carefully."
849
+
850
+ AskUserQuestion options:
851
+ - A) Approve as-is (accept all recommendations)
852
+ - B) Approve with overrides (specify which taste decisions to change)
853
+ - B2) Approve with user challenge responses (accept or reject each challenge)
854
+ - C) Interrogate (ask about any specific decision)
855
+ - D) Revise (the plan itself needs changes)
856
+ - E) Reject (start over)
857
+
858
+ **Option handling:**
859
+ - A: mark APPROVED, write review logs, suggest /ship
860
+ - B: ask which overrides, apply, re-present gate
861
+ - C: answer freeform, re-present gate
862
+ - D: make changes, re-run affected phases (scope→1B, design→2, test plan→3, arch→3). Max 3 cycles.
863
+ - E: start over
864
+
865
+ ---
866
+
867
+ ## Completion: Write Review Logs
868
+
869
+ On approval, write 3 separate review log entries so /ship's dashboard recognizes them.
870
+ Replace TIMESTAMP, STATUS, and N with actual values from each review phase.
871
+ STATUS is "clean" if no unresolved issues, "issues_open" otherwise.
872
+
873
+ ```bash
874
+ COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
875
+ TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
876
+
877
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"plan-ceo-review","timestamp":"'"$TIMESTAMP"'","status":"STATUS","unresolved":N,"critical_gaps":N,"mode":"SELECTIVE_EXPANSION","via":"autoplan","commit":"'"$COMMIT"'"}'
878
+
879
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"plan-eng-review","timestamp":"'"$TIMESTAMP"'","status":"STATUS","unresolved":N,"critical_gaps":N,"issues_found":N,"mode":"FULL_REVIEW","via":"autoplan","commit":"'"$COMMIT"'"}'
880
+ ```
881
+
882
+ If Phase 2 ran (UI scope):
883
+ ```bash
884
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"plan-design-review","timestamp":"'"$TIMESTAMP"'","status":"STATUS","unresolved":N,"via":"autoplan","commit":"'"$COMMIT"'"}'
885
+ ```
886
+
887
+ If Phase 3.5 ran (DX scope):
888
+ ```bash
889
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"plan-devex-review","timestamp":"'"$TIMESTAMP"'","status":"STATUS","initial_score":N,"overall_score":N,"product_type":"TYPE","tthw_current":"TTHW","tthw_target":"TARGET","unresolved":N,"via":"autoplan","commit":"'"$COMMIT"'"}'
890
+ ```
891
+
892
+ Dual voice logs (one per phase that ran):
893
+ ```bash
894
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"autoplan-voices","timestamp":"'"$TIMESTAMP"'","status":"STATUS","source":"SOURCE","phase":"ceo","via":"autoplan","consensus_confirmed":N,"consensus_disagree":N,"commit":"'"$COMMIT"'"}'
895
+
896
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"autoplan-voices","timestamp":"'"$TIMESTAMP"'","status":"STATUS","source":"SOURCE","phase":"eng","via":"autoplan","consensus_confirmed":N,"consensus_disagree":N,"commit":"'"$COMMIT"'"}'
897
+ ```
898
+
899
+ If Phase 2 ran (UI scope), also log:
900
+ ```bash
901
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"autoplan-voices","timestamp":"'"$TIMESTAMP"'","status":"STATUS","source":"SOURCE","phase":"design","via":"autoplan","consensus_confirmed":N,"consensus_disagree":N,"commit":"'"$COMMIT"'"}'
902
+ ```
903
+
904
+ If Phase 3.5 ran (DX scope), also log:
905
+ ```bash
906
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"autoplan-voices","timestamp":"'"$TIMESTAMP"'","status":"STATUS","source":"SOURCE","phase":"dx","via":"autoplan","consensus_confirmed":N,"consensus_disagree":N,"commit":"'"$COMMIT"'"}'
907
+ ```
908
+
909
+ SOURCE = "codex+subagent", "codex-only", "subagent-only", or "unavailable".
910
+ Replace N values with actual consensus counts from the tables.
911
+
912
+ Suggest next step: `/ship` when ready to create the PR.
913
+
914
+ ---
915
+
916
+ ## Important Rules
917
+
918
+ - **Never abort.** The user chose /autoplan. Respect that choice. Surface all taste decisions, never redirect to interactive review.
919
+ - **Two gates.** The non-auto-decided AskUserQuestions are: (1) premise confirmation in Phase 1, and (2) User Challenges — when both models agree the user's stated direction should change. Everything else is auto-decided using the 6 principles.
920
+ - **Log every decision.** No silent auto-decisions. Every choice gets a row in the audit trail.
921
+ - **Full depth means full depth.** Do not compress or skip sections from the loaded skill files (except the skip list in Phase 0). "Full depth" means: read the code the section asks you to read, produce the outputs the section requires, identify every issue, and decide each one. A one-sentence summary of a section is not "full depth" — it is a skip. If you catch yourself writing fewer than 3 sentences for any review section, you are likely compressing.
922
+ - **Artifacts are deliverables.** Test plan artifact, failure modes registry, error/rescue table, ASCII diagrams — these must exist on disk or in the plan file when the review completes. If they don't exist, the review is incomplete.
923
+ - **Sequential order.** CEO → Design → Eng → DX. Each phase builds on the last.