@agent-native/core 0.37.3 → 0.38.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 (377) 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/index.js +10 -6
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/cli/plan-publish-store.d.ts +52 -0
  20. package/dist/cli/plan-publish-store.d.ts.map +1 -0
  21. package/dist/cli/plan-publish-store.js +103 -0
  22. package/dist/cli/plan-publish-store.js.map +1 -0
  23. package/dist/cli/skills.d.ts +29 -4
  24. package/dist/cli/skills.d.ts.map +1 -1
  25. package/dist/cli/skills.js +851 -275
  26. package/dist/cli/skills.js.map +1 -1
  27. package/dist/cli/templates-meta.js +12 -12
  28. package/dist/cli/templates-meta.js.map +1 -1
  29. package/dist/client/AssistantChat.d.ts +3 -1
  30. package/dist/client/AssistantChat.d.ts.map +1 -1
  31. package/dist/client/AssistantChat.js +65 -15
  32. package/dist/client/AssistantChat.js.map +1 -1
  33. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  34. package/dist/client/MultiTabAssistantChat.js +20 -2
  35. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  36. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  37. package/dist/client/agent-chat-adapter.js +12 -0
  38. package/dist/client/agent-chat-adapter.js.map +1 -1
  39. package/dist/client/agent-engine-key.d.ts +24 -0
  40. package/dist/client/agent-engine-key.d.ts.map +1 -0
  41. package/dist/client/agent-engine-key.js +49 -0
  42. package/dist/client/agent-engine-key.js.map +1 -0
  43. package/dist/client/analytics.d.ts.map +1 -1
  44. package/dist/client/analytics.js +34 -0
  45. package/dist/client/analytics.js.map +1 -1
  46. package/dist/client/blocks/BlockView.d.ts +26 -0
  47. package/dist/client/blocks/BlockView.d.ts.map +1 -0
  48. package/dist/client/blocks/BlockView.js +24 -0
  49. package/dist/client/blocks/BlockView.js.map +1 -0
  50. package/dist/client/blocks/SchemaBlockEditor.d.ts +25 -0
  51. package/dist/client/blocks/SchemaBlockEditor.d.ts.map +1 -0
  52. package/dist/client/blocks/SchemaBlockEditor.js +72 -0
  53. package/dist/client/blocks/SchemaBlockEditor.js.map +1 -0
  54. package/dist/client/blocks/agent.d.ts +30 -0
  55. package/dist/client/blocks/agent.d.ts.map +1 -0
  56. package/dist/client/blocks/agent.js +61 -0
  57. package/dist/client/blocks/agent.js.map +1 -0
  58. package/dist/client/blocks/index.d.ts +34 -0
  59. package/dist/client/blocks/index.d.ts.map +1 -0
  60. package/dist/client/blocks/index.js +42 -0
  61. package/dist/client/blocks/index.js.map +1 -0
  62. package/dist/client/blocks/library/checklist.config.d.ts +36 -0
  63. package/dist/client/blocks/library/checklist.config.d.ts.map +1 -0
  64. package/dist/client/blocks/library/checklist.config.js +25 -0
  65. package/dist/client/blocks/library/checklist.config.js.map +1 -0
  66. package/dist/client/blocks/library/checklist.d.ts +26 -0
  67. package/dist/client/blocks/library/checklist.d.ts.map +1 -0
  68. package/dist/client/blocks/library/checklist.js +76 -0
  69. package/dist/client/blocks/library/checklist.js.map +1 -0
  70. package/dist/client/blocks/library/code-tabs.config.d.ts +36 -0
  71. package/dist/client/blocks/library/code-tabs.config.d.ts.map +1 -0
  72. package/dist/client/blocks/library/code-tabs.config.js +30 -0
  73. package/dist/client/blocks/library/code-tabs.config.js.map +1 -0
  74. package/dist/client/blocks/library/code-tabs.d.ts +3 -0
  75. package/dist/client/blocks/library/code-tabs.d.ts.map +1 -0
  76. package/dist/client/blocks/library/code-tabs.js +165 -0
  77. package/dist/client/blocks/library/code-tabs.js.map +1 -0
  78. package/dist/client/blocks/library/html.config.d.ts +37 -0
  79. package/dist/client/blocks/library/html.config.d.ts.map +1 -0
  80. package/dist/client/blocks/library/html.config.js +46 -0
  81. package/dist/client/blocks/library/html.config.js.map +1 -0
  82. package/dist/client/blocks/library/html.d.ts +21 -0
  83. package/dist/client/blocks/library/html.d.ts.map +1 -0
  84. package/dist/client/blocks/library/html.js +69 -0
  85. package/dist/client/blocks/library/html.js.map +1 -0
  86. package/dist/client/blocks/library/table.config.d.ts +30 -0
  87. package/dist/client/blocks/library/table.config.d.ts.map +1 -0
  88. package/dist/client/blocks/library/table.config.js +22 -0
  89. package/dist/client/blocks/library/table.config.js.map +1 -0
  90. package/dist/client/blocks/library/table.d.ts +8 -0
  91. package/dist/client/blocks/library/table.d.ts.map +1 -0
  92. package/dist/client/blocks/library/table.js +107 -0
  93. package/dist/client/blocks/library/table.js.map +1 -0
  94. package/dist/client/blocks/library/tabs.config.d.ts +56 -0
  95. package/dist/client/blocks/library/tabs.config.d.ts.map +1 -0
  96. package/dist/client/blocks/library/tabs.config.js +36 -0
  97. package/dist/client/blocks/library/tabs.config.js.map +1 -0
  98. package/dist/client/blocks/library/tabs.d.ts +20 -0
  99. package/dist/client/blocks/library/tabs.d.ts.map +1 -0
  100. package/dist/client/blocks/library/tabs.js +123 -0
  101. package/dist/client/blocks/library/tabs.js.map +1 -0
  102. package/dist/client/blocks/mdx.d.ts +74 -0
  103. package/dist/client/blocks/mdx.d.ts.map +1 -0
  104. package/dist/client/blocks/mdx.js +205 -0
  105. package/dist/client/blocks/mdx.js.map +1 -0
  106. package/dist/client/blocks/provider.d.ts +25 -0
  107. package/dist/client/blocks/provider.d.ts.map +1 -0
  108. package/dist/client/blocks/provider.js +19 -0
  109. package/dist/client/blocks/provider.js.map +1 -0
  110. package/dist/client/blocks/registry.d.ts +24 -0
  111. package/dist/client/blocks/registry.d.ts.map +1 -0
  112. package/dist/client/blocks/registry.js +50 -0
  113. package/dist/client/blocks/registry.js.map +1 -0
  114. package/dist/client/blocks/schema-form/introspect.d.ts +31 -0
  115. package/dist/client/blocks/schema-form/introspect.d.ts.map +1 -0
  116. package/dist/client/blocks/schema-form/introspect.js +164 -0
  117. package/dist/client/blocks/schema-form/introspect.js.map +1 -0
  118. package/dist/client/blocks/server.d.ts +22 -0
  119. package/dist/client/blocks/server.d.ts.map +1 -0
  120. package/dist/client/blocks/server.js +25 -0
  121. package/dist/client/blocks/server.js.map +1 -0
  122. package/dist/client/blocks/types.d.ts +212 -0
  123. package/dist/client/blocks/types.d.ts.map +1 -0
  124. package/dist/client/blocks/types.js +5 -0
  125. package/dist/client/blocks/types.js.map +1 -0
  126. package/dist/client/composer/ComposerPlusMenu.js +10 -1
  127. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  128. package/dist/client/guided-questions.d.ts +68 -0
  129. package/dist/client/guided-questions.d.ts.map +1 -1
  130. package/dist/client/guided-questions.js +158 -3
  131. package/dist/client/guided-questions.js.map +1 -1
  132. package/dist/client/index.d.ts +5 -1
  133. package/dist/client/index.d.ts.map +1 -1
  134. package/dist/client/index.js +15 -1
  135. package/dist/client/index.js.map +1 -1
  136. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts +37 -0
  137. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts.map +1 -0
  138. package/dist/client/rich-markdown-editor/BubbleToolbar.js +161 -0
  139. package/dist/client/rich-markdown-editor/BubbleToolbar.js.map +1 -0
  140. package/dist/client/rich-markdown-editor/ImageExtension.d.ts +63 -0
  141. package/dist/client/rich-markdown-editor/ImageExtension.d.ts.map +1 -0
  142. package/dist/client/rich-markdown-editor/ImageExtension.js +242 -0
  143. package/dist/client/rich-markdown-editor/ImageExtension.js.map +1 -0
  144. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +51 -0
  145. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts.map +1 -0
  146. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js +37 -0
  147. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js.map +1 -0
  148. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +61 -0
  149. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -0
  150. package/dist/client/rich-markdown-editor/SharedRichEditor.js +121 -0
  151. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -0
  152. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts +36 -0
  153. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts.map +1 -0
  154. package/dist/client/rich-markdown-editor/SlashCommandMenu.js +193 -0
  155. package/dist/client/rich-markdown-editor/SlashCommandMenu.js.map +1 -0
  156. package/dist/client/rich-markdown-editor/extensions.d.ts +166 -0
  157. package/dist/client/rich-markdown-editor/extensions.d.ts.map +1 -0
  158. package/dist/client/rich-markdown-editor/extensions.js +222 -0
  159. package/dist/client/rich-markdown-editor/extensions.js.map +1 -0
  160. package/dist/client/rich-markdown-editor/index.d.ts +9 -0
  161. package/dist/client/rich-markdown-editor/index.d.ts.map +1 -0
  162. package/dist/client/rich-markdown-editor/index.js +9 -0
  163. package/dist/client/rich-markdown-editor/index.js.map +1 -0
  164. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts +18 -0
  165. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +1 -0
  166. package/dist/client/rich-markdown-editor/uploadEditorImage.js +57 -0
  167. package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +1 -0
  168. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +91 -0
  169. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -0
  170. package/dist/client/rich-markdown-editor/useCollabReconcile.js +342 -0
  171. package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -0
  172. package/dist/client/track.d.ts +25 -0
  173. package/dist/client/track.d.ts.map +1 -0
  174. package/dist/client/track.js +53 -0
  175. package/dist/client/track.js.map +1 -0
  176. package/dist/client/use-action.d.ts.map +1 -1
  177. package/dist/client/use-action.js +6 -0
  178. package/dist/client/use-action.js.map +1 -1
  179. package/dist/client/use-session.d.ts +3 -2
  180. package/dist/client/use-session.d.ts.map +1 -1
  181. package/dist/client/use-session.js +3 -2
  182. package/dist/client/use-session.js.map +1 -1
  183. package/dist/deploy/build.d.ts +5 -0
  184. package/dist/deploy/build.d.ts.map +1 -1
  185. package/dist/deploy/build.js +67 -1
  186. package/dist/deploy/build.js.map +1 -1
  187. package/dist/extensions/schema.d.ts +1 -1
  188. package/dist/mcp/build-server.d.ts.map +1 -1
  189. package/dist/mcp/build-server.js +9 -2
  190. package/dist/mcp/build-server.js.map +1 -1
  191. package/dist/mcp/server.d.ts +1 -1
  192. package/dist/mcp/server.d.ts.map +1 -1
  193. package/dist/mcp/server.js +35 -2
  194. package/dist/mcp/server.js.map +1 -1
  195. package/dist/provider-api/index.d.ts +1 -1
  196. package/dist/provider-api/index.d.ts.map +1 -1
  197. package/dist/scripts/docs/search.d.ts.map +1 -1
  198. package/dist/scripts/docs/search.js +5 -2
  199. package/dist/scripts/docs/search.js.map +1 -1
  200. package/dist/scripts/runner.d.ts.map +1 -1
  201. package/dist/scripts/runner.js +16 -3
  202. package/dist/scripts/runner.js.map +1 -1
  203. package/dist/server/action-discovery.d.ts.map +1 -1
  204. package/dist/server/action-discovery.js +2 -0
  205. package/dist/server/action-discovery.js.map +1 -1
  206. package/dist/server/action-routes.d.ts.map +1 -1
  207. package/dist/server/action-routes.js +30 -4
  208. package/dist/server/action-routes.js.map +1 -1
  209. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  210. package/dist/server/agent-chat-plugin.js +65 -19
  211. package/dist/server/agent-chat-plugin.js.map +1 -1
  212. package/dist/server/agent-teams.d.ts.map +1 -1
  213. package/dist/server/agent-teams.js +8 -1
  214. package/dist/server/agent-teams.js.map +1 -1
  215. package/dist/server/agents-bundle.d.ts +27 -1
  216. package/dist/server/agents-bundle.d.ts.map +1 -1
  217. package/dist/server/agents-bundle.js +41 -3
  218. package/dist/server/agents-bundle.js.map +1 -1
  219. package/dist/server/auth.d.ts.map +1 -1
  220. package/dist/server/auth.js +76 -3
  221. package/dist/server/auth.js.map +1 -1
  222. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  223. package/dist/server/core-routes-plugin.js +60 -0
  224. package/dist/server/core-routes-plugin.js.map +1 -1
  225. package/dist/server/onboarding-html.d.ts.map +1 -1
  226. package/dist/server/onboarding-html.js +160 -22
  227. package/dist/server/onboarding-html.js.map +1 -1
  228. package/dist/server/sentry.d.ts.map +1 -1
  229. package/dist/server/sentry.js +6 -0
  230. package/dist/server/sentry.js.map +1 -1
  231. package/dist/server/social-og-image.d.ts +2 -1
  232. package/dist/server/social-og-image.d.ts.map +1 -1
  233. package/dist/server/social-og-image.js +24 -4
  234. package/dist/server/social-og-image.js.map +1 -1
  235. package/dist/sharing/schema.d.ts +1 -1
  236. package/dist/styles/agent-native.css +1 -0
  237. package/dist/styles/rich-markdown-editor.css +439 -0
  238. package/dist/templates/default/.agents/skills/actions/SKILL.md +4 -1
  239. package/dist/templates/default/.agents/skills/security/SKILL.md +13 -4
  240. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +15 -3
  241. package/dist/templates/default/AGENTS.md +1 -0
  242. package/dist/templates/default/DEVELOPING.md +2 -0
  243. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +10 -3
  244. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +98 -10
  245. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +45 -3
  246. package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -0
  247. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +37 -4
  248. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +9 -4
  249. package/dist/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +2 -0
  250. package/dist/templates/workspace-core/.agents/skills/client-methods/SKILL.md +106 -0
  251. package/dist/templates/workspace-core/.agents/skills/client-methods/references/legacy-client-fetch-audit-2026-06-03.md +53 -0
  252. package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +2 -0
  253. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +62 -61
  254. package/dist/templates/workspace-core/.agents/skills/context-xray/SKILL.md +47 -0
  255. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +28 -0
  256. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +52 -1
  257. package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +2 -0
  258. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +95 -433
  259. package/dist/templates/workspace-core/.agents/skills/extensions/references/api.md +285 -0
  260. package/dist/templates/workspace-core/.agents/skills/extensions/references/examples.md +259 -0
  261. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +398 -0
  262. package/dist/templates/workspace-core/.agents/skills/external-agents/references/mcp-apps-embedding.md +157 -0
  263. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +17 -0
  264. package/dist/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +13 -2
  265. package/dist/templates/workspace-core/.agents/skills/mvp-followup/SKILL.md +51 -0
  266. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +14 -4
  267. package/dist/templates/workspace-core/.agents/skills/onboarding/SKILL.md +13 -1
  268. package/dist/templates/workspace-core/.agents/skills/portability/SKILL.md +27 -5
  269. package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +24 -8
  270. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +53 -7
  271. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +43 -10
  272. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +2 -0
  273. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +43 -14
  274. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +50 -1
  275. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -2
  276. package/dist/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +11 -1
  277. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +15 -0
  278. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +5 -1
  279. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +48 -19
  280. package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +7 -3
  281. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +13 -6
  282. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +236 -0
  283. package/dist/templates/workspace-core/AGENTS.md +5 -1
  284. package/dist/templates/workspace-root/AGENTS.md +5 -2
  285. package/dist/tracking/route.d.ts +43 -0
  286. package/dist/tracking/route.d.ts.map +1 -0
  287. package/dist/tracking/route.js +85 -0
  288. package/dist/tracking/route.js.map +1 -0
  289. package/dist/vite/client.d.ts.map +1 -1
  290. package/dist/vite/client.js +15 -0
  291. package/dist/vite/client.js.map +1 -1
  292. package/docs/content/a2a-protocol.md +18 -4
  293. package/docs/content/actions.md +87 -0
  294. package/docs/content/agent-mentions.md +2 -1
  295. package/docs/content/authentication.md +2 -1
  296. package/docs/content/client.md +64 -13
  297. package/docs/content/cloneable-saas.md +1 -1
  298. package/docs/content/code-agents-ui.md +17 -11
  299. package/docs/content/context-awareness.md +23 -28
  300. package/docs/content/creating-templates.md +1 -1
  301. package/docs/content/drop-in-agent.md +2 -0
  302. package/docs/content/getting-started.md +2 -2
  303. package/docs/content/key-concepts.md +2 -2
  304. package/docs/content/messaging.md +57 -15
  305. package/docs/content/migration-workbench.md +1 -1
  306. package/docs/content/multi-app-workspace.md +1 -1
  307. package/docs/content/multi-tenancy.md +17 -15
  308. package/docs/content/real-time-collaboration.md +1 -1
  309. package/docs/content/recurring-jobs.md +1 -1
  310. package/docs/content/security.md +2 -2
  311. package/docs/content/server.md +4 -4
  312. package/docs/content/skills-guide.md +30 -0
  313. package/docs/content/template-analytics.md +2 -2
  314. package/docs/content/template-assets.md +17 -1
  315. package/docs/content/template-brain.md +2 -2
  316. package/docs/content/template-calendar.md +1 -1
  317. package/docs/content/template-clips.md +3 -3
  318. package/docs/content/template-content.md +2 -2
  319. package/docs/content/template-design.md +2 -2
  320. package/docs/content/template-dispatch.md +3 -3
  321. package/docs/content/template-forms.md +14 -2
  322. package/docs/content/template-mail.md +1 -3
  323. package/docs/content/template-plan.md +118 -0
  324. package/docs/content/template-slides.md +5 -4
  325. package/docs/content/template-starter.md +4 -4
  326. package/docs/content/template-videos.md +6 -11
  327. package/docs/content/tracking.md +21 -1
  328. package/docs/content/visual-plans.md +72 -0
  329. package/docs/content/workspace.md +9 -9
  330. package/package.json +26 -11
  331. package/src/templates/default/.agents/skills/actions/SKILL.md +4 -1
  332. package/src/templates/default/.agents/skills/security/SKILL.md +13 -4
  333. package/src/templates/default/.agents/skills/storing-data/SKILL.md +15 -3
  334. package/src/templates/default/AGENTS.md +1 -0
  335. package/src/templates/default/DEVELOPING.md +2 -0
  336. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +10 -3
  337. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +98 -10
  338. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +45 -3
  339. package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -0
  340. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +37 -4
  341. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +9 -4
  342. package/src/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +2 -0
  343. package/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +106 -0
  344. package/src/templates/workspace-core/.agents/skills/client-methods/references/legacy-client-fetch-audit-2026-06-03.md +53 -0
  345. package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +2 -0
  346. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +62 -61
  347. package/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +47 -0
  348. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +28 -0
  349. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +52 -1
  350. package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +2 -0
  351. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +95 -433
  352. package/src/templates/workspace-core/.agents/skills/extensions/references/api.md +285 -0
  353. package/src/templates/workspace-core/.agents/skills/extensions/references/examples.md +259 -0
  354. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +398 -0
  355. package/src/templates/workspace-core/.agents/skills/external-agents/references/mcp-apps-embedding.md +157 -0
  356. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +17 -0
  357. package/src/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +13 -2
  358. package/src/templates/workspace-core/.agents/skills/mvp-followup/SKILL.md +51 -0
  359. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +14 -4
  360. package/src/templates/workspace-core/.agents/skills/onboarding/SKILL.md +13 -1
  361. package/src/templates/workspace-core/.agents/skills/portability/SKILL.md +27 -5
  362. package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +24 -8
  363. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +53 -7
  364. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +43 -10
  365. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +2 -0
  366. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +43 -14
  367. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +50 -1
  368. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -2
  369. package/src/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +11 -1
  370. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +15 -0
  371. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +5 -1
  372. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +48 -19
  373. package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +7 -3
  374. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +13 -6
  375. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +236 -0
  376. package/src/templates/workspace-core/AGENTS.md +5 -1
  377. 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|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
