@agent-native/core 0.37.3 → 0.39.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 (476) hide show
  1. package/README.md +19 -6
  2. package/dist/action.d.ts +60 -2
  3. package/dist/action.d.ts.map +1 -1
  4. package/dist/action.js +6 -2
  5. package/dist/action.js.map +1 -1
  6. package/dist/agent/production-agent.d.ts +12 -6
  7. package/dist/agent/production-agent.d.ts.map +1 -1
  8. package/dist/agent/production-agent.js +161 -11
  9. package/dist/agent/production-agent.js.map +1 -1
  10. package/dist/agent/types.d.ts +2 -0
  11. package/dist/agent/types.d.ts.map +1 -1
  12. package/dist/agent/types.js.map +1 -1
  13. package/dist/catalog.json +2 -2
  14. package/dist/cli/connect.d.ts.map +1 -1
  15. package/dist/cli/connect.js +15 -0
  16. package/dist/cli/connect.js.map +1 -1
  17. package/dist/cli/create.d.ts.map +1 -1
  18. package/dist/cli/create.js +8 -1
  19. package/dist/cli/create.js.map +1 -1
  20. package/dist/cli/index.js +10 -6
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/cli/plan-publish-store.d.ts +52 -0
  23. package/dist/cli/plan-publish-store.d.ts.map +1 -0
  24. package/dist/cli/plan-publish-store.js +103 -0
  25. package/dist/cli/plan-publish-store.js.map +1 -0
  26. package/dist/cli/skills.d.ts +30 -4
  27. package/dist/cli/skills.d.ts.map +1 -1
  28. package/dist/cli/skills.js +1240 -339
  29. package/dist/cli/skills.js.map +1 -1
  30. package/dist/cli/templates-meta.js +12 -12
  31. package/dist/cli/templates-meta.js.map +1 -1
  32. package/dist/client/AssistantChat.d.ts +3 -1
  33. package/dist/client/AssistantChat.d.ts.map +1 -1
  34. package/dist/client/AssistantChat.js +65 -15
  35. package/dist/client/AssistantChat.js.map +1 -1
  36. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  37. package/dist/client/MultiTabAssistantChat.js +20 -2
  38. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  39. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  40. package/dist/client/agent-chat-adapter.js +12 -0
  41. package/dist/client/agent-chat-adapter.js.map +1 -1
  42. package/dist/client/agent-engine-key.d.ts +24 -0
  43. package/dist/client/agent-engine-key.d.ts.map +1 -0
  44. package/dist/client/agent-engine-key.js +49 -0
  45. package/dist/client/agent-engine-key.js.map +1 -0
  46. package/dist/client/analytics.d.ts.map +1 -1
  47. package/dist/client/analytics.js +34 -0
  48. package/dist/client/analytics.js.map +1 -1
  49. package/dist/client/blocks/BlockView.d.ts +35 -0
  50. package/dist/client/blocks/BlockView.d.ts.map +1 -0
  51. package/dist/client/blocks/BlockView.js +45 -0
  52. package/dist/client/blocks/BlockView.js.map +1 -0
  53. package/dist/client/blocks/SchemaBlockEditor.d.ts +25 -0
  54. package/dist/client/blocks/SchemaBlockEditor.d.ts.map +1 -0
  55. package/dist/client/blocks/SchemaBlockEditor.js +165 -0
  56. package/dist/client/blocks/SchemaBlockEditor.js.map +1 -0
  57. package/dist/client/blocks/agent.d.ts +30 -0
  58. package/dist/client/blocks/agent.d.ts.map +1 -0
  59. package/dist/client/blocks/agent.js +61 -0
  60. package/dist/client/blocks/agent.js.map +1 -0
  61. package/dist/client/blocks/index.d.ts +51 -0
  62. package/dist/client/blocks/index.d.ts.map +1 -0
  63. package/dist/client/blocks/index.js +67 -0
  64. package/dist/client/blocks/index.js.map +1 -0
  65. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts +6 -0
  66. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -0
  67. package/dist/client/blocks/library/AnnotatedCodeBlock.js +135 -0
  68. package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -0
  69. package/dist/client/blocks/library/ApiEndpointBlock.d.ts +20 -0
  70. package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -0
  71. package/dist/client/blocks/library/ApiEndpointBlock.js +131 -0
  72. package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -0
  73. package/dist/client/blocks/library/DataModelBlock.d.ts +28 -0
  74. package/dist/client/blocks/library/DataModelBlock.d.ts.map +1 -0
  75. package/dist/client/blocks/library/DataModelBlock.js +222 -0
  76. package/dist/client/blocks/library/DataModelBlock.js.map +1 -0
  77. package/dist/client/blocks/library/DiffBlock.d.ts +6 -0
  78. package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -0
  79. package/dist/client/blocks/library/DiffBlock.js +293 -0
  80. package/dist/client/blocks/library/DiffBlock.js.map +1 -0
  81. package/dist/client/blocks/library/FileTreeBlock.d.ts +23 -0
  82. package/dist/client/blocks/library/FileTreeBlock.d.ts.map +1 -0
  83. package/dist/client/blocks/library/FileTreeBlock.js +225 -0
  84. package/dist/client/blocks/library/FileTreeBlock.js.map +1 -0
  85. package/dist/client/blocks/library/JsonExplorerBlock.d.ts +19 -0
  86. package/dist/client/blocks/library/JsonExplorerBlock.d.ts.map +1 -0
  87. package/dist/client/blocks/library/JsonExplorerBlock.js +171 -0
  88. package/dist/client/blocks/library/JsonExplorerBlock.js.map +1 -0
  89. package/dist/client/blocks/library/MermaidBlock.d.ts +17 -0
  90. package/dist/client/blocks/library/MermaidBlock.d.ts.map +1 -0
  91. package/dist/client/blocks/library/MermaidBlock.js +131 -0
  92. package/dist/client/blocks/library/MermaidBlock.js.map +1 -0
  93. package/dist/client/blocks/library/OpenApiSpecBlock.d.ts +19 -0
  94. package/dist/client/blocks/library/OpenApiSpecBlock.d.ts.map +1 -0
  95. package/dist/client/blocks/library/OpenApiSpecBlock.js +494 -0
  96. package/dist/client/blocks/library/OpenApiSpecBlock.js.map +1 -0
  97. package/dist/client/blocks/library/annotated-code.config.d.ts +58 -0
  98. package/dist/client/blocks/library/annotated-code.config.d.ts.map +1 -0
  99. package/dist/client/blocks/library/annotated-code.config.js +53 -0
  100. package/dist/client/blocks/library/annotated-code.config.js.map +1 -0
  101. package/dist/client/blocks/library/api-endpoint.config.d.ts +71 -0
  102. package/dist/client/blocks/library/api-endpoint.config.d.ts.map +1 -0
  103. package/dist/client/blocks/library/api-endpoint.config.js +91 -0
  104. package/dist/client/blocks/library/api-endpoint.config.js.map +1 -0
  105. package/dist/client/blocks/library/checklist.config.d.ts +36 -0
  106. package/dist/client/blocks/library/checklist.config.d.ts.map +1 -0
  107. package/dist/client/blocks/library/checklist.config.js +25 -0
  108. package/dist/client/blocks/library/checklist.config.js.map +1 -0
  109. package/dist/client/blocks/library/checklist.d.ts +26 -0
  110. package/dist/client/blocks/library/checklist.d.ts.map +1 -0
  111. package/dist/client/blocks/library/checklist.js +78 -0
  112. package/dist/client/blocks/library/checklist.js.map +1 -0
  113. package/dist/client/blocks/library/code-tabs.config.d.ts +36 -0
  114. package/dist/client/blocks/library/code-tabs.config.d.ts.map +1 -0
  115. package/dist/client/blocks/library/code-tabs.config.js +30 -0
  116. package/dist/client/blocks/library/code-tabs.config.js.map +1 -0
  117. package/dist/client/blocks/library/code-tabs.d.ts +3 -0
  118. package/dist/client/blocks/library/code-tabs.d.ts.map +1 -0
  119. package/dist/client/blocks/library/code-tabs.js +165 -0
  120. package/dist/client/blocks/library/code-tabs.js.map +1 -0
  121. package/dist/client/blocks/library/data-model.config.d.ts +72 -0
  122. package/dist/client/blocks/library/data-model.config.d.ts.map +1 -0
  123. package/dist/client/blocks/library/data-model.config.js +59 -0
  124. package/dist/client/blocks/library/data-model.config.js.map +1 -0
  125. package/dist/client/blocks/library/dev-doc-ui.d.ts +49 -0
  126. package/dist/client/blocks/library/dev-doc-ui.d.ts.map +1 -0
  127. package/dist/client/blocks/library/dev-doc-ui.js +50 -0
  128. package/dist/client/blocks/library/dev-doc-ui.js.map +1 -0
  129. package/dist/client/blocks/library/diff.config.d.ts +41 -0
  130. package/dist/client/blocks/library/diff.config.d.ts.map +1 -0
  131. package/dist/client/blocks/library/diff.config.js +34 -0
  132. package/dist/client/blocks/library/diff.config.js.map +1 -0
  133. package/dist/client/blocks/library/file-tree.config.d.ts +59 -0
  134. package/dist/client/blocks/library/file-tree.config.d.ts.map +1 -0
  135. package/dist/client/blocks/library/file-tree.config.js +45 -0
  136. package/dist/client/blocks/library/file-tree.config.js.map +1 -0
  137. package/dist/client/blocks/library/html.config.d.ts +37 -0
  138. package/dist/client/blocks/library/html.config.d.ts.map +1 -0
  139. package/dist/client/blocks/library/html.config.js +46 -0
  140. package/dist/client/blocks/library/html.config.js.map +1 -0
  141. package/dist/client/blocks/library/html.d.ts +21 -0
  142. package/dist/client/blocks/library/html.d.ts.map +1 -0
  143. package/dist/client/blocks/library/html.js +72 -0
  144. package/dist/client/blocks/library/html.js.map +1 -0
  145. package/dist/client/blocks/library/json-explorer.config.d.ts +46 -0
  146. package/dist/client/blocks/library/json-explorer.config.d.ts.map +1 -0
  147. package/dist/client/blocks/library/json-explorer.config.js +28 -0
  148. package/dist/client/blocks/library/json-explorer.config.js.map +1 -0
  149. package/dist/client/blocks/library/mermaid.config.d.ts +32 -0
  150. package/dist/client/blocks/library/mermaid.config.d.ts.map +1 -0
  151. package/dist/client/blocks/library/mermaid.config.js +24 -0
  152. package/dist/client/blocks/library/mermaid.config.js.map +1 -0
  153. package/dist/client/blocks/library/openapi-spec.config.d.ts +49 -0
  154. package/dist/client/blocks/library/openapi-spec.config.d.ts.map +1 -0
  155. package/dist/client/blocks/library/openapi-spec.config.js +24 -0
  156. package/dist/client/blocks/library/openapi-spec.config.js.map +1 -0
  157. package/dist/client/blocks/library/server-specs.d.ts +35 -0
  158. package/dist/client/blocks/library/server-specs.d.ts.map +1 -0
  159. package/dist/client/blocks/library/server-specs.js +171 -0
  160. package/dist/client/blocks/library/server-specs.js.map +1 -0
  161. package/dist/client/blocks/library/specs.d.ts +29 -0
  162. package/dist/client/blocks/library/specs.d.ts.map +1 -0
  163. package/dist/client/blocks/library/specs.js +229 -0
  164. package/dist/client/blocks/library/specs.js.map +1 -0
  165. package/dist/client/blocks/library/table.config.d.ts +30 -0
  166. package/dist/client/blocks/library/table.config.d.ts.map +1 -0
  167. package/dist/client/blocks/library/table.config.js +22 -0
  168. package/dist/client/blocks/library/table.config.js.map +1 -0
  169. package/dist/client/blocks/library/table.d.ts +8 -0
  170. package/dist/client/blocks/library/table.d.ts.map +1 -0
  171. package/dist/client/blocks/library/table.js +109 -0
  172. package/dist/client/blocks/library/table.js.map +1 -0
  173. package/dist/client/blocks/library/tabs.config.d.ts +56 -0
  174. package/dist/client/blocks/library/tabs.config.d.ts.map +1 -0
  175. package/dist/client/blocks/library/tabs.config.js +36 -0
  176. package/dist/client/blocks/library/tabs.config.js.map +1 -0
  177. package/dist/client/blocks/library/tabs.d.ts +20 -0
  178. package/dist/client/blocks/library/tabs.d.ts.map +1 -0
  179. package/dist/client/blocks/library/tabs.js +123 -0
  180. package/dist/client/blocks/library/tabs.js.map +1 -0
  181. package/dist/client/blocks/mdx.d.ts +74 -0
  182. package/dist/client/blocks/mdx.d.ts.map +1 -0
  183. package/dist/client/blocks/mdx.js +205 -0
  184. package/dist/client/blocks/mdx.js.map +1 -0
  185. package/dist/client/blocks/provider.d.ts +25 -0
  186. package/dist/client/blocks/provider.d.ts.map +1 -0
  187. package/dist/client/blocks/provider.js +19 -0
  188. package/dist/client/blocks/provider.js.map +1 -0
  189. package/dist/client/blocks/registry.d.ts +32 -0
  190. package/dist/client/blocks/registry.d.ts.map +1 -0
  191. package/dist/client/blocks/registry.js +65 -0
  192. package/dist/client/blocks/registry.js.map +1 -0
  193. package/dist/client/blocks/schema-form/introspect.d.ts +31 -0
  194. package/dist/client/blocks/schema-form/introspect.d.ts.map +1 -0
  195. package/dist/client/blocks/schema-form/introspect.js +164 -0
  196. package/dist/client/blocks/schema-form/introspect.js.map +1 -0
  197. package/dist/client/blocks/server.d.ts +31 -0
  198. package/dist/client/blocks/server.d.ts.map +1 -0
  199. package/dist/client/blocks/server.js +41 -0
  200. package/dist/client/blocks/server.js.map +1 -0
  201. package/dist/client/blocks/types.d.ts +252 -0
  202. package/dist/client/blocks/types.d.ts.map +1 -0
  203. package/dist/client/blocks/types.js +5 -0
  204. package/dist/client/blocks/types.js.map +1 -0
  205. package/dist/client/composer/ComposerPlusMenu.js +10 -1
  206. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  207. package/dist/client/guided-questions.d.ts +68 -0
  208. package/dist/client/guided-questions.d.ts.map +1 -1
  209. package/dist/client/guided-questions.js +158 -3
  210. package/dist/client/guided-questions.js.map +1 -1
  211. package/dist/client/index.d.ts +6 -1
  212. package/dist/client/index.d.ts.map +1 -1
  213. package/dist/client/index.js +24 -1
  214. package/dist/client/index.js.map +1 -1
  215. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts +37 -0
  216. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts.map +1 -0
  217. package/dist/client/rich-markdown-editor/BubbleToolbar.js +161 -0
  218. package/dist/client/rich-markdown-editor/BubbleToolbar.js.map +1 -0
  219. package/dist/client/rich-markdown-editor/DragHandle.d.ts +52 -0
  220. package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +1 -0
  221. package/dist/client/rich-markdown-editor/DragHandle.js +403 -0
  222. package/dist/client/rich-markdown-editor/DragHandle.js.map +1 -0
  223. package/dist/client/rich-markdown-editor/ImageExtension.d.ts +63 -0
  224. package/dist/client/rich-markdown-editor/ImageExtension.d.ts.map +1 -0
  225. package/dist/client/rich-markdown-editor/ImageExtension.js +242 -0
  226. package/dist/client/rich-markdown-editor/ImageExtension.js.map +1 -0
  227. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts +97 -0
  228. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -0
  229. package/dist/client/rich-markdown-editor/RegistryBlockNode.js +214 -0
  230. package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -0
  231. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +51 -0
  232. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts.map +1 -0
  233. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js +37 -0
  234. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js.map +1 -0
  235. package/dist/client/rich-markdown-editor/RunId.d.ts +28 -0
  236. package/dist/client/rich-markdown-editor/RunId.d.ts.map +1 -0
  237. package/dist/client/rich-markdown-editor/RunId.js +60 -0
  238. package/dist/client/rich-markdown-editor/RunId.js.map +1 -0
  239. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +85 -0
  240. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -0
  241. package/dist/client/rich-markdown-editor/SharedRichEditor.js +130 -0
  242. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -0
  243. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts +36 -0
  244. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts.map +1 -0
  245. package/dist/client/rich-markdown-editor/SlashCommandMenu.js +193 -0
  246. package/dist/client/rich-markdown-editor/SlashCommandMenu.js.map +1 -0
  247. package/dist/client/rich-markdown-editor/extensions.d.ts +166 -0
  248. package/dist/client/rich-markdown-editor/extensions.d.ts.map +1 -0
  249. package/dist/client/rich-markdown-editor/extensions.js +222 -0
  250. package/dist/client/rich-markdown-editor/extensions.js.map +1 -0
  251. package/dist/client/rich-markdown-editor/gfmDoc.d.ts +24 -0
  252. package/dist/client/rich-markdown-editor/gfmDoc.d.ts.map +1 -0
  253. package/dist/client/rich-markdown-editor/gfmDoc.js +83 -0
  254. package/dist/client/rich-markdown-editor/gfmDoc.js.map +1 -0
  255. package/dist/client/rich-markdown-editor/index.d.ts +14 -0
  256. package/dist/client/rich-markdown-editor/index.d.ts.map +1 -0
  257. package/dist/client/rich-markdown-editor/index.js +14 -0
  258. package/dist/client/rich-markdown-editor/index.js.map +1 -0
  259. package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts +46 -0
  260. package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts.map +1 -0
  261. package/dist/client/rich-markdown-editor/registrySlashCommands.js +13 -0
  262. package/dist/client/rich-markdown-editor/registrySlashCommands.js.map +1 -0
  263. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts +18 -0
  264. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +1 -0
  265. package/dist/client/rich-markdown-editor/uploadEditorImage.js +57 -0
  266. package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +1 -0
  267. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +91 -0
  268. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -0
  269. package/dist/client/rich-markdown-editor/useCollabReconcile.js +375 -0
  270. package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -0
  271. package/dist/client/track.d.ts +25 -0
  272. package/dist/client/track.d.ts.map +1 -0
  273. package/dist/client/track.js +53 -0
  274. package/dist/client/track.js.map +1 -0
  275. package/dist/client/use-action.d.ts.map +1 -1
  276. package/dist/client/use-action.js +6 -0
  277. package/dist/client/use-action.js.map +1 -1
  278. package/dist/client/use-session.d.ts +3 -2
  279. package/dist/client/use-session.d.ts.map +1 -1
  280. package/dist/client/use-session.js +3 -2
  281. package/dist/client/use-session.js.map +1 -1
  282. package/dist/deploy/build.d.ts +5 -0
  283. package/dist/deploy/build.d.ts.map +1 -1
  284. package/dist/deploy/build.js +67 -1
  285. package/dist/deploy/build.js.map +1 -1
  286. package/dist/extensions/schema.d.ts +1 -1
  287. package/dist/mcp/build-server.d.ts.map +1 -1
  288. package/dist/mcp/build-server.js +9 -2
  289. package/dist/mcp/build-server.js.map +1 -1
  290. package/dist/mcp/server.d.ts +1 -1
  291. package/dist/mcp/server.d.ts.map +1 -1
  292. package/dist/mcp/server.js +35 -2
  293. package/dist/mcp/server.js.map +1 -1
  294. package/dist/provider-api/index.d.ts +1 -1
  295. package/dist/provider-api/index.d.ts.map +1 -1
  296. package/dist/scripts/docs/search.d.ts.map +1 -1
  297. package/dist/scripts/docs/search.js +5 -2
  298. package/dist/scripts/docs/search.js.map +1 -1
  299. package/dist/scripts/runner.d.ts.map +1 -1
  300. package/dist/scripts/runner.js +16 -3
  301. package/dist/scripts/runner.js.map +1 -1
  302. package/dist/server/action-discovery.d.ts.map +1 -1
  303. package/dist/server/action-discovery.js +2 -0
  304. package/dist/server/action-discovery.js.map +1 -1
  305. package/dist/server/action-routes.d.ts.map +1 -1
  306. package/dist/server/action-routes.js +30 -4
  307. package/dist/server/action-routes.js.map +1 -1
  308. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  309. package/dist/server/agent-chat-plugin.js +65 -19
  310. package/dist/server/agent-chat-plugin.js.map +1 -1
  311. package/dist/server/agent-teams.d.ts.map +1 -1
  312. package/dist/server/agent-teams.js +8 -1
  313. package/dist/server/agent-teams.js.map +1 -1
  314. package/dist/server/agents-bundle.d.ts +27 -1
  315. package/dist/server/agents-bundle.d.ts.map +1 -1
  316. package/dist/server/agents-bundle.js +41 -3
  317. package/dist/server/agents-bundle.js.map +1 -1
  318. package/dist/server/auth.d.ts.map +1 -1
  319. package/dist/server/auth.js +76 -3
  320. package/dist/server/auth.js.map +1 -1
  321. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  322. package/dist/server/core-routes-plugin.js +60 -0
  323. package/dist/server/core-routes-plugin.js.map +1 -1
  324. package/dist/server/onboarding-html.d.ts.map +1 -1
  325. package/dist/server/onboarding-html.js +160 -22
  326. package/dist/server/onboarding-html.js.map +1 -1
  327. package/dist/server/sentry.d.ts.map +1 -1
  328. package/dist/server/sentry.js +6 -0
  329. package/dist/server/sentry.js.map +1 -1
  330. package/dist/server/social-og-image.d.ts +2 -1
  331. package/dist/server/social-og-image.d.ts.map +1 -1
  332. package/dist/server/social-og-image.js +24 -4
  333. package/dist/server/social-og-image.js.map +1 -1
  334. package/dist/sharing/schema.d.ts +1 -1
  335. package/dist/styles/agent-native.css +1 -0
  336. package/dist/styles/rich-markdown-editor.css +439 -0
  337. package/dist/templates/default/.agents/skills/actions/SKILL.md +4 -1
  338. package/dist/templates/default/.agents/skills/security/SKILL.md +13 -4
  339. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +15 -3
  340. package/dist/templates/default/AGENTS.md +1 -0
  341. package/dist/templates/default/DEVELOPING.md +2 -0
  342. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +10 -3
  343. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +98 -10
  344. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +45 -3
  345. package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -0
  346. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +37 -4
  347. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +9 -4
  348. package/dist/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +2 -0
  349. package/dist/templates/workspace-core/.agents/skills/client-methods/SKILL.md +106 -0
  350. package/dist/templates/workspace-core/.agents/skills/client-methods/references/legacy-client-fetch-audit-2026-06-03.md +53 -0
  351. package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +2 -0
  352. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +62 -61
  353. package/dist/templates/workspace-core/.agents/skills/context-xray/SKILL.md +47 -0
  354. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +28 -0
  355. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +52 -1
  356. package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +2 -0
  357. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +95 -433
  358. package/dist/templates/workspace-core/.agents/skills/extensions/references/api.md +285 -0
  359. package/dist/templates/workspace-core/.agents/skills/extensions/references/examples.md +259 -0
  360. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +398 -0
  361. package/dist/templates/workspace-core/.agents/skills/external-agents/references/mcp-apps-embedding.md +157 -0
  362. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +17 -0
  363. package/dist/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +13 -2
  364. package/dist/templates/workspace-core/.agents/skills/mvp-followup/SKILL.md +51 -0
  365. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +14 -4
  366. package/dist/templates/workspace-core/.agents/skills/onboarding/SKILL.md +13 -1
  367. package/dist/templates/workspace-core/.agents/skills/portability/SKILL.md +27 -5
  368. package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +24 -8
  369. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +53 -7
  370. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +43 -10
  371. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +2 -0
  372. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +43 -14
  373. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +50 -1
  374. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -2
  375. package/dist/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +11 -1
  376. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +15 -0
  377. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +5 -1
  378. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +48 -19
  379. package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +7 -3
  380. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +13 -6
  381. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +236 -0
  382. package/dist/templates/workspace-core/AGENTS.md +5 -1
  383. package/dist/templates/workspace-root/AGENTS.md +5 -2
  384. package/dist/tracking/route.d.ts +43 -0
  385. package/dist/tracking/route.d.ts.map +1 -0
  386. package/dist/tracking/route.js +85 -0
  387. package/dist/tracking/route.js.map +1 -0
  388. package/dist/vite/client.d.ts.map +1 -1
  389. package/dist/vite/client.js +15 -0
  390. package/dist/vite/client.js.map +1 -1
  391. package/docs/content/a2a-protocol.md +18 -4
  392. package/docs/content/actions.md +87 -0
  393. package/docs/content/agent-mentions.md +2 -1
  394. package/docs/content/authentication.md +2 -1
  395. package/docs/content/client.md +64 -13
  396. package/docs/content/cloneable-saas.md +1 -1
  397. package/docs/content/code-agents-ui.md +17 -11
  398. package/docs/content/context-awareness.md +23 -28
  399. package/docs/content/creating-templates.md +1 -1
  400. package/docs/content/drop-in-agent.md +2 -0
  401. package/docs/content/getting-started.md +2 -2
  402. package/docs/content/key-concepts.md +2 -2
  403. package/docs/content/messaging.md +57 -15
  404. package/docs/content/migration-workbench.md +1 -1
  405. package/docs/content/multi-app-workspace.md +1 -1
  406. package/docs/content/multi-tenancy.md +17 -15
  407. package/docs/content/real-time-collaboration.md +1 -1
  408. package/docs/content/recurring-jobs.md +1 -1
  409. package/docs/content/security.md +2 -2
  410. package/docs/content/server.md +4 -4
  411. package/docs/content/skills-guide.md +30 -0
  412. package/docs/content/template-analytics.md +2 -2
  413. package/docs/content/template-assets.md +17 -1
  414. package/docs/content/template-brain.md +2 -2
  415. package/docs/content/template-calendar.md +1 -1
  416. package/docs/content/template-clips.md +3 -3
  417. package/docs/content/template-content.md +2 -2
  418. package/docs/content/template-design.md +2 -2
  419. package/docs/content/template-dispatch.md +3 -3
  420. package/docs/content/template-forms.md +14 -2
  421. package/docs/content/template-mail.md +1 -3
  422. package/docs/content/template-plan.md +133 -0
  423. package/docs/content/template-slides.md +5 -4
  424. package/docs/content/template-starter.md +4 -4
  425. package/docs/content/template-videos.md +6 -11
  426. package/docs/content/tracking.md +21 -1
  427. package/docs/content/visual-plans.md +74 -0
  428. package/docs/content/workspace.md +9 -9
  429. package/package.json +26 -11
  430. package/src/templates/default/.agents/skills/actions/SKILL.md +4 -1
  431. package/src/templates/default/.agents/skills/security/SKILL.md +13 -4
  432. package/src/templates/default/.agents/skills/storing-data/SKILL.md +15 -3
  433. package/src/templates/default/AGENTS.md +1 -0
  434. package/src/templates/default/DEVELOPING.md +2 -0
  435. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +10 -3
  436. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +98 -10
  437. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +45 -3
  438. package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -0
  439. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +37 -4
  440. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +9 -4
  441. package/src/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +2 -0
  442. package/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +106 -0
  443. package/src/templates/workspace-core/.agents/skills/client-methods/references/legacy-client-fetch-audit-2026-06-03.md +53 -0
  444. package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +2 -0
  445. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +62 -61
  446. package/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +47 -0
  447. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +28 -0
  448. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +52 -1
  449. package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +2 -0
  450. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +95 -433
  451. package/src/templates/workspace-core/.agents/skills/extensions/references/api.md +285 -0
  452. package/src/templates/workspace-core/.agents/skills/extensions/references/examples.md +259 -0
  453. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +398 -0
  454. package/src/templates/workspace-core/.agents/skills/external-agents/references/mcp-apps-embedding.md +157 -0
  455. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +17 -0
  456. package/src/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +13 -2
  457. package/src/templates/workspace-core/.agents/skills/mvp-followup/SKILL.md +51 -0
  458. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +14 -4
  459. package/src/templates/workspace-core/.agents/skills/onboarding/SKILL.md +13 -1
  460. package/src/templates/workspace-core/.agents/skills/portability/SKILL.md +27 -5
  461. package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +24 -8
  462. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +53 -7
  463. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +43 -10
  464. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +2 -0
  465. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +43 -14
  466. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +50 -1
  467. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -2
  468. package/src/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +11 -1
  469. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +15 -0
  470. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +5 -1
  471. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +48 -19
  472. package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +7 -3
  473. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +13 -6
  474. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +236 -0
  475. package/src/templates/workspace-core/AGENTS.md +5 -1
  476. package/src/templates/workspace-root/AGENTS.md +5 -2
