supipowers 1.5.3 → 2.0.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 (340) hide show
  1. package/README.md +14 -8
  2. package/bin/install.mjs +20 -5
  3. package/bin/install.ts +95 -0
  4. package/package.json +8 -4
  5. package/skills/context-mode/SKILL.md +17 -10
  6. package/skills/harness/SKILL.md +94 -0
  7. package/skills/ui-design/SKILL.md +63 -0
  8. package/skills/ui-design/sub-agent-templates/component-builder.md +29 -0
  9. package/skills/ui-design/sub-agent-templates/design-critic.md +46 -0
  10. package/skills/ui-design/sub-agent-templates/pencil/component-builder.md +29 -0
  11. package/skills/ui-design/sub-agent-templates/pencil/design-critic.md +42 -0
  12. package/skills/ui-design/sub-agent-templates/pencil/section-assembler.md +27 -0
  13. package/skills/ui-design/sub-agent-templates/section-assembler.md +27 -0
  14. package/skills/ultraplan-discover/SKILL.md +96 -0
  15. package/skills/ultraplan-intake/SKILL.md +89 -0
  16. package/skills/ultraplan-research/SKILL.md +129 -0
  17. package/skills/ultraplan-review/SKILL.md +86 -0
  18. package/skills/ultraplan-review-scope/SKILL.md +111 -0
  19. package/skills/ultraplan-review-structure/SKILL.md +120 -0
  20. package/skills/ultraplan-review-tdd/SKILL.md +142 -0
  21. package/skills/ultraplan-scout/SKILL.md +110 -0
  22. package/skills/ultraplan-synthesize/SKILL.md +124 -0
  23. package/src/{quality/ai-session.ts → ai/final-message.ts} +27 -0
  24. package/src/ai/schema-text.ts +129 -0
  25. package/src/ai/structured-output.ts +274 -0
  26. package/src/ai/template.ts +27 -0
  27. package/src/bootstrap.ts +63 -28
  28. package/src/commands/agents.ts +131 -42
  29. package/src/commands/ai-review.ts +251 -30
  30. package/src/commands/clear.ts +434 -0
  31. package/src/commands/commit.ts +1 -0
  32. package/src/commands/config.ts +242 -44
  33. package/src/commands/context.ts +55 -28
  34. package/src/commands/doctor.ts +234 -6
  35. package/src/commands/fix-pr.ts +306 -131
  36. package/src/commands/generate.ts +111 -21
  37. package/src/commands/memory.ts +192 -0
  38. package/src/commands/model-picker.ts +28 -21
  39. package/src/commands/model.ts +18 -8
  40. package/src/commands/optimize-context.ts +408 -29
  41. package/src/commands/plan.ts +2 -0
  42. package/src/commands/qa.ts +312 -137
  43. package/src/commands/release.ts +259 -76
  44. package/src/commands/review.ts +293 -59
  45. package/src/commands/status.ts +200 -13
  46. package/src/commands/supi.ts +3 -35
  47. package/src/commands/ui-design.ts +394 -0
  48. package/src/commands/ultraplan.ts +1518 -0
  49. package/src/commands/update.ts +86 -0
  50. package/src/config/defaults.ts +62 -0
  51. package/src/config/loader.ts +448 -60
  52. package/src/config/schema.ts +108 -2
  53. package/src/context/optimizer.ts +25 -33
  54. package/src/context/rule-renderer.ts +223 -0
  55. package/src/context/savings.ts +258 -0
  56. package/src/context/startup-check.ts +380 -0
  57. package/src/context/startup-optimizer.ts +355 -0
  58. package/src/context/tokenignore.ts +146 -0
  59. package/src/context-mode/cache-handle.ts +49 -0
  60. package/src/context-mode/cache-preview.ts +71 -0
  61. package/src/context-mode/cache-store.ts +738 -0
  62. package/src/context-mode/compressor.ts +131 -26
  63. package/src/context-mode/dedup.ts +108 -0
  64. package/src/context-mode/detector.ts +35 -4
  65. package/src/context-mode/event-extractor.ts +14 -12
  66. package/src/context-mode/event-store.ts +91 -36
  67. package/src/context-mode/hooks.ts +798 -56
  68. package/src/context-mode/knowledge/store.ts +255 -11
  69. package/src/context-mode/memory-store.ts +325 -0
  70. package/src/context-mode/metrics-recorder.ts +158 -0
  71. package/src/context-mode/metrics-store.ts +765 -0
  72. package/src/context-mode/model.ts +24 -0
  73. package/src/context-mode/processor-keys.ts +29 -0
  74. package/src/context-mode/processors/build.ts +66 -0
  75. package/src/context-mode/processors/docker.ts +57 -0
  76. package/src/context-mode/processors/git.ts +111 -0
  77. package/src/context-mode/processors/json.ts +112 -0
  78. package/src/context-mode/processors/k8s.ts +67 -0
  79. package/src/context-mode/processors/lint.ts +67 -0
  80. package/src/context-mode/processors/log.ts +86 -0
  81. package/src/context-mode/processors/registry.ts +116 -0
  82. package/src/context-mode/processors/test-runner.ts +102 -0
  83. package/src/context-mode/processors/types.ts +20 -0
  84. package/src/context-mode/repomap.ts +400 -0
  85. package/src/context-mode/routing.ts +97 -24
  86. package/src/context-mode/sandbox/runners.ts +5 -1
  87. package/src/context-mode/snapshot-builder.ts +106 -11
  88. package/src/context-mode/source-hash.ts +173 -0
  89. package/src/context-mode/tool-name.ts +11 -0
  90. package/src/context-mode/tools.ts +654 -22
  91. package/src/context-mode/web/fetcher.ts +31 -12
  92. package/src/debug/logger.ts +2 -1
  93. package/src/deps/registry.ts +1 -1
  94. package/src/discipline/failure-summarizer.ts +170 -0
  95. package/src/discipline/failure-taxonomy.ts +131 -0
  96. package/src/discipline/workflow-invariants.ts +125 -0
  97. package/src/discovery/index.ts +31 -0
  98. package/src/discovery/lsp.ts +87 -0
  99. package/src/discovery/rank.ts +144 -0
  100. package/src/discovery/sources.ts +89 -0
  101. package/src/discovery/workflow.ts +87 -0
  102. package/src/docs/contracts.ts +39 -0
  103. package/src/docs/drift.ts +117 -87
  104. package/src/fix-pr/assessment.ts +200 -0
  105. package/src/fix-pr/contracts.ts +47 -0
  106. package/src/fix-pr/fetch-comments.ts +80 -0
  107. package/src/fix-pr/prompt-builder.ts +58 -40
  108. package/src/fix-pr/scripts/exec.ts +34 -0
  109. package/src/fix-pr/scripts/trigger-review.ts +106 -0
  110. package/src/fix-pr/scripts/wait-and-check.ts +108 -0
  111. package/src/fix-pr/types.ts +4 -0
  112. package/src/git/branch-finish.ts +5 -0
  113. package/src/git/commit-contract.ts +83 -0
  114. package/src/git/commit.ts +121 -184
  115. package/src/git/status.ts +62 -8
  116. package/src/harness/anti_slop/architecture-parser.ts +210 -0
  117. package/src/harness/anti_slop/backend-factory.ts +30 -0
  118. package/src/harness/anti_slop/backend.ts +140 -0
  119. package/src/harness/anti_slop/desloppify-adapter.ts +319 -0
  120. package/src/harness/anti_slop/fallow-adapter.ts +305 -0
  121. package/src/harness/anti_slop/installer.ts +227 -0
  122. package/src/harness/anti_slop/queue.ts +216 -0
  123. package/src/harness/anti_slop/recommend.ts +84 -0
  124. package/src/harness/anti_slop/score.ts +180 -0
  125. package/src/harness/anti_slop/synthetic-edit-test.ts +128 -0
  126. package/src/harness/artifacts/agents-md.ts +88 -0
  127. package/src/harness/artifacts/checks-wiring.ts +57 -0
  128. package/src/harness/artifacts/docs-tree.ts +79 -0
  129. package/src/harness/artifacts/lint-configs.ts +136 -0
  130. package/src/harness/artifacts/review-agents.ts +67 -0
  131. package/src/harness/bare-entry.ts +108 -0
  132. package/src/harness/command.ts +1010 -0
  133. package/src/harness/default-agents/design.md +23 -0
  134. package/src/harness/default-agents/discover.md +18 -0
  135. package/src/harness/default-agents/implement.md +24 -0
  136. package/src/harness/default-agents/plan.md +19 -0
  137. package/src/harness/default-agents/research.md +21 -0
  138. package/src/harness/default-agents/validate.md +22 -0
  139. package/src/harness/gc/reporter.ts +28 -0
  140. package/src/harness/gc/runner.ts +136 -0
  141. package/src/harness/hooks/layer-context-inject.ts +155 -0
  142. package/src/harness/hooks/post-session-sweep.ts +130 -0
  143. package/src/harness/hooks/pre-edit-dupe-probe.ts +224 -0
  144. package/src/harness/hooks/register.ts +118 -0
  145. package/src/harness/model.ts +117 -0
  146. package/src/harness/pipeline.ts +348 -0
  147. package/src/harness/project-paths.ts +235 -0
  148. package/src/harness/stage-runner.ts +107 -0
  149. package/src/harness/stages/design.ts +386 -0
  150. package/src/harness/stages/discover.ts +454 -0
  151. package/src/harness/stages/implement.ts +162 -0
  152. package/src/harness/stages/plan.ts +335 -0
  153. package/src/harness/stages/research.ts +263 -0
  154. package/src/harness/stages/validate.ts +684 -0
  155. package/src/harness/storage.ts +467 -0
  156. package/src/harness/tools.ts +426 -0
  157. package/src/lsp/bridge.ts +56 -95
  158. package/src/lsp/capabilities.ts +108 -0
  159. package/src/lsp/contracts.ts +35 -0
  160. package/src/lsp/detector.ts +8 -12
  161. package/src/markdown-frontmatter.ts +68 -0
  162. package/src/mempalace/bridge.ts +135 -0
  163. package/src/mempalace/config.ts +75 -0
  164. package/src/mempalace/format.ts +163 -0
  165. package/src/mempalace/hooks.ts +370 -0
  166. package/src/mempalace/installer-helper.ts +194 -0
  167. package/src/mempalace/python/mempalace_bridge.py +440 -0
  168. package/src/mempalace/runtime.ts +565 -0
  169. package/src/mempalace/schema.ts +268 -0
  170. package/src/mempalace/session-summary.ts +198 -0
  171. package/src/mempalace/tool.ts +186 -0
  172. package/src/mempalace/uv.ts +256 -0
  173. package/src/migrate/runner.ts +354 -0
  174. package/src/planning/approval-flow.ts +206 -9
  175. package/src/planning/plan-writer-prompt.ts +4 -3
  176. package/src/planning/planning-ask-tool.ts +39 -0
  177. package/src/planning/render-markdown.ts +74 -0
  178. package/src/planning/spec.ts +42 -0
  179. package/src/planning/system-prompt.ts +11 -8
  180. package/src/planning/validate.ts +84 -0
  181. package/src/platform/omp.ts +15 -2
  182. package/src/platform/system-prompt.ts +37 -0
  183. package/src/platform/test-utils.ts +3 -0
  184. package/src/platform/types.ts +6 -1
  185. package/src/qa/config.ts +12 -6
  186. package/src/qa/detect-app-type.ts +13 -6
  187. package/src/qa/matrix.ts +12 -6
  188. package/src/qa/prompt-builder.ts +28 -30
  189. package/src/qa/scripts/dev-server-utils.ts +72 -0
  190. package/src/qa/scripts/run-e2e-tests.ts +226 -0
  191. package/src/qa/scripts/start-dev-server.ts +138 -0
  192. package/src/qa/scripts/stop-dev-server.ts +77 -0
  193. package/src/qa/session.ts +13 -7
  194. package/src/quality/ai-setup.ts +27 -25
  195. package/src/quality/contracts.ts +34 -0
  196. package/src/quality/gates/ai-review.ts +20 -58
  197. package/src/quality/gates/command.ts +249 -46
  198. package/src/quality/review-gates.ts +18 -2
  199. package/src/quality/runner.ts +63 -22
  200. package/src/quality/schemas.ts +37 -2
  201. package/src/quality/setup.ts +96 -16
  202. package/src/release/changelog.ts +1 -1
  203. package/src/release/channels/custom.ts +13 -3
  204. package/src/release/channels/types.ts +5 -0
  205. package/src/release/contracts.ts +90 -0
  206. package/src/release/executor.ts +122 -45
  207. package/src/release/prompt.ts +18 -2
  208. package/src/release/targets.ts +86 -0
  209. package/src/release/version.ts +96 -71
  210. package/src/review/agent-loader.ts +221 -109
  211. package/src/review/fixer.ts +10 -6
  212. package/src/review/multi-agent-runner.ts +114 -13
  213. package/src/review/output.ts +12 -139
  214. package/src/review/runner.ts +12 -6
  215. package/src/review/scope.ts +144 -24
  216. package/src/review/types.ts +1 -20
  217. package/src/review/validator.ts +12 -6
  218. package/src/storage/fix-pr-sessions.ts +21 -14
  219. package/src/storage/plans.ts +14 -5
  220. package/src/storage/qa-sessions.ts +25 -19
  221. package/src/storage/reliability-metrics.ts +180 -0
  222. package/src/storage/reports.ts +8 -7
  223. package/src/storage/review-sessions.ts +55 -20
  224. package/src/tool-catalog/active-tool-controller.ts +164 -0
  225. package/src/tool-catalog/active-tool-planner.ts +212 -0
  226. package/src/tool-catalog/tool-groups.ts +102 -0
  227. package/src/types.ts +1399 -5
  228. package/src/ui-design/backend-adapter.ts +78 -0
  229. package/src/ui-design/backends/local-html.ts +82 -0
  230. package/src/ui-design/backends/pencil-mcp.ts +111 -0
  231. package/src/ui-design/components-scanner.ts +124 -0
  232. package/src/ui-design/config.ts +55 -0
  233. package/src/ui-design/pen-scanner.ts +95 -0
  234. package/src/ui-design/pen-selector.ts +72 -0
  235. package/src/ui-design/prompt-builder.ts +73 -0
  236. package/src/ui-design/scanner.ts +136 -0
  237. package/src/ui-design/session.ts +974 -0
  238. package/src/ui-design/system-prompt.ts +312 -0
  239. package/src/ui-design/tokens-scanner.ts +181 -0
  240. package/src/ui-design/types.ts +96 -0
  241. package/src/ultraplan/agent-catalog.ts +522 -0
  242. package/src/ultraplan/authoring/agent-catalog.ts +310 -0
  243. package/src/ultraplan/authoring/authoring-tools.ts +552 -0
  244. package/src/ultraplan/authoring/command-handlers.ts +339 -0
  245. package/src/ultraplan/authoring/markdown.ts +510 -0
  246. package/src/ultraplan/authoring/model.ts +162 -0
  247. package/src/ultraplan/authoring/pipeline.ts +319 -0
  248. package/src/ultraplan/authoring/stage-runner.ts +141 -0
  249. package/src/ultraplan/authoring/stages/approve.ts +249 -0
  250. package/src/ultraplan/authoring/stages/discover.ts +289 -0
  251. package/src/ultraplan/authoring/stages/intake.ts +203 -0
  252. package/src/ultraplan/authoring/stages/research.ts +399 -0
  253. package/src/ultraplan/authoring/stages/review.ts +333 -0
  254. package/src/ultraplan/authoring/stages/scout.ts +188 -0
  255. package/src/ultraplan/authoring/stages/synthesize.ts +348 -0
  256. package/src/ultraplan/authoring/storage.ts +594 -0
  257. package/src/ultraplan/authoring/synth-gate.ts +165 -0
  258. package/src/ultraplan/authoring-draft.ts +653 -0
  259. package/src/ultraplan/authoring-persist.ts +180 -0
  260. package/src/ultraplan/authoring-tool.ts +608 -0
  261. package/src/ultraplan/authoring-wizard.ts +587 -0
  262. package/src/ultraplan/batch/merge.ts +98 -0
  263. package/src/ultraplan/batch/planner.ts +150 -0
  264. package/src/ultraplan/batch/presenter.ts +97 -0
  265. package/src/ultraplan/batch/storage.ts +420 -0
  266. package/src/ultraplan/batch/supervisor.ts +317 -0
  267. package/src/ultraplan/batch/worker.ts +26 -0
  268. package/src/ultraplan/batch/worktree.ts +110 -0
  269. package/src/ultraplan/contracts.ts +1593 -0
  270. package/src/ultraplan/default-agents/authoring/discoverer.md +12 -0
  271. package/src/ultraplan/default-agents/authoring/intake.md +12 -0
  272. package/src/ultraplan/default-agents/authoring/planner.md +12 -0
  273. package/src/ultraplan/default-agents/authoring/researcher.md +12 -0
  274. package/src/ultraplan/default-agents/authoring/scope-checker.md +12 -0
  275. package/src/ultraplan/default-agents/authoring/scout.md +12 -0
  276. package/src/ultraplan/default-agents/authoring/structure-checker.md +12 -0
  277. package/src/ultraplan/default-agents/authoring/tdd-checker.md +12 -0
  278. package/src/ultraplan/default-agents/backend-domain-reviewer.md +10 -0
  279. package/src/ultraplan/default-agents/backend-executor.md +10 -0
  280. package/src/ultraplan/default-agents/backend-stack-reviewer.md +10 -0
  281. package/src/ultraplan/default-agents/backend-tester.md +10 -0
  282. package/src/ultraplan/default-agents/frontend-domain-reviewer.md +10 -0
  283. package/src/ultraplan/default-agents/frontend-executor.md +10 -0
  284. package/src/ultraplan/default-agents/frontend-stack-reviewer.md +10 -0
  285. package/src/ultraplan/default-agents/frontend-tester.md +10 -0
  286. package/src/ultraplan/default-agents/infrastructure-domain-reviewer.md +10 -0
  287. package/src/ultraplan/default-agents/infrastructure-executor.md +10 -0
  288. package/src/ultraplan/default-agents/infrastructure-stack-reviewer.md +10 -0
  289. package/src/ultraplan/default-agents/infrastructure-tester.md +10 -0
  290. package/src/ultraplan/execution/contract.ts +71 -0
  291. package/src/ultraplan/execution/policy.ts +217 -0
  292. package/src/ultraplan/execution/runtime-tools.ts +107 -0
  293. package/src/ultraplan/execution/session-runner.ts +281 -0
  294. package/src/ultraplan/next-router.ts +85 -0
  295. package/src/ultraplan/presenter.ts +359 -0
  296. package/src/ultraplan/project-paths.ts +342 -0
  297. package/src/ultraplan/runtime/active-execution.ts +72 -0
  298. package/src/ultraplan/runtime/apply-mutation.ts +416 -0
  299. package/src/ultraplan/runtime/blockers.ts +243 -0
  300. package/src/ultraplan/runtime/hook-bridge.ts +486 -0
  301. package/src/ultraplan/runtime/launch-context.ts +207 -0
  302. package/src/ultraplan/runtime/migration.ts +524 -0
  303. package/src/ultraplan/runtime/normalize.ts +281 -0
  304. package/src/ultraplan/runtime/proof.ts +260 -0
  305. package/src/ultraplan/runtime/reducer.ts +416 -0
  306. package/src/ultraplan/runtime/repair.ts +251 -0
  307. package/src/ultraplan/runtime/tracker-storage.ts +368 -0
  308. package/src/ultraplan/session-selection.ts +291 -0
  309. package/src/ultraplan/storage.ts +374 -0
  310. package/src/utils/editor.ts +38 -0
  311. package/src/utils/executable.ts +80 -0
  312. package/src/utils/paths.ts +1 -20
  313. package/src/utils/shell.ts +31 -0
  314. package/src/visual/companion.ts +2 -1
  315. package/src/visual/scripts/frame-template.html +60 -0
  316. package/src/visual/scripts/index.js +59 -13
  317. package/src/visual/scripts/package.json +3 -0
  318. package/src/visual/start-server.ts +2 -1
  319. package/src/workspace/git-scope.ts +64 -0
  320. package/src/workspace/locks.ts +23 -0
  321. package/src/workspace/package-manager.ts +117 -0
  322. package/src/workspace/path-mapping.ts +75 -0
  323. package/src/workspace/project-slug.ts +92 -0
  324. package/src/workspace/repo-root.ts +137 -0
  325. package/src/workspace/selector.ts +115 -0
  326. package/src/workspace/state-paths.ts +118 -0
  327. package/src/workspace/targets.ts +313 -0
  328. package/src/fix-pr/scripts/diff-comments.sh +0 -33
  329. package/src/fix-pr/scripts/fetch-pr-comments.sh +0 -25
  330. package/src/fix-pr/scripts/trigger-review.sh +0 -36
  331. package/src/fix-pr/scripts/wait-and-check.sh +0 -37
  332. package/src/qa/scripts/detect-app-type.sh +0 -68
  333. package/src/qa/scripts/discover-routes.sh +0 -143
  334. package/src/qa/scripts/run-e2e-tests.sh +0 -131
  335. package/src/qa/scripts/start-dev-server.sh +0 -46
  336. package/src/qa/scripts/stop-dev-server.sh +0 -36
  337. package/src/review/prompts/fix-output-schema.md +0 -18
  338. package/src/review/prompts/review-output-schema.md +0 -38
  339. package/src/review/template.ts +0 -15
  340. /package/src/{review → ai}/prompts/invalid-output-retry.md +0 -0