+ * `/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\`, \`/visual-questions\`,
218
+ \`/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: >-
@@ -205,9 +258,9 @@ 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 \`/visual-questions\` only when the user explicitly wants a visual intake form
262
+ before planning. Use \`/visualize-plan\` to turn an existing Codex, Claude Code,
263
+ Markdown, or pasted plan into a visual companion.
211
264
 
212
265
  ## When To Use
213
266
 
@@ -231,9 +284,11 @@ direction before you implement.
231
284
  plan. Start editing only after the user approves the direction.
232
285
  - **Clarify vs. assume.** Do not ask how to build it — explore and present the
233
286
  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
236
- explicitly and proceed, and put anything unresolved in an open-questions block.
287
+ ambiguity would change the design and you cannot resolve it from the code; use
288
+ the host agent's normal ask-user-question flow and batch 2-4 high-leverage
289
+ questions before finalizing. Do not create visual questions from \`/visual-plan\`.
290
+ Otherwise state the assumption explicitly and proceed, and put anything
291
+ unresolved in an open-questions block.
237
292
  - **The plan is the approval gate.** After surfacing it, ask the user to review
238
293
  and approve before you write code, and name which files/areas the work touches.
239
294
  Presenting the plan and requesting sign-off is the approval step — do not ask a
@@ -244,102 +299,123 @@ direction before you implement.
244
299
 
245
300
  ## Core Workflow
246
301
 
247
- 1. Call \`create-visual-plan\` with the title, brief, source, repo path, and
302
+ 1. Follow the host agent's normal planning flow: inspect the codebase, delegate
303
+ wide exploration when useful, gather the info needed, and ask native
304
+ clarifying questions as needed before generating the plan.
305
+ 2. Call \`create-visual-plan\` with the title, brief, source, repo path, and
248
306
  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,
307
+ 3. Compose the canvas from the kit and write the document with native blocks
308
+ (see the two cores below). Keep the document close to the Markdown plan the
309
+ agent would normally output; add diagrams, wireframes, and visual callouts
310
+ only where they clarify the plan. Skip the canvas for non-visual work.
311
+ 4. Surface the returned Plans link or inline MCP App and ask the user to review.
312
+ Always include the actual URL in chat so the next step is a click in CLI or
313
+ other text-only hosts. When the host exposes an embedded browser/preview panel
314
+ and a tool can open arbitrary URLs there, open the returned plan URL
315
+ automatically for convenient review; do not rely on this as the only handoff.
316
+ 5. Call \`get-plan-feedback\` before editing, after review, after any long pause,
253
317
  and before the final response.
254
- 5. Apply changes with \`update-visual-plan\`, preferring targeted \`contentPatches\`.
318
+ 6. Apply changes with \`update-visual-plan\`, preferring targeted \`contentPatches\`.
255
319
  When the user wants source-control friendly edits, use
256
320
  \`patch-visual-plan-source\` against the MDX files instead of regenerating the
257
321
  plan.
258
- 6. Export with \`export-visual-plan\` only when the user wants a shareable receipt
322
+ 7. Export with \`export-visual-plan\` only when the user wants a shareable receipt
259
323
  or repo-check-in artifacts.
260
324
 
261
325
  <!-- SHARED-CORE:wireframe-canvas START -->
326
+
262
327
  ## Wireframe & Canvas Core
263
328
 
264
329
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
265
330
  \`/visualize-plan\`. It is the single source of truth for how wireframes and the
266
331
  canvas work. Do not paraphrase it per command.
267
332
 
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.
333
+ **A wireframe is an HTML mockup. The renderer owns the look; you write the
334
+ content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
335
+ screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
336
+ the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
337
+ never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags, font-family, hex colors,
338
+ or any width/height/coordinates. You write real HTML layout and real product
339
+ content; the renderer styles and roughens it.
273
340
 
274
- **A wireframe block's data is a declarative kit tree, not geometry:**
341
+ **A wireframe block's data is an HTML screen plus a surface:**
275
342
 
276
343
  \`\`\`json
277
344
  {
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
- ]
345
+ "surface": "browser",
346
+ "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
347
  }
299
348
  \`\`\`
300
349
 
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.
350
+ **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
351
+ (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
352
+ are auto-themed no classes needed. Helper classes carry the rest:
353
+
354
+ - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
355
+ - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
356
+ (\`<span class="wf-pill accent">\`) for the accent-filled variant.
357
+ - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
358
+ - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
359
+ primary button.
360
+
361
+ **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
362
+ these on light/dark, so reading them is what keeps a mockup correct in both
363
+ themes. For any inline border, background, or text color, reference a token:
364
+ \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
365
+ \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
366
+ (page background), \`--wf-card\` (raised surface), \`--wf-accent\` /
367
+ \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
368
+ and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
369
+ renderer owns the sketch/clean font.
370
+
371
+ **Lay out with inline \`style\` flex/grid.** You write the real layout —
372
+ \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
373
+ renderer never repositions anything. Compose the actual product: reproduce the
374
+ current screen, then show the modification. Real labels, real counts, real dates,
375
+ real button text grounded in the screen you read; not lorem or gray bars.
304
376
 
305
377
  **Surface presets — match the real footprint, never default to desktop+mobile.**
306
378
  Pick the \`surface\` that matches what the user will actually see:
307
379
 
308
- - \`desktop\`: a full page or app shell.
380
+ - \`browser\`: a web page that needs a browser chrome frame around it.
381
+ - \`desktop\`: a full desktop app page or app shell.
309
382
  - \`mobile\`: a phone screen, only when the work is genuinely mobile.
310
383
  - \`popover\`: a small floating menu, dropdown, or inline popover.
311
384
  - \`panel\`: a side panel, inspector, or sidebar widget.
312
- - \`browser\`: a page that needs a browser chrome frame around it.
313
385
 
386
+ The surface locks the footprint and aspect; never set width/height/coordinates.
314
387
  A sidebar popover renders as a small surface, not a desktop page and a phone
315
388
  frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
316
389
  actually changes the layout. For a component or widget, show one broader
317
390
  app-context frame only when placement affects understanding, then the focused
318
391
  component states.
319
392
 
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.
393
+ **Modify, don't redesign.** When the task changes an existing screen, reproduce
394
+ the current screen's real layout and footprint FIRST, then change only the delta
395
+ and call it out with a single annotation. Do not restack the page into a new
396
+ layout. For net-new surfaces, compose from the real app shell.
397
+
398
+ **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
399
+ popover, menu, dialog, toast), show the full screen once, then add a small
400
+ separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
401
+ the whole page around it, and do not scale a duplicate up. Pick the matching
402
+ \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
403
+ page width.
404
+
405
+ **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
406
+ fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
407
+ built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
408
+ no labels or copy. The renderer drops borders, sketch, and color into the
409
+ skeleton register automatically. Never escape to a \`custom-html\` document block
410
+ to fake a loader, and never move a mockup out of the canvas — mockups always
411
+ live in canvas artboards.
412
+
413
+ **Editing an existing mockup.** To change one element, text, or color in an
414
+ existing html mockup, do NOT regenerate the frame call \`update-visual-plan\`
415
+ with \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
416
+ replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
417
+ first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
418
+ occurrence. The result is re-sanitized.
343
419
 
344
420
  **Canvas annotations are designer notes on the artboard.** When a top canvas is
345
421
  present, sprinkle Figma-style notes near the frames they explain: a short
@@ -350,8 +426,16 @@ point at one specific control or transition; for a broad frame-level note, write
350
426
  text beside the frame with no connector. Connectors are for real sequences only —
351
427
  never fake "Step 1 → Step 2" lines between independent states.
352
428
 
353
- **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
354
- (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
429
+ **Do not create overlapping annotations.** Anchor each note to the frame it
430
+ explains with \`targetId\` + \`placement\` (top/right/bottom/left). The renderer
431
+ parks notes in a gutter beside the frame and lays them out automatically — never
432
+ supply x/y or points for anchored notes; hand-placed coordinates fight the
433
+ auto-layout and cause the overlap you're trying to avoid. Reserve arrows for a
434
+ note that must point at a specific control inside a frame; a note that simply
435
+ sits beside its frame needs no arrow.
436
+
437
+ **Patching.** Edit one wireframe, canvas annotation, or block with targeted \`contentPatches\`
438
+ (for example \`update-block\`, \`replace-blocks\`, \`update-canvas-annotation\`) rather
355
439
  than regenerating the whole plan. \`contentPatches\` are part of the public MCP
356
440
  action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
357
441
  edits. If an agent is working from exported source files, use
@@ -360,14 +444,66 @@ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
360
444
  \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
361
445
  patch action normalizes the MDX back into the same JSON runtime model. JSON is
362
446
  the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
447
+ In the browser, humans edit \`rich-text\` prose inline; agents should still use
448
+ \`update-rich-text\` content patches or source patches for prose, and use
449
+ comments/structured patches for canvas, artboard, wireframe, and diagram edits.
450
+
451
+ **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.
452
+
453
+ **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).
454
+
455
+ **Good example — a contacts list, surface \`browser\`.** A small, real screen
456
+ composed from the helper classes and tokens, layout in inline flex, no fonts or
457
+ hex colors:
458
+
459
+ \`\`\`html
460
+ <div style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%">
461
+ <div style="display:flex;align-items:center;justify-content:space-between">
462
+ <h1>Contacts</h1>
463
+ <button class="primary">New contact</button>
464
+ </div>
465
+ <div style="display:flex;gap:6px">
466
+ <span class="wf-pill accent">All 128</span>
467
+ <span class="wf-pill">Favorites</span>
468
+ <span class="wf-pill">Archived</span>
469
+ </div>
470
+ <div class="wf-card" style="display:flex;flex-direction:column;gap:0;padding:0">
471
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)">
472
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
473
+ <div style="flex:1"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>
474
+ <span class="wf-pill">Lead</span>
475
+ </div>
476
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
477
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
478
+ <div style="flex:1"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>
479
+ <span class="wf-pill">Customer</span>
480
+ </div>
481
+ </div>
482
+ </div>
483
+ \`\`\`
484
+
485
+ **Mockups belong on the canvas.** When the user asks for a mockup, UI state,
486
+ loading state, prototype, layout, screen, or visual comparison, make the top
487
+ canvas the primary home for that visual. Document blocks can explain, compare,
488
+ or map implementation, but they should not host the primary mockup just because
489
+ \`custom-html\`, screenshots, or prose are easier to produce. If the canvas cannot
490
+ represent the requested fidelity, still keep a canvas artboard and call out or
491
+ extend the needed canvas renderer capability.
492
+
493
+ **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
494
+ nodes instead of \`html\`; the renderer still accepts and displays it, but new
495
+ plans emit \`html\`. Do not author fresh kit-tree screens — write the HTML mockup
496
+ instead. Likewise, old or imported plans may carry coordinate-based regions or
497
+ free-float x/y on notes or artboards; those are legacy escape hatches the
498
+ renderer still shows but you must never produce. The \`surface\` drives the aspect
499
+ and footprint, the canvas auto-places artboards, and the gutter parks notes by
500
+ \`targetId\` + \`placement\`; never supply width, height, or coordinates for a new
501
+ plan.
363
502
 
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
503
  <!-- SHARED-CORE:wireframe-canvas END -->
369
504
 
370
505
  <!-- SHARED-CORE:document-quality START -->
506
+
371
507
  ## Document Quality Core
372
508
 
373
509
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
@@ -391,7 +527,10 @@ snippets, migration or implementation phases, risks, and validation. Repeat a
391
527
  wireframe in the document only for a genuinely new detail view or comparison.
392
528
  Skip the canvas entirely for non-visual work and write a clean rich document.
393
529
 
394
- **Use the right block, and make it carry substance:**
530
+ **Use the right block, and make it carry substance.** For the authoritative,
531
+ machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
532
+ — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
533
+ so you never emit a block the editor cannot render or round-trip:
395
534
 
396
535
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
397
536
  - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
@@ -414,41 +553,53 @@ a dedicated open-questions / needs-clarification block. Never put a
414
553
  questions/decisions wall inside the plan narrative.
415
554
 
416
555
  **\`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.
556
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
557
+ placeholder, density demo, or proof that custom HTML works. Prefer the native
558
+ blocks for normal plans. It may support supplemental demos or references, but it
559
+ is never the primary home for a requested mockup, UI state, or visual
560
+ comparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the
561
+ product fix is canvas support for that artifact type, not moving the mockup into
562
+ the document.
420
563
 
421
564
  **Before handoff, open the plan and check it.** Fix overlap, excessive
422
565
  whitespace, clipped fragments, misleading inactive controls, poor contrast, and
423
566
  unreadable diagrams before asking for approval.
567
+
424
568
  <!-- SHARED-CORE:document-quality END -->
425
569
 
426
570
  <!-- SHARED-CORE:exemplar START -->
571
+
427
572
  ## Good vs. Bad Exemplar
428
573
 
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.
574
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard whose
575
+ \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
576
+ \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
577
+ filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
578
+ titles, due dates, and a primary \`button.primary\` styled only through bare
579
+ elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
580
+ correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
581
+ designer notes sit spaced off the frame, pointing only at the controls that need
582
+ explanation. Below it, a Claude/Codex-grade document: objective and
583
+ done-criteria, an \`implementation-map\` naming the real components and actions
584
+ with short highlighted snippets, a \`decision\` card weighing two real approaches,
585
+ and a validation step none of it repeating the canvas. This is the bar.
586
+
587
+ **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
588
+ pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
589
+ frame; a forced desktop + mobile pair for a popover; floating bordered
590
+ annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
591
+ instead of \`html\`; a mockup escaped into a document \`custom-html\` block; and a
592
+ marketing-style document with a hero heading and value props that just restates
593
+ what the canvas already shows. Never produce this.
594
+
445
595
  <!-- SHARED-CORE:exemplar END -->
446
596
 
447
597
  ## Tool Guidance
448
598
 
449
599
  - \`create-visual-plan\`: start one structured visual plan per agent task/run.
450
600
  - \`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.
601
+ - \`create-visual-questions\`: use only for the explicit \`/visual-questions\`
602
+ command, not as \`/visual-plan\` preflight.
452
603
  - \`visualize-plan\`: build a visual companion from an existing text plan.
453
604
  - \`update-visual-plan\`: revise content, status, or comments; prefer
454
605
  \`contentPatches\` over regenerating the whole plan.
@@ -466,6 +617,41 @@ props that just restates what the canvas already shows. Never produce this.
466
617
  When the user critiques a plan's look or structure, fix the renderer or this
467
618
  skill — never hand-edit one stored plan. Turn feedback into better guidance.
468
619
 
620
+ ## Setup & Authentication
621
+
622
+ There are two ways into Plans.
623
+
624
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
625
+ installs the Plans skills, registers the hosted Plans MCP connector, and
626
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
627
+ intended), so the first tool call does not hit an OAuth wall:
628
+
629
+ \`\`\`bash
630
+ agent-native skills add visual-plan
631
+ \`\`\`
632
+
633
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/visual-questions\`,
634
+ \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
635
+ register the connector without authenticating, then run
636
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
637
+
638
+ **Browser (people you share with).** Open the Plans editor and create & edit
639
+ with no sign-up — you work as a guest. Sign in only when you want to save or
640
+ share; signing in claims the plans you made as a guest into your account.
641
+
642
+ Sharing and commenting require an account: public/shared plans are viewable by
643
+ anyone with the link, but commenting on them needs an agent-native account.
644
+
645
+ For fully offline, no-account use, run the Plans app locally and sync plans to
646
+ your repo as MDX. This local mode is a separate advanced path, not the default
647
+ hosted flow.
648
+
649
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
650
+ do not keep retrying the tool. Authenticate the connector with
651
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
652
+ instead re-run /mcp and choose Authenticate), then continue once the connector
653
+ is available.
654
+
469
655
  Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
470
656
  not put shared secrets in skill files.
471
657
  `;