@@ -8,30 +8,39 @@ import os from "node:os";
8
8
  import path from "node:path";
9
9
  import { spawn } from "node:child_process";
10
10
  import { buildAppSkillPack, ensureAppSkill, loadAppSkillManifest, normalizeAppSkillManifest, } from "./app-skill.js";
11
- import { readConnectClientPreferences, resolveClients, writeConnectClientPreferences, } from "./connect.js";
11
+ import { readConnectClientPreferences, resolveClients, runConnect, writeConnectClientPreferences, } from "./connect.js";
12
12
  import { CONTEXT_XRAY_SKILL_MD, installLocalContextXray, } from "./context-xray-local.js";
13
13
  import { CLIENTS } from "./mcp-config-writers.js";
14
14
  const HELP = `agent-native skills
15
15
 
16
16
  Usage:
17
17
  agent-native skills list
18
- agent-native skills add assets|design-exploration|visual-plan|visual-questions|ui-plan|visualize-plan|context-xray [--client codex|claude-code|claude-code-cli|cowork|all] [--scope user|project] [--mcp-url <url>] [--yes] [--dry-run] [--json]
18
+ agent-native skills add assets|design-exploration|visual-plan|visual-questions|ui-plan|prototype-plan|visualize-plan|context-xray [--client codex|claude-code|claude-code-cli|cowork|all] [--scope user|project] [--mcp-url <url>] [--no-connect] [--yes] [--dry-run] [--json]
19
19
  agent-native skills add <manifest-or-app-dir> [--client ...] [--yes]
20
20
 
21
21
  Examples:
22
22
  agent-native skills add assets
23
23
  agent-native skills add design-exploration
24
24
  agent-native skills add visual-plan
25
+ agent-native skills add visual-plan --no-connect
25
26
  agent-native skills add context-xray --client all
26
27
  agent-native skills add assets --client claude-code
27
28
  agent-native skills add assets --mcp-url https://my-app.ngrok-free.dev
28
29
  agent-native skills add ./dist/assets-skill --client codex
29
30
 
30
- The add command wraps the Vercel Labs/open skills CLI for SKILL.md
31
- installation, then registers the app-backed MCP connector. Running
32
- "npx skills add ..." directly installs instructions only; use this Agent Native
33
- CLI path when you want MCP setup too. Pass --mcp-url to register that connector
34
- against a custom origin (an ngrok tunnel, a local dev server, or a self-hosted
31
+ The add command installs the SKILL.md instructions, registers the app-backed
32
+ MCP connector, and then authenticates it in one step so you do not hit an OAuth
33
+ wall on the first tool call. Authentication reuses "agent-native connect":
34
+ OAuth-capable clients (Claude Code) get a URL-only entry and a /mcp authenticate
35
+ prompt, while Codex / Cowork run the browser device-code flow. In a
36
+ non-interactive shell or CI the auth step is skipped and the exact
37
+ "agent-native connect <url>" command is printed instead.
38
+
39
+ Running "npx skills add ..." directly installs instructions only; use this Agent
40
+ Native CLI path when you want MCP setup and auth too. Pass --no-connect to
41
+ register the connector without authenticating (leave auth to the host or run
42
+ "agent-native connect" later). Pass --mcp-url to register that connector against
43
+ a custom origin (an ngrok tunnel, a local dev server, or a self-hosted
35
44
  deployment) instead of the built-in hosted default — a bare origin gets the
36
45
  standard /_agent-native/mcp path appended. Use app-skill pack for marketplace
37
46
  bundles and custom adapter output.`;
@@ -185,6 +194,50 @@ iteration, or a human-in-the-loop choice among design directions.
185
194
  - If you inspect local MCP config, redact \`Authorization\`, \`http_headers\`,
186
195
  and token values. Never paste bearer tokens into chat or logs.
187
196
  `;
