supipowers 1.5.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +129 -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 +264 -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
package/README.md CHANGED
@@ -60,6 +60,7 @@ The installer scans for these and offers to install missing tooling where it can
60
60
  | ------------------------ | ------------------------------------------------------------- |
61
61
  | `/supi` | Interactive menu with commands and project status |
62
62
  | `/supi:plan` | Collaborative planning with structured task breakdown |
63
+ | `/supi:ui-design` | Design Director pipeline — gather UI context, decompose target into components, build mockups in browser companion, validate, save to `.omp/supipowers/ui-design/` |
63
64
  | `/supi:review` | AI code review with validated findings docs and fix/document/discuss actions |
64
65
  | `/supi:checks` | Run deterministic quality gates |
65
66
  | `/supi:qa` | E2E testing pipeline with Playwright |
@@ -83,7 +84,7 @@ Most commands steer the AI session. These are TUI-only — they open native dial
83
84
 
84
85
  **Planning.** `/supi:plan` steers the AI through planning phases (scope → decompose → estimate → verify), saves the result to `.omp/supipowers/plans/`, and presents an approval UI. On approval, tasks execute in the same session.
85
86
 
86
- **Quality gates.** `/supi:checks` runs deterministic quality gates. Six gates are available: `lsp-diagnostics`, `lint`, `typecheck`, `format`, `test-suite`, and `build`. Each gate can be enabled independently via `/supi:config` or `.omp/supipowers/config.json`. Gates report issues with severity levels.
87
+ **Quality gates.** `/supi:checks` runs deterministic quality gates. Six gates are available: `lsp-diagnostics`, `lint`, `typecheck`, `format`, `test-suite`, and `build`. Each gate can be enabled independently via `/supi:config` or the shared repository config at `.omp/supipowers/config.json`. In monorepos, `/supi:checks` defaults to `All`, which runs the root target plus every workspace target sequentially; use `--target <package>` to narrow the run or `--target all` to request the batch mode explicitly. Gates report issues with severity levels.
87
88
 
88
89
  **AI code review.** `/supi:review` runs a programmatic AI review pipeline with configurable depth (quick, deep, or multi-agent). It uses headless agent sessions with structured JSON validation, always validates findings before user action, writes the current validated findings to a session `findings.md` document, and then presents three next-step choices: `Fix now`, `Document only`, or `Discuss before fixing`.
89
90
 
@@ -127,7 +128,7 @@ Use `/supi:agents` to inspect the merged set that will actually run.
127
128
 
128
129
  ## Quality gates
129
130
 
130
- `/supi:checks` runs deterministic quality gates. Each gate is independently configurable in `quality.gates` via `/supi:config` or the config JSON files:
131
+ `/supi:checks` runs deterministic quality gates. Each gate is independently configurable in `quality.gates` via `/supi:config` or the shared config JSON files:
131
132
 
132
133
  | Gate | What it checks | Config type |
133
134
  | ------------------ | ------------------------------- | ----------------- |
@@ -138,7 +139,7 @@ Use `/supi:agents` to inspect the merged set that will actually run.
138
139
  | `test-suite` | Test runner | enabled + command |
139
140
  | `build` | Build verification | enabled + command |
140
141
 
141
- Gates default to disabled. Enable them per-project in `.omp/supipowers/config.json` or globally in `~/.omp/supipowers/config.json`.
142
+ Gates default to disabled. Enable them globally in `~/.omp/supipowers/config.json` or per-repository in `.omp/supipowers/config.json`. In monorepos, the repository config is shared by the root target and every workspace, and `/supi:checks` defaults to `All` (root target + every workspace target).
142
143
 
143
144
  ## Configuration
144
145
 