@@ -487,8 +673,9 @@ comes first; implementation detail comes after the user has something concrete t
487
673
  react to.
488
674
 
489
675
  \`/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.
676
+ and mixed work. Use \`/visual-questions\` only when the user explicitly wants
677
+ visual intake before planning, and \`/visualize-plan\` when a text plan already
678
+ exists.
492
679
 
493
680
  ## Plan Discipline
494
681
 
@@ -503,21 +690,27 @@ questions, and \`/visualize-plan\` when a text plan already exists.
503
690
  Start editing only after the user approves the UI direction.
504
691
  - **Clarify vs. assume.** Do not ask how to build the UI — present the direction
505
692
  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.
693
+ ambiguity would change the design; use the host agent's normal
694
+ ask-user-question flow and batch 2-4 before finalizing. Do not create visual
695
+ questions from \`/ui-plan\`. Otherwise state the assumption in the plan and
696
+ proceed.
508
697
  - **The plan is the approval gate.** Ask the user to review and approve the UI
509
698
  direction before you write code, and name the files/areas the work touches.
510
699
 
511
700
  ## UI-First Workflow
512
701
 
513
- 1. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path, and
702
+ 1. Follow the host agent's normal planning flow: inspect the codebase, gather
703
+ the UI/component context needed, and ask native clarifying questions as needed
704
+ before generating the plan.
705
+ 2. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path, and
514
706
  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
707
+ 3. Compose the top canvas from the kit (see the cores below): the key artboards
516
708
  with real product content, designer notes, and connectors only for real
517
709
  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
710
+ 4. Continue below as a concise technical document that stays close to the
711
+ Markdown plan the agent would normally output — not a second copy of the
519
712
  canvas — covering concrete files, contracts, phases, risks, and validation.
520
- 4. Call \`get-plan-feedback\` before implementation, after review, after a long
713
+ 5. Call \`get-plan-feedback\` before implementation, after review, after a long
521
714
  pause, and before the final response. Apply changes with \`update-visual-plan\`,
522
715
  preferring \`contentPatches\` for one frame, annotation, node, tab, or block. When the user
523
716
  wants source-control friendly edits, use \`patch-visual-plan-source\` against
@@ -531,87 +724,99 @@ code changes. Never claim feedback has been applied until \`get-plan-feedback\`
531
724
  the user has supplied it.
532
725
 
533
726
  <!-- SHARED-CORE:wireframe-canvas START -->
727
+
534
728
  ## Wireframe & Canvas Core
535
729
 
536
730
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
537
731
  \`/visualize-plan\`. It is the single source of truth for how wireframes and the
538
732
  canvas work. Do not paraphrase it per command.
539
733
 
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.
734
+ **A wireframe is an HTML mockup. The renderer owns the look; you write the
735
+ content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
736
+ screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
737
+ the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
738
+ never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags, font-family, hex colors,
739
+ or any width/height/coordinates. You write real HTML layout and real product
740
+ content; the renderer styles and roughens it.
545
741
 
546
- **A wireframe block's data is a declarative kit tree, not geometry:**
742
+ **A wireframe block's data is an HTML screen plus a surface:**
547
743
 
548
744
  \`\`\`json
549
745
  {
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
- ]
746
+ "surface": "browser",
747
+ "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
748
  }
571
749
  \`\`\`
572
750
 
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.
751
+ **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
752
+ (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
753
+ are auto-themed no classes needed. Helper classes carry the rest:
754
+
755
+ - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
756
+ - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
757
+ (\`<span class="wf-pill accent">\`) for the accent-filled variant.
758
+ - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
759
+ - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
760
+ primary button.
761
+
762
+ **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
763
+ these on light/dark, so reading them is what keeps a mockup correct in both
764
+ themes. For any inline border, background, or text color, reference a token:
765
+ \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
766
+ \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
767
+ (page background), \`--wf-card\` (raised surface), \`--wf-accent\` /
768
+ \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
769
+ and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
770
+ renderer owns the sketch/clean font.
771
+
772
+ **Lay out with inline \`style\` flex/grid.** You write the real layout —
773
+ \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
774
+ renderer never repositions anything. Compose the actual product: reproduce the
775
+ current screen, then show the modification. Real labels, real counts, real dates,
776
+ real button text grounded in the screen you read; not lorem or gray bars.
576
777
 
577
778
  **Surface presets — match the real footprint, never default to desktop+mobile.**
578
779
  Pick the \`surface\` that matches what the user will actually see:
579
780
 
580
- - \`desktop\`: a full page or app shell.
781
+ - \`browser\`: a web page that needs a browser chrome frame around it.
782
+ - \`desktop\`: a full desktop app page or app shell.
581
783
  - \`mobile\`: a phone screen, only when the work is genuinely mobile.
582
784
  - \`popover\`: a small floating menu, dropdown, or inline popover.
583
785
  - \`panel\`: a side panel, inspector, or sidebar widget.
584
- - \`browser\`: a page that needs a browser chrome frame around it.
585
786
 
787
+ The surface locks the footprint and aspect; never set width/height/coordinates.
586
788
  A sidebar popover renders as a small surface, not a desktop page and a phone
587
789
  frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
588
790
  actually changes the layout. For a component or widget, show one broader
589
791
  app-context frame only when placement affects understanding, then the focused
590
792
  component states.
591
793
 
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.
794
+ **Modify, don't redesign.** When the task changes an existing screen, reproduce
795
+ the current screen's real layout and footprint FIRST, then change only the delta
796
+ and call it out with a single annotation. Do not restack the page into a new
797
+ layout. For net-new surfaces, compose from the real app shell.
798
+
799
+ **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
800
+ popover, menu, dialog, toast), show the full screen once, then add a small
801
+ separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
802
+ the whole page around it, and do not scale a duplicate up. Pick the matching
803
+ \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
804
+ page width.
805
+
806
+ **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
807
+ fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
808
+ built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
809
+ no labels or copy. The renderer drops borders, sketch, and color into the
810
+ skeleton register automatically. Never escape to a \`custom-html\` document block
811
+ to fake a loader, and never move a mockup out of the canvas — mockups always
812
+ live in canvas artboards.
813
+
814
+ **Editing an existing mockup.** To change one element, text, or color in an
815
+ existing html mockup, do NOT regenerate the frame call \`update-visual-plan\`
816
+ with \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
817
+ replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
818
+ first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
819
+ occurrence. The result is re-sanitized.
615
820
 
616
821
  **Canvas annotations are designer notes on the artboard.** When a top canvas is
617
822
  present, sprinkle Figma-style notes near the frames they explain: a short
@@ -622,8 +827,16 @@ point at one specific control or transition; for a broad frame-level note, write
622
827
  text beside the frame with no connector. Connectors are for real sequences only —
623
828
  never fake "Step 1 → Step 2" lines between independent states.
624
829
 
625
- **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
626
- (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
830
+ **Do not create overlapping annotations.** Anchor each note to the frame it
831
+ explains with \`targetId\` + \`placement\` (top/right/bottom/left). The renderer
832
+ parks notes in a gutter beside the frame and lays them out automatically — never
833
+ supply x/y or points for anchored notes; hand-placed coordinates fight the
834
+ auto-layout and cause the overlap you're trying to avoid. Reserve arrows for a
835
+ note that must point at a specific control inside a frame; a note that simply
836
+ sits beside its frame needs no arrow.
837
+
838
+ **Patching.** Edit one wireframe, canvas annotation, or block with targeted \`contentPatches\`
839
+ (for example \`update-block\`, \`replace-blocks\`, \`update-canvas-annotation\`) rather
627
840
  than regenerating the whole plan. \`contentPatches\` are part of the public MCP
628
841
  action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
629
842
  edits. If an agent is working from exported source files, use
@@ -632,14 +845,66 @@ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
632
845
  \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
633
846
  patch action normalizes the MDX back into the same JSON runtime model. JSON is
634
847
  the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
848
+ In the browser, humans edit \`rich-text\` prose inline; agents should still use
849
+ \`update-rich-text\` content patches or source patches for prose, and use
850
+ comments/structured patches for canvas, artboard, wireframe, and diagram edits.
851
+
852
+ **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.
853
+
854
+ **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).
855
+
856
+ **Good example — a contacts list, surface \`browser\`.** A small, real screen
857
+ composed from the helper classes and tokens, layout in inline flex, no fonts or
858
+ hex colors:
859
+
860
+ \`\`\`html
861
+ <div style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%">
862
+ <div style="display:flex;align-items:center;justify-content:space-between">
863
+ <h1>Contacts</h1>
864
+ <button class="primary">New contact</button>
865
+ </div>
866
+ <div style="display:flex;gap:6px">
867
+ <span class="wf-pill accent">All 128</span>
868
+ <span class="wf-pill">Favorites</span>
869
+ <span class="wf-pill">Archived</span>
870
+ </div>
871
+ <div class="wf-card" style="display:flex;flex-direction:column;gap:0;padding:0">
872
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)">
873
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
874
+ <div style="flex:1"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>
875
+ <span class="wf-pill">Lead</span>
876
+ </div>
877
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
878
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
879
+ <div style="flex:1"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>
880
+ <span class="wf-pill">Customer</span>
881
+ </div>
882
+ </div>
883
+ </div>
884
+ \`\`\`
885
+
886
+ **Mockups belong on the canvas.** When the user asks for a mockup, UI state,
887
+ loading state, prototype, layout, screen, or visual comparison, make the top
888
+ canvas the primary home for that visual. Document blocks can explain, compare,
889
+ or map implementation, but they should not host the primary mockup just because
890
+ \`custom-html\`, screenshots, or prose are easier to produce. If the canvas cannot
891
+ represent the requested fidelity, still keep a canvas artboard and call out or
892
+ extend the needed canvas renderer capability.
893
+
894
+ **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
895
+ nodes instead of \`html\`; the renderer still accepts and displays it, but new
896
+ plans emit \`html\`. Do not author fresh kit-tree screens — write the HTML mockup
897
+ instead. Likewise, old or imported plans may carry coordinate-based regions or
898
+ free-float x/y on notes or artboards; those are legacy escape hatches the
899
+ renderer still shows but you must never produce. The \`surface\` drives the aspect
900
+ and footprint, the canvas auto-places artboards, and the gutter parks notes by
901
+ \`targetId\` + \`placement\`; never supply width, height, or coordinates for a new
902
+ plan.
635
903
 
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
904
  <!-- SHARED-CORE:wireframe-canvas END -->
641
905
 
642
906
  <!-- SHARED-CORE:document-quality START -->
907
+
643
908
  ## Document Quality Core
644
909
 
645
910
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
@@ -663,7 +928,10 @@ snippets, migration or implementation phases, risks, and validation. Repeat a
663
928
  wireframe in the document only for a genuinely new detail view or comparison.
664
929
  Skip the canvas entirely for non-visual work and write a clean rich document.
665
930
 
666
- **Use the right block, and make it carry substance:**
931
+ **Use the right block, and make it carry substance.** For the authoritative,
932
+ machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
933
+ — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
934
+ so you never emit a block the editor cannot render or round-trip:
667
935
 
668
936
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
669
937
  - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
@@ -686,40 +954,52 @@ a dedicated open-questions / needs-clarification block. Never put a
686
954
  questions/decisions wall inside the plan narrative.
687
955
 
688
956
  **\`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.
957
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
958
+ placeholder, density demo, or proof that custom HTML works. Prefer the native
959
+ blocks for normal plans. It may support supplemental demos or references, but it
960
+ is never the primary home for a requested mockup, UI state, or visual
961
+ comparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the
962
+ product fix is canvas support for that artifact type, not moving the mockup into
963
+ the document.
692
964
 
693
965
  **Before handoff, open the plan and check it.** Fix overlap, excessive
694
966
  whitespace, clipped fragments, misleading inactive controls, poor contrast, and
695
967
  unreadable diagrams before asking for approval.
968
+
696
969
  <!-- SHARED-CORE:document-quality END -->
697
970
 
698
971
  <!-- SHARED-CORE:exemplar START -->
972
+
699
973
  ## Good vs. Bad Exemplar
700
974
 
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.
975
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard whose
976
+ \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
977
+ \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
978
+ filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
979
+ titles, due dates, and a primary \`button.primary\` styled only through bare
980
+ elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
981
+ correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
982
+ designer notes sit spaced off the frame, pointing only at the controls that need
983
+ explanation. Below it, a Claude/Codex-grade document: objective and
984
+ done-criteria, an \`implementation-map\` naming the real components and actions
985
+ with short highlighted snippets, a \`decision\` card weighing two real approaches,
986
+ and a validation step none of it repeating the canvas. This is the bar.
987
+
988
+ **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
989
+ pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
990
+ frame; a forced desktop + mobile pair for a popover; floating bordered
991
+ annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
992
+ instead of \`html\`; a mockup escaped into a document \`custom-html\` block; and a
993
+ marketing-style document with a hero heading and value props that just restates
994
+ what the canvas already shows. Never produce this.
995
+
717
996
  <!-- SHARED-CORE:exemplar END -->
718
997
 
719
998
  ## Tool Guidance
720
999
 
721
1000
  - \`create-ui-plan\`: create the UI-first structured visual plan.
722
- - \`create-visual-questions\`: run a visual intake form before the UI plan.
1001
+ - \`create-visual-questions\`: use only for the explicit \`/visual-questions\`
1002
+ command, not as \`/ui-plan\` preflight.
723
1003
  - \`update-visual-plan\`: revise content, mockups, comments, or handoff notes;
724
1004
  prefer targeted \`contentPatches\`.
725
1005
  - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
@@ -736,13 +1016,50 @@ props that just restates what the canvas already shows. Never produce this.
736
1016
  When the user critiques a plan's look or structure, fix the renderer or this
737
1017
  skill — never hand-edit one stored plan. Turn feedback into better guidance.
738
1018
 
739
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
1019
+ ## Setup & Authentication
1020
+
1021
+ There are two ways into Plans.
1022
+
1023
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
1024
+ installs the Plans skills, registers the hosted Plans MCP connector, and
1025
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
1026
+ intended), so the first tool call does not hit an OAuth wall:
1027
+
1028
+ \`\`\`bash
1029
+ agent-native skills add visual-plan
1030
+ \`\`\`
1031
+
1032
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/visual-questions\`,
1033
+ \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
1034
+ register the connector without authenticating, then run
1035
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
1036
+
1037
+ **Browser (people you share with).** Open the Plans editor and create & edit
1038
+ with no sign-up — you work as a guest. Sign in only when you want to save or
1039
+ share; signing in claims the plans you made as a guest into your account.
1040
+
1041
+ Sharing and commenting require an account: public/shared plans are viewable by
1042
+ anyone with the link, but commenting on them needs an agent-native account.
1043
+
1044
+ For fully offline, no-account use, run the Plans app locally and sync plans to
1045
+ your repo as MDX. This local mode is a separate advanced path, not the default
1046
+ hosted flow.
1047
+
1048
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
1049
+ do not keep retrying the tool. Authenticate the connector with
1050
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
1051
+ instead re-run /mcp and choose Authenticate), then continue once the connector
1052
+ is available.
1053
+
1054
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1055
+ not put shared secrets in skill files.
740
1056
  `;
