@bastani/atomic 0.8.26-alpha.1 → 0.8.26-alpha.11

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 (308) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +5 -5
  3. package/dist/builtin/intercom/CHANGELOG.md +60 -0
  4. package/dist/builtin/intercom/package.json +2 -2
  5. package/dist/builtin/mcp/CHANGELOG.md +60 -0
  6. package/dist/builtin/mcp/package.json +3 -3
  7. package/dist/builtin/subagents/CHANGELOG.md +61 -0
  8. package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
  9. package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
  10. package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -9
  11. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
  12. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
  13. package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
  14. package/dist/builtin/subagents/agents/debugger.md +6 -6
  15. package/dist/builtin/subagents/package.json +4 -4
  16. package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +1 -1
  17. package/dist/builtin/subagents/skills/browser/EXAMPLES.md +151 -0
  18. package/dist/builtin/subagents/skills/browser/LICENSE.txt +21 -0
  19. package/dist/builtin/subagents/skills/browser/REFERENCE.md +451 -0
  20. package/dist/builtin/subagents/skills/browser/SKILL.md +170 -0
  21. package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
  22. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +55 -12
  23. package/dist/builtin/subagents/src/runs/foreground/execution.ts +71 -12
  24. package/dist/builtin/subagents/src/runs/shared/acceptance.ts +2 -1
  25. package/dist/builtin/subagents/src/runs/shared/final-drain.ts +34 -0
  26. package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +416 -7
  27. package/dist/builtin/subagents/src/runs/shared/worktree.ts +2 -2
  28. package/dist/builtin/web-access/CHANGELOG.md +60 -0
  29. package/dist/builtin/web-access/package.json +2 -2
  30. package/dist/builtin/workflows/CHANGELOG.md +72 -0
  31. package/dist/builtin/workflows/README.md +10 -8
  32. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +11 -8
  33. package/dist/builtin/workflows/builtin/goal.ts +137 -109
  34. package/dist/builtin/workflows/builtin/index.d.ts +2 -0
  35. package/dist/builtin/workflows/builtin/open-claude-design.ts +228 -151
  36. package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
  37. package/dist/builtin/workflows/builtin/ralph.ts +452 -279
  38. package/dist/builtin/workflows/package.json +2 -2
  39. package/dist/builtin/workflows/skills/create-spec/SKILL.md +14 -0
  40. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +29 -10
  41. package/dist/builtin/workflows/src/extension/index.ts +10 -2
  42. package/dist/builtin/workflows/src/extension/runtime.ts +35 -3
  43. package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
  44. package/dist/builtin/workflows/src/runs/background/status.ts +52 -6
  45. package/dist/builtin/workflows/src/runs/foreground/executor.ts +453 -21
  46. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +77 -11
  47. package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +402 -8
  48. package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -2
  49. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
  50. package/dist/builtin/workflows/src/shared/persistence-restore.ts +182 -6
  51. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +76 -6
  52. package/dist/builtin/workflows/src/shared/stage-prompt.ts +33 -2
  53. package/dist/builtin/workflows/src/shared/store-types.ts +31 -0
  54. package/dist/builtin/workflows/src/shared/store.ts +160 -18
  55. package/dist/builtin/workflows/src/shared/types.ts +3 -3
  56. package/dist/builtin/workflows/src/shared/workflow-failures.ts +758 -132
  57. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +39 -3
  58. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +74 -74
  59. package/dist/core/agent-session.d.ts +33 -6
  60. package/dist/core/agent-session.d.ts.map +1 -1
  61. package/dist/core/agent-session.js +157 -182
  62. package/dist/core/agent-session.js.map +1 -1
  63. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  64. package/dist/core/atomic-guide-command.js +11 -9
  65. package/dist/core/atomic-guide-command.js.map +1 -1
  66. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  67. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  68. package/dist/core/compaction/branch-summarization.js +6 -3
  69. package/dist/core/compaction/branch-summarization.js.map +1 -1
  70. package/dist/core/compaction/compaction.d.ts.map +1 -1
  71. package/dist/core/compaction/compaction.js +23 -10
  72. package/dist/core/compaction/compaction.js.map +1 -1
  73. package/dist/core/compaction/context-compaction.d.ts +175 -0
  74. package/dist/core/compaction/context-compaction.d.ts.map +1 -0
  75. package/dist/core/compaction/context-compaction.js +1636 -0
  76. package/dist/core/compaction/context-compaction.js.map +1 -0
  77. package/dist/core/compaction/index.d.ts +1 -0
  78. package/dist/core/compaction/index.d.ts.map +1 -1
  79. package/dist/core/compaction/index.js +1 -0
  80. package/dist/core/compaction/index.js.map +1 -1
  81. package/dist/core/extensions/types.d.ts +3 -2
  82. package/dist/core/extensions/types.d.ts.map +1 -1
  83. package/dist/core/extensions/types.js.map +1 -1
  84. package/dist/core/footer-data-provider.d.ts.map +1 -1
  85. package/dist/core/footer-data-provider.js +3 -0
  86. package/dist/core/footer-data-provider.js.map +1 -1
  87. package/dist/core/index.d.ts +1 -1
  88. package/dist/core/index.d.ts.map +1 -1
  89. package/dist/core/index.js.map +1 -1
  90. package/dist/core/package-manager.d.ts.map +1 -1
  91. package/dist/core/package-manager.js +14 -7
  92. package/dist/core/package-manager.js.map +1 -1
  93. package/dist/core/session-manager.d.ts +41 -1
  94. package/dist/core/session-manager.d.ts.map +1 -1
  95. package/dist/core/session-manager.js +146 -7
  96. package/dist/core/session-manager.js.map +1 -1
  97. package/dist/core/slash-commands.d.ts.map +1 -1
  98. package/dist/core/slash-commands.js +1 -1
  99. package/dist/core/slash-commands.js.map +1 -1
  100. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +5 -5
  101. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
  102. package/dist/core/tools/ask-user-question/tool/format-answer.js +5 -5
  103. package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
  104. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +16 -3
  105. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
  106. package/dist/core/tools/ask-user-question/tool/response-envelope.js +21 -3
  107. package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
  108. package/dist/index.d.ts +4 -3
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +3 -2
  111. package/dist/index.js.map +1 -1
  112. package/dist/modes/index.d.ts +1 -1
  113. package/dist/modes/index.d.ts.map +1 -1
  114. package/dist/modes/index.js.map +1 -1
  115. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  116. package/dist/modes/interactive/components/chat-session-host.js +17 -0
  117. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  118. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
  119. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
  120. package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
  121. package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
  122. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  123. package/dist/modes/interactive/components/footer.js +4 -1
  124. package/dist/modes/interactive/components/footer.js.map +1 -1
  125. package/dist/modes/interactive/components/index.d.ts +1 -0
  126. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  127. package/dist/modes/interactive/components/index.js +1 -0
  128. package/dist/modes/interactive/components/index.js.map +1 -1
  129. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  130. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  131. package/dist/modes/interactive/interactive-mode.js +75 -10
  132. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  133. package/dist/modes/rpc/rpc-client.d.ts +13 -8
  134. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  135. package/dist/modes/rpc/rpc-client.js +8 -1
  136. package/dist/modes/rpc/rpc-client.js.map +1 -1
  137. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  138. package/dist/modes/rpc/rpc-mode.js +4 -0
  139. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  140. package/dist/modes/rpc/rpc-types.d.ts +14 -3
  141. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  142. package/dist/modes/rpc/rpc-types.js.map +1 -1
  143. package/dist/utils/git-env.d.ts +10 -0
  144. package/dist/utils/git-env.d.ts.map +1 -0
  145. package/dist/utils/git-env.js +33 -0
  146. package/dist/utils/git-env.js.map +1 -0
  147. package/docs/compaction.md +185 -50
  148. package/docs/custom-provider.md +11 -9
  149. package/docs/extensions.md +46 -42
  150. package/docs/index.md +13 -6
  151. package/docs/json.md +15 -12
  152. package/docs/packages.md +2 -0
  153. package/docs/providers.md +4 -1
  154. package/docs/quickstart.md +18 -11
  155. package/docs/rpc.md +38 -23
  156. package/docs/sdk.md +17 -8
  157. package/docs/session-format.md +26 -13
  158. package/docs/sessions.md +3 -3
  159. package/docs/settings.md +2 -2
  160. package/docs/skills.md +1 -15
  161. package/docs/termux.md +9 -10
  162. package/docs/themes.md +2 -2
  163. package/docs/tmux.md +3 -3
  164. package/docs/tui.md +19 -32
  165. package/docs/usage.md +2 -2
  166. package/docs/workflows.md +60 -16
  167. package/package.json +6 -12
  168. package/dist/builtin/subagents/skills/browser-use/SKILL.md +0 -234
  169. package/dist/builtin/subagents/skills/browser-use/references/cdp-python.md +0 -76
  170. package/dist/builtin/subagents/skills/browser-use/references/multi-session.md +0 -92
  171. package/node_modules/@earendil-works/pi-tui/README.md +0 -779
  172. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +0 -54
  173. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +0 -1
  174. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -632
  175. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +0 -1
  176. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +0 -22
  177. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +0 -1
  178. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -104
  179. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +0 -1
  180. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +0 -22
  181. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +0 -1
  182. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +0 -35
  183. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +0 -1
  184. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +0 -249
  185. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +0 -1
  186. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +0 -1857
  187. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +0 -1
  188. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +0 -28
  189. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +0 -1
  190. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -89
  191. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +0 -1
  192. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +0 -37
  193. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +0 -1
  194. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +0 -378
  195. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +0 -1
  196. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -31
  197. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +0 -1
  198. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +0 -69
  199. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +0 -1
  200. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +0 -96
  201. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +0 -1
  202. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -644
  203. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +0 -1
  204. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +0 -50
  205. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +0 -1
  206. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +0 -159
  207. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +0 -1
  208. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +0 -50
  209. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +0 -1
  210. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +0 -185
  211. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +0 -1
  212. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +0 -12
  213. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +0 -1
  214. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -23
  215. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +0 -1
  216. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +0 -19
  217. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +0 -1
  218. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -89
  219. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +0 -1
  220. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +0 -13
  221. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +0 -1
  222. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -51
  223. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +0 -1
  224. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +0 -39
  225. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +0 -1
  226. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +0 -2
  227. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +0 -1
  228. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +0 -16
  229. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +0 -1
  230. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +0 -110
  231. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +0 -1
  232. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +0 -23
  233. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +0 -1
  234. package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -32
  235. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +0 -1
  236. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +0 -193
  237. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +0 -1
  238. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +0 -174
  239. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +0 -1
  240. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +0 -184
  241. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +0 -1
  242. package/node_modules/@earendil-works/pi-tui/dist/keys.js +0 -1173
  243. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +0 -1
  244. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +0 -28
  245. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +0 -1
  246. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +0 -44
  247. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +0 -1
  248. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +0 -3
  249. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +0 -1
  250. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +0 -53
  251. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +0 -1
  252. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +0 -50
  253. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +0 -1
  254. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +0 -361
  255. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +0 -1
  256. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -90
  257. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +0 -1
  258. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -366
  259. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +0 -1
  260. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +0 -113
  261. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +0 -1
  262. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +0 -472
  263. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +0 -1
  264. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +0 -227
  265. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +0 -1
  266. package/node_modules/@earendil-works/pi-tui/dist/tui.js +0 -1106
  267. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +0 -1
  268. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +0 -17
  269. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +0 -1
  270. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +0 -25
  271. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +0 -1
  272. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -84
  273. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +0 -1
  274. package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -1029
  275. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +0 -1
  276. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +0 -25
  277. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +0 -1
  278. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +0 -96
  279. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +0 -1
  280. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  281. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  282. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  283. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  284. package/node_modules/@earendil-works/pi-tui/package.json +0 -47
  285. package/node_modules/get-east-asian-width/index.d.ts +0 -60
  286. package/node_modules/get-east-asian-width/index.js +0 -30
  287. package/node_modules/get-east-asian-width/license +0 -9
  288. package/node_modules/get-east-asian-width/lookup-data.js +0 -21
  289. package/node_modules/get-east-asian-width/lookup.js +0 -138
  290. package/node_modules/get-east-asian-width/package.json +0 -71
  291. package/node_modules/get-east-asian-width/readme.md +0 -65
  292. package/node_modules/get-east-asian-width/utilities.js +0 -24
  293. package/node_modules/marked/LICENSE.md +0 -44
  294. package/node_modules/marked/README.md +0 -106
  295. package/node_modules/marked/bin/main.js +0 -282
  296. package/node_modules/marked/bin/marked.js +0 -15
  297. package/node_modules/marked/lib/marked.cjs +0 -2211
  298. package/node_modules/marked/lib/marked.cjs.map +0 -7
  299. package/node_modules/marked/lib/marked.d.cts +0 -728
  300. package/node_modules/marked/lib/marked.d.ts +0 -728
  301. package/node_modules/marked/lib/marked.esm.js +0 -2189
  302. package/node_modules/marked/lib/marked.esm.js.map +0 -7
  303. package/node_modules/marked/lib/marked.umd.js +0 -2213
  304. package/node_modules/marked/lib/marked.umd.js.map +0 -7
  305. package/node_modules/marked/man/marked.1 +0 -111
  306. package/node_modules/marked/man/marked.1.md +0 -92
  307. package/node_modules/marked/marked.min.js +0 -69
  308. package/node_modules/marked/package.json +0 -111