@@ -148,23 +149,27 @@ Gates default to disabled. Enable them per-project in `.omp/supipowers/config.js
148
149
 
149
150
  Opens an interactive settings screen. Toggles flip instantly, selects open a picker, text fields open an input dialog.
150
151
 
151
- Configuration is a three-layer deep-merge (lowest to highest priority):
152
+ Configuration uses built-in defaults plus two user-managed override layers:
152
153
 
153
154
  1. Built-in defaults
154
155
  2. `~/.omp/supipowers/config.json` — global overrides
155
- 3. `.omp/supipowers/config.json` — per-project overrides
156
+ 3. `.omp/supipowers/config.json` — repository overrides
156
157
 
158
+ `/supi:config` exposes only `Global` and `Repository`. In monorepos, the repository config is shared across every workspace; there are no per-workspace Supipowers config files for general settings.
157
159
 
158
160
  ## Release channels
159
161
 
160
162
  Three built-in channels are available: `github` (GitHub Release via `gh` CLI), `gitlab` (GitLab Release via `glab` CLI), and `gitea` (Gitea Release via `tea` CLI). Channels are selected per-project in `release.channels`.
161
163
 
162
- Release notes are generated from conventional commits scoped to the paths listed in `package.json`'s `files` field commits touching files outside those paths are excluded.
164
+ `/supi:release` auto-detects publishable release targets at runtime. In single-package repos it keeps the classic root-package flow. In Bun, npm, pnpm, and Yarn workspaces it discovers publishable packages from workspace metadata, auto-selects the only publishable target when there is one, and otherwise opens a picker that lists all publishable packages with changed packages first. Target choice is runtime-only and is not persisted to config.
163
165
 
164
- `/supi:release` accepts two optional flags:
166
+ Release notes are scoped to the selected target's publishable paths. When that target declares a `files` whitelist in its `package.json`, only commits touching those paths are included. Otherwise the changelog falls back to the target package directory plus its `package.json`. Root releases keep the configured `release.tagFormat`; workspace releases use `<package-name>@<version>` tags to avoid collisions across packages.
167
+
168
+ `/supi:release` accepts three optional flags:
165
169
 
166
170
  | Flag | Effect |
167
171
  | ----------- | ------ |
172
+ | `--target <package>` | Skip the target picker and release the named package directly |
168
173
  | `--raw` | Skip AI polish of release notes; use raw conventional-commit output |
169
174
  | `--dry-run` | Run the full release flow without publishing |
170
175
 
@@ -187,7 +192,7 @@ Custom channels can be defined in `release.customChannels`:
187
192
  | Field | Required | Description |
188
193
  | ---------------- | -------- | -------------------------------------------------------------- |
189
194
  | `label` | yes | Display name shown in the release picker |
190
- | `publishCommand` | yes | Shell command run to publish; `$tag`, `$version`, `$changelog` are passed as environment variables |
195
+ | `publishCommand` | yes | Shell command run to publish; `$tag`, `$version`, `$changelog`, `$targetName`, `$targetId`, `$targetPath`, `$manifestPath`, and `$packageManager` are passed as environment variables |
191
196
  | `detectCommand` | no | Shell command to detect availability; exit 0 = available. If omitted, the channel is assumed available |
192
197
 
193
198
  ## Skills
@@ -197,6 +202,7 @@ Supipowers ships runtime-loaded prompt skills that are also available to the age
197
202
  | Skill | Used by |
198
203
  | ----------------------- | ----------------------- |
199
204
  | `planning` | `/supi:plan` |
205
+ | `ui-design` | `/supi:ui-design` |
200
206
  | `code-review` | Manual prompting / reusable review guidance |
201
207
  | `qa-strategy` | `/supi:qa` |
202
208
  | `fix-pr` | `/supi:fix-pr` |
package/bin/install.mjs CHANGED
@@ -5,11 +5,26 @@ import { dirname, join } from "node:path";
5
5
 
6
6
  const isWindows = process.platform === "win32";
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
- // When invoked via bunx/npx, always force a full install to guarantee
9
- // node_modules/ and a consistent extension directory. The --force flag
10
- // bypasses the "already up to date" version check.
11
- const args = [join(__dirname, "install.ts"), "--force", ...process.argv.slice(2)];
12
- const result = spawnSync("bun", args, {
8
+
9
+ const userArgs = process.argv.slice(2);
10
+ const subcommand = userArgs[0];
11
+
12
+ let script;
13
+ let scriptArgs;
14
+
15
+ if (subcommand === "migrate") {
16
+ // `bunx supipowers migrate [...]` — execution-state migration.
17
+ script = join(__dirname, "migrate.ts");
18
+ scriptArgs = userArgs.slice(1);
19
+ } else {
20
+ // Default: installer flow. When invoked via bunx/npx, always force a full
21
+ // install to guarantee node_modules/ and a consistent extension directory.
22
+ // The --force flag bypasses the "already up to date" version check.
23
+ script = join(__dirname, "install.ts");
24
+ scriptArgs = ["--force", ...userArgs];
25
+ }
26
+
27
+ const result = spawnSync("bun", [script, ...scriptArgs], {
13
28
  stdio: "inherit",
14
29
  env: process.env,
15
30
  shell: isWindows,
package/bin/install.ts CHANGED
@@ -25,6 +25,11 @@ import { resolve, dirname, join } from "node:path";
25
25
  import { fileURLToPath } from "node:url";
26
26
  import { homedir } from "node:os";
27
27
  import { scanAll, installDep, formatReport } from "../src/deps/registry.js";
28
+ import {
29
+ runMempalaceSetup,
30
+ snapshotMempalaceInstall,
31
+ } from "../src/mempalace/installer-helper.js";
32
+ import { createPaths } from "../src/platform/types.js";
28
33
  import type { ExecResult } from "../src/platform/types.js";
29
34
 
30
35
  const isWindows = process.platform === "win32";
@@ -128,6 +133,7 @@ async function exec(cmd: string, args: string[]): Promise<ExecResult> {
128
133
 
129
134
  const cliArgs = process.argv.slice(2);
130
135
  const skipDeps = cliArgs.includes("--skip-deps");
136
+ const skipMempalace = cliArgs.includes("--skip-mempalace");
131
137
  const FORCE = cliArgs.includes("--force");
132
138
  const DEBUG = cliArgs.includes("--debug");
133
139
 
@@ -555,6 +561,14 @@ async function main(): Promise<void> {
555
561
  }
556
562
  }
557
563
 
564
+ // ── Step 5: MemPalace memory (optional) ─────────────────────
565
+
566
+ if (!skipMempalace) {
567
+ await offerMempalaceSetup();
568
+ } else {
569
+ log("--skip-mempalace flag set, skipping MemPalace prompt");
570
+ }
571
+
558
572
  // ── Done ───────────────────────────────────────────────────
559
573
 
560
574
  const targetNames = targets.map((t) => t.name.toLowerCase()).join(" or ");
@@ -566,6 +580,87 @@ async function main(): Promise<void> {
566
580
  outro(`supipowers is ready!`);
567
581
  }
568
582
 
583
+ async function offerMempalaceSetup(): Promise<void> {
584
+ const cwd = process.cwd();
585
+ const paths = createPaths(".omp");
586
+ const snap = snapshotMempalaceInstall(paths, cwd);
587
+
588
+ if (!snap.bridgeOk) {
589
+ note(
590
+ `MemPalace bridge missing at ${snap.bridgePath}.\n` +
591
+ "The supipowers package was installed without the bundled Python bridge.\n" +
592
+ "Reinstall supipowers and rerun setup.",
593
+ "MemPalace",
594
+ );
595
+ return;
596
+ }
597
+
598
+ const message = snap.ready
599
+ ? `Reinstall MemPalace memory (mempalace==${snap.packageVersion})? Recreates the managed venv.`
600
+ : "Install MemPalace memory now? Downloads uv (~30MB), Python 3.12, and the mempalace package.";
601
+
602
+ const ok = await confirm({
603
+ message,
604
+ initialValue: !snap.ready,
605
+ });
606
+ if (isCancel(ok) || !ok) {
607
+ note(
608
+ "Skipped. Run `/supi:memory setup` from inside OMP, or rerun the installer to revisit this step.",
609
+ "MemPalace",
610
+ );
611
+ return;
612
+ }
613
+
614
+ const s = spinner();
615
+ s.start("Installing MemPalace...");
616
+
617
+ const runner = async (
618
+ cmd: string,
619
+ args: string[],
620
+ runnerOpts?: { input?: string; timeoutMs?: number },
621
+ ) => {
622
+ const result = run(cmd, args, {
623
+ ...(runnerOpts?.input ? { input: runnerOpts.input } : {}),
624
+ ...(runnerOpts?.timeoutMs ? { timeout: runnerOpts.timeoutMs } : {}),
625
+ });
626
+ return {
627
+ code: result.status ?? 1,
628
+ stdout: result.stdout ?? "",
629
+ stderr: result.stderr ?? "",
630
+ };
631
+ };
632
+
633
+ const result = await runMempalaceSetup({
634
+ paths,
635
+ cwd,
636
+ runner,
637
+ onProgress: (msg) => s.message(msg),
638
+ });
639
+
640
+ if (!result.ok) {
641
+ s.stop("MemPalace installation failed");
642
+ note(
643
+ `${result.error.message}\n\n${result.error.remediation ?? ""}`.trim(),
644
+ "MemPalace error",
645
+ );
646
+ return;
647
+ }
648
+
649
+ s.stop(
650
+ `MemPalace v${result.details.packageVersion} ready (Python ${result.details.managedPython} via uv)`,
651
+ );
652
+ note(
653
+ `palace path: ~/.mempalace/palace\n` +
654
+ `managed venv: ${result.details.venvPath}\n` +
655
+ `uv binary: ${result.details.uvPath} (${result.details.uvVersion})\n\n` +
656
+ "On the first OMP session in this project, ask the agent to run\n" +
657
+ ` mempalace(action="init", dir=".", yes=true)\n` +
658
+ ` mempalace(action="mine", dir=".", limit=20)\n` +
659
+ "or just say `init mempalace` and the agent will register the project's wing and seed memory.",
660
+ "MemPalace",
661
+ );
662
+ }
663
+
569
664
  main().catch((e) => {
570
665
  console.error(e);
571
666
  process.exit(1);
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "supipowers",
3
- "version": "1.5.3",
3
+ "version": "2.0.0",
4
4
  "description": "Workflow extension for OMP coding agents.",
5
5
  "type": "module",
6
6
  "scripts": {
7
- "test": "bun test tests/",
7
+ "test": "bun test --timeout 20000 tests/",
8
8
  "typecheck": "tsc --noEmit",
9
- "test:watch": "bun test --watch tests/",
9
+ "test:watch": "bun test --timeout 20000 --watch tests/",
10
+ "test:evals": "bun test --timeout 20000 tests/evals/",
10
11
  "build": "tsc -p tsconfig.build.json",
12
+ "install:visual-server": "npm --prefix src/visual/scripts ci --ignore-scripts --no-audit --no-fund",
13
+ "postinstall": "bun run install:visual-server",
11
14
  "prepare": "git config core.hooksPath hooks || true"
12
15
  },
13
16
  "engines": {
@@ -61,7 +64,8 @@
61
64
  },
62
65
  "dependencies": {
63
66
  "@clack/prompts": "^0.10.0",
64
- "handlebars": "^4.7.8"
67
+ "handlebars": "^4.7.8",
68
+ "yaml": "^2.8.3"
65
69
  },
66
70
  "peerDependencies": {
67
71
  "@oh-my-pi/pi-coding-agent": "*",
@@ -4,9 +4,9 @@ Route high-output tool calls through sandboxed execution to protect the context
4
4
 
5
5
  | Scope | Tool routing rules for supi-context-mode |
6
6
  |-------|-----------------------------------------------------|
7
- | Trigger | Always active when supi-context-mode tools are available |
7
+ | Trigger | Active-aware; only currently active `ctx_*` tools can be used or named as enforced replacements |
8
8
  | Goal | Prevent context flooding — a single unrouted command can dump 56 KB into context |
9
- | Key rule | Blocked tools return errors; use sandbox equivalents instead |
9
+ | Key rule | Blocked native tools are blocked only when an active `ctx_*` replacement exists |
10
10
 
11
11
  ## Tool Selection Hierarchy
12
12
 
@@ -16,27 +16,28 @@ Pick the highest-priority tool that fits the task:
16
16
  |----------|------|---------|
17
17
  | 1 — GATHER | `ctx_batch_execute(commands, queries)` | Primary tool. Runs all commands, auto-indexes, returns search results. ONE call replaces 30+ individual calls. |
18
18
  | 2 — FOLLOW-UP | `ctx_search(queries: ["q1", "q2", ...])` | Query already-indexed content. Pass ALL questions as array in ONE call. |
19
+ | 2.5 — CACHE | `ctx_open_cached(handle, offset?, limit?)` | Open `cache://<sha>` handles when this tool is active. Returns bounded slices only. |
19
20
  | 3 — PROCESSING | `ctx_execute(language, code)` / `ctx_execute_file(path, language, code)` | Sandbox execution. Only stdout enters context. |