741
1057
  export const VISUAL_QUESTIONS_SKILL_MD = `---
742
1058
  name: visual-questions
743
1059
  description: >-
744
- Use Agent-Native Plans to ask rich visual intake questions before creating a
745
- UI plan or visual plan.
1060
+ Use Agent-Native Plans to ask rich visual intake questions when
1061
+ /visual-questions is explicitly requested before creating a UI plan or visual
1062
+ plan.
746
1063
  metadata:
747
1064
  visibility: both
748
1065
  ---
@@ -767,6 +1084,9 @@ Gate hard: skip this for tiny, unambiguous changes. If the agent can reasonably
767
1084
  infer the answer, prefer \`/ui-plan\` or \`/visual-plan\` directly and put
768
1085
  assumptions in the plan.
769
1086
 
1087
+ Visual questions are an explicit intake command, not an automatic preflight for
1088
+ \`/visual-plan\` or \`/ui-plan\`.
1089
+
770
1090
  ## Workflow
771
1091
 
772
1092
  1. Call \`create-visual-questions\` with a clear title, brief, source, and repo
@@ -819,7 +1139,43 @@ desktop/mobile pair for a popover, panel, or component.
819
1139
  - \`read-visual-plan-source\` / \`patch-visual-plan-source\`: inspect or patch the
820
1140
  MDX source if another agent is operating from checked-in plan files.
821
1141
 
822
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
1142
+ ## Setup & Authentication
1143
+
1144
+ There are two ways into Plans.
1145
+
1146
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
1147
+ installs the Plans skills, registers the hosted Plans MCP connector, and
1148
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
1149
+ intended), so the first tool call does not hit an OAuth wall:
1150
+
1151
+ \`\`\`bash
1152
+ agent-native skills add visual-plan
1153
+ \`\`\`
1154
+
1155
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/visual-questions\`,
1156
+ \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
1157
+ register the connector without authenticating, then run
1158
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
1159
+
1160
+ **Browser (people you share with).** Open the Plans editor and create & edit
1161
+ with no sign-up — you work as a guest. Sign in only when you want to save or
1162
+ share; signing in claims the plans you made as a guest into your account.
1163
+
1164
+ Sharing and commenting require an account: public/shared plans are viewable by
1165
+ anyone with the link, but commenting on them needs an agent-native account.
1166
+
1167
+ For fully offline, no-account use, run the Plans app locally and sync plans to
1168
+ your repo as MDX. This local mode is a separate advanced path, not the default
1169
+ hosted flow.
1170
+
1171
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
1172
+ do not keep retrying the tool. Authenticate the connector with
1173
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
1174
+ instead re-run /mcp and choose Authenticate), then continue once the connector
1175
+ is available.
1176
+
1177
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1178
+ not put shared secrets in skill files.
823
1179
  `;