197
+ /**
198
+ * Shared setup/auth block for every Plans skill (`/visual-plan`, `/ui-plan`,
199
+ * `/prototype-plan`, `/visual-questions`, `/visualize-plan`). Interpolated into each skill markdown
200
+ * so the install + one-step authenticate instructions never drift between them.
201
+ * Keep this in sync with the copies under `templates/plan/.agents/skills/*` and
202
+ * top-level `skills/*` (this skill's SKILL.md is triplicated with no sync test).
203
+ */
204
+ const PLAN_SETUP_AUTH_MD = `## Setup & Authentication
205
+
206
+ There are two ways into Plans.
207
+
208
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
209
+ installs the Plans skills, registers the hosted Plans MCP connector, and
210
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
211
+ intended), so the first tool call does not hit an OAuth wall:
212
+
213
+ \`\`\`bash
214
+ agent-native skills add visual-plan
215
+ \`\`\`
216
+
217
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/prototype-plan\`,
218
+ \`/visual-questions\`, \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
219
+ register the connector without authenticating, then run
220
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
221
+
222
+ **Browser (people you share with).** Open the Plans editor and create & edit
223
+ with no sign-up — you work as a guest. Sign in only when you want to save or
224
+ share; signing in claims the plans you made as a guest into your account.
225
+
226
+ Sharing and commenting require an account: public/shared plans are viewable by
227
+ anyone with the link, but commenting on them needs an agent-native account.
228
+
229
+ For fully offline, no-account use, run the Plans app locally and sync plans to
230
+ your repo as MDX. This local mode is a separate advanced path, not the default
231
+ hosted flow.
232
+
233
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
234
+ do not keep retrying the tool. Authenticate the connector with
235
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
236
+ instead re-run /mcp and choose Authenticate), then continue once the connector
237
+ is available.
238
+
239
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
240
+ not put shared secrets in skill files.`;
188
241
  export const VISUAL_PLANS_SKILL_MD = `---
189
242
  name: visual-plan
190
243
  description: >-
@@ -199,15 +252,16 @@ metadata:
199
252
 
200
253
  Agent-Native Plans is structured visual planning mode for coding agents. Build
201
254
  the plan you would normally write in Markdown, but as a scannable document with
202
- editable blocks mixed in: an optional pan/zoom wireframe canvas on top and a
203
- Notion-like technical document below. The user reacts to visuals first and reads
204
- prose only where it helps.
255
+ editable blocks mixed in: an optional top visual review area (wireframe canvas,
256
+ live prototype, or both in tabs) and a Notion-like technical document below. The
257
+ user reacts to visuals first and reads prose only where it helps.
205
258
 
206
259
  \`/visual-plan\` is the canonical command and the main entry point. Use \`/ui-plan\`
207
260
  when the work is primarily product UI and review should start with the screens.
208
- Use \`/visual-questions\` to run a visual intake form first. Use \`/visualize-plan\`
209
- to turn an existing Codex, Claude Code, Markdown, or pasted plan into a visual
210
- companion.
261
+ Use \`/prototype-plan\` when review should start with a functional live prototype.
262
+ Use \`/visual-questions\` only when the user explicitly wants a visual intake form
263
+ before planning. Use \`/visualize-plan\` to turn an existing Codex, Claude Code,
264
+ Markdown, or pasted plan into a visual companion.
211
265
 
212
266
  ## When To Use
213
267
 
@@ -231,8 +285,11 @@ direction before you implement.
231
285
  plan. Start editing only after the user approves the direction.
232
286
  - **Clarify vs. assume.** Do not ask how to build it — explore and present the
233
287
  approach and options in the plan. Ask a clarifying question only when an
234
- ambiguity would change the design and you cannot resolve it from the code; batch
235
- 2-4 high-leverage questions before finalizing. Otherwise state the assumption
288
+ ambiguity would change the design and you cannot resolve it from the code; use
289
+ the host agent's normal ask-user-question flow and batch 2-4 high-leverage
290
+ questions before finalizing. Do not call \`create-visual-questions\` from
291
+ \`/visual-plan\`; keep any answerable follow-up inside the plan itself as a
292
+ bottom \`question-form\` Open Questions block. Otherwise state the assumption
236
293
  explicitly and proceed, and put anything unresolved in an open-questions block.
237
294
  - **The plan is the approval gate.** After surfacing it, ask the user to review
238
295
  and approve before you write code, and name which files/areas the work touches.
@@ -244,102 +301,151 @@ direction before you implement.
244
301
 
245
302
  ## Core Workflow
246
303
 
247
- 1. Call \`create-visual-plan\` with the title, brief, source, repo path, and
248
- structured \`content\` blocks.
249
- 2. Compose the canvas from the kit and write the document with native blocks
250
- (see the two cores below). Skip the canvas for non-visual work.
251
- 3. Surface the returned Plans link or inline MCP App and ask the user to review.
252
- 4. Call \`get-plan-feedback\` before editing, after review, after any long pause,
253
- and before the final response.
254
- 5. Apply changes with \`update-visual-plan\`, preferring targeted \`contentPatches\`.
304
+ 1. Follow the host agent's normal planning flow: inspect the codebase, delegate
305
+ wide exploration when useful, gather the info needed, and ask native
306
+ clarifying questions as needed before generating the plan.
307
+ 2. Decide the top visual surface with the rules below, then call
308
+ \`create-visual-plan\` with the title, brief, source, repo path, and structured \`content\` blocks.
309
+ 3. Compose any top visual surface from the kit and write the document with
310
+ native blocks (see the cores below). Keep the document close to the Markdown
311
+ plan the agent would normally output; add diagrams, wireframes, prototypes,
312
+ and visual callouts only where they clarify the plan. Skip the top visual
313
+ surface for non-visual work.
314
+ 4. Surface the returned Plans link or inline MCP App and ask the user to review.
315
+ Always include the actual URL in chat so the next step is a click in CLI or
316
+ other text-only hosts. When the host exposes an embedded browser/preview panel
317
+ and a tool can open arbitrary URLs there, open the returned plan URL
318
+ automatically for convenient review; do not rely on this as the only handoff.
319
+ 5. Call \`get-plan-feedback\` before editing, after review, after any long pause,
320
+ and before the final response. Treat \`anchorDetails\`, resolver intent, recent
321
+ review events, and any focused screenshots from browser handoff as the source
322
+ of truth for exactly what changed and exactly what each comment points at.
323
+ 6. Apply changes with \`update-visual-plan\`, preferring targeted \`contentPatches\`.
255
324
  When the user wants source-control friendly edits, use
256
325
  \`patch-visual-plan-source\` against the MDX files instead of regenerating the
257
326
  plan.
258
- 6. Export with \`export-visual-plan\` only when the user wants a shareable receipt
327
+ 7. Export with \`export-visual-plan\` only when the user wants a shareable receipt
259
328
  or repo-check-in artifacts.
260
329
 
330
+ ## Visual Surface Choice
331
+
332
+ Choose the surface before creating the plan. Do not add visual chrome by
333
+ default:
334
+
335
+ - **No visual surface** for architecture-only, backend-only, data migration,
336
+ copy-only, or otherwise non-visual plans. Use a strong document with diagrams
337
+ only when relationships need a visual explanation.
338
+ - **Canvas only** for one static screen, a before/after comparison, a component
339
+ state, a small popover, or a visual direction that does not require clicking.
340
+ Put those wireframes in \`content.canvas\` and omit \`content.prototype\`.
341
+ - **Canvas + prototype** for multi-step UI flows, onboarding, wizards,
342
+ review/approval flows, navigation changes, or anything where the reviewer
343
+ needs to operate the behavior. Keep the static wireframes in
344
+ \`content.canvas\`, add the aligned functional prototype in
345
+ \`content.prototype\`, and rely on the top visual tabs to switch between them.
346
+ - **Prototype-first** when the user explicitly asks for \`/prototype-plan\`, asks
347
+ to operate the UI, or when interaction is the main question. Use
348
+ \`create-prototype-plan\`, which still preserves static mocks where useful.
349
+
350
+ For mixed canvas + prototype plans, reuse the same real labels, app statuses,
351
+ and screen ids across both surfaces. The canvas is the inspectable static reference;
352
+ the prototype is the interactive version of that same flow, not a separate
353
+ design direction.
354
+
261
355
  <!-- SHARED-CORE:wireframe-canvas START -->
356
+
262
357
  ## Wireframe & Canvas Core
263
358
 
264
359
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
265
360
  \`/visualize-plan\`. It is the single source of truth for how wireframes and the
266
361
  canvas work. Do not paraphrase it per command.
267
362
 
268
- **The renderer owns all visual quality. You emit content, never styling.** Flex
269
- layout, fonts, density, spacing, theme, and the hand-drawn wobble all live in
270
- the app renderer. Never emit coordinates, CSS, pixel sizes, or raw HTML for a
271
- wireframe's internals. Your job is to pick a surface, compose real product
272
- content from the kit, and annotate — nothing else.
363
+ **A wireframe is an HTML mockup. The renderer owns the look; you write the
364
+ content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
365
+ screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
366
+ the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
367
+ never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags, font-family, hex colors,
368
+ or any width/height/coordinates. You write real HTML layout and real product
369
+ content; the renderer styles and roughens it.
273
370
 
274
- **A wireframe block's data is a declarative kit tree, not geometry:**
371
+ **A wireframe block's data is an HTML screen plus a surface:**
275
372
 
276
373
  \`\`\`json
277
374
  {
278
- "surface": "desktop",
279
- "screen": [
280
- { "el": "browserBar", "title": "tasklist" },
281
- { "el": "row", "children": [
282
- { "el": "sidebar", "children": [
283
- { "el": "navItem", "label": "Inbox", "count": 12, "active": true },
284
- { "el": "navItem", "label": "Today", "count": 4 },
285
- { "el": "navItem", "label": "Done" }
286
- ] },
287
- { "el": "main", "children": [
288
- { "el": "title", "text": "Today", "script": true },
289
- { "el": "chips", "items": [
290
- { "label": "All", "active": true }, { "label": "Active" }, { "label": "Done" }
291
- ] },
292
- { "el": "section", "label": "OVERDUE", "tone": "warn" },
293
- { "el": "taskRow", "title": "Send invoice to Acme Co.", "due": "Yesterday", "dueTone": "warn", "prio": 1 },
294
- { "el": "taskRow", "title": "Reply to design feedback", "due": "Today", "prio": 2 }
295
- ] }
296
- ] }
297
- ]
375
+ "surface": "browser",
376
+ "html": "<div style=\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\"><h1>Sign in</h1><p class=\\"wf-muted\\">Use your work email to continue.</p><div class=\\"wf-card\\" style=\\"display:flex;flex-direction:column;gap:10px\\"><label>Email<input value=\\"jane@acme.co\\" /></label><label>Password<input value=\\"••••••••\\" /></label><label style=\\"display:flex;align-items:center;gap:8px\\"><input type=\\"checkbox\\" checked /> Remember me</label><button class=\\"primary\\">Sign in</button></div><a href=\\"#\\">Forgot password?</a></div>"
298
377
  }
299
378
  \`\`\`
300
379
 
301
- The renderer maps each node to a flex kit component and applies one whole-frame
302
- wobble. Layout is always flex: \`row\`, \`col\`, \`sidebar\`, and \`main\` set the flex
303
- direction; everything aligns by construction, so you never get overlap or drift.
380
+ **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
381
+ (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
382
+ are auto-themed no classes needed. Helper classes carry the rest:
383
+
384
+ - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
385
+ - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
386
+ (\`<span class="wf-pill accent">\`) for the accent-filled variant.
387
+ - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
388
+ - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
389
+ primary button.
390
+
391
+ **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
392
+ these on light/dark, so reading them is what keeps a mockup correct in both
393
+ themes. For any inline border, background, or text color, reference a token:
394
+ \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
395
+ \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
396
+ (page background), \`--wf-card\` (raised surface), \`--wf-accent\` /
397
+ \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
398
+ and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
399
+ renderer owns the sketch/clean font.
400
+
401
+ **Lay out with inline \`style\` flex/grid.** You write the real layout —
402
+ \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
403
+ renderer never repositions anything. Compose the actual product: reproduce the
404
+ current screen, then show the modification. Real labels, real counts, real dates,
405
+ real button text grounded in the screen you read; not lorem or gray bars.
304
406
 
305
407
  **Surface presets — match the real footprint, never default to desktop+mobile.**
306
408
  Pick the \`surface\` that matches what the user will actually see:
307
409
 
308
- - \`desktop\`: a full page or app shell.
410
+ - \`browser\`: a web page that needs a browser chrome frame around it.
411
+ - \`desktop\`: a full desktop app page or app shell.
309
412
  - \`mobile\`: a phone screen, only when the work is genuinely mobile.
310
413
  - \`popover\`: a small floating menu, dropdown, or inline popover.
311
414
  - \`panel\`: a side panel, inspector, or sidebar widget.
312
- - \`browser\`: a page that needs a browser chrome frame around it.
313
415
 
416
+ The surface locks the footprint and aspect; never set width/height/coordinates.
314
417
  A sidebar popover renders as a small surface, not a desktop page and a phone
315
418
  frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
316
419
  actually changes the layout. For a component or widget, show one broader
317
420
  app-context frame only when placement affects understanding, then the focused
318
421
  component states.
319
422
 
320
- **Node vocabulary (\`el\` values).** Every node is \`{ el, ...props, children? }\`:
321
-
322
- - Layout: \`screen\`, \`row\`, \`col\`, \`sidebar\`, \`main\`, \`card{children}\`,
323
- \`column{title,count?,children}\`, \`box{children,dashed?}\`, \`divider\`.
324
- - Chrome: \`browserBar{title}\`, \`statusBar\`, \`searchBar\`, \`toolbar\`.
325
- - Navigation: \`navItem{label,count?,active?,dot?}\`, \`tabs\`/\`chips{items:[{label,active?}]}\`,
326
- \`chip{label,active?}\`, \`pill{label,tone?}\`.
327
- - Content: \`title{text,script?}\`, \`text{value,color?,weight?}\`,
328
- \`lines{n?,widths?}\`, \`section{label,tone?}\`,
329
- \`taskRow{title,note?,due?,dueTone?,prio?,done?}\`, \`kv{rows:[{k,v}]}\`,
330
- \`avatar\`, \`iconSquare{active?}\`.
331
- - Inputs: \`field{label?,value?,placeholder?,area?}\`, \`check{done?,shape?}\`,
332
- \`btn{label,solid?,full?}\`, \`fab{icon?}\`.
333
-
334
- Put **real product content** in props: real labels, real dates, real counts,
335
- real button text grounded in the actual screen or component you read. Use
336
- \`lines\`/\`text\` (with no \`value\`) only for genuine placeholder body copy — never
337
- fill a screen with gray placeholder bars. Buttons (\`btn\`, \`fab\`) must read as
338
- actionable controls.
339
-
340
- **Default crisp.** Sketchiness is a low default (a subtle single wobble over the
341
- whole frame), not a heavy scribble. Do not ask for or assume a heavy sketch
342
- look.
423
+ **Modify, don't redesign.** When the task changes an existing screen, reproduce
424
+ the current screen's real layout and footprint FIRST, then change only the delta
425
+ and call it out with a single annotation. Do not restack the page into a new
426
+ layout. For net-new surfaces, compose from the real app shell.
427
+
428
+ **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
429
+ popover, menu, dialog, toast), show the full screen once, then add a small
430
+ separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
431
+ the whole page around it, and do not scale a duplicate up. Pick the matching
432
+ \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
433
+ page width.
434
+
435
+ **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
436
+ fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
437
+ built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
438
+ no labels or copy. The renderer drops borders, sketch, and color into the
439
+ skeleton register automatically. Never escape to a \`custom-html\` document block
440
+ to fake a loader, and never move a mockup out of the canvas — mockups always
441
+ live in canvas artboards.
442
+
443
+ **Editing an existing mockup.** To change one element, text, or color in an
444
+ existing html mockup, do NOT regenerate the frame call \`update-visual-plan\`
445
+ with \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
446
+ replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
447
+ first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
448
+ occurrence. The result is re-sanitized.
343
449
 
344
450
  **Canvas annotations are designer notes on the artboard.** When a top canvas is
345
451
  present, sprinkle Figma-style notes near the frames they explain: a short
@@ -350,8 +456,16 @@ point at one specific control or transition; for a broad frame-level note, write
350
456
  text beside the frame with no connector. Connectors are for real sequences only —
351
457
  never fake "Step 1 → Step 2" lines between independent states.
352
458
 
353
- **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
354
- (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
459
+ **Do not create overlapping annotations.** Anchor each note to the frame it
460
+ explains with \`targetId\` + \`placement\` (top/right/bottom/left). The renderer
461
+ parks notes in a gutter beside the frame and lays them out automatically — never
462
+ supply x/y or points for anchored notes; hand-placed coordinates fight the
463
+ auto-layout and cause the overlap you're trying to avoid. Reserve arrows for a
464
+ note that must point at a specific control inside a frame; a note that simply
465
+ sits beside its frame needs no arrow.
466
+
467
+ **Patching.** Edit one wireframe, canvas annotation, or block with targeted \`contentPatches\`
468
+ (for example \`update-block\`, \`replace-blocks\`, \`update-canvas-annotation\`) rather
355
469
  than regenerating the whole plan. \`contentPatches\` are part of the public MCP
356
470
  action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
357
471
  edits. If an agent is working from exported source files, use
@@ -360,14 +474,71 @@ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
360
474
  \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
361
475
  patch action normalizes the MDX back into the same JSON runtime model. JSON is
362
476
  the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
477
+ In the browser, humans edit \`rich-text\` prose inline; agents should still use
478
+ \`update-rich-text\` content patches or source patches for prose, and use
479
+ comments/structured patches for canvas, artboard, wireframe, and diagram edits.
480
+
481
+ **Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an \`html\` wireframe (or reference a wireframe block via \`blockId\`) — a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.
482
+
483
+ **Fill the frame; keep labels short.** Each artboard is a fixed-size surface — compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (\`flex:1\`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column — shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).
484
+
485
+ **Good example — a contacts list, surface \`browser\`.** A small, real screen
486
+ composed from the helper classes and tokens, layout in inline flex, no fonts or
487
+ hex colors:
488
+
489
+ \`\`\`html
490
+ <div style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%">
491
+ <div style="display:flex;align-items:center;justify-content:space-between">
492
+ <h1>Contacts</h1>
493
+ <button class="primary">New contact</button>
494
+ </div>
495
+ <div style="display:flex;gap:6px">
496
+ <span class="wf-pill accent">All 128</span>
497
+ <span class="wf-pill">Favorites</span>
498
+ <span class="wf-pill">Archived</span>
499
+ </div>
500
+ <div class="wf-card" style="display:flex;flex-direction:column;gap:0;padding:0">
501
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)">
502
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
503
+ <div style="flex:1"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>
504
+ <span class="wf-pill">Lead</span>
505
+ </div>
506
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
507
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
508
+ <div style="flex:1"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>
509
+ <span class="wf-pill">Customer</span>
510
+ </div>
511
+ </div>
512
+ </div>
513
+ \`\`\`
514
+
515
+ **Mockups belong in the top visual review area.** Static visuals live on the
516
+ canvas; multi-step flows get both canvas wireframes and a prototype. When the
517
+ user asks for a mockup, UI state, loading state, layout, screen, or visual
518
+ comparison, make the canvas the primary home for that static visual. When the
519
+ user asks for a prototype or the plan contains a sequence the reviewer must
520
+ feel, keep the canvas artboards and add \`content.prototype\` so the top surface
521
+ shows Wireframes / Prototype tabs. Document blocks can explain, compare, or map
522
+ implementation, but they should not host the primary mockup or prototype just
523
+ because \`custom-html\`, screenshots, or prose are easier to produce. If the
524
+ canvas/prototype surface cannot represent the requested fidelity, still keep the
525
+ closest top-surface representation and call out or extend the needed renderer
526
+ capability.
527
+
528
+ **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
529
+ nodes instead of \`html\`; the renderer still accepts and displays it, but new
530
+ plans emit \`html\`. Do not author fresh kit-tree screens — write the HTML mockup
531
+ instead. Likewise, old or imported plans may carry coordinate-based regions or
532
+ free-float x/y on notes or artboards; those are legacy escape hatches the
533
+ renderer still shows but you must never produce. The \`surface\` drives the aspect
534
+ and footprint, the canvas auto-places artboards, and the gutter parks notes by
535
+ \`targetId\` + \`placement\`; never supply width, height, or coordinates for a new
536
+ plan.
363
537
 
364
- **Legacy imports only.** Old or imported plans may carry coordinate-based
365
- regions or a full standalone HTML document; the renderer still displays them.
366
- Never emit geometry, regions, or a standalone HTML document for a new plan —
367
- compose the kit tree instead.
368
538
  <!-- SHARED-CORE:wireframe-canvas END -->
369
539
 
370
540
  <!-- SHARED-CORE:document-quality START -->
541
+
371
542
  ## Document Quality Core
372
543
 
373
544
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
@@ -384,14 +555,19 @@ behavior). Replace vague prose with specifics; never ship a step like "make it
384
555
  work." No hero art, gradients, logos, nav bars, slogans, value props, giant
385
556
  landing-page headings, or marketing cards unless the user explicitly asks.
386
557
 
387
- **Canvas and document never duplicate each other.** The UI story lives on the
388
- canvas with on-canvas annotations; the document carries the technical depth the
389
- canvas cannot show concrete file/symbol maps, API and data contracts, code
390
- snippets, migration or implementation phases, risks, and validation. Repeat a
391
- wireframe in the document only for a genuinely new detail view or comparison.
392
- Skip the canvas entirely for non-visual work and write a clean rich document.
558
+ **Top visuals and document never duplicate each other.** The UI story lives in
559
+ the top visual surface: canvas artboards for static inspection, plus prototype
560
+ tabs when the flow should be functional. The document carries the technical depth
561
+ the visuals cannot show concrete file/symbol maps, API and data contracts,
562
+ code snippets, migration or implementation phases, risks, and validation. Repeat
563
+ a wireframe in the document only for a genuinely new detail view or comparison.
564
+ Skip the visual surface entirely for non-visual work and write a clean rich
565
+ document.
393
566
 
394
- **Use the right block, and make it carry substance:**
567
+ **Use the right block, and make it carry substance.** For the authoritative,
568
+ machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
569
+ — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
570
+ so you never emit a block the editor cannot render or round-trip:
395
571
 
396
572
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
397
573
  - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
@@ -409,46 +585,72 @@ Skip the canvas entirely for non-visual work and write a clean rich document.
409
585
  visual unless the tab is intentionally document-only.
410
586
  - \`table\`, \`checklist\`, \`callout\` for scannable structure.
411
587
 
412
- **Open questions are callouts, not buried prose.** Surface anything unresolved in
413
- a dedicated open-questions / needs-clarification block. Never put a
414
- questions/decisions wall inside the plan narrative.
588
+ **Open questions live at the bottom as a form when answers would change the
589
+ plan.** Surface answerable unresolved decisions in a final \`question-form\`
590
+ block titled "Open Questions". Use \`single\` or \`multi\` for clear choices,
591
+ \`freeform\` for constraints, \`recommended: true\` for the default you would pick,
592
+ and option \`wireframe\` / \`diagram\` previews for visual directions when useful.
593
+ Keep non-answerable assumptions or risks as concise \`callout\` blocks in the
594
+ relevant section. Never bury a questions/decisions wall inside the plan
595
+ narrative.
415
596
 
416
597
  **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
417
- inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a placeholder,
418
- density demo, or proof that custom HTML works. Prefer the native blocks; they
419
- cover real plans.
598
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
599
+ placeholder, density demo, or proof that custom HTML works. Prefer the native
600
+ blocks for normal plans. It may support supplemental demos or references, but it
601
+ is never the primary home for a requested mockup, UI state, or visual
602
+ comparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the
603
+ product fix is canvas support for that artifact type, not moving the mockup into
604
+ the document.
420
605
 
421
606
  **Before handoff, open the plan and check it.** Fix overlap, excessive
422
607
  whitespace, clipped fragments, misleading inactive controls, poor contrast, and
423
608
  unreadable diagrams before asking for approval.
609
+
424
610
  <!-- SHARED-CORE:document-quality END -->
425
611
 
426
612
  <!-- SHARED-CORE:exemplar START -->
613
+
427
614
  ## Good vs. Bad Exemplar
428
615
 
429
- **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard
430
- composed from the kit — a sidebar of real \`navItem\`s (\`Inbox 12\`, \`Today 4\`,
431
- \`Done\`), a \`main\` with a scripted \`title\`, real \`chips\`, a \`section\` labeled
432
- \`OVERDUE\`, and \`taskRow\`s carrying real titles, due dates, and priorities — one
433
- subtle whole-frame wobble, correct desktop footprint, and plain-text designer
434
- notes spaced off the frames pointing only at the controls that need explanation.
435
- Below it, a Claude/Codex-grade document: objective and done-criteria, an
436
- \`implementation-map\` naming the real components and actions with short
437
- highlighted snippets, a \`decision\` card weighing two real approaches, and a
438
- validation step none of it repeating the canvas. This is the bar.
439
-
440
- **BAD.** Empty coordinate boxes placed by \`x/y/width/height\`, gray placeholder
441
- bars "insinuating" text, crisp double-bordered rectangles or a heavy scribble, a
442
- forced desktop + mobile pair for a popover, floating bordered annotation cards
443
- hugging the frames, and a marketing-style document with a hero heading and value
444
- props that just restates what the canvas already shows. Never produce this.
616
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard whose
617
+ \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
618
+ \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
619
+ filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
620
+ titles, due dates, and a primary \`button.primary\` styled only through bare
621
+ elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
622
+ correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
623
+ designer notes sit spaced off the frame, pointing only at the controls that need
624
+ explanation. Below it, a Claude/Codex-grade document: objective and
625
+ done-criteria, an \`implementation-map\` naming the real components and actions
626
+ with short highlighted snippets, a \`decision\` card weighing two real approaches,
627
+ and a validation step none of it repeating the canvas. If the task also
628
+ changes a multi-step completion flow, the same top area includes a Prototype tab
629
+ whose screens use the same labels and states as the canvas artboards, with
630
+ \`data-goto\` controls for the sequence. This is the bar.
631
+
632
+ **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
633
+ pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
634
+ frame; a forced desktop + mobile pair for a popover; floating bordered
635
+ annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
636
+ instead of \`html\`; a multi-step UI flow with only static frames and no prototype
637
+ tab; a mockup escaped into a document \`custom-html\` block; and a marketing-style
638
+ document with a hero heading and value props that just restates what the canvas
639
+ already shows. Never produce this.
640
+
445
641
  <!-- SHARED-CORE:exemplar END -->
446
642
 
447
643
  ## Tool Guidance
448
644
 
449
- - \`create-visual-plan\`: start one structured visual plan per agent task/run.
645
+ - \`create-visual-plan\`: start one structured visual plan per agent task/run;
646
+ \`content\` may include no visual surface, canvas only, or canvas + prototype.
450
647
  - \`create-ui-plan\`: start a UI-first plan when the work is primarily product UI.
451
- - \`create-visual-questions\`: run a visual intake form before planning.
648
+ - \`create-prototype-plan\`: start a prototype-first plan with a functional top
649
+ review surface.
650
+ - \`convert-visual-plan-to-prototype\`: convert an existing HTML wireframe canvas
651
+ into a prototype plan.
652
+ - \`create-visual-questions\`: use only for the explicit \`/visual-questions\`
653
+ command, not as \`/visual-plan\` preflight.
452
654
  - \`visualize-plan\`: build a visual companion from an existing text plan.
453
655
  - \`update-visual-plan\`: revise content, status, or comments; prefer
454
656
  \`contentPatches\` over regenerating the whole plan.
@@ -459,13 +661,50 @@ props that just restates what the canvas already shows. Never produce this.
459
661
  - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
460
662
  - \`get-visual-plan\`: read the current structured plan, exported HTML, and
461
663
  annotations; it also returns the MDX folder for source workflows.
462
- - \`get-plan-feedback\`: read unconsumed human feedback. Use it frequently.
664
+ - \`get-plan-feedback\`: read unconsumed human feedback. Use it frequently; it
665
+ returns grouped threads, exact anchor details, expected resolver, and recent
666
+ review-event payloads so agents can act only on the comments meant for them.
463
667
  - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
464
668
  files for repo check-in.
465
669
 
466
670
  When the user critiques a plan's look or structure, fix the renderer or this
467
671
  skill — never hand-edit one stored plan. Turn feedback into better guidance.
468
672
 
673
+ ## Setup & Authentication
674
+
675
+ There are two ways into Plans.
676
+
677
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
678
+ installs the Plans skills, registers the hosted Plans MCP connector, and
679
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
680
+ intended), so the first tool call does not hit an OAuth wall:
681
+
682
+ \`\`\`bash
683
+ agent-native skills add visual-plan
684
+ \`\`\`
685
+
686
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/prototype-plan\`,
687
+ \`/visual-questions\`, \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
688
+ register the connector without authenticating, then run
689
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
690
+
691
+ **Browser (people you share with).** Open the Plans editor and create & edit
692
+ with no sign-up — you work as a guest. Sign in only when you want to save or
693
+ share; signing in claims the plans you made as a guest into your account.
694
+
695
+ Sharing and commenting require an account: public/shared plans are viewable by
696
+ anyone with the link, but commenting on them needs an agent-native account.
697
+
698
+ For fully offline, no-account use, run the Plans app locally and sync plans to
699
+ your repo as MDX. This local mode is a separate advanced path, not the default
700
+ hosted flow.
701
+
702
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
703
+ do not keep retrying the tool. Authenticate the connector with
704
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
705
+ instead re-run /mcp and choose Authenticate), then continue once the connector
706
+ is available.
707
+
469
708
  Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
470
709
  not put shared secrets in skill files.
471
710
  `;