@@ -0,0 +1,42 @@
1
+ # Design Critic Sub-agent (pencil-mcp)
2
+
3
+ You are the design critic for `/supi:ui-design`. You audit a composed page inside a `.pen` file and produce `critique.md` — the single source of truth for the fix loop.
4
+
5
+ ## Inputs (passed by the Design Director)
6
+
7
+ - `contextMd` — the full design brief
8
+ - `pageNodeId` — id of the composed page frame inside the `.pen` file
9
+ - `penFilePath` — absolute path to the target `.pen` file; EVERY `mcp__pencil_*` call MUST pass `filePath: <penFilePath>`
10
+ - `outPath` — absolute path where you MUST write `critique.md`
11
+
12
+ ## Contract
13
+
14
+ 1. Inspect the page without editing it:
15
+ - `mcp__pencil_get_screenshot` on `pageNodeId` for the visual pass.
16
+ - `mcp__pencil_snapshot_layout` on `pageNodeId` for alignment / overflow / clipping issues.
17
+ - `mcp__pencil_search_all_unique_properties` on the page tree to spot rogue tokens (colors, fonts, radii, paddings) that don't match the design system.
18
+ 2. Write `outPath` with two top-level sections in this exact shape:
19
+
20
+ ```markdown
21
+ # Critique
22
+
23
+ ## Fixable
24
+
25
+ - <bullet per fixable issue, with concrete correction hint>
26
+
27
+ ## Advisory
28
+
29
+ - <bullet per nice-to-have or stylistic note>
30
+ ```
31
+
32
+ If a section has nothing, write `- none` (a single bullet). Do not omit the section heading.
33
+
34
+ 3. Do NOT edit the `.pen` file. The Director owns the fix loop.
35
+ 4. Do NOT write any file outside `outPath`.
36
+
37
+ ## Output
38
+
39
+ Return a single status line in your final message:
40
+
41
+ - `ok` — `critique.md` written.
42
+ - `failed: <short reason>` — critique could not be produced.
@@ -0,0 +1,27 @@
1
+ # Section Assembler Sub-agent (pencil-mcp)
2
+
3
+ You are composing a single section frame inside a `.pen` file for the `/supi:ui-design` pipeline.
4
+
5
+ ## Inputs (passed by the Design Director)
6
+
7
+ - `contextMd` — the full design brief
8
+ - `sectionSpec` — `{ name, brief, components: [{ name, nodeId }], order }`
9
+ - `penFilePath` — absolute path to the target `.pen` file; EVERY `mcp__pencil_*` call MUST pass `filePath: <penFilePath>`
10
+ - `parentNodeId` — the `Sections` frame id under which the new section frame must be inserted
11
+ - `nodeOutPath` — absolute path where you MUST write the returned section node id (plain text)
12
+
13
+ ## Contract
14
+
15
+ 1. Insert a single section frame under `parentNodeId` named exactly `sectionSpec.name`.
16
+ 2. Inside the section frame, instantiate each component in `sectionSpec.components` using `ref` nodes that point at the supplied `nodeId`s. Preserve the ordering from `sectionSpec.order`.
17
+ 3. Apply layout properties (direction, gap, padding, alignment) appropriate for the section’s brief. Reuse existing tokens, never invent new ones.
18
+ 4. Write `nodeOutPath` with the ID of the section frame — nothing else.
19
+ 5. Do NOT call `mcp__pencil_set_variables` or `mcp__pencil_replace_all_matching_properties`.
20
+ 6. Do NOT write any file outside `nodeOutPath`.
21
+
22
+ ## Output
23
+
24
+ Return a single status line in your final message:
25
+
26
+ - `ok` — section frame inserted, `nodeOutPath` written.
27
+ - `failed: <short reason>` — section could not be composed.
@@ -0,0 +1,27 @@
1
+ # Section Assembler Sub-agent
2
+
3
+ You compose previously-built component HTML fragments into a single section for the `/supi:ui-design` pipeline.
4
+
5
+ ## Inputs
6
+
7
+ - `contextMd` — the full design brief
8
+ - `sectionSpec` — `{ name, brief, componentRefs }` (kebab-cased name, short prose brief, ordered list of component ids)
9
+ - `componentPaths` — `{ [componentId: string]: string }` mapping each referenced component id to an absolute file path
10
+ - `outPath` — absolute path where the section HTML MUST be written
11
+
12
+ ## Contract
13
+
14
+ 1. Read each component fragment listed in `componentRefs` from `componentPaths`.
15
+ 2. Compose them into a single self-contained HTML section at `outPath`:
16
+ - Inline styles and layout.
17
+ - Reuse the same design tokens from `contextMd`.
18
+ - No duplicated component markup; reference and arrange, don't rebuild.
19
+ 3. Do NOT modify the source component files.
20
+ 4. Do NOT write outside `outPath`.
21
+
22
+ ## Output
23
+
24
+ Single status line in your final message:
25
+
26
+ - `ok` — section file written.
27
+ - `failed: <short reason>` — nothing written.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: ultraplan-discover
3
+ description: Gray-area extraction stage — surfaces decisions the user must make before the plan can be authored, without expanding scope
4
+ ---
5
+
6
+ # UltraPlan Discover
7
+
8
+ Identify the open decisions and ambiguities that block confident scenario authoring. This stage mirrors the GSD discuss phase. It runs after scout and before research. Its sole output is a set of decision records and, optionally, deferred-idea records.
9
+
10
+ ## Quick Reference
11
+
12
+ | Aspect | Detail |
13
+ |--------|--------|
14
+ | **Inputs** | Intake artifact + scout artifact (provided by pipeline runner) |
15
+ | **Output** | One `ultraplan_decision_record` call per decision area; deferred ideas via the same tool with `deferred: true` |
16
+ | **Scope** | Identification only — no library selection, no scenario generation |
17
+ | **Scope guardrail** | You MUST NOT expand scope beyond what the intake goal states |
18
+ | **Storage tools** | `ultraplan_decision_record` — one call per area |
19
+
20
+ ## Decision Areas
21
+
22
+ A decision area is any ambiguity that, if resolved differently, would materially change the plan's scenarios, slots, or test architecture. Examples:
23
+
24
+ | Category | Example Questions |
25
+ |----------|------------------|
26
+ | Auth strategy | Session vs JWT vs OAuth provider — which applies? |
27
+ | API shape | REST vs GraphQL vs RPC — does the intake imply a choice? |
28
+ | Error semantics | Should errors surface to the UI or be swallowed silently? |
29
+ | Library choice | Is there an existing library in the scout, or is a new one needed? |
30
+ | Data ownership | Which service owns the canonical record? |
31
+ | Deployment target | Is this cloud-agnostic, or tied to a specific provider? |
32
+ | Test boundary | Should integration tests hit a real database or a test double? |
33
+
34
+ ## Classify Each Area
35
+
36
+ For each area you identify, assign a disposition:
37
+
38
+ - **OPEN**: The intake and scout provide no signal. The user must decide before authoring proceeds.
39
+ - **RESOLVED-BY-SCOUT**: The scout found an existing pattern that answers the question. Record what was found.
40
+ - **RESOLVED-BY-INTAKE**: The intake stated or clearly implied an answer. Record the answer.
41
+ - **DEFERRED**: The question is out of scope for this session. Record with `deferred: true`.
42
+
43
+ Only OPEN areas require user input. RESOLVED areas are recorded for downstream stages to use as constraints.
44
+
45
+ ## Scope Guardrail
46
+
47
+ You MUST NOT add new requirements, features, or capabilities not present in the intake. If a discovery area reveals an attractive extension, record it with `deferred: true` and move on. The goal statement in the intake is the boundary.
48
+
49
+ ## Process
50
+
51
+ ### Step 1 — Read intake goal and success criteria
52
+
53
+ Anchor every decision area to a field in the intake. If an area cannot be linked to the intake goal, it is out of scope.
54
+
55
+ ### Step 2 — Read scout findings per stack
56
+
57
+ For each applicable stack, check whether the scout already resolved the area. Mark accordingly.
58
+
59
+ ### Step 3 — Record each area
60
+
61
+ Call `ultraplan_decision_record` once per area:
62
+
63
+ ```
64
+ ultraplan_decision_record({
65
+ area: string, // short label, e.g. "auth-strategy"
66
+ category: string, // one of: auth, api-shape, error-semantics,
67
+ // library-choice, data-ownership, deployment, test-boundary, other
68
+ disposition: "OPEN" | "RESOLVED-BY-SCOUT" | "RESOLVED-BY-INTAKE" | "DEFERRED",
69
+ question: string, // the specific question to answer
70
+ resolution: string | null, // null when OPEN; the answer when RESOLVED or DEFERRED
71
+ deferred: boolean, // true when disposition is DEFERRED
72
+ affectedStacks: ("frontend" | "backend" | "infrastructure")[]
73
+ })
74
+ ```
75
+
76
+ ### Step 4 — Verify scope
77
+
78
+ Before finishing, confirm: do all recorded areas trace to the intake goal? If any do not, mark them DEFERRED.
79
+
80
+ ## MUST DO / MUST NOT DO
81
+
82
+ | MUST DO | MUST NOT DO |
83
+ |---------|-------------|
84
+ | Link every area to the intake goal | Introduce requirements not in the intake |
85
+ | Record RESOLVED areas even when no user input is needed | Skip an area because it seems obvious |
86
+ | Mark attractive extensions as DEFERRED | Silently fold deferred ideas into the plan |
87
+ | Call `ultraplan_decision_record` once per area | Batch multiple areas into one call |
88
+ | Consult scout findings before marking an area OPEN | Ask the user to resolve something the scout already answered |
89
+
90
+ ## Final Checklist
91
+
92
+ - [ ] Every identified area has a `ultraplan_decision_record` call
93
+ - [ ] All RESOLVED areas cite the intake field or scout finding that resolves them
94
+ - [ ] All out-of-scope ideas recorded with `deferred: true`
95
+ - [ ] No new requirements introduced beyond the intake goal
96
+ - [ ] No clarifying questions sent to the user
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: ultraplan-intake
3
+ description: Structured extraction of the user's seed prompt into a typed intake artifact — first stage of the UltraPlan authoring pipeline
4
+ ---
5
+
6
+ # UltraPlan Intake
7
+
8
+ Extract a structured, complete intake artifact from the user's seed prompt. This is the first stage of the multi-stage authoring pipeline. It runs once per session.
9
+
10
+ ## Quick Reference
11
+
12
+ | Aspect | Detail |
13
+ |--------|--------|
14
+ | **Input** | Raw user goal/prompt (provided by the pipeline runner as `seedPrompt`) |
15
+ | **Output** | Intake artifact written via `ultraplan_intake_record` |
16
+ | **Scope** | Extraction only — no library selection, no scenario generation, no clarifying questions |
17
+ | **Constraint** | Do NOT chat with the user. Do NOT pick libraries. Do NOT generate scenarios. |
18
+ | **Storage tool** | `ultraplan_intake_record` — called exactly once |
19
+
20
+ ## What You Extract
21
+
22
+ From the seed prompt, populate each field below. If a field cannot be determined from the prompt, leave it as an explicit null or empty list — do not invent.
23
+
24
+ | Field | Type | Rule |
25
+ |-------|------|------|
26
+ | `title` | string | Short noun phrase (≤10 words) describing the feature or project |
27
+ | `goal` | string | One sentence capturing the user's stated outcome |
28
+ | `stackApplicability` | `{ frontend, backend, infrastructure }` | `applicable` if the prompt implies work in that stack; `not-applicable` if clearly excluded; `unknown` if ambiguous |
29
+ | `deferredIdeas` | string[] | Ideas mentioned in the prompt that are out of scope for this session — nice-to-haves, future features, speculative extensions |
30
+ | `constraints` | string[] | Explicit constraints stated by the user (performance targets, tech restrictions, team limits) |
31
+ | `successCriteria` | string[] | Measurable outcomes the user stated or clearly implied |
32
+
33
+ ## Stack Applicability Rules
34
+
35
+ - `frontend`: prompt mentions UI, pages, components, browser, client, mobile, design, UX.
36
+ - `backend`: prompt mentions API, server, database, service, auth, worker, queue, jobs.
37
+ - `infrastructure`: prompt mentions hosting, CI/CD, deployment, containers, cloud, IaC, monitoring, secrets.
38
+ - Mark `unknown` when the prompt is ambiguous. The discover stage resolves `unknown` entries.
39
+ - Mark `not-applicable` only when the stack is explicitly excluded or clearly irrelevant.
40
+
41
+ ## Process
42
+
43
+ ### Step 1 — Read the seed prompt exactly as given
44
+
45
+ Do not paraphrase. Treat the user's words as ground truth.
46
+
47
+ ### Step 2 — Extract each field
48
+
49
+ Work field by field in the order listed in the table above. Apply the stack applicability rules. Collect deferred ideas as-is: do not evaluate or prioritize them.
50
+
51
+ ### Step 3 — Write the artifact
52
+
53
+ Call `ultraplan_intake_record` exactly once with the fully populated object:
54
+
55
+ ```
56
+ ultraplan_intake_record({
57
+ title: string,
58
+ goal: string,
59
+ stackApplicability: {
60
+ frontend: "applicable" | "not-applicable" | "unknown",
61
+ backend: "applicable" | "not-applicable" | "unknown",
62
+ infrastructure: "applicable" | "not-applicable" | "unknown"
63
+ },
64
+ constraints: string[],
65
+ successCriteria: string[],
66
+ deferredIdeas: string[]
67
+ })
68
+ ```
69
+
70
+ Do not call `ultraplan_intake_record` more than once.
71
+
72
+ ## MUST DO / MUST NOT DO
73
+
74
+ | MUST DO | MUST NOT DO |
75
+ |---------|-------------|
76
+ | Extract only what the seed prompt states or clearly implies | Ask the user clarifying questions |
77
+ | Mark ambiguous stacks as `unknown` | Pick libraries, frameworks, or implementation approaches |
78
+ | Collect deferred ideas verbatim | Generate scenarios, domains, or tasks |
79
+ | Call `ultraplan_intake_record` exactly once | Call it zero times or more than once |
80
+ | Leave fields null/empty when undeterminable | Invent constraints or success criteria |
81
+
82
+ ## Final Checklist
83
+
84
+ - [ ] `title` is ≤10 words and noun-phrase form
85
+ - [ ] `goal` is a single sentence
86
+ - [ ] All three stacks have an applicability value (not missing)
87
+ - [ ] `deferredIdeas` contains only ideas mentioned in the prompt, not invented ones
88
+ - [ ] `ultraplan_intake_record` called exactly once
89
+ - [ ] No clarifying questions sent to the user
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: ultraplan-research
3
+ description: Per-stack research stage — produces library choices, established patterns, pitfalls, and test architecture for one applicable stack
4
+ ---
5
+
6
+ # UltraPlan Research
7
+
8
+ Produce a research artifact for a single assigned stack. This stage is spawned once per applicable stack. It runs after discover and before synthesize. Outputs are consumed by the synthesize stage to ground scenario authoring in observable evidence.
9
+
10
+ ## Quick Reference
11
+
12
+ | Aspect | Detail |
13
+ |--------|--------|
14
+ | **Inputs** | Intake + scout + discover artifacts; the assigned stack identifier (`frontend`, `backend`, or `infrastructure`) |
15
+ | **Output** | Research artifact written via `ultraplan_research_record` |
16
+ | **Tools** | `web_search`, `read`, `search`, `find` |
17
+ | **Scope** | The assigned stack only — do not research other stacks |
18
+ | **Storage tool** | `ultraplan_research_record` — called exactly once |
19
+
20
+ ## Research Areas
21
+
22
+ ### 1. Library and Framework Choices
23
+
24
+ - Start from the scout's `reusableAssets` and package manifest. Prefer what is already installed.
25
+ - For each capability gap identified in the discover decisions, determine the best-fit library.
26
+ - Use `web_search` to confirm current versions, security advisories, and API stability.
27
+ - For each choice, record the reasoning: why this library over the alternatives.
28
+
29
+ ### 2. Established Patterns
30
+
31
+ - Patterns already in use in the codebase (from scout) take precedence over external patterns.
32
+ - For patterns not yet in the codebase, cite official documentation or a canonical reference.
33
+ - Focus on patterns directly relevant to the intake goal for this stack.
34
+
35
+ ### 3. Common Pitfalls
36
+
37
+ - Known footguns for the chosen libraries and patterns, sourced from official docs or `web_search`.
38
+ - File-level gotchas identified in the scout's `gotchas` list for this stack.
39
+ - Performance or correctness traps specific to this stack's integration points.
40
+
41
+ ### 4. Validation and Test Architecture
42
+
43
+ - What test level is appropriate for each capability (unit, integration, e2e)?
44
+ - Which test runner and assertion approach to use (from the scout's `testPatterns`)?
45
+ - Fixture and factory requirements: what test data must be set up?
46
+ - Contract: what does "this stack's work is correct" look like as a passing test?
47
+
48
+ ## Source Citation Rules
49
+
50
+ Every claim You MUST cite. Use:
51
+ - A file path for claims sourced from the repo (e.g. `src/lib/auth.ts:45`)
52
+ - A URL for claims sourced from official docs or `web_search`
53
+ - Do NOT assert best practices without a citation
54
+
55
+ ## Process
56
+
57
+ ### Step 1 — Load prior artifacts
58
+
59
+ Read the intake goal, scout findings for your assigned stack, and discover decisions that affect your stack.
60
+
61
+ ### Step 2 — Inventory installed capabilities
62
+
63
+ Read the package manifest for your stack's directory. Note what is already present; do not propose replacing it.
64
+
65
+ ### Step 3 — Fill each research area
66
+
67
+ For each gap in the existing stack, use `web_search` with specific queries (library name + version + use case). Read official docs or changelog pages. Do not use `web_search` for things already visible in the repo.
68
+
69
+ ### Step 4 — Write the artifact
70
+
71
+ Call `ultraplan_research_record` exactly once:
72
+
73
+ ```
74
+ ultraplan_research_record({
75
+ stack: "frontend" | "backend" | "infrastructure",
76
+ content: {
77
+ libraryChoices: [
78
+ {
79
+ capability: string,
80
+ chosen: string,
81
+ version: string | null,
82
+ reasoning: string,
83
+ alternativesConsidered: string[],
84
+ source: string // file path or URL
85
+ }
86
+ ],
87
+ patterns: [
88
+ {
89
+ name: string,
90
+ description: string,
91
+ source: string // file path or URL
92
+ }
93
+ ],
94
+ pitfalls: [
95
+ {
96
+ description: string,
97
+ mitigation: string,
98
+ source: string
99
+ }
100
+ ],
101
+ testArchitecture: {
102
+ unitScope: string,
103
+ integrationScope: string,
104
+ e2eScope: string,
105
+ runner: string,
106
+ fixtureApproach: string,
107
+ source: string
108
+ }
109
+ }
110
+ })
111
+ ```
112
+
113
+ ## MUST DO / MUST NOT DO
114
+
115
+ | MUST DO | MUST NOT DO |
116
+ |---------|-------------|
117
+ | Cite every claim with a file path or URL | Assert best practices without evidence |
118
+ | Prefer packages already in the repo over new introductions | Propose replacing existing working libraries |
119
+ | Use `web_search` for capability gaps only | Use `web_search` for things the repo already answers |
120
+ | Call `ultraplan_research_record` exactly once | Research stacks other than your assigned stack |
121
+ | Consult discover decisions before proposing library choices | Contradict a RESOLVED discover decision |
122
+
123
+ ## Final Checklist
124
+
125
+ - [ ] Every library choice cites a source
126
+ - [ ] Every pattern cites a repo file or official doc URL
127
+ - [ ] Test architecture matches the scout's observed test runner and conventions
128
+ - [ ] No library replacement proposed where an existing one works
129
+ - [ ] `ultraplan_research_record` called exactly once with `stack` matching the assigned stack
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: ultraplan-review
3
+ description: Generic plan-review framing — what each checker catches, severity semantics, and the revision contract
4
+ ---
5
+
6
+ # UltraPlan Review
7
+
8
+ Apply one or more plan checkers to a synthesized draft. This stage runs after synthesize and gates the approve stage. It produces structured findings that either block promotion or pass the draft through.
9
+
10
+ ## Quick Reference
11
+
12
+ | Aspect | Detail |
13
+ |--------|--------|
14
+ | **Inputs** | Current draft (`authored.json` + `manifest.json`); iteration number; prior findings if revising |
15
+ | **Output** | Findings written via `ultraplan_review_finding` (one call per finding) |
16
+ | **Checkers** | `structure-checker`, `scope-checker`, `tdd-checker` |
17
+ | **Gate** | Zero BLOCKER findings required to advance to approve |
18
+ | **Loop** | If BLOCKERs remain after revision, the pipeline returns to synthesize |
19
+
20
+ ## Checker Responsibilities
21
+
22
+ | Checker | What It Catches |
23
+ |---------|----------------|
24
+ | `structure-checker` | Missing stacks, missing domains, missing scenario fields, duplicate IDs, dependency cycles |
25
+ | `scope-checker` | Uncovered intake success criteria, scope creep, silently included deferred ideas |
26
+ | `tdd-checker` | Wrong slot for level, missing red-test step, missing proof obligations |
27
+
28
+ ## Severity Semantics
29
+
30
+ | Severity | Meaning | Gate |
31
+ |----------|---------|------|
32
+ | `BLOCKER` | The plan cannot be executed correctly as written. The synthesize stage MUST revise before re-review. | Blocks approve |
33
+ | `WARNING` | The plan can execute, but a quality or coverage gap exists. The planner SHOULD fix, but approve MAY proceed. | Does not block |
34
+
35
+ Use BLOCKER only when execution would fail, produce wrong output, or violate a structural invariant. Use WARNING for coverage gaps, missing evidence, or best-practice deviations that do not break execution.
36
+
37
+ ## Finding Format
38
+
39
+ Each `ultraplan_review_finding` call produces one finding:
40
+
41
+ ```
42
+ ultraplan_review_finding({
43
+ id: string, // unique within this iteration, e.g. "s1-missing-unit-slot"
44
+ severity: "BLOCKER" | "WARNING",
45
+ source: "structure-checker" | "scope-checker" | "tdd-checker",
46
+ target: {
47
+ stack: "frontend" | "backend" | "infrastructure" | null,
48
+ domainId: string | null,
49
+ scenarioId: string | null
50
+ },
51
+ message: string, // what is wrong
52
+ recommendation: string // concrete fix the planner can act on
53
+ })
54
+ ```
55
+
56
+ The `message` MUST identify the exact location (stack, domain, scenario ID when applicable). The `recommendation` MUST be actionable — say what to add, remove, or change.
57
+
58
+ ## Revision Contract
59
+
60
+ When the pipeline returns to synthesize with findings:
61
+ - The planner receives all findings from the current iteration.
62
+ - The planner MUST address every BLOCKER. Ignoring a BLOCKER and resubmitting is a stall.
63
+ - The planner MAY address WARNINGs at its discretion.
64
+ - After revision, `ultraplan_synth_draft` is called again and the review stage re-runs on the new draft.
65
+ - Iteration count increments on each revision cycle.
66
+
67
+ ## Running Multiple Checkers
68
+
69
+ Each checker runs independently and writes its own findings. The pipeline runner aggregates all findings for the iteration. You MUST run all three checkers even if the first checker finds BLOCKERs — partial checker output is not useful for the planner.
70
+
71
+ ## MUST DO / MUST NOT DO
72
+
73
+ | MUST DO | MUST NOT DO |
74
+ |---------|-------------|
75
+ | Run all three checkers every iteration | Stop after the first BLOCKER |
76
+ | Target every finding to a specific location | Emit vague findings without stack/domain/scenario |
77
+ | Use BLOCKER only for structural or execution failures | Escalate style or preference issues to BLOCKER |
78
+ | Provide an actionable recommendation for every finding | Report a finding without a fix direction |
79
+ | Call `ultraplan_review_finding` once per distinct issue | Batch multiple issues into one finding |
80
+
81
+ ## Final Checklist
82
+
83
+ - [ ] All three checkers ran and produced output (or explicitly recorded zero findings)
84
+ - [ ] Every BLOCKER has a specific target and an actionable recommendation
85
+ - [ ] No finding conflates multiple issues
86
+ - [ ] Iteration number is correct for this review cycle
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: ultraplan-review-scope
3
+ description: Requirement coverage checker — verifies every intake success criterion maps to a scenario, no scope creep exists, and deferred ideas are not silently included
4
+ ---
5
+
6
+ # UltraPlan Review: Scope Checker
7
+
8
+ Verify that the draft covers what was promised and nothing more. This checker runs as part of the review stage. It does not verify structural validity — it verifies semantic alignment between the intake artifact and the draft scenarios.
9
+
10
+ ## Quick Reference
11
+
12
+ | Aspect | Detail |
13
+ |--------|--------|
14
+ | **Inputs** | Draft `authored.json`; intake artifact (goal, success criteria, deferred ideas) |
15
+ | **Output** | Findings via `ultraplan_review_finding` with `source: "scope-checker"` |
16
+ | **Scope** | Coverage, creep, and deferred-idea containment only |
17
+ | **Storage tool** | `ultraplan_review_finding` — one call per distinct scope violation |
18
+
19
+ ## Checks
20
+
21
+ ### Check 1 — Success Criterion Coverage
22
+
23
+ Every success criterion listed in the intake artifact MUST map to at least one scenario in the draft. A scenario maps to a criterion when its `title` or `steps` directly address the criterion's stated outcome.
24
+
25
+ Coverage mapping rules:
26
+ - Exact keyword overlap is sufficient evidence.
27
+ - If a criterion is broad (e.g. "users can manage their profile"), look for at least one scenario per meaningful sub-action implied by the criterion.
28
+ - If coverage is ambiguous, record a WARNING rather than a BLOCKER.
29
+
30
+ Severity:
31
+ - BLOCKER if a success criterion has zero scenario coverage.
32
+ - WARNING if coverage exists but appears partial (one scenario covers a criterion that clearly implies multiple distinct behaviors).
33
+
34
+ ### Check 2 — Scope Creep
35
+
36
+ Every scenario in the draft MUST trace to either a success criterion or a structural necessity (e.g. a required setup step that enables a criterion). A scenario with no traceable link to any intake criterion is scope creep.
37
+
38
+ Severity:
39
+ - WARNING if a scenario cannot be traced to any intake criterion or structural necessity.
40
+ - BLOCKER if a scenario introduces a capability explicitly outside the intake goal (e.g. intake said "read-only dashboard" but a scenario writes data).
41
+
42
+ ### Check 3 — Deferred Idea Containment
43
+
44
+ Every idea listed in the intake's `deferredIdeas` array MUST NOT appear as a scenario in the draft. Matching is by semantic similarity, not exact string match.
45
+
46
+ Severity:
47
+ - BLOCKER if a deferred idea appears as a scenario, regardless of how it is named.
48
+
49
+ ### Check 4 — Goal Alignment
50
+
51
+ The draft's `manifest.goal` MUST match the intake's `goal`. Paraphrasing is acceptable; omitting or expanding the goal is not.
52
+
53
+ Severity:
54
+ - WARNING if the manifest goal is a paraphrase that preserves intent.
55
+ - BLOCKER if the manifest goal omits a key constraint from the intake goal.
56
+ - BLOCKER if the manifest goal adds capabilities not present in the intake goal.
57
+
58
+ ## Finding Format
59
+
60
+ ```
61
+ ultraplan_review_finding({
62
+ id: "scope-<N>",
63
+ severity: "BLOCKER" | "WARNING",
64
+ source: "scope-checker",
65
+ target: {
66
+ stack: "<stack-id>" | null,
67
+ domainId: "<domain-id>" | null,
68
+ scenarioId: "<scenario-id>" | null
69
+ },
70
+ message: string,
71
+ recommendation: string
72
+ })
73
+ ```
74
+
75
+ For Check 1 failures, set `target.stack`, `target.domainId`, `target.scenarioId` all to null (the gap is at the criteria level, not the scenario level).
76
+ For Check 2 and 3 failures, target the specific scenario that introduces creep.
77
+
78
+ ## Process
79
+
80
+ Run all four checks in order. Complete all checks before stopping.
81
+
82
+ ### Example Finding — Uncovered Criterion
83
+
84
+ ```
85
+ ultraplan_review_finding({
86
+ id: "scope-1",
87
+ severity: "BLOCKER",
88
+ source: "scope-checker",
89
+ target: { stack: null, domainId: null, scenarioId: null },
90
+ message: "Intake success criterion 'Users can export their data as CSV' has no matching scenario in the draft.",
91
+ recommendation: "Add a scenario in the relevant stack/domain that covers the CSV export behavior."
92
+ })
93
+ ```
94
+
95
+ ## MUST DO / MUST NOT DO
96
+
97
+ | MUST DO | MUST NOT DO |
98
+ |---------|-------------|
99
+ | Check every intake success criterion individually | Assume a broad scenario implicitly covers all sub-behaviors |
100
+ | Check every draft scenario for traceability | Only check scenarios that look suspicious |
101
+ | Match deferred ideas semantically, not just by exact string | Miss a deferred idea because its scenario uses different wording |
102
+ | Report Check 1 gaps at the criteria level (null target) | Target a scenario when the violation is a missing scenario |
103
+ | Complete all four checks before emitting findings | Stop after the first BLOCKER |
104
+
105
+ ## Final Checklist
106
+
107
+ - [ ] Every intake success criterion checked for coverage
108
+ - [ ] Every draft scenario checked for traceability
109
+ - [ ] All deferred ideas checked against draft scenarios
110
+ - [ ] Manifest goal compared against intake goal
111
+ - [ ] Every finding targets the correct level (criteria vs scenario)