@@ -21,8 +21,8 @@
21
21
  *
22
22
  * The refinement loop has been re-shaped so that the artifact under review is
23
23
  * a real HTML page on disk (`preview.html`). The workflow attempts to open it
24
- * through `browser-use` so the user can interactively review and annotate;
25
- * when browser-use is unavailable, the file path is surfaced so the user
24
+ * through the `browser` skill so the user can interactively review;
25
+ * when browser automation is unavailable, the file path is surfaced so the user
26
26
  * can open it manually. The final exporter produces a rich `spec.html` that
27
27
  * embeds the agreed-upon design alongside the implementation handoff.
28
28
  */
@@ -53,7 +53,10 @@ type PromptSection = readonly [tag: string, content: string];
53
53
 
54
54
  function taggedPrompt(sections: readonly PromptSection[]): string {
55
55
  return sections
56
- .map(([tag, content]) => `<${tag}>\n${content.trim()}\n</${tag}>`)
56
+ .map(([tag, content]) => {
57
+ const trimmed = content.trim();
58
+ return `<${tag}>\n${trimmed}\n</${tag}>`;
59
+ })
57
60
  .join("\n\n");
58
61
  }
59
62
 
@@ -79,28 +82,135 @@ function isFileLike(value: string): boolean {
79
82
  return trimmed.length > 0 && !isUrl(trimmed);
80
83
  }