@@ -482,13 +721,15 @@ metadata:
482
721
  # UI Plan
483
722
 
484
723
  Use \`/ui-plan\` when the task is primarily about product UI, user flows,
485
- interaction states, component layout, or visual direction. The reviewable UI
724
+ interaction details, component layout, or visual direction. The reviewable UI
486
725
  comes first; implementation detail comes after the user has something concrete to
487
726
  react to.
488
727
 
489
728
  \`/visual-plan\` remains the general command for architecture, backend, refactors,
490
- and mixed work. Use \`/visual-questions\` first when the user should answer intake
491
- questions, and \`/visualize-plan\` when a text plan already exists.
729
+ and mixed work. Use \`/prototype-plan\` when the UI review needs a functional live
730
+ prototype instead of static screens. Use \`/visual-questions\` only when the user
731
+ explicitly wants visual intake before planning, and \`/visualize-plan\` when a text
732
+ plan already exists.
492
733
 
493
734
  ## Plan Discipline
494
735
 
@@ -503,25 +744,35 @@ questions, and \`/visualize-plan\` when a text plan already exists.
503
744
  Start editing only after the user approves the UI direction.
504
745
  - **Clarify vs. assume.** Do not ask how to build the UI — present the direction
505
746
  and options as mockups and tabs. Ask a clarifying question only when an
506
- ambiguity would change the design; batch 2-4 before finalizing. Otherwise state
507
- the assumption in the plan and proceed.
747
+ ambiguity would change the design; use the host agent's normal
748
+ ask-user-question flow and batch 2-4 before finalizing. Do not call
749
+ \`create-visual-questions\` from \`/ui-plan\`; keep answerable follow-up inside
750
+ the same plan as a bottom \`question-form\` Open Questions block. Otherwise
751
+ state the assumption in the plan and proceed.
508
752
  - **The plan is the approval gate.** Ask the user to review and approve the UI
509
753
  direction before you write code, and name the files/areas the work touches.
510
754
 
511
755
  ## UI-First Workflow
512
756
 
513
- 1. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path, and
757
+ 1. Follow the host agent's normal planning flow: inspect the codebase, gather
758
+ the UI/component context needed, and ask native clarifying questions as needed
759
+ before generating the plan.
760
+ 2. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path, and
514
761
  structured \`content\`. The canvas comes first, the document second.
515
- 2. Compose the top canvas from the kit (see the cores below): the key artboards
762
+ 3. Compose the top canvas from the kit (see the cores below): the key artboards
516
763
  with real product content, designer notes, and connectors only for real
517
764
  sequences. Skip the canvas when wireframes would not clarify the work.
518
- 3. Continue below as a concise technical document not a second copy of the
765
+ 4. Continue below as a concise technical document that stays close to the
766
+ Markdown plan the agent would normally output — not a second copy of the
519
767
  canvas — covering concrete files, contracts, phases, risks, and validation.
520
- 4. Call \`get-plan-feedback\` before implementation, after review, after a long
521
- pause, and before the final response. Apply changes with \`update-visual-plan\`,
522
- preferring \`contentPatches\` for one frame, annotation, node, tab, or block. When the user
523
- wants source-control friendly edits, use \`patch-visual-plan-source\` against
524
- the MDX files instead of regenerating the plan.
768
+ 5. Call \`get-plan-feedback\` before implementation, after review, after a long
769
+ pause, and before the final response. Treat \`anchorDetails\`, resolver intent,
770
+ recent review events, and any focused screenshots from browser handoff as the
771
+ source of truth for exactly what changed and exactly what each UI comment
772
+ points at. Apply changes with \`update-visual-plan\`, preferring
773
+ \`contentPatches\` for one frame, annotation, node, tab, or block. When the
774
+ user wants source-control friendly edits, use \`patch-visual-plan-source\`
775
+ against the MDX files instead of regenerating the plan.
525
776
 
526
777
  ## Agent Handoff
527
778
 
@@ -531,87 +782,99 @@ code changes. Never claim feedback has been applied until \`get-plan-feedback\`
531
782
  the user has supplied it.
532
783
 
533
784
  <!-- SHARED-CORE:wireframe-canvas START -->
785
+
534
786
  ## Wireframe & Canvas Core
535
787
 
536
788
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
537
789
  \`/visualize-plan\`. It is the single source of truth for how wireframes and the
538
790
  canvas work. Do not paraphrase it per command.
539
791
 
540
- **The renderer owns all visual quality. You emit content, never styling.** Flex
541
- layout, fonts, density, spacing, theme, and the hand-drawn wobble all live in
542
- the app renderer. Never emit coordinates, CSS, pixel sizes, or raw HTML for a
543
- wireframe's internals. Your job is to pick a surface, compose real product
544
- content from the kit, and annotate — nothing else.
792
+ **A wireframe is an HTML mockup. The renderer owns the look; you write the
793
+ content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
794
+ screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
795
+ the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
796
+ never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags, font-family, hex colors,
797
+ or any width/height/coordinates. You write real HTML layout and real product
798
+ content; the renderer styles and roughens it.
545
799
 
546
- **A wireframe block's data is a declarative kit tree, not geometry:**
800
+ **A wireframe block's data is an HTML screen plus a surface:**
547
801
 
548
802
  \`\`\`json
549
803
  {
550
- "surface": "desktop",
551
- "screen": [
552
- { "el": "browserBar", "title": "tasklist" },
553
- { "el": "row", "children": [
554
- { "el": "sidebar", "children": [
555
- { "el": "navItem", "label": "Inbox", "count": 12, "active": true },
556
- { "el": "navItem", "label": "Today", "count": 4 },
557
- { "el": "navItem", "label": "Done" }
558
- ] },
559
- { "el": "main", "children": [
560
- { "el": "title", "text": "Today", "script": true },
561
- { "el": "chips", "items": [
562
- { "label": "All", "active": true }, { "label": "Active" }, { "label": "Done" }
563
- ] },
564
- { "el": "section", "label": "OVERDUE", "tone": "warn" },
565
- { "el": "taskRow", "title": "Send invoice to Acme Co.", "due": "Yesterday", "dueTone": "warn", "prio": 1 },
566
- { "el": "taskRow", "title": "Reply to design feedback", "due": "Today", "prio": 2 }
567
- ] }
568
- ] }
569
- ]
804
+ "surface": "browser",
805
+ "html": "<div style=\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\"><h1>Sign in</h1><p class=\\"wf-muted\\">Use your work email to continue.</p><div class=\\"wf-card\\" style=\\"display:flex;flex-direction:column;gap:10px\\"><label>Email<input value=\\"jane@acme.co\\" /></label><label>Password<input value=\\"••••••••\\" /></label><label style=\\"display:flex;align-items:center;gap:8px\\"><input type=\\"checkbox\\" checked /> Remember me</label><button class=\\"primary\\">Sign in</button></div><a href=\\"#\\">Forgot password?</a></div>"
570
806
  }
571
807
  \`\`\`
572
808
 
573
- The renderer maps each node to a flex kit component and applies one whole-frame
574
- wobble. Layout is always flex: \`row\`, \`col\`, \`sidebar\`, and \`main\` set the flex
575
- direction; everything aligns by construction, so you never get overlap or drift.
809
+ **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
810
+ (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
811
+ are auto-themed no classes needed. Helper classes carry the rest:
812
+
813
+ - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
814
+ - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
815
+ (\`<span class="wf-pill accent">\`) for the accent-filled variant.
816
+ - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
817
+ - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
818
+ primary button.
819
+
820
+ **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
821
+ these on light/dark, so reading them is what keeps a mockup correct in both
822
+ themes. For any inline border, background, or text color, reference a token:
823
+ \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
824
+ \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
825
+ (page background), \`--wf-card\` (raised surface), \`--wf-accent\` /
826
+ \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
827
+ and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
828
+ renderer owns the sketch/clean font.
829
+
830
+ **Lay out with inline \`style\` flex/grid.** You write the real layout —
831
+ \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
832
+ renderer never repositions anything. Compose the actual product: reproduce the
833
+ current screen, then show the modification. Real labels, real counts, real dates,
834
+ real button text grounded in the screen you read; not lorem or gray bars.
576
835
 
577
836
  **Surface presets — match the real footprint, never default to desktop+mobile.**
578
837
  Pick the \`surface\` that matches what the user will actually see:
579
838
 
580
- - \`desktop\`: a full page or app shell.
839
+ - \`browser\`: a web page that needs a browser chrome frame around it.
840
+ - \`desktop\`: a full desktop app page or app shell.
581
841
  - \`mobile\`: a phone screen, only when the work is genuinely mobile.
582
842
  - \`popover\`: a small floating menu, dropdown, or inline popover.
583
843
  - \`panel\`: a side panel, inspector, or sidebar widget.
584
- - \`browser\`: a page that needs a browser chrome frame around it.
585
844
 
845
+ The surface locks the footprint and aspect; never set width/height/coordinates.
586
846
  A sidebar popover renders as a small surface, not a desktop page and a phone
587
847
  frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
588
848
  actually changes the layout. For a component or widget, show one broader
589
849
  app-context frame only when placement affects understanding, then the focused
590
850
  component states.
591
851
 
592
- **Node vocabulary (\`el\` values).** Every node is \`{ el, ...props, children? }\`:
593
-
594
- - Layout: \`screen\`, \`row\`, \`col\`, \`sidebar\`, \`main\`, \`card{children}\`,
595
- \`column{title,count?,children}\`, \`box{children,dashed?}\`, \`divider\`.
596
- - Chrome: \`browserBar{title}\`, \`statusBar\`, \`searchBar\`, \`toolbar\`.
597
- - Navigation: \`navItem{label,count?,active?,dot?}\`, \`tabs\`/\`chips{items:[{label,active?}]}\`,
598
- \`chip{label,active?}\`, \`pill{label,tone?}\`.
599
- - Content: \`title{text,script?}\`, \`text{value,color?,weight?}\`,
600
- \`lines{n?,widths?}\`, \`section{label,tone?}\`,
601
- \`taskRow{title,note?,due?,dueTone?,prio?,done?}\`, \`kv{rows:[{k,v}]}\`,
602
- \`avatar\`, \`iconSquare{active?}\`.
603
- - Inputs: \`field{label?,value?,placeholder?,area?}\`, \`check{done?,shape?}\`,
604
- \`btn{label,solid?,full?}\`, \`fab{icon?}\`.
605
-
606
- Put **real product content** in props: real labels, real dates, real counts,
607
- real button text grounded in the actual screen or component you read. Use
608
- \`lines\`/\`text\` (with no \`value\`) only for genuine placeholder body copy — never
609
- fill a screen with gray placeholder bars. Buttons (\`btn\`, \`fab\`) must read as
610
- actionable controls.
611
-
612
- **Default crisp.** Sketchiness is a low default (a subtle single wobble over the
613
- whole frame), not a heavy scribble. Do not ask for or assume a heavy sketch
614
- look.
852
+ **Modify, don't redesign.** When the task changes an existing screen, reproduce
853
+ the current screen's real layout and footprint FIRST, then change only the delta
854
+ and call it out with a single annotation. Do not restack the page into a new
855
+ layout. For net-new surfaces, compose from the real app shell.
856
+
857
+ **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
858
+ popover, menu, dialog, toast), show the full screen once, then add a small
859
+ separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
860
+ the whole page around it, and do not scale a duplicate up. Pick the matching
861
+ \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
862
+ page width.
863
+
864
+ **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
865
+ fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
866
+ built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
867
+ no labels or copy. The renderer drops borders, sketch, and color into the
868
+ skeleton register automatically. Never escape to a \`custom-html\` document block
869
+ to fake a loader, and never move a mockup out of the canvas — mockups always
870
+ live in canvas artboards.
871
+
872
+ **Editing an existing mockup.** To change one element, text, or color in an
873
+ existing html mockup, do NOT regenerate the frame call \`update-visual-plan\`
874
+ with \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
875
+ replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
876
+ first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
877
+ occurrence. The result is re-sanitized.
615
878
 
616
879
  **Canvas annotations are designer notes on the artboard.** When a top canvas is
617
880
  present, sprinkle Figma-style notes near the frames they explain: a short
@@ -622,8 +885,16 @@ point at one specific control or transition; for a broad frame-level note, write
622
885
  text beside the frame with no connector. Connectors are for real sequences only —
623
886
  never fake "Step 1 → Step 2" lines between independent states.
624
887
 
625
- **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
626
- (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
888
+ **Do not create overlapping annotations.** Anchor each note to the frame it
889
+ explains with \`targetId\` + \`placement\` (top/right/bottom/left). The renderer
890
+ parks notes in a gutter beside the frame and lays them out automatically — never
891
+ supply x/y or points for anchored notes; hand-placed coordinates fight the
892
+ auto-layout and cause the overlap you're trying to avoid. Reserve arrows for a
893
+ note that must point at a specific control inside a frame; a note that simply
894
+ sits beside its frame needs no arrow.
895
+
896
+ **Patching.** Edit one wireframe, canvas annotation, or block with targeted \`contentPatches\`
897
+ (for example \`update-block\`, \`replace-blocks\`, \`update-canvas-annotation\`) rather
627
898
  than regenerating the whole plan. \`contentPatches\` are part of the public MCP
628
899
  action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
629
900
  edits. If an agent is working from exported source files, use
@@ -632,14 +903,71 @@ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
632
903
  \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
633
904
  patch action normalizes the MDX back into the same JSON runtime model. JSON is
634
905
  the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
906
+ In the browser, humans edit \`rich-text\` prose inline; agents should still use
907
+ \`update-rich-text\` content patches or source patches for prose, and use
908
+ comments/structured patches for canvas, artboard, wireframe, and diagram edits.
909
+
910
+ **Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an \`html\` wireframe (or reference a wireframe block via \`blockId\`) — a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.
911
+
912
+ **Fill the frame; keep labels short.** Each artboard is a fixed-size surface — compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (\`flex:1\`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column — shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).
913
+
914
+ **Good example — a contacts list, surface \`browser\`.** A small, real screen
915
+ composed from the helper classes and tokens, layout in inline flex, no fonts or
916
+ hex colors:
917
+
918
+ \`\`\`html
919
+ <div style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%">
920
+ <div style="display:flex;align-items:center;justify-content:space-between">
921
+ <h1>Contacts</h1>
922
+ <button class="primary">New contact</button>
923
+ </div>
924
+ <div style="display:flex;gap:6px">
925
+ <span class="wf-pill accent">All 128</span>
926
+ <span class="wf-pill">Favorites</span>
927
+ <span class="wf-pill">Archived</span>
928
+ </div>
929
+ <div class="wf-card" style="display:flex;flex-direction:column;gap:0;padding:0">
930
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)">
931
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
932
+ <div style="flex:1"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>
933
+ <span class="wf-pill">Lead</span>
934
+ </div>
935
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
936
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
937
+ <div style="flex:1"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>
938
+ <span class="wf-pill">Customer</span>
939
+ </div>
940
+ </div>
941
+ </div>
942
+ \`\`\`
943
+
944
+ **Mockups belong in the top visual review area.** Static visuals live on the
945
+ canvas; multi-step flows get both canvas wireframes and a prototype. When the
946
+ user asks for a mockup, UI state, loading state, layout, screen, or visual
947
+ comparison, make the canvas the primary home for that static visual. When the
948
+ user asks for a prototype or the plan contains a sequence the reviewer must
949
+ feel, keep the canvas artboards and add \`content.prototype\` so the top surface
950
+ shows Wireframes / Prototype tabs. Document blocks can explain, compare, or map
951
+ implementation, but they should not host the primary mockup or prototype just
952
+ because \`custom-html\`, screenshots, or prose are easier to produce. If the
953
+ canvas/prototype surface cannot represent the requested fidelity, still keep the
954
+ closest top-surface representation and call out or extend the needed renderer
955
+ capability.
956
+
957
+ **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
958
+ nodes instead of \`html\`; the renderer still accepts and displays it, but new
959
+ plans emit \`html\`. Do not author fresh kit-tree screens — write the HTML mockup
960
+ instead. Likewise, old or imported plans may carry coordinate-based regions or
961
+ free-float x/y on notes or artboards; those are legacy escape hatches the
962
+ renderer still shows but you must never produce. The \`surface\` drives the aspect
963
+ and footprint, the canvas auto-places artboards, and the gutter parks notes by
964
+ \`targetId\` + \`placement\`; never supply width, height, or coordinates for a new
965
+ plan.
635
966
 
636
- **Legacy imports only.** Old or imported plans may carry coordinate-based
637
- regions or a full standalone HTML document; the renderer still displays them.
638
- Never emit geometry, regions, or a standalone HTML document for a new plan —
639
- compose the kit tree instead.
640
967
  <!-- SHARED-CORE:wireframe-canvas END -->
641
968
 
642
969
  <!-- SHARED-CORE:document-quality START -->
970
+
643
971
  ## Document Quality Core
644
972
 
645
973
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
@@ -656,14 +984,19 @@ behavior). Replace vague prose with specifics; never ship a step like "make it
656
984
  work." No hero art, gradients, logos, nav bars, slogans, value props, giant
657
985
  landing-page headings, or marketing cards unless the user explicitly asks.
658
986
 
659
- **Canvas and document never duplicate each other.** The UI story lives on the
660
- canvas with on-canvas annotations; the document carries the technical depth the
661
- canvas cannot show concrete file/symbol maps, API and data contracts, code
662
- snippets, migration or implementation phases, risks, and validation. Repeat a
663
- wireframe in the document only for a genuinely new detail view or comparison.
664
- Skip the canvas entirely for non-visual work and write a clean rich document.
987
+ **Top visuals and document never duplicate each other.** The UI story lives in
988
+ the top visual surface: canvas artboards for static inspection, plus prototype
989
+ tabs when the flow should be functional. The document carries the technical depth
990
+ the visuals cannot show concrete file/symbol maps, API and data contracts,
991
+ code snippets, migration or implementation phases, risks, and validation. Repeat
992
+ a wireframe in the document only for a genuinely new detail view or comparison.
993
+ Skip the visual surface entirely for non-visual work and write a clean rich
994
+ document.
665
995
 
666
- **Use the right block, and make it carry substance:**
996
+ **Use the right block, and make it carry substance.** For the authoritative,
997
+ machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
998
+ — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
999
+ so you never emit a block the editor cannot render or round-trip:
667
1000
 
668
1001
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
669
1002
  - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
@@ -681,45 +1014,70 @@ Skip the canvas entirely for non-visual work and write a clean rich document.
681
1014
  visual unless the tab is intentionally document-only.
682
1015
  - \`table\`, \`checklist\`, \`callout\` for scannable structure.
683
1016
 
684
- **Open questions are callouts, not buried prose.** Surface anything unresolved in
685
- a dedicated open-questions / needs-clarification block. Never put a
686
- questions/decisions wall inside the plan narrative.
1017
+ **Open questions live at the bottom as a form when answers would change the
1018
+ plan.** Surface answerable unresolved decisions in a final \`question-form\`
1019
+ block titled "Open Questions". Use \`single\` or \`multi\` for clear choices,
1020
+ \`freeform\` for constraints, \`recommended: true\` for the default you would pick,
1021
+ and option \`wireframe\` / \`diagram\` previews for visual directions when useful.
1022
+ Keep non-answerable assumptions or risks as concise \`callout\` blocks in the
1023
+ relevant section. Never bury a questions/decisions wall inside the plan
1024
+ narrative.
687
1025
 
688
1026
  **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
689
- inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a placeholder,
690
- density demo, or proof that custom HTML works. Prefer the native blocks; they
691
- cover real plans.
1027
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
1028
+ placeholder, density demo, or proof that custom HTML works. Prefer the native
1029
+ blocks for normal plans. It may support supplemental demos or references, but it
1030
+ is never the primary home for a requested mockup, UI state, or visual
1031
+ comparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the
1032
+ product fix is canvas support for that artifact type, not moving the mockup into
1033
+ the document.
692
1034
 
693
1035
  **Before handoff, open the plan and check it.** Fix overlap, excessive
694
1036
  whitespace, clipped fragments, misleading inactive controls, poor contrast, and
695
1037
  unreadable diagrams before asking for approval.
1038
+
696
1039
  <!-- SHARED-CORE:document-quality END -->
697
1040
 
698
1041
  <!-- SHARED-CORE:exemplar START -->
1042
+
699
1043
  ## Good vs. Bad Exemplar
700
1044
 
701
- **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard
702
- composed from the kit — a sidebar of real \`navItem\`s (\`Inbox 12\`, \`Today 4\`,
703
- \`Done\`), a \`main\` with a scripted \`title\`, real \`chips\`, a \`section\` labeled
704
- \`OVERDUE\`, and \`taskRow\`s carrying real titles, due dates, and priorities — one
705
- subtle whole-frame wobble, correct desktop footprint, and plain-text designer
706
- notes spaced off the frames pointing only at the controls that need explanation.
707
- Below it, a Claude/Codex-grade document: objective and done-criteria, an
708
- \`implementation-map\` naming the real components and actions with short
709
- highlighted snippets, a \`decision\` card weighing two real approaches, and a
710
- validation step none of it repeating the canvas. This is the bar.
711
-
712
- **BAD.** Empty coordinate boxes placed by \`x/y/width/height\`, gray placeholder
713
- bars "insinuating" text, crisp double-bordered rectangles or a heavy scribble, a
714
- forced desktop + mobile pair for a popover, floating bordered annotation cards
715
- hugging the frames, and a marketing-style document with a hero heading and value
716
- props that just restates what the canvas already shows. Never produce this.
1045
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard whose
1046
+ \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
1047
+ \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
1048
+ filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
1049
+ titles, due dates, and a primary \`button.primary\` styled only through bare
1050
+ elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
1051
+ correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
1052
+ designer notes sit spaced off the frame, pointing only at the controls that need
1053
+ explanation. Below it, a Claude/Codex-grade document: objective and
1054
+ done-criteria, an \`implementation-map\` naming the real components and actions
1055
+ with short highlighted snippets, a \`decision\` card weighing two real approaches,
1056
+ and a validation step none of it repeating the canvas. If the task also
1057
+ changes a multi-step completion flow, the same top area includes a Prototype tab
1058
+ whose screens use the same labels and states as the canvas artboards, with
1059
+ \`data-goto\` controls for the sequence. This is the bar.
1060
+
1061
+ **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
1062
+ pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
1063
+ frame; a forced desktop + mobile pair for a popover; floating bordered
1064
+ annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
1065
+ instead of \`html\`; a multi-step UI flow with only static frames and no prototype
1066
+ tab; a mockup escaped into a document \`custom-html\` block; and a marketing-style
1067
+ document with a hero heading and value props that just restates what the canvas
1068
+ already shows. Never produce this.
1069
+
717
1070
  <!-- SHARED-CORE:exemplar END -->
718
1071
 
719
1072
  ## Tool Guidance
720
1073
 
721
1074
  - \`create-ui-plan\`: create the UI-first structured visual plan.
722
- - \`create-visual-questions\`: run a visual intake form before the UI plan.
1075
+ - \`create-prototype-plan\`: create a prototype-first plan when UI review needs a
1076
+ functional live prototype.
1077
+ - \`convert-visual-plan-to-prototype\`: convert an existing HTML wireframe canvas
1078
+ into a prototype plan.
1079
+ - \`create-visual-questions\`: use only for the explicit \`/visual-questions\`
1080
+ command, not as \`/ui-plan\` preflight.
723
1081
  - \`update-visual-plan\`: revise content, mockups, comments, or handoff notes;
724
1082
  prefer targeted \`contentPatches\`.
725
1083
  - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
@@ -729,20 +1087,218 @@ props that just restates what the canvas already shows. Never produce this.
729
1087
  - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
730
1088
  - \`get-visual-plan\`: inspect the current structured plan, exported HTML, and
731
1089
  annotations; it also returns the MDX folder for source workflows.
732
- - \`get-plan-feedback\`: read unconsumed reviewer comments before coding.
1090
+ - \`get-plan-feedback\`: read unconsumed reviewer comments before coding; it
1091
+ returns grouped threads, exact anchor details, expected resolver, and recent
1092
+ review-event payloads so agents can act only on the comments meant for them.
733
1093
  - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
734
1094
  files for repo check-in.
735
1095
 
736
1096
  When the user critiques a plan's look or structure, fix the renderer or this
737
1097
  skill — never hand-edit one stored plan. Turn feedback into better guidance.
738
1098
 
739
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
1099
+ ## Setup & Authentication
1100
+
1101
+ There are two ways into Plans.
1102
+
1103
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
1104
+ installs the Plans skills, registers the hosted Plans MCP connector, and
1105
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
1106
+ intended), so the first tool call does not hit an OAuth wall:
1107
+
1108
+ \`\`\`bash
1109
+ agent-native skills add visual-plan
1110
+ \`\`\`
1111
+
1112
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/prototype-plan\`,
1113
+ \`/visual-questions\`, \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
1114
+ register the connector without authenticating, then run
1115
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
1116
+
1117
+ **Browser (people you share with).** Open the Plans editor and create & edit
1118
+ with no sign-up — you work as a guest. Sign in only when you want to save or
1119
+ share; signing in claims the plans you made as a guest into your account.
1120
+
1121
+ Sharing and commenting require an account: public/shared plans are viewable by
1122
+ anyone with the link, but commenting on them needs an agent-native account.
1123
+
1124
+ For fully offline, no-account use, run the Plans app locally and sync plans to
1125
+ your repo as MDX. This local mode is a separate advanced path, not the default
1126
+ hosted flow.
1127
+
1128
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
1129
+ do not keep retrying the tool. Authenticate the connector with
1130
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
1131
+ instead re-run /mcp and choose Authenticate), then continue once the connector
1132
+ is available.
1133
+
1134
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1135
+ not put shared secrets in skill files.
1136
+ `;
1137
+ export const PROTOTYPE_PLAN_SKILL_MD = `---
1138
+ name: prototype-plan
1139
+ description: >-
1140
+ Use Agent-Native Plans for /prototype-plan when work needs a functional
1141
+ prototype-first plan, static mocks, comments, review toggles, or conversion
1142
+ from a visual plan.
1143
+ metadata:
1144
+ visibility: exported
1145
+ ---
1146
+
1147
+ # Prototype Plan
1148
+
1149
+ \`/prototype-plan\` creates a plan whose primary review surface is a live,
1150
+ functional prototype above the document. Use it when the user needs to feel a
1151
+ flow, operate basic UI state, or comment on interaction before implementation
1152
+ hardens the decision.
1153
+
1154
+ ## Rule
1155
+
1156
+ Make the prototype answer a concrete question. The plan should say what is being
1157
+ tested, show the functional prototype first, then keep static mocks and implementation
1158
+ notes in the document below.
1159
+
1160
+ ## When To Use
1161
+
1162
+ Use \`/prototype-plan\` when the user asks for a prototype, wants to click through
1163
+ and operate UI states, needs design review before code, wants comments pinned to
1164
+ live screens, or asks to move a visual plan into a prototype.
1165
+
1166
+ Prefer \`/visual-plan\` for architecture, data flow, or non-interactive planning.
1167
+ Prefer \`/ui-plan\` when static screen review is enough. Use \`/visualize-plan\`
1168
+ first only when the user hands you an existing Markdown/Codex/Claude plan that
1169
+ needs a visual companion before becoming interactive.
1170
+
1171
+ ## Core Workflow
1172
+
1173
+ 1. Inspect the real codebase and decide the question the prototype should
1174
+ answer. Good examples: "Does this onboarding flow feel short enough?" or
1175
+ "Which dashboard density should we implement?"
1176
+ 2. Call \`create-prototype-plan\` with a title, brief, and screen HTML. Default to
1177
+ one functional prototype screen when local UI behavior is enough; use 2-4
1178
+ screens only for true routes, steps, or materially different contexts. The
1179
+ returned plan opens with the prototype viewer on top and static mocks, flow
1180
+ diagram, implementation map, and verification below.
1181
+ 3. Make controls actually work. Use the renderer's safe Alpine-like directives:
1182
+ \`x-data\`, \`x-model\`, \`x-for\`, \`x-text\`, \`x-show\`, \`:class\`, \`@click\`, and
1183
+ \`@keydown.enter\`. Use safe helper verbs such as \`remove(list, item)\`,
1184
+ \`setAll(list, 'done', true)\`, \`removeWhere(list, 'done', true)\`, and counters
1185
+ such as \`count(list)\`, \`countWhere(list, 'done', true)\`, and
1186
+ \`remaining(list, 'done')\` when they help. Use \`data-goto="screen-id"\` only
1187
+ for true screen/route changes, not for every button press.
1188
+ 4. Show important app feedback inside the prototype itself: selected filters,
1189
+ checked rows, typed drafts, validation messages, permissions, progress, or
1190
+ empty states.
1191
+ 5. Surface the returned Plans link and ask the user to click through, comment on
1192
+ the prototype or static mocks, and approve the direction before code changes.
1193
+ 6. Before implementing or revising, call \`get-plan-feedback\`. Treat prototype
1194
+ anchors, screenshots, and resolver intent as the source of truth.
1195
+ 7. Update with \`update-visual-plan\` content patches. Use
1196
+ \`patch-prototype-html\`, \`update-prototype-screen\`, or \`set-prototype\` for
1197
+ targeted prototype edits instead of regenerating the whole plan.
1198
+
1199
+ ## Converting A Visual Plan
1200
+
1201
+ When a visual plan already has HTML canvas wireframes, call
1202
+ \`convert-visual-plan-to-prototype\` with the plan id. This derives prototype
1203
+ screens from the canvas frames, preserves the canvas/static mocks by default,
1204
+ and changes the top review surface to the prototype viewer.
1205
+
1206
+ Use \`removeCanvas: true\` only when the user explicitly wants the old canvas
1207
+ gone. Otherwise keep static mocks available for source export and detailed
1208
+ review.
1209
+
1210
+ ## Prototype Screen HTML
1211
+
1212
+ Write bounded semantic HTML fragments only:
1213
+
1214
+ \`\`\`html
1215
+ <div style="display:flex;flex-direction:column;gap:14px;padding:18px;height:100%">
1216
+ <header style="display:flex;justify-content:space-between;gap:12px">
1217
+ <div>
1218
+ <h1>Launch checklist</h1>
1219
+ <p class="wf-muted">Reviewer can add, complete, filter, and remove tasks.</p>
1220
+ </div>
1221
+ <span class="wf-pill accent">Live prototype</span>
1222
+ </header>
1223
+ <section
1224
+ class="wf-card"
1225
+ x-data="{ draft: '', filter: 'all', todos: [{ text: 'Check copy', done: false }, { text: 'Confirm owner', done: true }] }"
1226
+ style="display:flex;flex-direction:column;gap:10px"
1227
+ >
1228
+ <div style="display:flex;gap:8px">
1229
+ <input x-model="draft" @keydown.enter="draft && todos.push({ text: draft, done: false }); draft = ''" placeholder="Add task" />
1230
+ <button class="primary" @click="draft && todos.push({ text: draft, done: false }); draft = ''">Add</button>
1231
+ </div>
1232
+ <div style="display:flex;gap:8px">
1233
+ <button @click="filter = 'all'" :class="{ primary: filter === 'all' }">All</button>
1234
+ <button @click="filter = 'done'" :class="{ primary: filter === 'done' }">Done</button>
1235
+ <button @click="setAll(todos, 'done', true)">Mark all done</button>
1236
+ </div>
1237
+ <p class="wf-muted"><span x-text="remaining(todos, 'done')"></span> open / <span x-text="count(todos)"></span> total</p>
1238
+ <div
1239
+ class="wf-box"
1240
+ x-for="todo in todos"
1241
+ x-show="filter === 'all' || (filter === 'done' && todo.done)"
1242
+ :class="{ 'is-done': todo.done }"
1243
+ style="display:flex;justify-content:space-between;gap:10px"
1244
+ >
1245
+ <label style="display:flex;gap:8px"><input type="checkbox" x-model="todo.done" /><span x-text="todo.text"></span></label>
1246
+ <button @click="remove(todos, todo)">Remove</button>
1247
+ </div>
1248
+ <button @click="removeWhere(todos, 'done', true)">Clear completed</button>
1249
+ </section>
1250
+ </div>
1251
+ \`\`\`
1252
+
1253
+ Use real labels, counts, dates, and controls grounded in the target app. Keep
1254
+ surfaces honest: \`browser\` for web pages, \`desktop\` for app shells, \`mobile\`
1255
+ only for real mobile work, \`panel\` for side panels, and \`popover\` for menus.
1256
+
1257
+ Do not include \`<html>\`, \`<body>\`, \`<script>\`, \`<style>\`, browser \`on*\`
1258
+ handler attributes such as \`onclick\`, fake APIs, raw secrets, or customer data.
1259
+ The renderer owns sketchy/clean mode, theme, surface sizing, rough outlines, and
1260
+ comment overlays.
1261
+
1262
+ ## Review Surface
1263
+
1264
+ Prototype plans support:
1265
+
1266
+ - real local controls through safe prototype directives
1267
+ - optional screen/route transitions from \`data-goto\`
1268
+ - rough vs clean mode through the shared wireframe toggle
1269
+ - dark vs light mode through the shared theme toggle
1270
+ - comment visibility from the prototype toolbar
1271
+ - Figma-style comments pinned directly on live prototype screens
1272
+ - a popout URL with \`?prototype=1\` for focused browser review
1273
+ - static wireframe mocks in the document body where they help implementation
1274
+
1275
+ ## Source Files
1276
+
1277
+ Runtime JSON is canonical. Source export uses:
1278
+
1279
+ - \`plan.mdx\` for document blocks
1280
+ - \`prototype.mdx\` for \`<Prototype>\`, \`<PrototypeScreen>\`, and
1281
+ \`<PrototypeTransition>\`
1282
+ - \`canvas.mdx\` for static mocks when a canvas is present
1283
+ - \`.plan-state.json\` for persisted viewport state
1284
+
1285
+ Patch source with \`patch-visual-plan-source\` only when the user wants
1286
+ source-control friendly edits. Patch runtime content when the user is simply
1287
+ reviewing and iterating.
1288
+
1289
+ ## Related Skills
1290
+
1291
+ - \`visual-plan\`
1292
+ - \`ui-plan\`
1293
+ - \`visualize-plan\`
1294
+ - \`visual-questions\`
740
1295
  `;