20
21
  | 4 — WEB | `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` | Fetch, chunk, index, query. Raw HTML never enters context. |
21
22
  | 5 — INDEX | `ctx_index(content, source)` | Store content in FTS5 knowledge base for later search. |
22
23
 
23
24
  ## Blocked Commands
24
25
 
25
- Blocked commands are intercepted and replaced with an error. Do NOT retry via Bash.
26
+ Blocked commands are intercepted only when their replacement `ctx_*` tool is active for the turn. Do NOT retry via Bash when a block reason names an active replacement.
26
27
 
27
28
  | Blocked tool | Replacement |
28
29
  |---|---|
29
30
  | `curl` / `wget` in Bash | `ctx_fetch_and_index(url, source)` or `ctx_execute` with `fetch()` |
30
31
  | Inline HTTP (`fetch('http`, `requests.get(`, etc.) in Bash | `ctx_execute(language, code)` — only stdout enters context |
31
32
  | WebFetch / Fetch tool | `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` |
32
- | Grep tool | `ctx_search(queries)`, `ctx_batch_execute(commands, queries)`, or `ctx_execute(language: "shell", code: "grep ...")` |
33
+ | Search tool | `ctx_search(queries)`, `ctx_batch_execute(commands, queries)`, or `ctx_execute(language: "shell", code: "grep ...")` |
33
34
  | Find / Glob tool | `ctx_execute(language: "shell", code: "find ...")` or `ctx_batch_execute(commands, queries)` |