81
84
 
82
- function refinementComplete(text: string): boolean {
83
- const normalized = text.toLowerCase();
84
- return (
85
- normalized.includes("refinement complete") ||
86
- normalized.includes("approved for export") ||
87
- normalized.trim() === "done"
88
- );
85
+ type RefinementDecision = {
86
+ readonly ready_for_export: boolean;
87
+ readonly rationale: string;
88
+ readonly required_changes: readonly string[];
89
+ };
90
+
91
+ type ExportGateFinding = {
92
+ readonly finding: string;
93
+ readonly evidence: string;
94
+ readonly why_blocking: string;
95
+ readonly must_fix_action: string;
96
+ readonly severity: "P0";
97
+ };
98
+
99
+ type ExportGateDecision = {
100
+ readonly has_blocking_findings: boolean;
101
+ readonly rationale: string;
102
+ readonly blocking_findings: readonly ExportGateFinding[];
103
+ };
104
+
105
+ const refinementDecisionSchema = {
106
+ type: "object",
107
+ additionalProperties: false,
108
+ required: ["ready_for_export", "rationale", "required_changes"],
109
+ properties: {
110
+ ready_for_export: { type: "boolean" },
111
+ rationale: { type: "string" },
112
+ required_changes: { type: "array", items: { type: "string" } },
113
+ },
114
+ } as const;
115
+
116
+ const refinementDecisionTool = {
117
+ name: "refinement_decision",
118
+ label: "Refinement Decision",
119
+ description: "Emit the structured design refinement decision.",
120
+ promptSnippet: "Emit the final refinement decision as structured data",
121
+ promptGuidelines: [
122
+ "Call refinement_decision after inspecting the preview and deciding whether another refinement iteration is needed.",
123
+ "This is a terminating structured-output tool; do not emit another assistant response after calling it.",
124
+ ],
125
+ parameters: refinementDecisionSchema,
126
+ async execute(_toolCallId: string, params: RefinementDecision) {
127
+ return {
128
+ content: [{ type: "text" as const, text: JSON.stringify(params, null, 2) }],
129
+ details: params,
130
+ terminate: true,
131
+ };
132
+ },
133
+ };
134
+
135
+ const exportGateDecisionSchema = {
136
+ type: "object",
137
+ additionalProperties: false,
138
+ required: ["has_blocking_findings", "rationale", "blocking_findings"],
139
+ properties: {
140
+ has_blocking_findings: { type: "boolean" },
141
+ rationale: { type: "string" },
142
+ blocking_findings: {
143
+ type: "array",
144
+ items: {
145
+ type: "object",
146
+ additionalProperties: false,
147
+ required: ["finding", "evidence", "why_blocking", "must_fix_action", "severity"],
148
+ properties: {
149
+ finding: { type: "string" },
150
+ evidence: { type: "string" },
151
+ why_blocking: { type: "string" },
152
+ must_fix_action: { type: "string" },
153
+ severity: { type: "string", enum: ["P0"] },
154
+ },
155
+ },
156
+ },
157
+ },
158
+ } as const;
159
+
160
+ const exportGateDecisionTool = {
161
+ name: "export_gate_decision",
162
+ label: "Export Gate Decision",
163
+ description: "Emit the structured pre-export gate decision.",
164
+ promptSnippet: "Emit the final export gate decision as structured data",
165
+ promptGuidelines: [
166
+ "Call export_gate_decision after auditing the preview for blocking findings.",
167
+ "This is a terminating structured-output tool; do not emit another assistant response after calling it.",
168
+ ],
169
+ parameters: exportGateDecisionSchema,
170
+ async execute(_toolCallId: string, params: ExportGateDecision) {
171
+ return {
172
+ content: [{ type: "text" as const, text: JSON.stringify(params, null, 2) }],
173
+ details: params,
174
+ terminate: true,
175
+ };
176
+ },
177
+ };
178
+
179
+ function parseRefinementDecision(text: string): RefinementDecision {
180
+ const parsed = JSON.parse(text) as Partial<RefinementDecision>;
181
+ if (typeof parsed.ready_for_export !== "boolean") {
182
+ throw new Error("open-claude-design refinement decision missing ready_for_export.");
183
+ }
184
+ return {
185
+ ready_for_export: parsed.ready_for_export,
186
+ rationale: typeof parsed.rationale === "string" ? parsed.rationale : "",
187
+ required_changes: Array.isArray(parsed.required_changes)
188
+ ? parsed.required_changes.filter((item): item is string => typeof item === "string")
189
+ : [],
190
+ };
89
191
  }
90
192
 
91
- function hasBlockingFindings(text: string): boolean {
92
- const normalized = text.toLowerCase();
93
- if (
94
- normalized.includes("no blocking findings") ||
95
- normalized.includes("no banned anti-patterns")
96
- ) {
97
- return false;
193
+ function parseExportGateDecision(text: string): ExportGateDecision {
194
+ const parsed = JSON.parse(text) as Partial<ExportGateDecision>;
195
+ if (typeof parsed.has_blocking_findings !== "boolean") {
196
+ throw new Error("open-claude-design export gate decision missing has_blocking_findings.");
98
197
  }
99
- return (
100
- normalized.includes("blocking") ||
101
- normalized.includes("banned anti-pattern") ||
102
- normalized.includes("must fix")
103
- );
198
+ return {
199
+ has_blocking_findings: parsed.has_blocking_findings,
200
+ rationale: typeof parsed.rationale === "string" ? parsed.rationale : "",
201
+ blocking_findings: Array.isArray(parsed.blocking_findings)
202
+ ? parsed.blocking_findings.filter(
203
+ (item): item is ExportGateFinding =>
204
+ typeof item === "object" &&
205
+ item !== null &&
206
+ "finding" in item &&
207
+ "evidence" in item &&
208
+ "why_blocking" in item &&
209
+ "must_fix_action" in item &&
210
+ "severity" in item,
211
+ )
212
+ : [],
213
+ };
104
214
  }
105
215
 
106
216
  function joinResults(results: readonly WorkflowTaskResult[]): string {
@@ -151,7 +261,7 @@ function prepareArtifactDir(cwd = process.cwd()): {
151
261
  }
152
262
 
153
263
  const HTML_PREVIEW_RULES = [
154
- "Produce a single self-contained HTML5 document. Inline all CSS in a <style> block and inline any JS in a <script> block; no external network requests except Google Fonts when explicitly required.",
264
+ "Produce a single self-contained HTML document. Inline all CSS in a <style> block and inline any JS in a <script> block; no external network requests except Google Fonts when explicitly required.",
155
265
  "Embed realistic content that respects the design brief — no Lorem ipsum, no obvious placeholders.",
156
266
  "Implement responsive behavior with sensible breakpoints (use container queries or media queries) so the file renders well from 360px up to 1440px.",
157
267
  "Cover at minimum: default state, hover/focus state for every interactive element, empty state if relevant, loading state if relevant, error state if relevant.",
@@ -166,15 +276,14 @@ const ANTI_SLOP_RULES = [
166
276
  ].join("\n");
167
277
 
168
278
  const BROWSER_USE_BOOTSTRAP_RULES = [
169
- "Probe for browser-use availability with `browser-use --version` (or `bunx browser-use --version` when relying on an ephemeral Bun execution). Do not install browser-use itself.",
170
- "If browser-use is available but opening a page fails because Chrome, Chrome for Testing, Chromium, or another browser executable is not installed, first run `browser-use doctor`, then run `browser-use setup` if the doctor output recommends setup, and retry the browser action once.",
171
- "Only install or configure the missing browser runtime; do not install npm packages, change project dependencies, or repeatedly retry failed setup.",
172
- "If browser-use is unavailable or browser setup still fails, degrade gracefully and surface the manual file path / URL.",
279
+ "Probe for the browser skill's `browse` CLI with `which browse`; if it is unavailable, install the CLI with `npm install -g browse` as documented by the skill, then retry once. Do not add project dependencies.",
280
+ "Use `browse open <url> --local --headed` when a generated local preview should be visible to the user, and use `browse snapshot` plus `browse screenshot --path <file>` for review evidence.",
281
+ "If `browse` is unavailable after three attempts or the browser runtime still fails, degrade gracefully and surface the manual file path / URL.",
173
282
  ].join("\n");
174
283
 
175
284
  export default defineWorkflow("open-claude-design")
176
285
  .description(
177
- "AI-powered design workflow: design-system onboarding → reference import → HTML generation → impeccable-driven refinement → quality gate → rich HTML handoff. Each stage delegates to a specific impeccable sub-skill; the user can iteratively review and annotate the generated HTML through browser-use.",
286
+ "AI-powered design workflow: design-system onboarding → reference import → HTML generation → impeccable-driven refinement → quality gate → rich HTML handoff. Each stage delegates to a specific impeccable sub-skill; the user can iteratively review the generated HTML through the browser skill.",
178
287
  )
179
288
  .input("prompt", Type.String({
180
289
  description: "What to design (for example, a dashboard, page, component, or prototype).",
@@ -226,13 +335,23 @@ export default defineWorkflow("open-claude-design")
226
335
  const specFileUrl = `file://${specPath}`;
227
336
 
228
337
  const designModelConfig = {
229
- model: "anthropic/claude-opus-4-8:xhigh",
338
+ model: "github-copilot/claude-opus-4.8:xhigh",
230
339
  fallbackModels: [
231
- "github-copilot/claude-opus-4.8:medium",
232
- "anthropic/claude-sonnet-4-6:xhigh",
233
- "github-copilot/claude-sonnet-4.6:medium",
340
+ "anthropic/claude-opus-4-8:xhigh",
341
+ "github-copilot/claude-sonnet-4.6:high",
342
+ "anthropic/claude-sonnet-4-6:high",
234
343
  ],
235
344
  };
345
+ const refinementDecisionConfig = {
346
+ ...designModelConfig,
347
+ tools: [refinementDecisionTool.name],
348
+ customTools: [refinementDecisionTool],
349
+ };
350
+ const exportGateDecisionConfig = {
351
+ ...designModelConfig,
352
+ tools: [exportGateDecisionTool.name],
353
+ customTools: [exportGateDecisionTool],
354
+ };
236
355
 
237
356
  let designSystem: string;
238
357
  let onboarding: readonly WorkflowTaskResult[] = [];
@@ -242,17 +361,13 @@ export default defineWorkflow("open-claude-design")
242
361
  prompt: taggedPrompt([
243
362
  [
244
363
  "role",
245
- "You are an impeccable design-system analyst. Apply the impeccable `document` sub-skill to read an existing DESIGN.md / PRODUCT.md (or equivalent) and re-emit it in the six-section Google Stitch DESIGN.md format so the rest of this workflow can rely on it.",
364
+ "You are an opinionated staff design engineer.",
246
365
  ],
247
366
  [
248
367
  "objective",
249
- `Prepare a six-section DESIGN.md-shaped brief that will steer generation of: ${prompt}`,
368
+ `Prepare a six-section DESIGN.md-shaped brief that will steer generation of: ${prompt}. Apply the impeccable \`document\` sub-skill to read an existing DESIGN.md / PRODUCT.md (or equivalent).`,
250
369
  ],
251
370
  ["design_system_reference", designSystemInput],
252
- [
253
- "impeccable_skill",
254
- "document — generate a spec-compliant DESIGN.md (Overview, Colors, Typography, Elevation, Components, Do's and Don'ts) in fixed order with fixed names. Headers must be parseable by downstream tools.",
255
- ],
256
371
  [
257
372
  "instructions",
258
373
  [
@@ -288,15 +403,11 @@ export default defineWorkflow("open-claude-design")
288
403
  task: taggedPrompt([
289
404
  [
290
405
  "role",
291
- "You are an impeccable design-system locator. Apply the impeccable `extract` sub-skill to find design-system evidence already living in this codebase.",
406
+ "You are an opinionated staff design engineer.",
292
407
  ],
293
408
  [
294
409
  "objective",
295
- `Find UI/design-system sources for this request: ${prompt}`,
296
- ],
297
- [
298
- "impeccable_skill",
299
- "extract — only flag patterns used three or more times with the same intent. Two usages are not a pattern. Identify tokens, components, composition patterns, type styles, and motion patterns.",
410
+ `Find UI/design-system sources for this request: ${prompt}. Apply the impeccable \`extract\` sub-skill to find design-system evidence already living in this codebase.`,
300
411
  ],
301
412
  [
302
413
  "instructions",
@@ -319,11 +430,11 @@ export default defineWorkflow("open-claude-design")
319
430
  task: taggedPrompt([
320
431
  [
321
432
  "role",
322
- "You are an impeccable UI architecture auditor. Apply the impeccable `audit` sub-skill to score the project's UI implementation across five dimensions.",
433
+ "You are an opinionated staff design engineer.",
323
434
  ],
324
435
  [
325
436
  "objective",
326
- `Audit the project UI constraints that must shape: ${prompt}`,
437
+ `Audit the project UI constraints that must shape: ${prompt}. Apply the impeccable \`audit\` sub-skill to evaluate the located design-system evidence against impeccable's six dimensions of design quality and produce a detailed report with actionable insights for generation.`,
327
438
  ],
328
439
  [
329
440
  "impeccable_skill",
@@ -359,15 +470,11 @@ export default defineWorkflow("open-claude-design")
359
470
  task: taggedPrompt([
360
471
  [
361
472
  "role",
362
- "You are an impeccable pattern miner. Apply the impeccable `extract` sub-skill to harvest reusable design and component patterns, plus the anti-patterns to avoid.",
473
+ "You are an opinionated staff design engineer.",
363
474
  ],
364
475
  [
365
476
  "objective",
366
- `Extract reusable patterns and anti-patterns for: ${prompt}`,
367
- ],
368
- [
369
- "impeccable_skill",
370
- "extract — only extract things used 3+ times with the same intent. Never extract speculatively. Always note migration implications.",
477
+ `Extract reusable patterns and anti-patterns for: ${prompt}. Apply the impeccable \`extract\` sub-skill to find design patterns that should be reused and anti-patterns that must be avoided in generation.`,
371
478
  ],
372
479
  [
373
480
  "instructions",
@@ -393,15 +500,11 @@ export default defineWorkflow("open-claude-design")
393
500
  prompt: taggedPrompt([
394
501
  [
395
502
  "role",
396
- "You are an impeccable design-system author. Apply the impeccable `document` sub-skill to synthesize a project-specific DESIGN.md in the six-section Google Stitch format from the three onboarding analyses.",
503
+ "You are a staff design enginer.",
397
504
  ],
398
505
  [
399
506
  "objective",
400
- `Build the project DESIGN.md that will steer generation for: ${prompt}`,
401
- ],
402
- [
403
- "impeccable_skill",
404
- "document — output the six fixed sections in fixed order: Overview, Colors, Typography, Elevation, Components, Do's and Don'ts. Pick a single named Creative North Star metaphor; use descriptive color names; commit to non-default fonts when justified.",
507
+ `Build the project DESIGN.md that will steer generation for: ${prompt}. Apply the impeccable \`document\` sub-skill to synthesize a coherent design system spec from the located evidence, audit findings, and pattern analysis. This is the most critical step for generation quality; use impeccable's design knowledge to make smart calls when evidence conflicts or is incomplete.`,
405
508
  ],
406
509
  ["onboarding_analysis", "{previous}"],
407
510
  [
@@ -441,23 +544,19 @@ export default defineWorkflow("open-claude-design")
441
544
  task: taggedPrompt([
442
545
  [
443
546
  "role",
444
- "You are an impeccable reference extractor for live web pages. Apply the impeccable `extract` sub-skill to pull only the design traits that should transfer into the project — never just clone the source.",
547
+ "You are a staff QA engineer with design expertise.",
445
548
  ],
446
549
  [
447
550
  "objective",
448
- `Capture transferable design intent from this reference for: ${prompt}`,
551
+ `Capture transferable design intent from this reference for: ${prompt}. Apply the impeccable \`extract\` sub-skill to lift concrete, citable design traits from the reference URL. Use browser/screenshot tooling if available; never guess about visual traits without observable evidence.`,
449
552
  ],
450
553
  ["reference_url", reference],
451
- [
452
- "impeccable_skill",
453
- "extract — separate one-off styling from repeated, intentional patterns. Only carry forward what is used 3+ times or what is structurally load-bearing.",
454
- ],
455
- ["browser_use_bootstrap", BROWSER_USE_BOOTSTRAP_RULES],
554
+ ["browser_use_guidelines", BROWSER_USE_BOOTSTRAP_RULES],
456
555
  [
457
556
  "instructions",
458
557
  [
459
- "1. Use browser/screenshot tooling (e.g. browser-use) if available; cite observable evidence rather than guessing.",
460
- "2. If browser-use is available but opening the reference URL reports a missing browser executable, follow the bootstrap rules and retry once.",
558
+ "1. Use browser/screenshot tooling (for example the browser skill's `browse` CLI) if available; cite observable evidence rather than guessing.",
559
+ "2. If `browse` is available but opening the reference URL reports a missing browser executable, follow the bootstrap rules and retry once.",
461
560
  "3. Analyze: layout, visual hierarchy, navigation, color, typography, spacing, states, interactions, responsive behavior.",
462
561
  "4. Separate reference-specific styling from requirements that should transfer to this project's design system.",
463
562
  "5. If the URL is inaccessible or browser bootstrap fails, state that and provide a best-effort fallback based only on available information — never fabricate observations.",
@@ -477,17 +576,13 @@ export default defineWorkflow("open-claude-design")
477
576
  task: taggedPrompt([
478
577
  [
479
578
  "role",
480
- "You are an impeccable reference parser for local design files. Apply the impeccable `extract` sub-skill to lift concrete, citable requirements out of supplied references.",
579
+ "You are an opinionated staff design engineer.",
481
580
  ],
482
581
  [
483
582
  "objective",
484
- `Extract actionable design requirements for: ${prompt}`,
583
+ `Extract actionable design requirements for: ${prompt}. Apply the impeccable \`extract\` sub-skill to pull out concrete, citable design requirements from this reference file or doc. The reference might be a design file, a screenshot, a code file, or a design doc; adapt your extraction approach accordingly but never guess about traits that are not explicitly observable in the source.`,
485
584
  ],
486
585
  ["reference", reference],
487
- [
488
- "impeccable_skill",
489
- "extract — quote or cite concrete sections/paths; never hallucinate content that is not in the source.",
490
- ],
491
586
  [
492
587
  "instructions",
493
588
  [
@@ -519,21 +614,17 @@ export default defineWorkflow("open-claude-design")
519
614
  prompt: taggedPrompt([
520
615
  [
521
616
  "role",
522
- "You are an impeccable design-and-build engineer. Apply the impeccable `craft` sub-skill to ship a production-quality HTML artifact that traces back to the synthesized DESIGN.md.",
617
+ "You are an opinionated staff design engineer.",
523
618
  ],
524
619
  [
525
620
  "objective",
526
- `Generate the first revision of a production-ready ${outputType} for: ${prompt}. Write it to disk as an interactive HTML preview the user can open in a browser.`,
527
- ],
528
- [
529
- "impeccable_skill",
530
- "craft — four phases: (1) read the brief, (2) load relevant references, (3) build with deliberate ordering (structure → spacing/hierarchy → type/color → states → motion → responsive), (4) iterate visually. Every decision must trace back to the brief.",
621
+ `Generate the first revision of a production-ready ${outputType} for: ${prompt}. Write it to disk as an interactive HTML preview the user can open in a browser. Apply the impeccable \`craft\` sub-skill to build the design with deliberate ordering and impeccable attention to detail. Every design decision must trace back to the brief, and every visual trait must be justified by the design system or reference context.`,
531
622
  ],
532
623
  ["design_system", designSystem],
533
624
  ["reference_context", importContext],
534
625
  ["preview_artifact_path", previewPath],
535
626
  ["html_rules", HTML_PREVIEW_RULES],
536
- ["anti_slop_rules", ANTI_SLOP_RULES],
627
+ ["anti_design_slop_rules", ANTI_SLOP_RULES],
537
628
  [
538
629
  "instructions",
539
630
  [
@@ -566,29 +657,29 @@ export default defineWorkflow("open-claude-design")
566
657
  let approvedForExport = false;
567
658
  let refinementCount = 0;
568
659
 
569
- // Try to display the freshly generated preview to the user via browser-use.
660
+ // Try to display the freshly generated preview to the user via browser.
570
661
  await ctx
571
662
  .task("preview-display-initial", {
572
663
  prompt: taggedPrompt([
573
664
  [
574
665
  "role",
575
- "You are a preview presenter. Your job is to make the just-generated HTML artifact visible to the user so they can give feedback.",
666
+ "You are an opinionated staff design engineer.",
576
667
  ],
577
668
  [
578
669
  "objective",
579
- "Open the HTML preview file in a browser using browser-use and prompt the user for annotated feedback. Gracefully degrade if browser-use is unavailable.",
670
+ "Your job is to make the just-generated HTML artifact visible to the user so they can give feedback. Open the HTML preview file using the browser skill's `browse` CLI when available, then prompt the user for feedback. Gracefully degrade if browser automation is unavailable.",
580
671
  ],
581
672
  ["preview_path", previewPath],
582
673
  ["preview_file_url", previewFileUrl],
583
- ["browser_use_bootstrap", BROWSER_USE_BOOTSTRAP_RULES],
674
+ ["browser_use_guidelines", BROWSER_USE_BOOTSTRAP_RULES],
584
675
  [
585
676
  "instructions",
586
677
  [
587
- "1. Probe for browser-use availability using the bootstrap rules above.",
588
- `2. If available, run: \`browser-use open ${previewFileUrl}\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
589
- "3. Then run `browser-use show --annotate` so the user can draw boxes and leave notes directly on the live page.",
590
- "4. Once the user finishes annotating, capture the returned annotated snapshot path / notes and surface them in your output.",
591
- `5. If browser-use is NOT available or browser bootstrap fails, print a clear instruction block telling the user to open the file manually at: ${previewPath} (or via the URL ${previewFileUrl}).`,
678
+ "1. Probe for `browse` availability using the bootstrap rules above.",
679
+ `2. If available, run: \`browse open ${previewFileUrl} --local --headed\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
680
+ "3. Then run `browse snapshot` and use any available annotation/review flow from the active browser environment; if none exists, ask the user to review the visible page or manual file path and provide notes inline.",
681
+ "4. Capture any annotation artifact path, screenshot path, or user notes and surface them in your output.",
682
+ `5. If \`browse\` is NOT available or browser bootstrap fails, print a clear instruction block telling the user to open the file manually at: ${previewPath} (or via the URL ${previewFileUrl}).`,
592
683
  "6. Never block the workflow on unavailable tooling; always exit with a non-empty status string.",
593
684
  ].join("\n"),
594
685
  ],
@@ -608,15 +699,11 @@ export default defineWorkflow("open-claude-design")
608
699
  prompt: taggedPrompt([
609
700
  [
610
701
  "role",
611
- "You are an impeccable design reviewer collecting actionable refinement feedback from the user about the rendered HTML preview. Apply the impeccable `critique` sub-skill to decide whether the artifact is ready.",
702
+ "You are a staff product manager with deep design and engineering empathy collecting actionable refinement feedback from the user about the rendered HTML preview. You call out bs because the user is your partner, not your boss; you want to get to a great design together, and that means being honest about what you don't like and what the user won't like. You are user-experience-obsessed.",
612
703
  ],
613
704
  [
614
705
  "objective",
615
- `Decide whether refinement is needed for iteration ${iteration}/${maxRefinements} of: ${prompt}.`,
616
- ],
617
- [
618
- "impeccable_skill",
619
- "critique — score Nielsen's 10 heuristics 0–4, cognitive-load count 0–8, persona-based passes, cross-check the 25 anti-pattern detector. Produce a prioritized list, not free-form prose.",
706
+ `Decide whether refinement is needed for iteration ${iteration}/${maxRefinements} of: ${prompt}. Apply the impeccable \`critique\` sub-skill to decide whether the artifact is ready. Score Nielsen's 10 heuristics 0–4, cognitive-load count 0–8, persona-based passes, cross-check the 25 anti-pattern detector. Produce a prioritized list, not free-form prose.`,
620
707
  ],
621
708
  ["preview_path", previewPath],
622
709
  ["preview_file_url", previewFileUrl],
@@ -626,21 +713,26 @@ export default defineWorkflow("open-claude-design")
626
713
  [
627
714
  "1. If a previous `preview-display-*` step captured annotated user feedback or notes, honor them as the primary signal.",
628
715
  "2. Otherwise, you may inspect the HTML file at preview_path directly (read it from disk) and run an impeccable `critique` against it.",
629
- "3. If the current design is ready for export, reply with the exact phrase `refinement complete — <reason>`.",
630
- "4. Otherwise, list specific changes needed, ordered by user value and implementation risk. Prefer concrete fixes over subjective taste notes.",
716
+ "3. Decide whether the current design is ready for export using the refinement_decision structured-output tool.",
717
+ "4. If refinement is still needed, put specific changes in required_changes ordered by user value and implementation risk.",
631
718
  "5. Never request changes that contradict DESIGN.md unless you explicitly identify and explain the conflict.",
632
719
  ].join("\n"),
633
720
  ],
634
721
  [
635
722
  "output_format",
636
- "Either the literal phrase `refinement complete — <reason>`, OR markdown bullets grouped under `Priority 1`, `Priority 2`, `Priority 3` headings.",
723
+ [
724
+ "Call the refinement_decision tool after your inspection.",
725
+ "Set ready_for_export=true only when the current preview needs no further refinement before export.",
726
+ "Set ready_for_export=false and populate required_changes when another polish iteration is needed.",
727
+ ].join("\n"),
637
728
  ],
638
729
  ]),
639
730
  previous: { name: "current-design", text: latestDesign },
640
- ...designModelConfig,
731
+ ...refinementDecisionConfig,
641
732
  });
642
733
 
643
- if (refinementComplete(feedback.text)) {
734
+ const feedbackDecision = parseRefinementDecision(feedback.text);
735
+ if (feedbackDecision.ready_for_export) {
644
736
  approvedForExport = true;
645
737
  break;
646
738
  }
@@ -652,15 +744,11 @@ export default defineWorkflow("open-claude-design")
652
744
  task: taggedPrompt([
653
745
  [
654
746
  "role",
655
- "You are an impeccable design critic. Apply the impeccable `critique` sub-skill to run the formal two-pass review against the live HTML preview.",
747
+ "You are a staff product manager with deep design and engineering empathy collecting actionable refinement feedback from the user about the rendered HTML preview. You call out bs because the user is your partner, not your boss; you want to get to a great design together, and that means being honest about what you don't like and what the user won't like. You are user-experience-obsessed.",
656
748
  ],
657
749
  [
658
750
  "objective",
659
- `Critique the current ${outputType} for: ${prompt}. Produce the formal impeccable critique report.`,
660
- ],
661
- [
662
- "impeccable_skill",
663
- "critique — two parallel passes: (a) LLM design review with Nielsen heuristic scores (0–4), cognitive-load failure count (0–8), persona scoring, and AI-slop verdict; (b) deterministic detector for the 25 anti-patterns (gradient text, purple palettes, side-tab borders, nested cards, line-length issues, etc.).",
751
+ `Critique the current ${outputType} for: ${prompt}. Produce the formal impeccable critique report. Apply the impeccable \`critique\` sub-skill to run the formal two-pass review against the live HTML preview.`,
664
752
  ],
665
753
  ["preview_path", previewPath],
666
754
  ["current_design_and_feedback", "{previous}"],
@@ -695,30 +783,26 @@ export default defineWorkflow("open-claude-design")
695
783
  task: taggedPrompt([
696
784
  [
697
785
  "role",
698
- "You are an impeccable visual QA specialist for the rendered HTML preview. Apply the impeccable `audit` plus `live` sub-skills to validate the rendered output against breakpoints, states, and accessibility.",
786
+ "You are a staff QA engineer with design expertise.",
699
787
  ],
700
788
  [
701
789
  "objective",
702
- `Validate visual implementation risks for: ${prompt}.`,
703
- ],
704
- [
705
- "impeccable_skill",
706
- "audit + live — `audit` covers contrast, performance, theming, responsive, anti-patterns with P0–P3 severities; `live` validates against the actual rendered page in a real browser, not the source.",
790
+ `Validate visual implementation risks for: ${prompt}. Apply the impeccable \`audit + live\` sub-skills to run a live audit against the rendered HTML preview, validating or invalidating every visual risk with evidence from the actual rendered page in a real browser, not just the source code.`,
707
791
  ],
708
792
  ["preview_path", previewPath],
709
793
  ["preview_file_url", previewFileUrl],
710
794
  ["current_design_and_feedback", "{previous}"],
711
795
  [
712
- "browser_use_bootstrap",
796
+ "browser_use_guidelines",
713
797
  BROWSER_USE_BOOTSTRAP_RULES,
714
798
  ],
715
799
  [
716
800
  "instructions",
717
801
  [
718
- `1. Attempt rendering verification via browser-use: \`browser-use open ${previewFileUrl}\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
719
- `2. Then run \`browser-use resize 360 800\`, \`browser-use screenshot ${join(artifactDir, `mobile-${iteration}.png`)}\`, \`browser-use resize 1440 900\`, \`browser-use screenshot ${join(artifactDir, `desktop-${iteration}.png`)}\`.`,
802
+ `1. Attempt rendering verification via the browser skill: \`browse open ${previewFileUrl} --local\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
803
+ `2. Then run \`browse viewport 360 800\`, \`browse screenshot --path ${join(artifactDir, `mobile-${iteration}.png`)}\`, \`browse viewport 1440 900\`, \`browse screenshot --path ${join(artifactDir, `desktop-${iteration}.png`)}\`.`,
720
804
  "3. Check: contrast (WCAG AA), overflow, spacing rhythm, alignment, breakpoint behavior, empty/loading/error states, keyboard/pointer affordances, focus rings, prefers-reduced-motion.",
721
- "4. If browser-use is unavailable or browser bootstrap fails, perform a static design review of the HTML source and mark every finding as `needs-rendering-verification`.",
805
+ "4. If `browse` is unavailable or browser bootstrap fails, perform a static design review of the HTML source and mark every finding as `needs-rendering-verification`.",
722
806
  "5. Distinguish confirmed visual issues from risks that need rendering verification. Never fabricate rendered evidence.",
723
807
  ].join("\n"),
724
808
  ],
@@ -741,15 +825,11 @@ export default defineWorkflow("open-claude-design")
741
825
  prompt: taggedPrompt([
742
826
  [
743
827
  "role",
744
- "You are an impeccable design polisher. Apply the impeccable `polish` — the meticulous final pass between good and great — to revise the HTML preview in place.",
828
+ "You are an opinionated staff design engineer.",
745
829
  ],
746
830
  [
747
831
  "objective",
748
- `Produce the next ${outputType} revision for: ${prompt}. Update the HTML file in place; do not branch the artifact.`,
749
- ],
750
- [
751
- "impeccable_skill",
752
- "polish — work methodically across six dimensions: (1) visual alignment/spacing, (2) typography, (3) color/contrast, (4) interaction states, (5) transitions/motion, (6) copy. Refine; do not redesign.",
832
+ `Produce the next ${outputType} revision for: ${prompt}. Update the HTML file in place; do not branch the artifact. Apply the impeccable \`polish\` sub-skill to methodically apply the required changes, addressing every critique finding and screenshot-validated issue with surgical precision. This is not a redesign; it's a focused polish iteration to get from the current design to an export-ready state in one step.`,
753
833
  ],
754
834
  ["design_system", designSystem],
755
835
  ["preview_artifact_path", previewPath],
@@ -791,7 +871,7 @@ export default defineWorkflow("open-claude-design")
791
871
  prompt: taggedPrompt([
792
872
  [
793
873
  "role",
794
- "You are a preview presenter. Re-open the revised HTML preview so the user can review the latest iteration.",
874
+ "You are a staff product manager with expertise in design. Re-open the revised HTML preview so the user can review the latest iteration.",
795
875
  ],
796
876
  [
797
877
  "objective",
@@ -806,9 +886,9 @@ export default defineWorkflow("open-claude-design")
806
886
  [
807
887
  "instructions",
808
888
  [
809
- `1. If browser-use is available, run \`browser-use open ${previewFileUrl}\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
810
- "2. Then run `browser-use show --annotate` to invite annotated feedback.",
811
- `3. If browser-use is unavailable or browser bootstrap fails, surface the path clearly: ${previewPath} (URL: ${previewFileUrl}).`,
889
+ `1. If \`browse\` is available, run \`browse open ${previewFileUrl} --local --headed\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
890
+ "2. Then run `browse snapshot` and use any available annotation/review flow from the active browser environment; otherwise ask the user to provide feedback inline.",
891
+ `3. If \`browse\` is unavailable or browser bootstrap fails, surface the path clearly: ${previewPath} (URL: ${previewFileUrl}).`,
812
892
  "4. Return any captured annotations as structured notes the next user-feedback step can read.",
813
893
  "5. Do not block on unavailable tooling.",
814
894
  ].join("\n"),
@@ -827,15 +907,11 @@ export default defineWorkflow("open-claude-design")
827
907
  prompt: taggedPrompt([
828
908
  [
829
909
  "role",
830
- "You are an impeccable pre-release gate. Apply the impeccable `audit` sub-skill one final time to block export only for concrete, evidence-backed issues.",
910
+ "You are a staff product manager with deep design and engineering empathy collecting actionable refinement feedback from the user about the rendered HTML preview. You call out bs because the user is your partner, not your boss; you want to get to a great design together, and that means being honest about what you don't like and what the user won't like. You are user-experience-obsessed.",
831
911
  ],
832
912
  [
833
913
  "objective",
834
- `Final quality gate for this ${outputType}: ${prompt}. Decide whether the HTML preview at preview_path is safe to export.`,
835
- ],
836
- [
837
- "impeccable_skill",
838
- "audit — score Accessibility, Performance, Theming, Responsive, Anti-patterns 0–4. Only P0 (blocks release) findings should be marked blocking here.",
914
+ `Final quality gate for this ${outputType}: ${prompt}. Decide whether the HTML preview at preview_path is safe to export. Apply the impeccable \`audit\` sub-skill one final time to block export only for concrete, evidence-backed issues.`,
839
915
  ],
840
916
  ["preview_path", previewPath],
841
917
  ["final_design_summary", "{previous}"],
@@ -845,25 +921,30 @@ export default defineWorkflow("open-claude-design")
845
921
  "1. Read the HTML at preview_path and score it across all five audit dimensions.",
846
922
  "2. Scan for banned anti-patterns, accessibility blockers, severe visual regressions, missing critical states, and handoff gaps.",
847
923
  "3. Only mark findings as blocking when they would materially harm implementation or user experience (impeccable P0 severity).",
848
- "4. If safe to export, use the exact phrase `no blocking findings`.",
924
+ "4. Decide whether export is blocked using the export_gate_decision structured-output tool.",
849
925
  "5. Every blocking finding must include selector-level evidence and a must-fix action.",
850
926
  ].join("\n"),
851
927
  ],
852
928
  [
853
929
  "output_format",
854
- "Either the literal phrase `no blocking findings`, OR a markdown table: Finding | Evidence (selector/line) | Why blocking | Must-fix action | Severity (P0).",
930
+ [
931
+ "Call the export_gate_decision tool after the audit.",
932
+ "Set has_blocking_findings=true only when one or more P0 findings block export.",
933
+ "Populate blocking_findings with every blocking P0 issue; leave it empty when export is safe.",
934
+ ].join("\n"),
855
935
  ],
856
936
  ]),
857
937
  previous: { name: "final-design", text: latestDesign },
858
- ...designModelConfig,
938
+ ...exportGateDecisionConfig,
859
939
  });
860
940
 
861
- if (hasBlockingFindings(preExport.text)) {
941
+ const exportGateDecision = parseExportGateDecision(preExport.text);
942
+ if (exportGateDecision.has_blocking_findings) {
862
943
  const forcedFix = await ctx.task("forced-fix", {
863
944
  prompt: taggedPrompt([
864
945
  [
865
946
  "role",
866
- "You are an impeccable production-readiness hardener. Apply the impeccable `harden` sub-skill to remove blocking findings without redesigning.",
947
+ "You are an opinionated staff design engineer. Apply the impeccable `harden` sub-skill to remove blocking findings without redesigning.",
867
948
  ],
868
949
  [
869
950
  "objective",
@@ -902,15 +983,11 @@ export default defineWorkflow("open-claude-design")
902
983
  prompt: taggedPrompt([
903
984
  [
904
985
  "role",
905
- "You are an impeccable design documenter. Apply the impeccable `document` sub-skill to produce a RICH HTML SPEC that bundles the approved preview together with implementation guidance for a design/frontend engineer.",
986
+ "You are an opinionated staff design engineer.",
906
987
  ],
907
988
  [
908
989
  "objective",
909
- `Export the final ${outputType} for "${prompt}" as a rich HTML spec the engineering team can read directly in a browser. The spec must embed or link the approved preview so reviewers see exactly what is being implemented.`,
910
- ],
911
- [
912
- "impeccable_skill",
913
- "document — the spec must mirror the six-section DESIGN.md structure (Overview, Colors, Typography, Elevation, Components, Do's and Don'ts), plus implementation-handoff sections specific to this artifact.",
990
+ `Export the final ${outputType} for "${prompt}" as a rich HTML spec the engineering team can read directly in a browser. The spec must embed or link the approved preview so reviewers see exactly what is being implemented. Apply the impeccable \`document\` sub-skill to produce a rich HTML spec that bundles the approved preview together with implementation guidance for another design/frontend engineer to implement.`,
914
991
  ],
915
992
  ["design_system", designSystem],
916
993
  ["preview_artifact_path", previewPath],
@@ -930,14 +1007,14 @@ export default defineWorkflow("open-claude-design")
930
1007
  ].join("\n"),
931
1008
  ],
932
1009
  ["html_rules", HTML_PREVIEW_RULES],
933
- ["anti_slop_rules", ANTI_SLOP_RULES],
1010
+ ["anti_design_slop_rules", ANTI_SLOP_RULES],
934
1011
  [
935
1012
  "output_format",
936
1013
  [
937
1014
  "Return markdown with headings (NOT the HTML):",
938
1015
  "1. Spec written to (absolute path)",
939
1016
  "2. Sections included",
940
- "3. How to open the spec (browser-use command + manual fallback path)",
1017
+ "3. How to open the spec (browse command + manual fallback path)",
941
1018
  "4. Recommended files and components",
942
1019
  "5. Implementation steps",
943
1020
  "6. Usage example",
@@ -957,23 +1034,23 @@ export default defineWorkflow("open-claude-design")
957
1034
  prompt: taggedPrompt([
958
1035
  [
959
1036
  "role",
960
- "You are a final-spec presenter. Make the rich HTML spec visible to the user.",
1037
+ "You are an opinionated staff design engineer.",
961
1038
  ],
962
1039
  [
963
1040
  "objective",
964
- "Open the final spec.html in a browser via browser-use so the user can review the agreed design and implementation handoff. Degrade gracefully if browser-use is unavailable.",
1041
+ "Make the rich HTML spec visible to the user. Open the final spec.html with the browser skill's `browse` CLI so the user can review the agreed design and implementation handoff. Degrade gracefully if browser automation is unavailable.",
965
1042
  ],
966
1043
  ["spec_path", specPath],
967
1044
  ["spec_file_url", specFileUrl],
968
1045
  ["preview_path", previewPath],
969
1046
  ["preview_file_url", previewFileUrl],
970
- ["browser_use_bootstrap", BROWSER_USE_BOOTSTRAP_RULES],
1047
+ ["browser_use_guidelines", BROWSER_USE_BOOTSTRAP_RULES],
971
1048
  [
972
1049
  "instructions",
973
1050
  [
974
- "1. Probe for browser-use availability using the bootstrap rules above.",
975
- `2. If available, run \`browser-use open ${specFileUrl}\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
976
- "3. Then run `browser-use show --annotate` so the user can capture any final notes.",
1051
+ "1. Probe for `browse` availability using the bootstrap rules above.",
1052
+ `2. If available, run \`browse open ${specFileUrl} --local --headed\`. If that reports a missing browser executable, follow the bootstrap rules and retry once.`,
1053
+ "3. Then run `browse snapshot` and use any available annotation/review flow from the active browser environment so the user can capture any final notes.",
977
1054
  `4. Always print, prominently, the absolute paths so the user can open them manually:\n - Final spec: ${specPath}\n - Approved preview: ${previewPath}`,
978
1055
  "5. Do not block the workflow; return a structured summary even if no tooling worked.",
979
1056
  ].join("\n"),