824
1180
  export const VISUALIZE_PLAN_SKILL_MD = `---
825
1181
  name: visualize-plan
@@ -874,87 +1230,99 @@ still reads like a plan, not a marketing page.
874
1230
  native plan unless the user asks.
875
1231
 
876
1232
  <!-- SHARED-CORE:wireframe-canvas START -->
1233
+
877
1234
  ## Wireframe & Canvas Core
878
1235
 
879
1236
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
880
1237
  \`/visualize-plan\`. It is the single source of truth for how wireframes and the
881
1238
  canvas work. Do not paraphrase it per command.
882
1239
 
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.
1240
+ **A wireframe is an HTML mockup. The renderer owns the look; you write the
1241
+ content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
1242
+ screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
1243
+ the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
1244
+ never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags, font-family, hex colors,
1245
+ or any width/height/coordinates. You write real HTML layout and real product
1246
+ content; the renderer styles and roughens it.
888
1247
 
889
- **A wireframe block's data is a declarative kit tree, not geometry:**
1248
+ **A wireframe block's data is an HTML screen plus a surface:**
890
1249
 
891
1250
  \`\`\`json
892
1251
  {
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
- ]
1252
+ "surface": "browser",
1253
+ "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
1254
  }
914
1255
  \`\`\`
915
1256
 
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.
1257
+ **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
1258
+ (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
1259
+ are auto-themed no classes needed. Helper classes carry the rest:
1260
+
1261
+ - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
1262
+ - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
1263
+ (\`<span class="wf-pill accent">\`) for the accent-filled variant.
1264
+ - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
1265
+ - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
1266
+ primary button.
1267
+
1268
+ **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
1269
+ these on light/dark, so reading them is what keeps a mockup correct in both
1270
+ themes. For any inline border, background, or text color, reference a token:
1271
+ \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
1272
+ \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
1273
+ (page background), \`--wf-card\` (raised surface), \`--wf-accent\` /
1274
+ \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
1275
+ and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
1276
+ renderer owns the sketch/clean font.
1277
+
1278
+ **Lay out with inline \`style\` flex/grid.** You write the real layout —
1279
+ \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
1280
+ renderer never repositions anything. Compose the actual product: reproduce the
1281
+ current screen, then show the modification. Real labels, real counts, real dates,
1282
+ real button text grounded in the screen you read; not lorem or gray bars.
919
1283
 
920
1284
  **Surface presets — match the real footprint, never default to desktop+mobile.**
921
1285
  Pick the \`surface\` that matches what the user will actually see:
922
1286
 
923
- - \`desktop\`: a full page or app shell.
1287
+ - \`browser\`: a web page that needs a browser chrome frame around it.
1288
+ - \`desktop\`: a full desktop app page or app shell.
924
1289
  - \`mobile\`: a phone screen, only when the work is genuinely mobile.
925
1290
  - \`popover\`: a small floating menu, dropdown, or inline popover.
926
1291
  - \`panel\`: a side panel, inspector, or sidebar widget.
927
- - \`browser\`: a page that needs a browser chrome frame around it.
928
1292
 
1293
+ The surface locks the footprint and aspect; never set width/height/coordinates.
929
1294
  A sidebar popover renders as a small surface, not a desktop page and a phone
930
1295
  frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
931
1296
  actually changes the layout. For a component or widget, show one broader
932
1297
  app-context frame only when placement affects understanding, then the focused
933
1298
  component states.
934
1299
 
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.
1300
+ **Modify, don't redesign.** When the task changes an existing screen, reproduce
1301
+ the current screen's real layout and footprint FIRST, then change only the delta
1302
+ and call it out with a single annotation. Do not restack the page into a new
1303
+ layout. For net-new surfaces, compose from the real app shell.
1304
+
1305
+ **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
1306
+ popover, menu, dialog, toast), show the full screen once, then add a small
1307
+ separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
1308
+ the whole page around it, and do not scale a duplicate up. Pick the matching
1309
+ \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
1310
+ page width.
1311
+
1312
+ **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
1313
+ fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
1314
+ built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
1315
+ no labels or copy. The renderer drops borders, sketch, and color into the
1316
+ skeleton register automatically. Never escape to a \`custom-html\` document block
1317
+ to fake a loader, and never move a mockup out of the canvas — mockups always
1318
+ live in canvas artboards.
1319
+
1320
+ **Editing an existing mockup.** To change one element, text, or color in an
1321
+ existing html mockup, do NOT regenerate the frame call \`update-visual-plan\`
1322
+ with \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
1323
+ replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
1324
+ first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
1325
+ occurrence. The result is re-sanitized.
958
1326
 
959
1327
  **Canvas annotations are designer notes on the artboard.** When a top canvas is
960
1328
  present, sprinkle Figma-style notes near the frames they explain: a short
@@ -965,8 +1333,16 @@ point at one specific control or transition; for a broad frame-level note, write
965
1333
  text beside the frame with no connector. Connectors are for real sequences only —
966
1334
  never fake "Step 1 → Step 2" lines between independent states.
967
1335
 
968
- **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
969
- (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
1336
+ **Do not create overlapping annotations.** Anchor each note to the frame it
1337
+ explains with \`targetId\` + \`placement\` (top/right/bottom/left). The renderer
1338
+ parks notes in a gutter beside the frame and lays them out automatically — never
1339
+ supply x/y or points for anchored notes; hand-placed coordinates fight the
1340
+ auto-layout and cause the overlap you're trying to avoid. Reserve arrows for a
1341
+ note that must point at a specific control inside a frame; a note that simply
1342
+ sits beside its frame needs no arrow.
1343
+
1344
+ **Patching.** Edit one wireframe, canvas annotation, or block with targeted \`contentPatches\`
1345
+ (for example \`update-block\`, \`replace-blocks\`, \`update-canvas-annotation\`) rather
970
1346
  than regenerating the whole plan. \`contentPatches\` are part of the public MCP
971
1347
  action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
972
1348
  edits. If an agent is working from exported source files, use
@@ -975,14 +1351,66 @@ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
975
1351
  \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
976
1352
  patch action normalizes the MDX back into the same JSON runtime model. JSON is
977
1353
  the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
1354
+ In the browser, humans edit \`rich-text\` prose inline; agents should still use
1355
+ \`update-rich-text\` content patches or source patches for prose, and use
1356
+ comments/structured patches for canvas, artboard, wireframe, and diagram edits.
1357
+
1358
+ **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.
1359
+
1360
+ **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).
1361
+
1362
+ **Good example — a contacts list, surface \`browser\`.** A small, real screen
1363
+ composed from the helper classes and tokens, layout in inline flex, no fonts or
1364
+ hex colors:
1365
+
1366
+ \`\`\`html
1367
+ <div style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%">
1368
+ <div style="display:flex;align-items:center;justify-content:space-between">
1369
+ <h1>Contacts</h1>
1370
+ <button class="primary">New contact</button>
1371
+ </div>
1372
+ <div style="display:flex;gap:6px">
1373
+ <span class="wf-pill accent">All 128</span>
1374
+ <span class="wf-pill">Favorites</span>
1375
+ <span class="wf-pill">Archived</span>
1376
+ </div>
1377
+ <div class="wf-card" style="display:flex;flex-direction:column;gap:0;padding:0">
1378
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)">
1379
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
1380
+ <div style="flex:1"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>
1381
+ <span class="wf-pill">Lead</span>
1382
+ </div>
1383
+ <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
1384
+ <div style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"></div>
1385
+ <div style="flex:1"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>
1386
+ <span class="wf-pill">Customer</span>
1387
+ </div>
1388
+ </div>
1389
+ </div>
1390
+ \`\`\`
1391
+
1392
+ **Mockups belong on the canvas.** When the user asks for a mockup, UI state,
1393
+ loading state, prototype, layout, screen, or visual comparison, make the top
1394
+ canvas the primary home for that visual. Document blocks can explain, compare,
1395
+ or map implementation, but they should not host the primary mockup just because
1396
+ \`custom-html\`, screenshots, or prose are easier to produce. If the canvas cannot
1397
+ represent the requested fidelity, still keep a canvas artboard and call out or
1398
+ extend the needed canvas renderer capability.
1399
+
1400
+ **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
1401
+ nodes instead of \`html\`; the renderer still accepts and displays it, but new
1402
+ plans emit \`html\`. Do not author fresh kit-tree screens — write the HTML mockup
1403
+ instead. Likewise, old or imported plans may carry coordinate-based regions or
1404
+ free-float x/y on notes or artboards; those are legacy escape hatches the
1405
+ renderer still shows but you must never produce. The \`surface\` drives the aspect
1406
+ and footprint, the canvas auto-places artboards, and the gutter parks notes by
1407
+ \`targetId\` + \`placement\`; never supply width, height, or coordinates for a new
1408
+ plan.
978
1409
 
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
1410
  <!-- SHARED-CORE:wireframe-canvas END -->
984
1411
 
985
1412
  <!-- SHARED-CORE:document-quality START -->
1413
+
986
1414
  ## Document Quality Core
987
1415
 
988
1416
  This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
@@ -1006,7 +1434,10 @@ snippets, migration or implementation phases, risks, and validation. Repeat a
1006
1434
  wireframe in the document only for a genuinely new detail view or comparison.
1007
1435
  Skip the canvas entirely for non-visual work and write a clean rich document.
1008
1436
 
1009
- **Use the right block, and make it carry substance:**
1437
+ **Use the right block, and make it carry substance.** For the authoritative,
1438
+ machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
1439
+ — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
1440
+ so you never emit a block the editor cannot render or round-trip:
1010
1441
 
1011
1442
  - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
1012
1443
  - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
@@ -1029,34 +1460,45 @@ a dedicated open-questions / needs-clarification block. Never put a
1029
1460
  questions/decisions wall inside the plan narrative.
1030
1461
 
1031
1462
  **\`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.
1463
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
1464
+ placeholder, density demo, or proof that custom HTML works. Prefer the native
1465
+ blocks for normal plans. It may support supplemental demos or references, but it
1466
+ is never the primary home for a requested mockup, UI state, or visual
1467
+ comparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the
1468
+ product fix is canvas support for that artifact type, not moving the mockup into
1469
+ the document.
1035
1470
 
1036
1471
  **Before handoff, open the plan and check it.** Fix overlap, excessive
1037
1472
  whitespace, clipped fragments, misleading inactive controls, poor contrast, and
1038
1473
  unreadable diagrams before asking for approval.
1474
+
1039
1475
  <!-- SHARED-CORE:document-quality END -->
1040
1476
 
1041
1477
  <!-- SHARED-CORE:exemplar START -->
1478
+
1042
1479
  ## Good vs. Bad Exemplar
1043
1480
 
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.
1481
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard whose
1482
+ \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
1483
+ \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
1484
+ filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
1485
+ titles, due dates, and a primary \`button.primary\` styled only through bare
1486
+ elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
1487
+ correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
1488
+ designer notes sit spaced off the frame, pointing only at the controls that need
1489
+ explanation. Below it, a Claude/Codex-grade document: objective and
1490
+ done-criteria, an \`implementation-map\` naming the real components and actions
1491
+ with short highlighted snippets, a \`decision\` card weighing two real approaches,
1492
+ and a validation step none of it repeating the canvas. This is the bar.
1493
+
1494
+ **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
1495
+ pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
1496
+ frame; a forced desktop + mobile pair for a popover; floating bordered
1497
+ annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
1498
+ instead of \`html\`; a mockup escaped into a document \`custom-html\` block; and a
1499
+ marketing-style document with a hero heading and value props that just restates
1500
+ what the canvas already shows. Never produce this.
1501
+
1060
1502
  <!-- SHARED-CORE:exemplar END -->
1061
1503
 
1062
1504
  ## Tool Guidance
@@ -1078,7 +1520,43 @@ props that just restates what the canvas already shows. Never produce this.
1078
1520
  When the user critiques a plan's look or structure, fix the renderer or this
1079
1521
  skill — never hand-edit one stored plan. Turn feedback into better guidance.
1080
1522
 
1081
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
1523
+ ## Setup & Authentication
1524
+
1525
+ There are two ways into Plans.
1526
+
1527
+ **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
1528
+ installs the Plans skills, registers the hosted Plans MCP connector, and
1529
+ authenticates it in the same step (a one-time browser sign-in at setup — this is
1530
+ intended), so the first tool call does not hit an OAuth wall:
1531
+
1532
+ \`\`\`bash
1533
+ agent-native skills add visual-plan
1534
+ \`\`\`
1535
+
1536
+ After that, \`/visual-plan\` (and \`/ui-plan\`, \`/visual-questions\`,
1537
+ \`/visualize-plan\`) generate a plan and open the editor. Pass \`--no-connect\` to
1538
+ register the connector without authenticating, then run
1539
+ \`agent-native connect https://plan.agent-native.com\` whenever you are ready.
1540
+
1541
+ **Browser (people you share with).** Open the Plans editor and create & edit
1542
+ with no sign-up — you work as a guest. Sign in only when you want to save or
1543
+ share; signing in claims the plans you made as a guest into your account.
1544
+
1545
+ Sharing and commenting require an account: public/shared plans are viewable by
1546
+ anyone with the link, but commenting on them needs an agent-native account.
1547
+
1548
+ For fully offline, no-account use, run the Plans app locally and sync plans to
1549
+ your repo as MDX. This local mode is a separate advanced path, not the default
1550
+ hosted flow.
1551
+
1552
+ If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
1553
+ do not keep retrying the tool. Authenticate the connector with
1554
+ \`agent-native connect https://plan.agent-native.com\` (OAuth-capable hosts can
1555
+ instead re-run /mcp and choose Authenticate), then continue once the connector
1556
+ is available.
1557
+
1558
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
1559
+ not put shared secrets in skill files.
1082
1560
  `;