741
1296
  export const VISUAL_QUESTIONS_SKILL_MD = `---
742
1297
  name: visual-questions
743
1298
  description: >-
744
- Use Agent-Native Plans to ask rich visual intake questions before creating a
745
- UI plan or visual plan.
1299
+ Use Agent-Native Plans to ask rich visual intake questions when
1300
+ /visual-questions is explicitly requested before creating a UI plan or visual
1301
+ plan.
746
1302
  metadata:
747
1303
  visibility: both
748
1304
  ---
@@ -752,8 +1308,8 @@ metadata:
752
1308
  Use \`/visual-questions\` when the next best step is not a plan yet, but a
753
1309
  reviewable visual intake: single-choice chips, multi-select chips, freeform
754
1310
  notes, mockup choices, sketch diagrams, and a generated answer summary that feeds
755
- the next planning prompt. It composes with \`/visual-plan\`, \`/ui-plan\`, and
756
- \`/visualize-plan\`.
1311
+ the next planning prompt. It composes with \`/visual-plan\`, \`/ui-plan\`,
1312
+ \`/prototype-plan\`, and \`/visualize-plan\`.
757
1313
 
758
1314
  ## When To Use
759
1315
 
@@ -764,9 +1320,12 @@ the next planning prompt. It composes with \`/visual-plan\`, \`/ui-plan\`, and
764
1320
  than answering text-only prompts.
765
1321
 
766
1322
  Gate hard: skip this for tiny, unambiguous changes. If the agent can reasonably
767
- infer the answer, prefer \`/ui-plan\` or \`/visual-plan\` directly and put
1323
+ infer the answer, prefer \`/ui-plan\`, \`/prototype-plan\`, or \`/visual-plan\` directly and put
768
1324
  assumptions in the plan.
769
1325
 
1326
+ Visual questions are an explicit intake command, not an automatic preflight for
1327
+ \`/visual-plan\`, \`/ui-plan\`, or \`/prototype-plan\`.
1328
+
770
1329
  ## Workflow
771
1330
 
772
1331
  1. Call \`create-visual-questions\` with a clear title, brief, source, and repo
@@ -774,10 +1333,11 @@ assumptions in the plan.
774
1333
  2. Omit \`questions\` for the default UI intake. Provide a custom \`questions\` array
775
1334
  only when the task has domain-specific choices.
776
1335
  3. Surface the returned Plans link and ask the user to answer visually.
777
- 4. The generated summary drives the next step: \`create-ui-plan\` for UI flows,
1336
+ 4. The generated summary drives the next step: \`create-ui-plan\` for static UI
1337
+ review, \`create-prototype-plan\` for click-through UI flows,
778
1338
  \`create-visual-plan\` for general plans, \`visualize-plan\` when a text plan
779
- already exists, or \`update-visual-plan\` with targeted \`contentPatches\` to fold
780
- answers into an active plan.
1339
+ already exists, or \`update-visual-plan\` with targeted \`contentPatches\` to
1340
+ fold answers into an active plan.
781
1341
  5. If the user leaves comments, call \`get-plan-feedback\` before using the answers.
782
1342
 
783
1343
  ## Question Types
@@ -812,6 +1372,8 @@ desktop/mobile pair for a popover, panel, or component.
812
1372
  - \`get-visual-plan\`: inspect the current visual question plan.
813
1373
  - \`get-plan-feedback\`: read comments before creating or updating the next plan.
814
1374
  - \`create-ui-plan\`: create a UI-first plan from the answers.
1375
+ - \`create-prototype-plan\`: create a prototype-first plan from the answers when
1376
+ interaction feel matters.
815
1377
  - \`create-visual-plan\`: create a general visual plan from the answers.
816
1378
  - \`visualize-plan\`: enrich an existing text plan after answers are gathered.
817
1379
  - \`export-visual-plan\`: export answer plans as HTML, Markdown fallback,
@@ -819,14 +1381,50 @@ desktop/mobile pair for a popover, panel, or component.
819
1381
  - \`read-visual-plan-source\` / \`patch-visual-plan-source\`: inspect or patch the
820
1382
  MDX source if another agent is operating from checked-in plan files.
821
1383
 
822
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
1384
+ ## Setup & Authentication
1385
+
1386
+ There are two ways into Plans.
1387
+
1388
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
1389
+ installs the Plans skills, registers the hosted Plans MCP connector, and
1390
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
1391
+ intended), so the first tool call does not hit an OAuth wall:
1392
+
1393
+ \`\`\`bash
1394
+ agent-native skills add visual-plan
1395
+ \`\`\`
1396
+
1397
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/prototype-plan\`,
1398
+ \`/visual-questions\`, \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
1399
+ register the connector without authenticating, then run
1400
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
1401
+
1402
+ **Browser (people you share with).** Open the Plans editor and create & edit
1403
+ with no sign-up — you work as a guest. Sign in only when you want to save or
1404
+ share; signing in claims the plans you made as a guest into your account.
1405
+
1406
+ Sharing and commenting require an account: public/shared plans are viewable by
1407
+ anyone with the link, but commenting on them needs an agent-native account.
1408
+
1409
+ For fully offline, no-account use, run the Plans app locally and sync plans to
1410
+ your repo as MDX. This local mode is a separate advanced path, not the default
1411
+ hosted flow.
1412
+
1413
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
1414
+ do not keep retrying the tool. Authenticate the connector with
1415
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
1416
+ instead re-run /mcp and choose Authenticate), then continue once the connector
1417
+ is available.
1418
+
1419
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1420
+ not put shared secrets in skill files.
823
1421
  `;