34
35
 
35
- ### Example: routing a grep call
36
+ ### Example: routing a search call
36
37
 
37
38
  ```
38
39
  // WRONG — blocked, returns error
39
- grep(pattern: "TODO", path: "src/")
40
+ search(pattern: "TODO", paths: ["src/"])
40
41
 
41
42
  // CORRECT — runs in sandbox, only printed summary enters context
42
43
  ctx_execute(language: "shell", code: "grep -rn TODO src/")
@@ -58,15 +59,21 @@ For everything else:
58
59
  - `ctx_batch_execute(commands, queries)` — multiple commands + search in ONE call
59
60
  - `ctx_execute(language: "shell", code: "...")` — sandbox, only stdout enters context
60
61
 
62
+ When OMP's `shellMinimizer` is active, large bash output ends with a `[raw output: artifact://<id>]` footer. The footer is OMP's pointer to the full bytes — supipowers leaves it untouched. Recover the original with `read artifact://<id>`.
63
+
61
64
  ### Read
62
65
 
63
- Reads are never blocked — OMP's native read tool preserves hashline anchors (`N#XX`) for the edit contract. Large reads (>110 lines) are auto-compressed to head (80) + tail (30) with a `sel` hint.
66
+ Reads are never blocked — OMP's native open/read tool preserves hashline anchors (e.g., `120th|content` after 14.4.1) for the edit contract. Large reads (>110 lines) are auto-compressed to head (80) + tail (30) with a `sel` hint.
64
67
 
65
68
  For analysis-only reads where anchors are not needed, prefer `ctx_execute_file(path, language, code)` — only your printed summary enters context.
66
69
 
67
- ## Subagent Routing
70
+ ### Cache handles
71
+
72
+ When a prompt or prior output contains a `cache://<sha>` handle, open it with `ctx_open_cached(handle, offset?, limit?)` only if `ctx_open_cached` is active in the current tool catalog. Use bounded offsets/limits for follow-up reads; do not assume cached handles can be opened when the tool is inactive.
73
+
74
+ ## Runtime Routing Guidance
68
75
 
69
- The routing block is automatically injected into subagent prompts. Bash-type subagents are upgraded to general-purpose for tool access. You do NOT need to manually instruct subagents about context-mode.
76
+ The injected prompt is a compact, active-aware summary generated from the current active tool list. This static file is reference documentation; it is not injected wholesale.
70
77
 
71
78
  ## Output Constraints
72
79
 
@@ -82,7 +89,7 @@ The routing block is automatically injected into subagent prompts. Bash-type sub
82
89
 
83
90
  ## Checklist
84
91
 
85
- - [ ] Used tool hierarchy (batch_execute > search > execute > fetch) — not raw Bash/Grep/Find
92
+ - [ ] Used tool hierarchy (batch_execute > search > execute > fetch) — not raw Bash/Search/Find
86
93
  - [ ] No blocked tool calls attempted
87
94
  - [ ] Artifacts written to files, not returned inline
88
95
  - [ ] Source labels are descriptive for later search
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: harness
3
+ description: Guides the harness-engineering pipeline — turn a codebase into one that resists agentic slop with agent-neutral docs, mechanically enforced architecture, and three runtime guardrails
4
+ ---
5
+
6
+ # Harness Skill
7
+
8
+ Loaded by `/supi:harness`. Drives a six-phase pipeline that turns an arbitrary codebase into a *harness-friendly* one and installs a persistent **anti-slop** layer that catches the failure modes LLMs reliably fall into.
9
+
10
+ ## What it produces
11
+
12
+ - **Tier 1 — agent-neutral**: `AGENTS.md`, `docs/architecture.md`, `docs/golden-principles.md`, native lint/structural-test/eval configs at the repo root. Usable by any harness (Codex, Claude Code, Cursor, supipowers, …).
13
+ - **Tier 2 — supipowers-aware**: `.omp/supipowers/config.json` gate wiring + `.omp/supipowers/review-agents/harness-architecture.md`.
14
+ - **Tier 3 — anti-slop**: persistent slop queue, layer-aware context injection on every agent turn, pre-edit duplication probe, post-session dead-code sweep, lenient + strict scorecard, and architecture-aware LLM reviewer.
15
+
16
+ ## Phases
17
+
18
+ |#|Phase|Artifact|Validator|Gate|
19
+ |---|---|---|---|---|
20
+ |1|Discover|`<session>/discover.json`|TypeBox schema + cross-check vs deps registry|user review|
21
+ |2|Research|`<session>/research/<topic>.md`|≥2 primary sources + `## Options` / `## Recommendation`|none|
22
+ |3|Design|`<session>/design-spec.md` + `<session>/decisions.jsonl`|Spec-reviewer sub-agent|user approval|
23
+ |4|Plan|`~/.omp/supipowers/projects/<slug>/plans/<plan>.md`|Reuses `validatePlanMarkdown`|OMP plan-mode UI|
24
+ |5|Implement|repo writes (Tier 1+2+3)|`bun typecheck` + `bun test` + anti-slop hooks loadable|none|
25
+ |6|Validate|`<session>/validate-report.json`|Re-runs every artifact + anti-slop scan + synthetic-edit test|user accept|
26
+ |—|GC|drift report + targeted fix sub-agents|reuses Validate|none|
27
+
28
+ Each stage runs as a fresh `platform.createAgentSession` with a per-stage prompt. Stage runners are idempotent: if the canonical artifact exists and validates, the stage is skipped.
29
+
30
+ ## Gate modes
31
+
32
+ - `default`: gate at Discover review, Design approval, Plan-approval, Validate-accept.
33
+ - `auto`: end-to-end without user gates.
34
+ - `manual`: gate every stage.
35
+
36
+ ## Anti-slop guardrails
37
+
38
+ Three project-scoped runtime hooks, all individually toggle-able in `.omp/supipowers/config.json`:
39
+
40
+ ```json
41
+ {
42
+ "harness": {
43
+ "anti_slop": {
44
+ "pre_edit_dupe_probe": { "enabled": true, "threshold": 0.85, "min_token_count": 30 },
45
+ "post_session_sweep": { "enabled": true, "block_on_new_dead_code": false },
46
+ "layer_context_inject": { "enabled": true, "addendum_max_chars": 800 },
47
+ "score_floor": { "strict": 75, "lenient": 90, "release_blocking": false }
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ Hooks register only when `.omp/supipowers/harness/marker.json` exists at session start. Other repos see no behavior change.
54
+
55
+ ## Backend selection
56
+
57
+ Discover recommends a backend based on repo languages; Design lets the user override:
58
+
59
+ |Repo profile|Recommended backend|Why|
60
+ |---|---|---|
61
+ |TypeScript / JavaScript only|`fallow` + supi-native|No Python dep, deepest supipowers integration|
62
+ |3+ languages, or Python/Rust/Go|`desloppify`|29-language coverage, battle-tested LLM review|
63
+ |TS-dominant + non-TS subtrees|`hybrid`|fallow on TS, desloppify on the rest|
64
+ |Niche / no external CLIs allowed|`supi-native`|Manual lint/dupe per stack|
65
+
66
+ ## Score model
67
+
68
+ Scorecard has lenient + strict scores (0–100). Strict counts `wontfix` items as cost so it cannot be gamed. Score floor in config gates `/supi:checks` and CI when `release_blocking: true`.
69
+
70
+ ## Subcommands
71
+
72
+ - `/supi:harness` — bare entry. New repos start the pipeline; harness-installed repos prompt **harden / rebuild / cancel**.
73
+ - `/supi:harness discover|research|design|plan-draft|implement|validate` — run/advance one stage.
74
+ - `/supi:harness resume` — resume an in-flight session.
75
+ - `/supi:harness status` — display stage + score badge.
76
+ - `/supi:harness gc` — drain the slop queue, classify mechanical vs judgmental, and dispatch fix sub-agents.
77
+ - `/supi:harness next` — pop the next unresolved queue entry.
78
+ - `/supi:harness resolve <id>` — mark an entry resolved.
79
+ - `/supi:harness backlog` — list every open entry.
80
+ - `/supi:harness score` — recompute and display the score.
81
+
82
+ ## Conventions you MUST follow
83
+
84
+ - Every phase persists a typed artifact before claiming done. Validate owns the completion claim.
85
+ - Re-running a phase is idempotent: unchanged inputs produce identical outputs.
86
+ - The slop queue is content-addressed; duplicate violations from different backends collapse to the same id.
87
+ - Hooks must complete in ≤500 ms p95. On timeout, emit a one-line warning and skip — never block on perf.
88
+ - Agent-neutral artifacts (Tier 1) MUST NOT depend on supipowers being installed.
89
+
90
+ ## When to run
91
+
92
+ - New repo: install the harness on day 0 so the anti-slop hooks observe every change.
93
+ - Existing repo: install after a major refactor so duplicates and dead code don't compound.
94
+ - Recurring: run `/supi:harness gc` weekly (or pin to CI) to drain the queue.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: ui-design
3
+ description: Design Director state machine for `/supi:ui-design`. Drives 9 model-owned phases from scope selection through user review, producing a validated HTML mockup artifact.
4
+ ---
5
+
6
+ # Design Director
7
+
8
+ Guide the Design Director through 9 model-owned phases to produce a validated design artifact under `<sessionDir>`. Loaded by `/supi:ui-design` via system-prompt override.
9
+
10
+ You **MUST NOT** generate production code, write outside the session directory, or skip phases. You **MUST NOT** call `exit_plan_mode`. Use `planning_ask` for every user question — never the raw `ask` tool.
11
+
12
+ ## Director state machine
13
+
14
+ Before advancing to the next phase, you MUST verify the precondition output is on disk. `manifest.json` is the single source of truth for "what phase are we in". If state is unclear, re-read it and resume the first phase whose precondition output is missing.
15
+
16
+ | # | Phase | Precondition (file on disk) | Output (file to produce) | Manifest status on completion |
17
+ |---|---|---|---|---|
18
+ | 1 | Scope selection | `manifest.json` with `status: "in-progress"` | `planning_ask` result → update `manifest.scope`; write to `manifest.json` | `in-progress` |
19
+ | 2 | Context review | `manifest.scope` populated | `<session>/context.md` (rendered ContextScan + gap-interview answers) | `in-progress` |
20
+ | 3 | Decomposition | `<session>/context.md` exists | `<session>/screen-decomposition.html` (companion) + `<session>/decomposition.json` (kebab-case names, uniqueness asserted via `new Set(names).size === names.length`) | `in-progress` |
21
+ | 4 | Parallel components | `<session>/decomposition.json` exists | `<session>/components/<name>.html` + `<session>/components/<name>.tokens.json` per non-reused component | `in-progress` |
22
+ | 5 | Section assembly | all non-reused components present | `<session>/sections/<name>.html` per section | `in-progress` |
23
+ | 6 | Page composition | all sections present | `<session>/page.html`; update manifest | `critiquing` |
24
+ | 7 | Design-critic pass | `<session>/page.html` exists | `<session>/critique.md` with `## Fixable` and `## Advisory` headers | `awaiting-review` |
25
+ | 8 | Fix loop (≤ 2 iterations) | `<session>/critique.md` exists | Fixes applied in-place; critic re-run; leftover fixable items become advisory when budget exhausted | `awaiting-review` |
26
+ | 9 | User review gate + finalize | critic fix loop terminated | `<session>/screen-review.html`; `planning_ask` → approve / request-changes / discard; set `manifest.status = "complete"` + `approvedAt` on approve; revert to Phase 8 on request-changes; set `manifest.status = "discarded"` on discard | `complete` or `discarded` |
27
+
28
+ ## Parallelism rules
29
+
30
+ - Phase 4: parallel fan-out via a single `task` call carrying one sub-task per component. Pass each sub-agent its kebab-cased component name, a short brief, and the exact target path.
31
+ - Phase 5: serial. Later sections may reference earlier sections; avoid races on shared assets.
32
+ - Phase 7: single sub-agent. Cheap, focused pass.
33
+
34
+ ## Filename collision prevention
35
+
36
+ During Phase 3, before writing `decomposition.json`:
37
+
38
+ 1. Kebab-case every component name.
39
+ 2. Assert `new Set(names).size === names.length`.
40
+ 3. On collision, disambiguate with a numeric or semantic suffix (e.g., `hero-primary`, `hero-secondary`) and re-check.
41
+
42
+ Do **NOT** invoke `task` if the collision check fails — sub-agents will race on the same output path.
43
+
44
+ ## Sub-agent invocation guide
45
+
46
+ Use `task` for sub-agents; never `createAgentSession`. Three templates live under `skills/ui-design/sub-agent-templates/`:
47
+
48
+ - `component-builder.md` — Phase 4
49
+ - `section-assembler.md` — Phase 5
50
+ - `design-critic.md` — Phase 7
51
+
52
+ Every sub-agent MUST be passed the full `context.md` so component authors share the same design brief.
53
+
54
+ ## HARD-GATE
55
+
56
+ You MUST NOT:
57
+ - Write outside `<sessionDir>`.
58
+ - Generate production code (`.ts`, `.tsx`, `.vue`, `.svelte`, `.py`, etc.) intended for the user's codebase.
59
+ - Call `exit_plan_mode` or `ExitPlanMode` — the `/supi:ui-design` completion flow runs through the `agent_end` approval hook.
60
+ - Use the `ask` tool — use `planning_ask` for every user prompt.
61
+ - Skip a phase or declare "done" without updating `manifest.json`.
62
+ - Invoke `task` without a completed filename-collision check (Phase 3).
63
+ - Claim a phase is complete before the file named in its "Output" column exists on disk.
@@ -0,0 +1,29 @@
1
+ # Component Builder Sub-agent
2
+
3
+ You are building a single self-contained HTML fragment for the `/supi:ui-design` pipeline.
4
+
5
+ ## Inputs (passed by the Design Director)
6
+
7
+ - `contextMd` — the full design brief (tokens, existing components, design.md, package info)
8
+ - `componentSpec` — `{ name, brief, reusedFrom? }` (kebab-cased name, short prose brief)
9
+ - `outPath` — absolute path where the HTML fragment MUST be written
10
+ - `tokensOutPath` — absolute path where a `tokens-used.json` summary MUST be written
11
+
12
+ ## Contract
13
+
14
+ 1. Read `contextMd` and internalize the design tokens and existing components.
15
+ 2. Produce a single-file HTML fragment at `outPath`:
16
+ - Self-contained: inline `<style>` or `<script>` only.
17
+ - No external dependencies, no remote URLs, no CDN imports.
18
+ - Must render standalone in a browser.
19
+ 3. Write `tokensOutPath` as JSON: `{ "colors": ["primary", "..."], "fonts": ["sans"], "spacing": ["8px", "16px"] }` listing the token identifiers actually used.
20
+ 4. Do NOT write outside `outPath` and `tokensOutPath`.
21
+
22
+ ## Output
23
+
24
+ Return a single status line in your final message:
25
+
26
+ - `ok` — both files written.
27
+ - `failed: <short reason>` — nothing was written or the spec was unbuildable.
28
+
29
+ Never return HTML in your message body; the directory listing is the product.
@@ -0,0 +1,46 @@
1
+ # Design Critic Sub-agent
2
+
3
+ You critique a composed page for consistency with the design brief in the `/supi:ui-design` pipeline.
4
+
5
+ ## Inputs
6
+
7
+ - `contextMd` — the full design brief
8
+ - `pageHtml` — absolute path to the composed `page.html`
9
+ - `allTokensUsedJson` — absolute path to a file aggregating every component's `tokens-used.json`
10
+ - `outPath` — absolute path where `critique.md` MUST be written
11
+
12
+ ## Contract
13
+
14
+ 1. Read the page HTML and the aggregated tokens summary.
15
+ 2. Compare against `contextMd` for:
16
+ - Token consistency — are colors, fonts, and spacing drawn from the declared design system?
17
+ - Component reuse — are shared components used where they should be?
18
+ - Spacing and rhythm — are vertical/horizontal gaps consistent?
19
+ - Accessibility essentials — alt text, contrast, heading hierarchy.
20
+ 3. Write `outPath` as markdown with exactly two top-level headings:
21
+
22
+ ```markdown
23
+ # Critique
24
+
25
+ ## Fixable
26
+
27
+ - <finding-1>
28
+ - <finding-2>
29
+
30
+ ## Advisory
31
+
32
+ - <finding-1>
33
+ ```
34
+
35
+ - `Fixable`: issues the director can resolve by editing existing files in the session dir.
36
+ - `Advisory`: issues that require design-system or scope changes — not fixable in this session.
37
+
38
+ 4. Do NOT modify the page or component files.
39
+ 5. Do NOT write outside `outPath`.
40
+
41
+ ## Output
42
+
43
+ Single status line in your final message:
44
+
45
+ - `ok` — critique written.
46
+ - `failed: <short reason>` — nothing written.
@@ -0,0 +1,29 @@
1
+ # Component Builder Sub-agent (pencil-mcp)
2
+
3
+ You are building a single reusable 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 (tokens, existing components, design.md, package info)
8
+ - `componentSpec` — `{ name, brief, reusedFrom? }` (kebab-cased name, short prose brief)
9
+ - `penFilePath` — absolute path to the target `.pen` file; EVERY `mcp__pencil_*` call MUST pass `filePath: <penFilePath>`
10
+ - `parentNodeId` — the `Components` frame id under which the new reusable frame must be inserted
11
+ - `nodeOutPath` — absolute path where you MUST write the returned node id (plain text, just the id) so the Director can record it in `node-manifest.json.componentNodeIds`
12
+
13
+ ## Contract
14
+
15
+ 1. Read `contextMd` and internalize the design tokens and existing components. Do NOT invent tokens.
16
+ 2. Use `mcp__pencil_batch_design` to insert a single reusable frame under `parentNodeId` named exactly `componentSpec.name`. The frame MUST set `reusable: true` so the Director can instantiate it later via a `ref`.
17
+ 3. Compose the internal structure with nested `batch_design` operations on the returned id. Prefer existing reusable components inside the `.pen` file when the user's design system already covers the shape.
18
+ 4. Write `nodeOutPath` with the ID of the top-level reusable frame you created — nothing else, no JSON, no prose.
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` — reusable frame inserted, `nodeOutPath` written.
27
+ - `failed: <short reason>` — nothing inserted or the spec was unbuildable.
28
+
29
+ Never dump node JSON in your message body; the `.pen` file and `nodeOutPath` are the product.