1083
1561
  const BUILT_IN_APP_SKILLS = {
1084
1562
  assets: {
@@ -1495,6 +1973,7 @@ export function parseSkillsArgs(argv) {
1495
1973
  printJson: false,
1496
1974
  instructions: true,
1497
1975
  mcp: true,
1976
+ connect: true,
1498
1977
  };
1499
1978
  for (let i = 0; i < args.length; i++) {
1500
1979
  const arg = args[i];
@@ -1533,6 +2012,8 @@ export function parseSkillsArgs(argv) {
1533
2012
  out.instructions = false;
1534
2013
  else if (arg === "--instructions-only" || arg === "--no-mcp")
1535
2014
  out.mcp = false;
2015
+ else if (arg === "--no-connect" || arg === "--skip-connect")
2016
+ out.connect = false;
1536
2017
  else if (arg.startsWith("-"))
1537
2018
  throw new Error(`Unknown option: ${arg}`);
1538
2019
  else if (!out.target)
@@ -1663,6 +2144,8 @@ function dryRunInstallCommand(parsed, target) {
1663
2144
  args.push("--instructions-only");
1664
2145
  if (!parsed.instructions && parsed.mcp)
1665
2146
  args.push("--mcp-only");
2147
+ if (!parsed.connect)
2148
+ args.push("--no-connect");
1666
2149
  if (parsed.yes || isKnownSkill(target))
1667
2150
  args.push("--yes");
1668
2151
  return commandString("agent-native", args);
@@ -1736,6 +2219,72 @@ function withMcpUrlOverride(target, input) {
1736
2219
  },
1737
2220
  };
1738
2221
  }
2222
+ /**
2223
+ * Whether we can run the interactive browser/device auth flow. CI and
2224
+ * non-TTY shells must not block on a browser approval, so we skip the inline
2225
+ * flow there and surface the exact `agent-native connect` command instead.
2226
+ */
2227
+ function canRunInteractiveConnect(options) {
2228
+ if (options.isInteractive)
2229
+ return options.isInteractive();
2230
+ if (process.env.AGENT_NATIVE_NO_PROMPT === "1")
2231
+ return false;
2232
+ if (process.env.CI === "true")
2233
+ return false;
2234
+ return !!process.stdin.isTTY && !!process.stdout.isTTY;
2235
+ }
2236
+ /** Build the `agent-native connect <url> --client … --scope …` command. */
2237
+ function connectCommandFor(hostedUrl, clients, scope) {
2238
+ const args = [
2239
+ "connect",
2240
+ hostedUrl,
2241
+ "--client",
2242
+ clientArgForClients(clients),
2243
+ "--scope",
2244
+ scope,
2245
+ ];
2246
+ return commandString("agent-native", args);
2247
+ }
2248
+ /**
2249
+ * Authenticate the freshly-registered hosted MCP connector so the user does not
2250
+ * hit the OAuth wall on their first tool call. Reuses the existing
2251
+ * `agent-native connect` flow (OAuth-capable clients get URL-only config plus a
2252
+ * `/mcp` authenticate prompt; Codex / Cowork run the browser device-code flow).
2253
+ * In non-interactive shells we skip the inline flow and return the command to
2254
+ * run instead. Failures here are non-fatal: the connector is already registered,
2255
+ * so the user can authenticate later.
2256
+ */
2257
+ async function connectAfterEnsure(installTarget, clients, parsed, options) {
2258
+ const hostedUrl = installTarget.loaded.manifest.hosted.url;
2259
+ const authMode = installTarget.loaded.manifest.auth?.mode ?? "oauth";
2260
+ const connectCommand = connectCommandFor(hostedUrl, clients, parsed.scope);
2261
+ // Skills whose connector needs no auth (e.g. open/local-only) never need the
2262
+ // connect step.
2263
+ if (authMode === "none") {
2264
+ return { connected: false, connectCommand: "" };
2265
+ }
2266
+ if (!canRunInteractiveConnect(options)) {
2267
+ options.log?.(`Authentication skipped (non-interactive). To finish auth, run: ${connectCommand}`);
2268
+ return { connected: false, connectCommand };
2269
+ }
2270
+ options.log?.(`Authenticating ${installTarget.displayName}…`);
2271
+ try {
2272
+ await (options.runConnect ?? runConnect)([
2273
+ hostedUrl,
2274
+ "--client",
2275
+ clientArgForClients(clients),
2276
+ "--scope",
2277
+ parsed.scope,
2278
+ ]);
2279
+ return { connected: true, connectCommand: "" };
2280
+ }
2281
+ catch (err) {
2282
+ // Non-fatal: the MCP connector is registered. Surface the manual command.
2283
+ options.log?.(`Could not finish authentication automatically (${err?.message ?? err}). ` +
2284
+ `Run it later with: ${connectCommand}`);
2285
+ return { connected: false, connectCommand };
2286
+ }
2287
+ }
1739
2288
  export async function addAgentNativeSkill(parsed, options = {}) {
1740
2289
  const target = parsed.target ?? "assets";
1741
2290
  const knownTarget = normalizeKnownSkillTarget(target);
@@ -1812,6 +2361,8 @@ export async function addAgentNativeSkill(parsed, options = {}) {
1812
2361
  const commands = [];
1813
2362
  const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), "an-skills-add-"));
1814
2363
  let instructionSource;
2364
+ let connected = false;
2365
+ let connectCommand;
1815
2366
  try {
1816
2367
  if (parsed.instructions) {
1817
2368
  if (skillsAgents.length === 0) {
@@ -1853,6 +2404,17 @@ export async function addAgentNativeSkill(parsed, options = {}) {
1853
2404
  confirm: true,
1854
2405
  log: options.log,
1855
2406
  });
2407
+ // One-step install + authenticate: after registering a hosted MCP
2408
+ // connector, kick off the existing connect/device-code flow so the user
2409
+ // does not hit an OAuth wall on the first tool call. `--no-connect`
2410
+ // opts out; non-interactive shells get the exact command to run.
2411
+ if (parsed.connect) {
2412
+ const result = await connectAfterEnsure(installTarget, clients, parsed, options);
2413
+ connected = result.connected;
2414
+ connectCommand = result.connectCommand || undefined;
2415
+ if (connectCommand)
2416
+ commands.push(connectCommand);
2417
+ }
1856
2418
  }
1857
2419
  }
1858
2420
  return {
@@ -1865,6 +2427,8 @@ export async function addAgentNativeSkill(parsed, options = {}) {
1865
2427
  mcpClients: clients,
1866
2428
  dryRun: parsed.dryRun,
1867
2429
  commands,
2430
+ connected,
2431
+ connectCommand,
1868
2432
  };
1869
2433
  }
1870
2434
  finally {
@@ -1948,6 +2512,17 @@ export async function runSkills(argv, options = {}) {
1948
2512
  .filter((result) => result.local)
1949
2513
  .flatMap((result) => result.commands)),
1950
2514
  ];
2515
+ const authConnected = results.some((result) => result.connected);
2516
+ const pendingConnectCommands = [
2517
+ ...new Set(results
2518
+ .map((result) => result.connectCommand)
2519
+ .filter((command) => Boolean(command))),
2520
+ ];
2521
+ const authLine = authConnected
2522
+ ? "Authentication: completed."
2523
+ : pendingConnectCommands.length
2524
+ ? `Authentication: pending — run ${pendingConnectCommands.join(" && ")}`
2525
+ : "";
1951
2526
  process.stdout.write([
1952
2527
  `Installed ${installedNames} skill${results.length === 1 ? "" : "s"}.`,
1953
2528
  skillsAgents.length
@@ -1959,6 +2534,7 @@ export async function runSkills(argv, options = {}) {
1959
2534
  mcpUrls.length
1960
2535
  ? `MCP URL${mcpUrls.length === 1 ? "" : "s"}: ${mcpUrls.join(", ")}.`
1961
2536
  : "",
2537
+ authLine,
1962
2538
  localCommands.length ? `Local command: ${localCommands.join(", ")}.` : "",
1963
2539
  "Restart or reload selected agent clients if the skill is not visible yet.",
1964
2540
  parsed.clientExplicit