824
1422
  export const VISUALIZE_PLAN_SKILL_MD = `---
825
1423
  name: visualize-plan
826
1424
  description: >-
827
1425
  Convert an existing Codex, Claude Code, Markdown, or pasted plan into an
828
- Agent-Native Plans visual companion with diagrams, wireframes, annotations, and
829
- feedback.
1426
+ Agent-Native Plans visual companion with diagrams, wireframes, prototypes,
1427
+ annotations, and feedback.
830
1428
  metadata:
831
1429
  visibility: exported
832
1430
  ---
@@ -836,8 +1434,14 @@ metadata:
836
1434
  Use \`/visualize-plan\` when a plan already exists and the user wants it easier to
837
1435
  review. The native Codex or Claude Code plan can stay where it is; Agent-Native
838
1436
  Plans creates a structured visual companion beside it — diagrams, wireframes,
839
- state sketches, option cards, and comment prompts instead of a wall of text. It
840
- still reads like a plan, not a marketing page.
1437
+ state sketches, functional prototypes, option cards, and comment prompts instead
1438
+ of a wall of text. It still reads like a plan, not a marketing page.
1439
+
1440
+ Use \`/prototype-plan\` instead when the user wants a functional prototype as the first
1441
+ artifact and there is no text plan to preserve. When a text plan already exists,
1442
+ \`/visualize-plan\` should decide whether it needs no visual surface, canvas only,
1443
+ or canvas + prototype; call \`convert-visual-plan-to-prototype\` after
1444
+ visualization when its HTML wireframes should drive a prototype review.
841
1445
 
842
1446
  ## Plan Discipline
843
1447
 
@@ -849,112 +1453,160 @@ still reads like a plan, not a marketing page.
849
1453
  edits while building or reviewing the companion.
850
1454
  - **The companion is the approval gate.** Ask the user to review and approve the
851
1455
  direction before you write code, and name which files/areas the work touches.
852
- Carry unresolved assumptions and open questions into a clear block instead of
853
- guessing silently.
1456
+ Carry answerable unresolved assumptions and open questions into a bottom
1457
+ \`question-form\` block instead of guessing silently.
854
1458
 
855
1459
  ## Workflow
856
1460
 
857
1461
  1. Gather the existing plan text from the user's paste, a referenced file, or
858
1462
  recent visible agent context. Do not invent the source plan. If no plan text
859
- exists and the work is UI-heavy, use \`/ui-plan\` instead.
1463
+ exists and the work is UI-heavy, use \`/ui-plan\` or \`/prototype-plan\` instead.
860
1464
  2. Call \`visualize-plan\` with \`planText\`, \`title\`, \`brief\`, \`source\`, and
861
1465
  \`repoPath\` when available.
862
1466
  3. Surface the returned Plans link or inline MCP App.
863
- 4. Enrich the import with \`update-visual-plan\` (prefer targeted \`contentPatches\`):
864
- add a canvas with wireframes for user-visible UI, diagrams for architecture or
865
- data flow, option cards for real tradeoffs, and explicit open questions. Apply
866
- the two cores below the companion must meet the same quality bar as a fresh
867
- plan, not be a thinner ruleset. Label inferred visuals as inferred. When the
868
- user wants source-control friendly edits, use \`patch-visual-plan-source\`
869
- against the MDX files instead of regenerating the plan.
1467
+ 4. Decide the top visual surface with the rules below, then enrich the import
1468
+ with \`update-visual-plan\` (prefer targeted \`contentPatches\`): add canvas
1469
+ wireframes for user-visible UI, add \`content.prototype\` for multi-step flows,
1470
+ add diagrams for architecture or data flow, add option cards for real
1471
+ tradeoffs, and add explicit open questions. Apply the two cores below the
1472
+ companion must meet the same quality bar as a fresh plan, not be a thinner
1473
+ ruleset. Label inferred visuals as inferred. When the user wants
1474
+ source-control friendly edits, use \`patch-visual-plan-source\` against the MDX
1475
+ files instead of regenerating the plan. If the user asks to make the visual
1476
+ companion functional and the canvas contains HTML wireframes, call
1477
+ \`convert-visual-plan-to-prototype\`.
870
1478
  5. Ask the user to react, then call \`get-plan-feedback\` before implementing,
871
1479
  after review, and before the final response.
872
1480
  6. Treat imported text as source material. The structured visual plan and
873
1481
  comments are the review surface; HTML is the export receipt. Do not replace a
874
1482
  native plan unless the user asks.
875
1483
 
1484
+ ## Visual Surface Choice
1485
+
1486
+ Choose the surface after reading the source plan and before enriching it. Do not
1487
+ add visual chrome by default:
1488
+
1489
+ - **No visual surface** when the imported plan is architecture-only,
1490
+ backend-only, data migration, copy-only, or otherwise non-visual. Keep the
1491
+ companion as a strong document and add diagrams only when relationships need a
1492
+ visual explanation.
1493
+ - **Canvas only** when the source plan includes one static screen, a before/after
1494
+ comparison, a component state, a small popover, or a visual direction that does
1495
+ not require clicking. Put those wireframes in \`content.canvas\` and omit
1496
+ \`content.prototype\`.
1497
+ - **Canvas + prototype** when the source plan describes a multi-step UI flow,
1498
+ meaningful interactive app behavior, onboarding, wizard, review/approval flow,
1499
+ navigation change, or any sequence the reviewer needs to operate. Keep the
1500
+ static wireframes in
1501
+ \`content.canvas\`, add the aligned functional prototype in
1502
+ \`content.prototype\`, and rely on the top visual tabs to switch between them.
1503
+ - **Prototype-first conversion** when an already-visualized plan's HTML
1504
+ wireframes should become functional. Use \`convert-visual-plan-to-prototype\` for
1505
+ an existing canvas, or \`update-visual-plan\` with \`set-prototype\` when the
1506
+ imported plan needs a hand-authored prototype that does not map cleanly from
1507
+ the canvas. Keep static mocks unless the user explicitly asks to remove them.
1508
+
1509
+ For mixed canvas + prototype companions, reuse the same real labels, states, and
1510
+ screen ids across both surfaces. The canvas is the inspectable static reference;
1511
+ the prototype is the interactive version of that same flow, not a separate
1512
+ design direction. If the imported plan only has text, add HTML wireframes before
1513
+ calling \`convert-visual-plan-to-prototype\`; never convert a diagram-only or
1514
+ empty canvas into a fake prototype.
1515
+
876
1516
  <!-- SHARED-CORE:wireframe-canvas START -->
1517
+
877
1518
  ## Wireframe & Canvas Core
878
1519
 
879
1520
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
880
1521
  \`/visualize-plan\`. It is the single source of truth for how wireframes and the
881
1522
  canvas work. Do not paraphrase it per command.
882
1523
 
883
- **The renderer owns all visual quality. You emit content, never styling.** Flex
884
- layout, fonts, density, spacing, theme, and the hand-drawn wobble all live in
885
- the app renderer. Never emit coordinates, CSS, pixel sizes, or raw HTML for a
886
- wireframe's internals. Your job is to pick a surface, compose real product
887
- content from the kit, and annotate — nothing else.
1524
+ **A wireframe is an HTML mockup. The renderer owns the look; you write the
1525
+ content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
1526
+ screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
1527
+ the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
1528
+ never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags, font-family, hex colors,
1529
+ or any width/height/coordinates. You write real HTML layout and real product
1530
+ content; the renderer styles and roughens it.
888
1531
 
889
- **A wireframe block's data is a declarative kit tree, not geometry:**
1532
+ **A wireframe block's data is an HTML screen plus a surface:**
890
1533
 
891
1534
  \`\`\`json
892
1535
  {
893
- "surface": "desktop",
894
- "screen": [
895
- { "el": "browserBar", "title": "tasklist" },
896
- { "el": "row", "children": [
897
- { "el": "sidebar", "children": [
898
- { "el": "navItem", "label": "Inbox", "count": 12, "active": true },
899
- { "el": "navItem", "label": "Today", "count": 4 },
900
- { "el": "navItem", "label": "Done" }
901
- ] },
902
- { "el": "main", "children": [
903
- { "el": "title", "text": "Today", "script": true },
904
- { "el": "chips", "items": [
905
- { "label": "All", "active": true }, { "label": "Active" }, { "label": "Done" }
906
- ] },
907
- { "el": "section", "label": "OVERDUE", "tone": "warn" },
908
- { "el": "taskRow", "title": "Send invoice to Acme Co.", "due": "Yesterday", "dueTone": "warn", "prio": 1 },
909
- { "el": "taskRow", "title": "Reply to design feedback", "due": "Today", "prio": 2 }
910
- ] }
911
- ] }
912
- ]
1536
+ "surface": "browser",
1537
+ "html": "<div style=\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\"><h1>Sign in</h1><p class=\\"wf-muted\\">Use your work email to continue.</p><div class=\\"wf-card\\" style=\\"display:flex;flex-direction:column;gap:10px\\"><label>Email<input value=\\"jane@acme.co\\" /></label><label>Password<input value=\\"••••••••\\" /></label><label style=\\"display:flex;align-items:center;gap:8px\\"><input type=\\"checkbox\\" checked /> Remember me</label><button class=\\"primary\\">Sign in</button></div><a href=\\"#\\">Forgot password?</a></div>"
913
1538
  }
914
1539
  \`\`\`
915
1540
 
916
- The renderer maps each node to a flex kit component and applies one whole-frame
917
- wobble. Layout is always flex: \`row\`, \`col\`, \`sidebar\`, and \`main\` set the flex
918
- direction; everything aligns by construction, so you never get overlap or drift.
1541
+ **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
1542
+ (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
1543
+ are auto-themed no classes needed. Helper classes carry the rest:
1544
+
1545
+ - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
1546
+ - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
1547
+ (\`<span class="wf-pill accent">\`) for the accent-filled variant.
1548
+ - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
1549
+ - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
1550
+ primary button.
1551
+
1552
+ **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
1553
+ these on light/dark, so reading them is what keeps a mockup correct in both
1554
+ themes. For any inline border, background, or text color, reference a token:
1555
+ \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
1556
+ \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
1557
+ (page background), \`--wf-card\` (raised surface), \`--wf-accent\` /
1558
+ \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
1559
+ and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
1560
+ renderer owns the sketch/clean font.
1561
+
1562
+ **Lay out with inline \`style\` flex/grid.** You write the real layout —
1563
+ \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
1564
+ renderer never repositions anything. Compose the actual product: reproduce the
1565
+ current screen, then show the modification. Real labels, real counts, real dates,
1566
+ real button text grounded in the screen you read; not lorem or gray bars.
919
1567
 
920
1568
  **Surface presets — match the real footprint, never default to desktop+mobile.**
921
1569
  Pick the \`surface\` that matches what the user will actually see:
922
1570
 
923
- - \`desktop\`: a full page or app shell.
1571
+ - \`browser\`: a web page that needs a browser chrome frame around it.
1572
+ - \`desktop\`: a full desktop app page or app shell.
924
1573
  - \`mobile\`: a phone screen, only when the work is genuinely mobile.
925
1574
  - \`popover\`: a small floating menu, dropdown, or inline popover.
926
1575
  - \`panel\`: a side panel, inspector, or sidebar widget.
927
- - \`browser\`: a page that needs a browser chrome frame around it.
928
1576
 
1577
+ The surface locks the footprint and aspect; never set width/height/coordinates.
929
1578
  A sidebar popover renders as a small surface, not a desktop page and a phone
930
1579
  frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
931
1580
  actually changes the layout. For a component or widget, show one broader
932
1581
  app-context frame only when placement affects understanding, then the focused
933
1582
  component states.
934
1583
 
935
- **Node vocabulary (\`el\` values).** Every node is \`{ el, ...props, children? }\`:
936
-
937
- - Layout: \`screen\`, \`row\`, \`col\`, \`sidebar\`, \`main\`, \`card{children}\`,
938
- \`column{title,count?,children}\`, \`box{children,dashed?}\`, \`divider\`.
939
- - Chrome: \`browserBar{title}\`, \`statusBar\`, \`searchBar\`, \`toolbar\`.
940
- - Navigation: \`navItem{label,count?,active?,dot?}\`, \`tabs\`/\`chips{items:[{label,active?}]}\`,
941
- \`chip{label,active?}\`, \`pill{label,tone?}\`.
942
- - Content: \`title{text,script?}\`, \`text{value,color?,weight?}\`,
943
- \`lines{n?,widths?}\`, \`section{label,tone?}\`,
944
- \`taskRow{title,note?,due?,dueTone?,prio?,done?}\`, \`kv{rows:[{k,v}]}\`,
945
- \`avatar\`, \`iconSquare{active?}\`.
946
- - Inputs: \`field{label?,value?,placeholder?,area?}\`, \`check{done?,shape?}\`,
947
- \`btn{label,solid?,full?}\`, \`fab{icon?}\`.
948
-
949
- Put **real product content** in props: real labels, real dates, real counts,
950
- real button text grounded in the actual screen or component you read. Use
951
- \`lines\`/\`text\` (with no \`value\`) only for genuine placeholder body copy — never
952
- fill a screen with gray placeholder bars. Buttons (\`btn\`, \`fab\`) must read as
953
- actionable controls.
954
-
955
- **Default crisp.** Sketchiness is a low default (a subtle single wobble over the
956
- whole frame), not a heavy scribble. Do not ask for or assume a heavy sketch
957
- look.
1584
+ **Modify, don't redesign.** When the task changes an existing screen, reproduce
1585
+ the current screen's real layout and footprint FIRST, then change only the delta
1586
+ and call it out with a single annotation. Do not restack the page into a new
1587
+ layout. For net-new surfaces, compose from the real app shell.
1588
+
1589
+ **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
1590
+ popover, menu, dialog, toast), show the full screen once, then add a small
1591
+ separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
1592
+ the whole page around it, and do not scale a duplicate up. Pick the matching
1593
+ \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
1594
+ page width.
1595
+
1596
+ **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
1597
+ fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
1598
+ built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
1599
+ no labels or copy. The renderer drops borders, sketch, and color into the
1600
+ skeleton register automatically. Never escape to a \`custom-html\` document block
1601
+ to fake a loader, and never move a mockup out of the canvas — mockups always
1602
+ live in canvas artboards.
1603
+
1604
+ **Editing an existing mockup.** To change one element, text, or color in an
1605
+ existing html mockup, do NOT regenerate the frame call \`update-visual-plan\`
1606
+ with \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
1607
+ replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
1608
+ first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
1609
+ occurrence. The result is re-sanitized.
958
1610
 
959
1611
  **Canvas annotations are designer notes on the artboard.** When a top canvas is
960
1612
  present, sprinkle Figma-style notes near the frames they explain: a short
@@ -965,8 +1617,16 @@ point at one specific control or transition; for a broad frame-level note, write
965
1617
  text beside the frame with no connector. Connectors are for real sequences only —
966
1618
  never fake "Step 1 → Step 2" lines between independent states.
967
1619
 
968
- **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
969
- (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
1620
+ **Do not create overlapping annotations.** Anchor each note to the frame it
1621
+ explains with \`targetId\` + \`placement\` (top/right/bottom/left). The renderer
1622
+ parks notes in a gutter beside the frame and lays them out automatically — never
1623
+ supply x/y or points for anchored notes; hand-placed coordinates fight the
1624
+ auto-layout and cause the overlap you're trying to avoid. Reserve arrows for a
1625
+ note that must point at a specific control inside a frame; a note that simply
1626
+ sits beside its frame needs no arrow.
1627
+
1628
+ **Patching.** Edit one wireframe, canvas annotation, or block with targeted \`contentPatches\`
1629
+ (for example \`update-block\`, \`replace-blocks\`, \`update-canvas-annotation\`) rather
970
1630
  than regenerating the whole plan. \`contentPatches\` are part of the public MCP
971
1631
  action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
972
1632
  edits. If an agent is working from exported source files, use
@@ -975,14 +1635,71 @@ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
975
1635
  \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
976
1636
  patch action normalizes the MDX back into the same JSON runtime model. JSON is
977
1637
  the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
1638
+ In the browser, humans edit \`rich-text\` prose inline; agents should still use
1639
+ \`update-rich-text\` content patches or source patches for prose, and use
1640
+ comments/structured patches for canvas, artboard, wireframe, and diagram edits.
1641
+
1642
+ **Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an \`html\` wireframe (or reference a wireframe block via \`blockId\`) — a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.
1643
+
1644
+ **Fill the frame; keep labels short.** Each artboard is a fixed-size surface — compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (\`flex:1\`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column — shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).
1645
+
1646
+ **Good example — a contacts list, surface \`browser\`.** A small, real screen
1647
+ composed from the helper classes and tokens, layout in inline flex, no fonts or
1648
+ hex colors:
1649
+
1650
+ \`\`\`html
1651
+ <div style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%">
1652
+ <div style="display:flex;align-items:center;justify-content:space-between">
1653
+ <h1>Contacts</h1>
1654
+ <button class="primary">New contact</button>
1655
+ </div>
1656
+ <div style="display:flex;gap:6px">
1657
+ <span class="wf-pill accent">All 128</span>
1658
+ <span class="wf-pill">Favorites</span>
1659
+ <span class="wf-pill">Archived</span>
1660
+ </div>
1661
+ <div class="wf-card" style="display:flex;flex-direction:column;gap:0;padding:0">
1662
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)">
1663
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
1664
+ <div style="flex:1"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>
1665
+ <span class="wf-pill">Lead</span>
1666
+ </div>
1667
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
1668
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
1669
+ <div style="flex:1"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>
1670
+ <span class="wf-pill">Customer</span>
1671
+ </div>
1672
+ </div>
1673
+ </div>
1674
+ \`\`\`
1675
+
1676
+ **Mockups belong in the top visual review area.** Static visuals live on the
1677
+ canvas; multi-step flows get both canvas wireframes and a prototype. When the
1678
+ user asks for a mockup, UI state, loading state, layout, screen, or visual
1679
+ comparison, make the canvas the primary home for that static visual. When the
1680
+ user asks for a prototype or the plan contains a sequence the reviewer must
1681
+ feel, keep the canvas artboards and add \`content.prototype\` so the top surface
1682
+ shows Wireframes / Prototype tabs. Document blocks can explain, compare, or map
1683
+ implementation, but they should not host the primary mockup or prototype just
1684
+ because \`custom-html\`, screenshots, or prose are easier to produce. If the
1685
+ canvas/prototype surface cannot represent the requested fidelity, still keep the
1686
+ closest top-surface representation and call out or extend the needed renderer
1687
+ capability.
1688
+
1689
+ **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
1690
+ nodes instead of \`html\`; the renderer still accepts and displays it, but new
1691
+ plans emit \`html\`. Do not author fresh kit-tree screens — write the HTML mockup
1692
+ instead. Likewise, old or imported plans may carry coordinate-based regions or
1693
+ free-float x/y on notes or artboards; those are legacy escape hatches the
1694
+ renderer still shows but you must never produce. The \`surface\` drives the aspect
1695
+ and footprint, the canvas auto-places artboards, and the gutter parks notes by
1696
+ \`targetId\` + \`placement\`; never supply width, height, or coordinates for a new
1697
+ plan.
978
1698
 
979
- **Legacy imports only.** Old or imported plans may carry coordinate-based
980
- regions or a full standalone HTML document; the renderer still displays them.
981
- Never emit geometry, regions, or a standalone HTML document for a new plan —
982
- compose the kit tree instead.
983
1699
  <!-- SHARED-CORE:wireframe-canvas END -->
984
1700
 
985
1701
  <!-- SHARED-CORE:document-quality START -->
1702
+
986
1703
  ## Document Quality Core
987
1704
 
988
1705
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
@@ -999,14 +1716,19 @@ behavior). Replace vague prose with specifics; never ship a step like "make it
999
1716
  work." No hero art, gradients, logos, nav bars, slogans, value props, giant
1000
1717
  landing-page headings, or marketing cards unless the user explicitly asks.
1001
1718
 
1002
- **Canvas and document never duplicate each other.** The UI story lives on the
1003
- canvas with on-canvas annotations; the document carries the technical depth the
1004
- canvas cannot show concrete file/symbol maps, API and data contracts, code
1005
- snippets, migration or implementation phases, risks, and validation. Repeat a
1006
- wireframe in the document only for a genuinely new detail view or comparison.
1007
- Skip the canvas entirely for non-visual work and write a clean rich document.
1719
+ **Top visuals and document never duplicate each other.** The UI story lives in
1720
+ the top visual surface: canvas artboards for static inspection, plus prototype
1721
+ tabs when the flow should be functional. The document carries the technical depth
1722
+ the visuals cannot show concrete file/symbol maps, API and data contracts,
1723
+ code snippets, migration or implementation phases, risks, and validation. Repeat
1724
+ a wireframe in the document only for a genuinely new detail view or comparison.
1725
+ Skip the visual surface entirely for non-visual work and write a clean rich
1726
+ document.
1008
1727
 
1009
- **Use the right block, and make it carry substance:**
1728
+ **Use the right block, and make it carry substance.** For the authoritative,
1729
+ machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
1730
+ — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
1731
+ so you never emit a block the editor cannot render or round-trip:
1010
1732
 
1011
1733
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
1012
1734
  - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
@@ -1024,61 +1746,126 @@ Skip the canvas entirely for non-visual work and write a clean rich document.
1024
1746
  visual unless the tab is intentionally document-only.
1025
1747
  - \`table\`, \`checklist\`, \`callout\` for scannable structure.
1026
1748
 
1027
- **Open questions are callouts, not buried prose.** Surface anything unresolved in
1028
- a dedicated open-questions / needs-clarification block. Never put a
1029
- questions/decisions wall inside the plan narrative.
1749
+ **Open questions live at the bottom as a form when answers would change the
1750
+ plan.** Surface answerable unresolved decisions in a final \`question-form\`
1751
+ block titled "Open Questions". Use \`single\` or \`multi\` for clear choices,
1752
+ \`freeform\` for constraints, \`recommended: true\` for the default you would pick,
1753
+ and option \`wireframe\` / \`diagram\` previews for visual directions when useful.
1754
+ Keep non-answerable assumptions or risks as concise \`callout\` blocks in the
1755
+ relevant section. Never bury a questions/decisions wall inside the plan
1756
+ narrative.
1030
1757
 
1031
1758
  **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
1032
- inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a placeholder,
1033
- density demo, or proof that custom HTML works. Prefer the native blocks; they
1034
- cover real plans.
1759
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
1760
+ placeholder, density demo, or proof that custom HTML works. Prefer the native
1761
+ blocks for normal plans. It may support supplemental demos or references, but it
1762
+ is never the primary home for a requested mockup, UI state, or visual
1763
+ comparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the
1764
+ product fix is canvas support for that artifact type, not moving the mockup into
1765
+ the document.
1035
1766
 
1036
1767
  **Before handoff, open the plan and check it.** Fix overlap, excessive
1037
1768
  whitespace, clipped fragments, misleading inactive controls, poor contrast, and
1038
1769
  unreadable diagrams before asking for approval.
1770
+
1039
1771
  <!-- SHARED-CORE:document-quality END -->
1040
1772
 
1041
1773
  <!-- SHARED-CORE:exemplar START -->
1774
+
1042
1775
  ## Good vs. Bad Exemplar
1043
1776
 
1044
- **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard
1045
- composed from the kit — a sidebar of real \`navItem\`s (\`Inbox 12\`, \`Today 4\`,
1046
- \`Done\`), a \`main\` with a scripted \`title\`, real \`chips\`, a \`section\` labeled
1047
- \`OVERDUE\`, and \`taskRow\`s carrying real titles, due dates, and priorities — one
1048
- subtle whole-frame wobble, correct desktop footprint, and plain-text designer
1049
- notes spaced off the frames pointing only at the controls that need explanation.
1050
- Below it, a Claude/Codex-grade document: objective and done-criteria, an
1051
- \`implementation-map\` naming the real components and actions with short
1052
- highlighted snippets, a \`decision\` card weighing two real approaches, and a
1053
- validation step none of it repeating the canvas. This is the bar.
1054
-
1055
- **BAD.** Empty coordinate boxes placed by \`x/y/width/height\`, gray placeholder
1056
- bars "insinuating" text, crisp double-bordered rectangles or a heavy scribble, a
1057
- forced desktop + mobile pair for a popover, floating bordered annotation cards
1058
- hugging the frames, and a marketing-style document with a hero heading and value
1059
- props that just restates what the canvas already shows. Never produce this.
1777
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard whose
1778
+ \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
1779
+ \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
1780
+ filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
1781
+ titles, due dates, and a primary \`button.primary\` styled only through bare
1782
+ elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
1783
+ correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
1784
+ designer notes sit spaced off the frame, pointing only at the controls that need
1785
+ explanation. Below it, a Claude/Codex-grade document: objective and
1786
+ done-criteria, an \`implementation-map\` naming the real components and actions
1787
+ with short highlighted snippets, a \`decision\` card weighing two real approaches,
1788
+ and a validation step none of it repeating the canvas. If the task also
1789
+ changes a multi-step completion flow, the same top area includes a Prototype tab
1790
+ whose screens use the same labels and states as the canvas artboards, with
1791
+ \`data-goto\` controls for the sequence. This is the bar.
1792
+
1793
+ **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
1794
+ pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
1795
+ frame; a forced desktop + mobile pair for a popover; floating bordered
1796
+ annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
1797
+ instead of \`html\`; a multi-step UI flow with only static frames and no prototype
1798
+ tab; a mockup escaped into a document \`custom-html\` block; and a marketing-style
1799
+ document with a hero heading and value props that just restates what the canvas
1800
+ already shows. Never produce this.
1801
+
1060
1802
  <!-- SHARED-CORE:exemplar END -->
1061
1803
 
1062
1804
  ## Tool Guidance
1063
1805
 
1064
1806
  - \`visualize-plan\`: create the visual companion from the existing text plan.
1065
1807
  - \`update-visual-plan\`: enrich the import; prefer targeted \`contentPatches\` over
1066
- replacing the whole content.
1808
+ replacing the whole content. Use \`set-prototype\`, \`patch-prototype-html\`,
1809
+ \`update-prototype-screen\`, and \`patch-wireframe-html\` when revising
1810
+ functional prototype flows or their static frame counterparts.
1811
+ - \`convert-visual-plan-to-prototype\`: convert an existing HTML wireframe canvas
1812
+ into a functional prototype while preserving static mocks by default.
1813
+ - \`create-prototype-plan\`: use only when the user wants a prototype-first plan
1814
+ and there is no existing plan text that \`/visualize-plan\` should preserve.
1067
1815
  - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
1068
- optional \`canvas.mdx\`, optional \`.plan-state.json\`, and JSON.
1816
+ optional \`canvas.mdx\`, optional \`prototype.mdx\`, optional \`.plan-state.json\`,
1817
+ and JSON.
1069
1818
  - \`patch-visual-plan-source\`: apply granular MDX AST patches by stable block,
1070
- artboard, annotation, component, or wireframe-node id.
1819
+ artboard, annotation, component, prototype screen, or wireframe-node id.
1071
1820
  - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
1072
1821
  - \`get-visual-plan\`: inspect the current structured plan, exported HTML, and
1073
1822
  annotations; it also returns the MDX folder for source workflows.
1074
- - \`get-plan-feedback\`: read unconsumed reviewer comments before coding.
1823
+ - \`get-plan-feedback\`: read unconsumed reviewer comments before coding; it
1824
+ returns grouped threads, exact anchor details, expected resolver, and recent
1825
+ review-event payloads so agents can act only on the comments meant for them.
1075
1826
  - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
1076
1827
  files for repo check-in.
1077
1828
 
1078
1829
  When the user critiques a plan's look or structure, fix the renderer or this
1079
1830
  skill — never hand-edit one stored plan. Turn feedback into better guidance.
1080
1831
 
1081
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
1832
+ ## Setup & Authentication
1833
+
1834
+ There are two ways into Plans.
1835
+
1836
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
1837
+ installs the Plans skills, registers the hosted Plans MCP connector, and
1838
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
1839
+ intended), so the first tool call does not hit an OAuth wall:
1840
+
1841
+ \`\`\`bash
1842
+ agent-native skills add visual-plan
1843
+ \`\`\`
1844
+
1845
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/prototype-plan\`,
1846
+ \`/visual-questions\`, \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
1847
+ register the connector without authenticating, then run
1848
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
1849
+
1850
+ **Browser (people you share with).** Open the Plans editor and create & edit
1851
+ with no sign-up — you work as a guest. Sign in only when you want to save or
1852
+ share; signing in claims the plans you made as a guest into your account.
1853
+
1854
+ Sharing and commenting require an account: public/shared plans are viewable by
1855
+ anyone with the link, but commenting on them needs an agent-native account.
1856
+
1857
+ For fully offline, no-account use, run the Plans app locally and sync plans to
1858
+ your repo as MDX. This local mode is a separate advanced path, not the default
1859
+ hosted flow.
1860
+
1861
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
1862
+ do not keep retrying the tool. Authenticate the connector with
1863
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
1864
+ instead re-run /mcp and choose Authenticate), then continue once the connector
1865
+ is available.
1866
+
1867
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1868
+ not put shared secrets in skill files.
1082
1869
  `;
1083
1870
  const BUILT_IN_APP_SKILLS = {
1084
1871
  assets: {
@@ -1172,6 +1959,7 @@ const BUILT_IN_APP_SKILLS = {
1172
1959
  extraSkills: {
1173
1960
  "visual-questions": VISUAL_QUESTIONS_SKILL_MD,
1174
1961
  "ui-plan": UI_PLAN_SKILL_MD,
1962
+ "prototype-plan": PROTOTYPE_PLAN_SKILL_MD,
1175
1963
  "visualize-plan": VISUALIZE_PLAN_SKILL_MD,
1176
1964
  },
1177
1965
  manifest: normalizeAppSkillManifest({
@@ -1186,7 +1974,7 @@ const BUILT_IN_APP_SKILLS = {
1186
1974
  mcp: { serverName: "agent-native-plans" },
1187
1975
  auth: {
1188
1976
  mode: "oauth",
1189
- setup: "Install with the Agent-Native CLI to add /visual-plan, /visual-questions, /ui-plan, and /visualize-plan skills plus the Plans MCP connector. Authenticate only for hosted/account-backed sharing.",
1977
+ setup: "Install with the Agent-Native CLI to add /visual-plan, /visual-questions, /ui-plan, /prototype-plan, and /visualize-plan skills plus the Plans MCP connector. Authenticate only for hosted/account-backed sharing.",
1190
1978
  },
1191
1979
  surfaces: [
1192
1980
  {
@@ -1206,6 +1994,12 @@ const BUILT_IN_APP_SKILLS = {
1206
1994
  path: "/plans",
1207
1995
  description: "Create a UI-first Agent-Native plan with an optional top pan/zoom wireframe canvas and a refined rich document below.",
1208
1996
  },
1997
+ {
1998
+ id: "prototype-plan",
1999
+ action: "create-prototype-plan",
2000
+ path: "/plans",
2001
+ description: "Create a prototype-first Agent-Native plan with a functional live prototype above the document.",
2002
+ },
1209
2003
  {
1210
2004
  id: "visualize-plan",
1211
2005
  action: "visualize-plan",
@@ -1228,6 +2022,11 @@ const BUILT_IN_APP_SKILLS = {
1228
2022
  visibility: "exported",
1229
2023
  exportAs: "ui-plan",
1230
2024
  },
2025
+ {
2026
+ path: "skills/prototype-plan",
2027
+ visibility: "exported",
2028
+ exportAs: "prototype-plan",
2029
+ },
1231
2030
  {
1232
2031
  path: "skills/visualize-plan",
1233
2032
  visibility: "exported",
@@ -1300,6 +2099,9 @@ const BUILT_IN_APP_SKILL_ALIASES = {
1300
2099
  "visual-question": "visual-plans",
1301
2100
  "ui-plan": "visual-plans",
1302
2101
  "ui-plans": "visual-plans",
2102
+ "prototype-plan": "visual-plans",
2103
+ "prototype-plans": "visual-plans",
2104
+ prototype: "visual-plans",
1303
2105
  "visualize-plan": "visual-plans",
1304
2106
  "visualize-plans": "visual-plans",
1305
2107
  "html-plan": "visual-plans",
@@ -1325,6 +2127,7 @@ const BUILT_IN_APP_SKILL_DISPLAY_ALIASES = {
1325
2127
  "visual-plan",
1326
2128
  "visual-questions",
1327
2129
  "ui-plan",
2130
+ "prototype-plan",
1328
2131
  "visualize-plan",
1329
2132
  "html-plan",
1330
2133
  "plannotate",
@@ -1495,6 +2298,7 @@ export function parseSkillsArgs(argv) {
1495
2298
  printJson: false,
1496
2299
  instructions: true,
1497
2300
  mcp: true,
2301
+ connect: true,
1498
2302
  };
1499
2303
  for (let i = 0; i < args.length; i++) {
1500
2304
  const arg = args[i];
@@ -1533,6 +2337,8 @@ export function parseSkillsArgs(argv) {
1533
2337
  out.instructions = false;
1534
2338
  else if (arg === "--instructions-only" || arg === "--no-mcp")
1535
2339
  out.mcp = false;
2340
+ else if (arg === "--no-connect" || arg === "--skip-connect")
2341
+ out.connect = false;
1536
2342
  else if (arg.startsWith("-"))
1537
2343
  throw new Error(`Unknown option: ${arg}`);
1538
2344
  else if (!out.target)
@@ -1663,6 +2469,8 @@ function dryRunInstallCommand(parsed, target) {
1663
2469
  args.push("--instructions-only");
1664
2470
  if (!parsed.instructions && parsed.mcp)
1665
2471
  args.push("--mcp-only");
2472
+ if (!parsed.connect)
2473
+ args.push("--no-connect");
1666
2474
  if (parsed.yes || isKnownSkill(target))
1667
2475
  args.push("--yes");
1668
2476
  return commandString("agent-native", args);
@@ -1736,6 +2544,72 @@ function withMcpUrlOverride(target, input) {
1736
2544
  },
1737
2545
  };
1738
2546
  }
2547
+ /**
2548
+ * Whether we can run the interactive browser/device auth flow. CI and
2549
+ * non-TTY shells must not block on a browser approval, so we skip the inline
2550
+ * flow there and surface the exact `agent-native connect` command instead.
2551
+ */
2552
+ function canRunInteractiveConnect(options) {
2553
+ if (options.isInteractive)
2554
+ return options.isInteractive();
2555
+ if (process.env.AGENT_NATIVE_NO_PROMPT === "1")
2556
+ return false;
2557
+ if (process.env.CI === "true")
2558
+ return false;
2559
+ return !!process.stdin.isTTY && !!process.stdout.isTTY;
2560
+ }
2561
+ /** Build the `agent-native connect <url> --client … --scope …` command. */
2562
+ function connectCommandFor(hostedUrl, clients, scope) {
2563
+ const args = [
2564
+ "connect",
2565
+ hostedUrl,
2566
+ "--client",
2567
+ clientArgForClients(clients),
2568
+ "--scope",
2569
+ scope,
2570
+ ];
2571
+ return commandString("agent-native", args);
2572
+ }
2573
+ /**
2574
+ * Authenticate the freshly-registered hosted MCP connector so the user does not
2575
+ * hit the OAuth wall on their first tool call. Reuses the existing
2576
+ * `agent-native connect` flow (OAuth-capable clients get URL-only config plus a
2577
+ * `/mcp` authenticate prompt; Codex / Cowork run the browser device-code flow).
2578
+ * In non-interactive shells we skip the inline flow and return the command to
2579
+ * run instead. Failures here are non-fatal: the connector is already registered,
2580
+ * so the user can authenticate later.
2581
+ */
2582
+ async function connectAfterEnsure(installTarget, clients, parsed, options) {
2583
+ const hostedUrl = installTarget.loaded.manifest.hosted.url;
2584
+ const authMode = installTarget.loaded.manifest.auth?.mode ?? "oauth";
2585
+ const connectCommand = connectCommandFor(hostedUrl, clients, parsed.scope);
2586
+ // Skills whose connector needs no auth (e.g. open/local-only) never need the
2587
+ // connect step.
2588
+ if (authMode === "none") {
2589
+ return { connected: false, connectCommand: "" };
2590
+ }
2591
+ if (!canRunInteractiveConnect(options)) {
2592
+ options.log?.(`Authentication skipped (non-interactive). To finish auth, run: ${connectCommand}`);
2593
+ return { connected: false, connectCommand };
2594
+ }
2595
+ options.log?.(`Authenticating ${installTarget.displayName}…`);
2596
+ try {
2597
+ await (options.runConnect ?? runConnect)([
2598
+ hostedUrl,
2599
+ "--client",
2600
+ clientArgForClients(clients),
2601
+ "--scope",
2602
+ parsed.scope,
2603
+ ]);
2604
+ return { connected: true, connectCommand: "" };
2605
+ }
2606
+ catch (err) {
2607
+ // Non-fatal: the MCP connector is registered. Surface the manual command.
2608
+ options.log?.(`Could not finish authentication automatically (${err?.message ?? err}). ` +
2609
+ `Run it later with: ${connectCommand}`);
2610
+ return { connected: false, connectCommand };
2611
+ }
2612
+ }
1739
2613
  export async function addAgentNativeSkill(parsed, options = {}) {
1740
2614
  const target = parsed.target ?? "assets";
1741
2615
  const knownTarget = normalizeKnownSkillTarget(target);
@@ -1812,6 +2686,8 @@ export async function addAgentNativeSkill(parsed, options = {}) {
1812
2686
  const commands = [];
1813
2687
  const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), "an-skills-add-"));
1814
2688
  let instructionSource;
2689
+ let connected = false;
2690
+ let connectCommand;
1815
2691
  try {
1816
2692
  if (parsed.instructions) {
1817
2693
  if (skillsAgents.length === 0) {
@@ -1853,6 +2729,17 @@ export async function addAgentNativeSkill(parsed, options = {}) {
1853
2729
  confirm: true,
1854
2730
  log: options.log,
1855
2731
  });
2732
+ // One-step install + authenticate: after registering a hosted MCP
2733
+ // connector, kick off the existing connect/device-code flow so the user
2734
+ // does not hit an OAuth wall on the first tool call. `--no-connect`
2735
+ // opts out; non-interactive shells get the exact command to run.
2736
+ if (parsed.connect) {
2737
+ const result = await connectAfterEnsure(installTarget, clients, parsed, options);
2738
+ connected = result.connected;
2739
+ connectCommand = result.connectCommand || undefined;
2740
+ if (connectCommand)
2741
+ commands.push(connectCommand);
2742
+ }
1856
2743
  }
1857
2744
  }
1858
2745
  return {
@@ -1865,6 +2752,8 @@ export async function addAgentNativeSkill(parsed, options = {}) {
1865
2752
  mcpClients: clients,
1866
2753
  dryRun: parsed.dryRun,
1867
2754
  commands,
2755
+ connected,
2756
+ connectCommand,
1868
2757
  };
1869
2758
  }
1870
2759
  finally {
@@ -1948,6 +2837,17 @@ export async function runSkills(argv, options = {}) {
1948
2837
  .filter((result) => result.local)
1949
2838
  .flatMap((result) => result.commands)),
1950
2839
  ];
2840
+ const authConnected = results.some((result) => result.connected);
2841
+ const pendingConnectCommands = [
2842
+ ...new Set(results
2843
+ .map((result) => result.connectCommand)
2844
+ .filter((command) => Boolean(command))),
2845
+ ];
2846
+ const authLine = authConnected
2847
+ ? "Authentication: completed."
2848
+ : pendingConnectCommands.length
2849
+ ? `Authentication: pending — run ${pendingConnectCommands.join(" && ")}`
2850
+ : "";
1951
2851
  process.stdout.write([
1952
2852
  `Installed ${installedNames} skill${results.length === 1 ? "" : "s"}.`,
1953
2853
  skillsAgents.length
@@ -1959,6 +2859,7 @@ export async function runSkills(argv, options = {}) {
1959
2859
  mcpUrls.length
1960
2860
  ? `MCP URL${mcpUrls.length === 1 ? "" : "s"}: ${mcpUrls.join(", ")}.`
1961
2861
  : "",
2862
+ authLine,
1962
2863
  localCommands.length ? `Local command: ${localCommands.join(", ")}.` : "",
1963
2864
  "Restart or reload selected agent clients if the skill is not visible yet.",
1964
2865
  parsed.clientExplicit