@agent-native/core 0.96.0 → 0.98.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 (1241) hide show
  1. package/README.md +6 -0
  2. package/corpus/README.md +2 -2
  3. package/corpus/core/CHANGELOG.md +71 -0
  4. package/corpus/core/docs/content/audit-log.mdx +2 -1
  5. package/corpus/core/docs/content/authentication.mdx +3 -3
  6. package/corpus/core/docs/content/automations.mdx +7 -7
  7. package/corpus/core/docs/content/creating-templates.mdx +1 -1
  8. package/corpus/core/docs/content/doctor.mdx +170 -0
  9. package/corpus/core/docs/content/external-agents.mdx +8 -7
  10. package/corpus/core/docs/content/internationalization.mdx +2 -1
  11. package/corpus/core/docs/content/locales/ar-SA/audit-log.mdx +2 -1
  12. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +2 -2
  13. package/corpus/core/docs/content/locales/ar-SA/automations.mdx +7 -7
  14. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +8 -7
  15. package/corpus/core/docs/content/locales/ar-SA/getting-started.mdx +7 -1
  16. package/corpus/core/docs/content/locales/ar-SA/internationalization.mdx +1 -1
  17. package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
  18. package/corpus/core/docs/content/locales/ar-SA/package-lifecycle.mdx +19 -0
  19. package/corpus/core/docs/content/locales/ar-SA/sandbox-adapters.mdx +18 -7
  20. package/corpus/core/docs/content/locales/ar-SA/security.mdx +10 -0
  21. package/corpus/core/docs/content/locales/de-DE/audit-log.mdx +2 -1
  22. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
  23. package/corpus/core/docs/content/locales/de-DE/automations.mdx +7 -7
  24. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +8 -7
  25. package/corpus/core/docs/content/locales/de-DE/getting-started.mdx +7 -1
  26. package/corpus/core/docs/content/locales/de-DE/internationalization.mdx +1 -1
  27. package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
  28. package/corpus/core/docs/content/locales/de-DE/package-lifecycle.mdx +22 -0
  29. package/corpus/core/docs/content/locales/de-DE/sandbox-adapters.mdx +18 -7
  30. package/corpus/core/docs/content/locales/de-DE/security.mdx +10 -0
  31. package/corpus/core/docs/content/locales/es-ES/audit-log.mdx +2 -1
  32. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +2 -2
  33. package/corpus/core/docs/content/locales/es-ES/automations.mdx +7 -7
  34. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +8 -7
  35. package/corpus/core/docs/content/locales/es-ES/getting-started.mdx +7 -1
  36. package/corpus/core/docs/content/locales/es-ES/internationalization.mdx +1 -1
  37. package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
  38. package/corpus/core/docs/content/locales/es-ES/package-lifecycle.mdx +22 -0
  39. package/corpus/core/docs/content/locales/es-ES/sandbox-adapters.mdx +18 -7
  40. package/corpus/core/docs/content/locales/es-ES/security.mdx +10 -0
  41. package/corpus/core/docs/content/locales/fr-FR/audit-log.mdx +2 -1
  42. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
  43. package/corpus/core/docs/content/locales/fr-FR/automations.mdx +7 -7
  44. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +8 -7
  45. package/corpus/core/docs/content/locales/fr-FR/getting-started.mdx +7 -1
  46. package/corpus/core/docs/content/locales/fr-FR/internationalization.mdx +1 -1
  47. package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
  48. package/corpus/core/docs/content/locales/fr-FR/package-lifecycle.mdx +21 -0
  49. package/corpus/core/docs/content/locales/fr-FR/sandbox-adapters.mdx +19 -8
  50. package/corpus/core/docs/content/locales/fr-FR/security.mdx +10 -0
  51. package/corpus/core/docs/content/locales/hi-IN/audit-log.mdx +2 -1
  52. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +2 -2
  53. package/corpus/core/docs/content/locales/hi-IN/automations.mdx +7 -7
  54. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +8 -7
  55. package/corpus/core/docs/content/locales/hi-IN/getting-started.mdx +7 -1
  56. package/corpus/core/docs/content/locales/hi-IN/internationalization.mdx +1 -1
  57. package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
  58. package/corpus/core/docs/content/locales/hi-IN/package-lifecycle.mdx +20 -0
  59. package/corpus/core/docs/content/locales/hi-IN/sandbox-adapters.mdx +18 -7
  60. package/corpus/core/docs/content/locales/hi-IN/security.mdx +10 -0
  61. package/corpus/core/docs/content/locales/ja-JP/audit-log.mdx +2 -1
  62. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +2 -2
  63. package/corpus/core/docs/content/locales/ja-JP/automations.mdx +7 -7
  64. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +8 -7
  65. package/corpus/core/docs/content/locales/ja-JP/getting-started.mdx +7 -1
  66. package/corpus/core/docs/content/locales/ja-JP/internationalization.mdx +1 -1
  67. package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
  68. package/corpus/core/docs/content/locales/ja-JP/package-lifecycle.mdx +21 -0
  69. package/corpus/core/docs/content/locales/ja-JP/sandbox-adapters.mdx +17 -6
  70. package/corpus/core/docs/content/locales/ja-JP/security.mdx +10 -0
  71. package/corpus/core/docs/content/locales/ko-KR/audit-log.mdx +2 -1
  72. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +2 -2
  73. package/corpus/core/docs/content/locales/ko-KR/automations.mdx +7 -7
  74. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +8 -7
  75. package/corpus/core/docs/content/locales/ko-KR/getting-started.mdx +7 -1
  76. package/corpus/core/docs/content/locales/ko-KR/internationalization.mdx +1 -1
  77. package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
  78. package/corpus/core/docs/content/locales/ko-KR/package-lifecycle.mdx +20 -0
  79. package/corpus/core/docs/content/locales/ko-KR/sandbox-adapters.mdx +17 -6
  80. package/corpus/core/docs/content/locales/ko-KR/security.mdx +10 -0
  81. package/corpus/core/docs/content/locales/pt-BR/audit-log.mdx +2 -1
  82. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +2 -2
  83. package/corpus/core/docs/content/locales/pt-BR/automations.mdx +7 -7
  84. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +8 -7
  85. package/corpus/core/docs/content/locales/pt-BR/getting-started.mdx +7 -1
  86. package/corpus/core/docs/content/locales/pt-BR/internationalization.mdx +1 -1
  87. package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
  88. package/corpus/core/docs/content/locales/pt-BR/package-lifecycle.mdx +21 -0
  89. package/corpus/core/docs/content/locales/pt-BR/sandbox-adapters.mdx +18 -7
  90. package/corpus/core/docs/content/locales/pt-BR/security.mdx +10 -0
  91. package/corpus/core/docs/content/locales/zh-CN/audit-log.mdx +2 -1
  92. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +2 -2
  93. package/corpus/core/docs/content/locales/zh-CN/automations.mdx +7 -7
  94. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -7
  95. package/corpus/core/docs/content/locales/zh-CN/getting-started.mdx +6 -4
  96. package/corpus/core/docs/content/locales/zh-CN/internationalization.mdx +1 -1
  97. package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
  98. package/corpus/core/docs/content/locales/zh-CN/package-lifecycle.mdx +19 -0
  99. package/corpus/core/docs/content/locales/zh-CN/sandbox-adapters.mdx +17 -6
  100. package/corpus/core/docs/content/locales/zh-CN/security.mdx +10 -0
  101. package/corpus/core/docs/content/locales/zh-TW/audit-log.mdx +2 -1
  102. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +2 -2
  103. package/corpus/core/docs/content/locales/zh-TW/automations.mdx +7 -7
  104. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -7
  105. package/corpus/core/docs/content/locales/zh-TW/getting-started.mdx +6 -4
  106. package/corpus/core/docs/content/locales/zh-TW/internationalization.mdx +1 -1
  107. package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
  108. package/corpus/core/docs/content/locales/zh-TW/package-lifecycle.mdx +19 -0
  109. package/corpus/core/docs/content/locales/zh-TW/sandbox-adapters.mdx +18 -7
  110. package/corpus/core/docs/content/locales/zh-TW/security.mdx +10 -0
  111. package/corpus/core/docs/content/mcp-protocol.mdx +1 -1
  112. package/corpus/core/docs/content/package-lifecycle.mdx +51 -0
  113. package/corpus/core/docs/content/sandbox-adapters.mdx +16 -5
  114. package/corpus/core/docs/content/security.mdx +2 -0
  115. package/corpus/core/package.json +13 -2
  116. package/corpus/core/scripts/finalize-build.mjs +63 -3
  117. package/corpus/core/scripts/materialize-source-corpus.mjs +101 -15
  118. package/corpus/core/src/a2a/auth-policy.ts +33 -0
  119. package/corpus/core/src/action.ts +42 -0
  120. package/corpus/core/src/agent/durable-background.ts +15 -7
  121. package/corpus/core/src/agent/engine/builder-engine.ts +3 -0
  122. package/corpus/core/src/agent/engine/context-directives-transform.ts +69 -0
  123. package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +168 -0
  124. package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +85 -0
  125. package/corpus/core/src/agent/production-agent.ts +129 -244
  126. package/corpus/core/src/agent/run-store.ts +13 -4
  127. package/corpus/core/src/audit/actions/export-audit-events.ts +162 -0
  128. package/corpus/core/src/audit/store.ts +8 -3
  129. package/corpus/core/src/audit/types.ts +3 -0
  130. package/corpus/core/src/cli/doctor.ts +402 -0
  131. package/corpus/core/src/cli/index.ts +56 -0
  132. package/corpus/core/src/cli/info.ts +3 -3
  133. package/corpus/core/src/cli/package-lifecycle.ts +821 -0
  134. package/corpus/core/src/cli/plan-local.ts +10 -2
  135. package/corpus/core/src/cli/skills-content/assets-skill.ts +83 -0
  136. package/corpus/core/src/cli/skills-content/canvas.ts +153 -0
  137. package/corpus/core/src/cli/skills-content/connection.ts +52 -0
  138. package/corpus/core/src/cli/skills-content/content-skill.ts +109 -0
  139. package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +118 -0
  140. package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +228 -0
  141. package/corpus/core/src/cli/skills-content/document-quality.ts +196 -0
  142. package/corpus/core/src/cli/skills-content/exemplar.ts +69 -0
  143. package/corpus/core/src/cli/skills-content/help.ts +77 -0
  144. package/corpus/core/src/cli/skills-content/index.ts +22 -0
  145. package/corpus/core/src/cli/skills-content/local-files.ts +95 -0
  146. package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +80 -0
  147. package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +470 -0
  148. package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +547 -0
  149. package/corpus/core/src/cli/skills-content/visualize-repo-skill.ts +93 -0
  150. package/corpus/core/src/cli/skills-content/wireframe.ts +349 -0
  151. package/corpus/core/src/cli/skills.ts +27 -2733
  152. package/corpus/core/src/client/AgentPanel.tsx +6 -5
  153. package/corpus/core/src/client/CommandMenu.tsx +16 -5
  154. package/corpus/core/src/client/FeedbackButton.tsx +2 -2
  155. package/corpus/core/src/client/agent-chat-adapter.ts +9 -9
  156. package/corpus/core/src/client/app-providers.tsx +18 -5
  157. package/corpus/core/src/client/chat/tool-call-display.tsx +3 -3
  158. package/corpus/core/src/client/composer/PastedTextChip.tsx +1 -1
  159. package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +143 -45
  160. package/corpus/core/src/client/composer/TiptapComposer.tsx +1 -1
  161. package/corpus/core/src/client/composer/VoiceButton.tsx +21 -5
  162. package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +107 -10
  163. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +5 -2
  164. package/corpus/core/src/client/extensions/ExtensionEditor.tsx +37 -4
  165. package/corpus/core/src/client/extensions/ExtensionQueryErrorState.tsx +47 -0
  166. package/corpus/core/src/client/extensions/ExtensionSlot.tsx +39 -10
  167. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +44 -6
  168. package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -3
  169. package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +49 -11
  170. package/corpus/core/src/client/index.ts +0 -13
  171. package/corpus/core/src/client/progress/RunsTray.tsx +10 -3
  172. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +7 -0
  173. package/corpus/core/src/client/settings/useBuilderStatus.ts +6 -0
  174. package/corpus/core/src/client/tool-cells/EditCell.tsx +19 -16
  175. package/corpus/core/src/client/tool-cells/FilesChangedSummary.tsx +26 -23
  176. package/corpus/core/src/client/tool-cells/WriteCell.tsx +19 -16
  177. package/corpus/core/src/client/visual-style-controls.tsx +1 -1
  178. package/corpus/core/src/deploy/build.ts +36 -14
  179. package/corpus/core/src/guards/db-tool-scoping.ts +129 -0
  180. package/corpus/core/src/guards/index.ts +23 -0
  181. package/corpus/core/src/guards/no-drizzle-push.ts +116 -0
  182. package/corpus/core/src/guards/no-env-credentials.ts +229 -0
  183. package/corpus/core/src/guards/no-env-mutation.ts +114 -0
  184. package/corpus/core/src/guards/no-localhost-fallback.ts +124 -0
  185. package/corpus/core/src/guards/no-unscoped-credentials.ts +227 -0
  186. package/corpus/core/src/guards/no-unscoped-queries.ts +834 -0
  187. package/corpus/core/src/guards/scan-utils.ts +105 -0
  188. package/corpus/core/src/guards/types.ts +30 -0
  189. package/corpus/core/src/integrations/google-docs-poller.ts +23 -2
  190. package/corpus/core/src/integrations/plugin.ts +10 -0
  191. package/corpus/core/src/integrations/webhook-handler.ts +27 -2
  192. package/corpus/core/src/jobs/scheduler.ts +28 -2
  193. package/corpus/core/src/localization/default-messages.ts +8 -1
  194. package/corpus/core/src/mcp/oauth-token.ts +6 -1
  195. package/corpus/core/src/observability/routes.ts +36 -0
  196. package/corpus/core/src/observability/sentiment.ts +261 -0
  197. package/corpus/core/src/observability/store.ts +23 -0
  198. package/corpus/core/src/observability/traces.ts +49 -63
  199. package/corpus/core/src/observability/tracking-identity.ts +55 -0
  200. package/corpus/core/src/observability/types.ts +13 -0
  201. package/corpus/core/src/org/accept-pending.ts +9 -1
  202. package/corpus/core/src/org/migrations.ts +41 -0
  203. package/corpus/core/src/package-lifecycle/index.ts +1 -0
  204. package/corpus/core/src/package-lifecycle/manifest.ts +120 -0
  205. package/corpus/core/src/provider-api/custom-registry.ts +56 -0
  206. package/corpus/core/src/provider-api/index.ts +2 -0
  207. package/corpus/core/src/secrets/storage.ts +114 -30
  208. package/corpus/core/src/server/action-discovery.ts +4 -0
  209. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +199 -0
  210. package/corpus/core/src/server/agent-chat/browser-team-tools.ts +510 -0
  211. package/corpus/core/src/server/agent-chat/context-tools.ts +595 -0
  212. package/corpus/core/src/server/agent-chat/framework-prompts.ts +470 -0
  213. package/corpus/core/src/server/agent-chat/lazy-fs.ts +11 -0
  214. package/corpus/core/src/server/agent-chat/mcp-glue.ts +91 -0
  215. package/corpus/core/src/server/agent-chat/plugin-options.ts +350 -0
  216. package/corpus/core/src/server/agent-chat/process-run-failure.ts +62 -0
  217. package/corpus/core/src/server/agent-chat/prompt-resources.ts +688 -0
  218. package/corpus/core/src/server/agent-chat/recurring-jobs-runtime.ts +80 -0
  219. package/corpus/core/src/server/agent-chat/request-surface.ts +71 -0
  220. package/corpus/core/src/server/agent-chat/run-code-tools.ts +67 -0
  221. package/corpus/core/src/server/agent-chat/script-entries.ts +779 -0
  222. package/corpus/core/src/server/agent-chat/shared-thread.ts +301 -0
  223. package/corpus/core/src/server/agent-chat/skill-frontmatter.ts +41 -0
  224. package/corpus/core/src/server/agent-chat-plugin.ts +403 -4179
  225. package/corpus/core/src/server/agent-teams.ts +26 -3
  226. package/corpus/core/src/server/auth.ts +55 -57
  227. package/corpus/core/src/server/core-routes-plugin.ts +30 -14
  228. package/corpus/core/src/server/credential-provider.ts +22 -25
  229. package/corpus/core/src/server/csrf.ts +24 -5
  230. package/corpus/core/src/server/edge.ts +1 -0
  231. package/corpus/core/src/server/framework-request-handler.ts +34 -0
  232. package/corpus/core/src/server/google-realtime-session.ts +1 -36
  233. package/corpus/core/src/server/onboarding-html.ts +1 -16
  234. package/corpus/core/src/server/poll.ts +24 -2
  235. package/corpus/core/src/server/realtime-voice.ts +49 -5
  236. package/corpus/core/src/server/request-origin.ts +67 -0
  237. package/corpus/core/src/server/ssr-handler.ts +55 -2
  238. package/corpus/core/src/server/transcribe-voice.ts +1 -50
  239. package/corpus/core/src/sharing/access.ts +155 -11
  240. package/corpus/core/src/sharing/registry.ts +7 -0
  241. package/corpus/core/src/styles/agent-native.css +15 -14
  242. package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
  243. package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +6 -0
  244. package/corpus/core/src/templates/default/app/i18n/de-DE.ts +6 -0
  245. package/corpus/core/src/templates/default/app/i18n/en-US.ts +6 -0
  246. package/corpus/core/src/templates/default/app/i18n/es-ES.ts +6 -0
  247. package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +6 -0
  248. package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +6 -0
  249. package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +6 -0
  250. package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +6 -0
  251. package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +6 -0
  252. package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +6 -0
  253. package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +6 -0
  254. package/corpus/core/src/templates/default/package.json +2 -2
  255. package/corpus/core/src/templates/headless/package.json +0 -1
  256. package/corpus/core/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
  257. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
  258. package/corpus/core/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
  259. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
  260. package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
  261. package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
  262. package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
  263. package/corpus/core/src/templates/workspace-core/package.json +0 -1
  264. package/corpus/core/src/templates/workspace-core/src/server/index.ts +4 -2
  265. package/corpus/core/src/templates/workspace-root/package.json +0 -1
  266. package/corpus/core/src/testing.ts +26 -0
  267. package/corpus/core/src/triggers/actions.ts +11 -3
  268. package/corpus/core/src/triggers/dispatcher.ts +23 -2
  269. package/corpus/core/src/triggers/types.ts +7 -1
  270. package/corpus/core/src/vite/client.ts +126 -2
  271. package/corpus/core/tsconfig.cli.json +1 -1
  272. package/corpus/core/tsconfig.json +5 -1
  273. package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +2 -2
  274. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -1
  275. package/corpus/templates/analytics/AGENTS.md +19 -6
  276. package/corpus/templates/analytics/actions/compose-dashboard.ts +65 -37
  277. package/corpus/templates/analytics/actions/install-dashboard-template.ts +79 -43
  278. package/corpus/templates/analytics/actions/list-explorer-dashboards.ts +3 -3
  279. package/corpus/templates/analytics/actions/list-sql-dashboards.ts +8 -3
  280. package/corpus/templates/analytics/actions/mutate-dashboard.ts +73 -24
  281. package/corpus/templates/analytics/actions/rename-analysis.ts +8 -2
  282. package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -7
  283. package/corpus/templates/analytics/actions/reorder-dashboard-panels.ts +16 -13
  284. package/corpus/templates/analytics/actions/update-dashboard.ts +53 -42
  285. package/corpus/templates/analytics/actions/view-screen.ts +4 -23
  286. package/corpus/templates/analytics/app/components/ResourceLoadError.tsx +42 -0
  287. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +85 -70
  288. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +107 -89
  289. package/corpus/templates/analytics/app/components/layout/SidebarLoadError.tsx +24 -0
  290. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -5
  291. package/corpus/templates/analytics/app/i18n/zh-TW.ts +4 -0
  292. package/corpus/templates/analytics/app/i18n-data.ts +40 -0
  293. package/corpus/templates/analytics/app/pages/Settings.tsx +6 -2
  294. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +36 -20
  295. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +34 -20
  296. package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +42 -41
  297. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +43 -36
  298. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +11 -2
  299. package/corpus/templates/analytics/app/root.tsx +13 -1
  300. package/corpus/templates/analytics/app/routes/_index.tsx +14 -2
  301. package/corpus/templates/analytics/changelog/2026-07-03-agent-llm-observability-dashboard.md +1 -1
  302. package/corpus/templates/analytics/changelog/2026-07-10-dashboard-edits-from-the-agent-and-the-ui-at-the-same-time-n.md +6 -0
  303. package/corpus/templates/analytics/changelog/2026-07-10-timed-out-bigquery-jobs-are-now-cancelled-so-they-stop-consu.md +6 -0
  304. package/corpus/templates/analytics/changelog/2026-07-11-agent-feedback-sentiment-dashboard.md +6 -0
  305. package/corpus/templates/analytics/changelog/2026-07-11-analytics-chats-now-start-faster-by-loading-metric-definitio.md +6 -0
  306. package/corpus/templates/analytics/changelog/2026-07-11-command-and-sql-previews-now-respond-without-lag.md +6 -0
  307. package/corpus/templates/analytics/changelog/2026-07-11-command-search-now-reports-loading-failures-and-lets-you-ret.md +6 -0
  308. package/corpus/templates/analytics/changelog/2026-07-11-dashboard-navigation-now-loads-faster-and-reports-request-fa.md +6 -0
  309. package/corpus/templates/analytics/changelog/2026-07-11-inferred-message-sentiment-dashboard.md +6 -0
  310. package/corpus/templates/analytics/changelog/2026-07-11-microphone-settings-from-realtime-voice-mode-now-open-the-vo.md +6 -0
  311. package/corpus/templates/analytics/changelog/2026-07-11-more-dashboard-edit-paths-are-now-safe-against-simultaneous-.md +6 -0
  312. package/corpus/templates/analytics/changelog/2026-07-11-renaming-a-dashboard-is-now-safe-against-simultaneous-agent-.md +6 -0
  313. package/corpus/templates/analytics/changelog/2026-07-11-renaming-an-analysis-is-now-safe-against-simultaneous-edits.md +6 -0
  314. package/corpus/templates/analytics/changelog/2026-07-11-workspace-mounted-analytics-now-opens-ask-reliably-and-route.md +6 -0
  315. package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +37 -3
  316. package/corpus/templates/analytics/package.json +1 -2
  317. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +339 -1
  318. package/corpus/templates/analytics/server/lib/bigquery.ts +3 -2
  319. package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -24
  320. package/corpus/templates/analytics/server/lib/dashboard-seeds.ts +0 -5
  321. package/corpus/templates/analytics/server/lib/dashboards-store.ts +443 -31
  322. package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +106 -34
  323. package/corpus/templates/analytics/server/lib/demo-dashboards.ts +4 -1
  324. package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -39
  325. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -1
  326. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +30 -4
  327. package/corpus/templates/assets/app/routes/library.tsx +49 -5
  328. package/corpus/templates/assets/changelog/2026-07-11-library-load-failures-now-show-a-retry-action.md +6 -0
  329. package/corpus/templates/assets/package.json +1 -2
  330. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -1
  331. package/corpus/templates/brain/package.json +1 -2
  332. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -1
  333. package/corpus/templates/calendar/.env.example +5 -0
  334. package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +2 -2
  335. package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
  336. package/corpus/templates/calendar/app/i18n-data.ts +20 -0
  337. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +37 -1
  338. package/corpus/templates/calendar/app/pages/BookingsList.tsx +20 -3
  339. package/corpus/templates/calendar/changelog/2026-07-11-booking-load-failures-now-show-a-retry-action.md +6 -0
  340. package/corpus/templates/calendar/changelog/2026-07-11-event-cards-give-subtle-press-feedback-and-smoother-hover.md +6 -0
  341. package/corpus/templates/calendar/package.json +1 -2
  342. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -1
  343. package/corpus/templates/chat/package.json +1 -2
  344. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -1
  345. package/corpus/templates/clips/actions/decline-invite.ts +8 -0
  346. package/corpus/templates/clips/app/components/library/folder-tree.tsx +209 -187
  347. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +2 -2
  348. package/corpus/templates/clips/app/components/player/reactions-tray.tsx +17 -5
  349. package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -3
  350. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -2
  351. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +119 -95
  352. package/corpus/templates/clips/app/global.css +45 -0
  353. package/corpus/templates/clips/app/root.tsx +4 -0
  354. package/corpus/templates/clips/app/routes/_app.notifications.tsx +23 -2
  355. package/corpus/templates/clips/app/routes/_app.trash.tsx +24 -2
  356. package/corpus/templates/clips/changelog/2026-07-10-atomic-view-tracking.md +6 -0
  357. package/corpus/templates/clips/changelog/2026-07-11-controls-and-folders-now-move-more-smoothly.md +6 -0
  358. package/corpus/templates/clips/changelog/2026-07-11-declining-an-invitation-now-requires-being-its-recipient.md +6 -0
  359. package/corpus/templates/clips/changelog/2026-07-11-recording-overlays-are-lighter-weight-and-no-longer-cause-pa.md +6 -0
  360. package/corpus/templates/clips/changelog/2026-07-11-workspace-load-failures-now-show-a-retry-action.md +6 -0
  361. package/corpus/templates/clips/chrome-extension/package.json +3 -2
  362. package/corpus/templates/clips/chrome-extension/src/overlay.css +34 -5
  363. package/corpus/templates/clips/chrome-extension/src/styles.css +2 -2
  364. package/corpus/templates/clips/desktop/package.json +6 -4
  365. package/corpus/templates/clips/desktop/src/lib/recorder.ts +26 -13
  366. package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +4 -1
  367. package/corpus/templates/clips/desktop/src/styles.css +71 -26
  368. package/corpus/templates/clips/package.json +1 -2
  369. package/corpus/templates/clips/server/db/schema.ts +29 -17
  370. package/corpus/templates/clips/server/plugins/db.ts +8 -0
  371. package/corpus/templates/clips/server/routes/api/view-event.post.ts +260 -105
  372. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -1
  373. package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +16 -0
  374. package/corpus/templates/content/AGENTS.md +72 -62
  375. package/corpus/templates/content/actions/_content-database-source-adapters.ts +84 -0
  376. package/corpus/templates/content/actions/_database-source-utils.ts +206 -96
  377. package/corpus/templates/content/actions/_notion-database-source-adapter.ts +216 -0
  378. package/corpus/templates/content/actions/_position-utils.ts +76 -0
  379. package/corpus/templates/content/actions/_property-utils.ts +31 -20
  380. package/corpus/templates/content/actions/add-database-item.ts +52 -39
  381. package/corpus/templates/content/actions/attach-content-database-source.ts +95 -11
  382. package/corpus/templates/content/actions/change-content-database-source-role.ts +24 -1
  383. package/corpus/templates/content/actions/configure-document-property.ts +36 -27
  384. package/corpus/templates/content/actions/create-content-database.ts +40 -30
  385. package/corpus/templates/content/actions/create-document.ts +39 -32
  386. package/corpus/templates/content/actions/duplicate-document-property.ts +37 -28
  387. package/corpus/templates/content/actions/list-notion-database-sources.ts +80 -0
  388. package/corpus/templates/content/actions/move-document.ts +93 -61
  389. package/corpus/templates/content/actions/refresh-content-database-source.ts +42 -3
  390. package/corpus/templates/content/actions/share-local-file-document.ts +36 -27
  391. package/corpus/templates/content/actions/suggest-source-join-key.ts +39 -16
  392. package/corpus/templates/content/app/components/QueryErrorState.tsx +39 -0
  393. package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
  394. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +323 -1467
  395. package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +368 -0
  396. package/corpus/templates/content/app/components/editor/database/ListView.tsx +353 -0
  397. package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +580 -0
  398. package/corpus/templates/content/app/components/editor/database/settings.tsx +1 -1
  399. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -2
  400. package/corpus/templates/content/app/global.css +19 -19
  401. package/corpus/templates/content/app/hooks/use-content-database.ts +18 -1
  402. package/corpus/templates/content/app/i18n/zh-TW.ts +4 -0
  403. package/corpus/templates/content/app/i18n-data.ts +40 -0
  404. package/corpus/templates/content/app/root.tsx +2 -2
  405. package/corpus/templates/content/app/routes/_app._index.tsx +11 -1
  406. package/corpus/templates/content/changelog/2026-07-10-failed-row-creation-and-source-attach-now-show-an-error-inst.md +6 -0
  407. package/corpus/templates/content/changelog/2026-07-10-items-added-at-the-same-time-no-longer-end-up-with-identical.md +6 -0
  408. package/corpus/templates/content/changelog/2026-07-10-notion-databases-can-add-read-only-details-to-content-tables.md +6 -0
  409. package/corpus/templates/content/changelog/2026-07-11-document-load-failures-now-show-a-retry-action.md +6 -0
  410. package/corpus/templates/content/changelog/2026-07-11-editor-toggle-feedback-now-feels-more-responsive.md +6 -0
  411. package/corpus/templates/content/changelog/2026-07-11-moving-documents-at-the-same-time-no-longer-scrambles-their-.md +6 -0
  412. package/corpus/templates/content/changelog/2026-07-11-public-document-chats-now-start-faster-while-keeping-full-do.md +6 -0
  413. package/corpus/templates/content/changelog/2026-07-11-reopening-a-comment-now-uses-consistent-permissions-everywhe.md +6 -0
  414. package/corpus/templates/content/changelog/2026-07-11-sidebar-resizing-now-tracks-your-cursor-instantly-instead-of.md +6 -0
  415. package/corpus/templates/content/package.json +1 -2
  416. package/corpus/templates/content/parity/matrix.md +25 -25
  417. package/corpus/templates/content/parity/matrix.ts +1 -0
  418. package/corpus/templates/content/server/lib/public-documents.ts +47 -10
  419. package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +24 -24
  420. package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +43 -26
  421. package/corpus/templates/content/shared/api.ts +16 -1
  422. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -1
  423. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +8 -4
  424. package/corpus/templates/design/AGENTS.md +12 -2
  425. package/corpus/templates/design/DEVELOPING.md +10 -6
  426. package/corpus/templates/design/actions/apply-visual-edit.ts +191 -6
  427. package/corpus/templates/design/actions/duplicate-design.ts +31 -25
  428. package/corpus/templates/design/app/components/QueryErrorState.tsx +24 -0
  429. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
  430. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +5 -2
  431. package/corpus/templates/design/app/components/design/EditPanel.tsx +326 -319
  432. package/corpus/templates/design/app/components/design/LayersPanel.tsx +198 -193
  433. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +11 -4
  434. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +1 -1
  435. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
  436. package/corpus/templates/design/app/pages/DesignSystems.tsx +7 -1
  437. package/corpus/templates/design/app/pages/Index.tsx +14 -2
  438. package/corpus/templates/design/app/pages/Present.tsx +16 -3
  439. package/corpus/templates/design/app/pages/Templates.tsx +10 -4
  440. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +484 -0
  441. package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +378 -0
  442. package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +138 -0
  443. package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +15 -0
  444. package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +180 -0
  445. package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +226 -0
  446. package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +5 -1
  447. package/corpus/templates/design/app/pages/design-editor/png-export-render.ts +348 -0
  448. package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +160 -0
  449. package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +238 -0
  450. package/corpus/templates/design/app/pages/design-editor/tool-state.ts +23 -1
  451. package/corpus/templates/design/app/pages/design-editor/types.ts +25 -0
  452. package/corpus/templates/design/app/root.tsx +10 -1
  453. package/corpus/templates/design/changelog/2026-07-10-duplicating-a-design-can-no-longer-produce-a-copy-with-missi.md +6 -0
  454. package/corpus/templates/design/changelog/2026-07-10-local-visual-edits-can-now-save-safe-leaf-text-class-and.md +6 -0
  455. package/corpus/templates/design/changelog/2026-07-11-canvas-context-menus-now-open-without-motion-jitter.md +6 -0
  456. package/corpus/templates/design/changelog/2026-07-11-design-load-failures-now-show-a-retry-action.md +6 -0
  457. package/corpus/templates/design/changelog/2026-07-11-inspector-tooltips-appear-instantly-as-you-sweep-across-icon.md +6 -0
  458. package/corpus/templates/design/package.json +1 -1
  459. package/corpus/templates/design/shared/local-jsx-visual-edit.ts +388 -0
  460. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -1
  461. package/corpus/templates/dispatch/app/i18n/zh-TW.ts +10 -0
  462. package/corpus/templates/dispatch/app/i18n-data.ts +123 -0
  463. package/corpus/templates/dispatch/app/routes/integrations.tsx +163 -144
  464. package/corpus/templates/dispatch/changelog/2026-07-11-dispatch-mcp-connections-now-start-with-safer-app-access-and.md +6 -0
  465. package/corpus/templates/dispatch/changelog/2026-07-11-overview-and-chat-now-share-a-cleaner-more-stable-flow.md +6 -0
  466. package/corpus/templates/dispatch/changelog/2026-07-11-query-errors-now-show-a-retry-option.md +6 -0
  467. package/corpus/templates/dispatch/package.json +1 -2
  468. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -1
  469. package/corpus/templates/forms/actions/patch-form-fields.ts +82 -44
  470. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
  471. package/corpus/templates/forms/app/root.tsx +34 -8
  472. package/corpus/templates/forms/changelog/2026-07-10-simultaneous-edits-to-different-form-fields-no-longer-overwr.md +6 -0
  473. package/corpus/templates/forms/package.json +1 -2
  474. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -1
  475. package/corpus/templates/macros/app/components/DailyProgress.tsx +25 -5
  476. package/corpus/templates/macros/app/components/QueryErrorState.tsx +31 -0
  477. package/corpus/templates/macros/app/components/WeightTracker.tsx +5 -1
  478. package/corpus/templates/macros/app/components/ui/button.tsx +1 -1
  479. package/corpus/templates/macros/app/components/ui/progress.tsx +1 -1
  480. package/corpus/templates/macros/app/components/ui/tabs.tsx +1 -1
  481. package/corpus/templates/macros/app/i18n/ar-SA.ts +2 -0
  482. package/corpus/templates/macros/app/i18n/de-DE.ts +2 -0
  483. package/corpus/templates/macros/app/i18n/en-US.ts +2 -0
  484. package/corpus/templates/macros/app/i18n/es-ES.ts +2 -0
  485. package/corpus/templates/macros/app/i18n/fr-FR.ts +2 -0
  486. package/corpus/templates/macros/app/i18n/hi-IN.ts +2 -0
  487. package/corpus/templates/macros/app/i18n/ja-JP.ts +2 -0
  488. package/corpus/templates/macros/app/i18n/ko-KR.ts +2 -0
  489. package/corpus/templates/macros/app/i18n/pt-BR.ts +2 -0
  490. package/corpus/templates/macros/app/i18n/zh-CN.ts +2 -0
  491. package/corpus/templates/macros/app/i18n/zh-TW.ts +2 -0
  492. package/corpus/templates/macros/app/routes/_index.tsx +22 -12
  493. package/corpus/templates/macros/app/routes/analytics.tsx +31 -10
  494. package/corpus/templates/macros/changelog/2026-07-11-daily-tracking-now-loads-and-updates-more-quickly.md +6 -0
  495. package/corpus/templates/macros/changelog/2026-07-11-data-load-failures-now-show-a-clear-error-with-a-retry-actio.md +6 -0
  496. package/corpus/templates/macros/package.json +1 -2
  497. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -1
  498. package/corpus/templates/mail/.env.example +16 -11
  499. package/corpus/templates/mail/actions/list-emails.ts +39 -35
  500. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +58 -6
  501. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +35 -2
  502. package/corpus/templates/mail/app/components/email/EmailThread.tsx +3 -1
  503. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +113 -104
  504. package/corpus/templates/mail/app/root.tsx +8 -10
  505. package/corpus/templates/mail/changelog/2026-07-10-fixed-calendar-rsvp-buttons-in-emails-firing-duplicate-respo.md +6 -0
  506. package/corpus/templates/mail/changelog/2026-07-11-compose-and-navigation-motion-now-feel-faster-and-smoother.md +6 -0
  507. package/corpus/templates/mail/changelog/2026-07-11-swipe-to-archive-or-snooze-now-responds-to-quick-flicks-not-.md +6 -0
  508. package/corpus/templates/mail/changelog/2026-07-11-the-assistant-now-sees-the-same-inbox-you-do-snoozed-mail-st.md +6 -0
  509. package/corpus/templates/mail/package.json +1 -2
  510. package/corpus/templates/mail/server/handlers/emails.ts +25 -69
  511. package/corpus/templates/mail/server/lib/list-inbox-emails.ts +169 -0
  512. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -1
  513. package/corpus/templates/plan/.env.example +4 -0
  514. package/corpus/templates/plan/actions/create-plan-design.ts +89 -81
  515. package/corpus/templates/plan/actions/create-prototype-plan.ts +72 -59
  516. package/corpus/templates/plan/actions/create-ui-plan.ts +70 -55
  517. package/corpus/templates/plan/actions/create-visual-plan.ts +65 -51
  518. package/corpus/templates/plan/actions/restore-plan-version.ts +126 -96
  519. package/corpus/templates/plan/actions/update-local-plan-folder.ts +43 -30
  520. package/corpus/templates/plan/actions/update-visual-plan.ts +81 -64
  521. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +17 -0
  522. package/corpus/templates/plan/app/components/ui/tabs.tsx +1 -1
  523. package/corpus/templates/plan/app/i18n/ar-SA.ts +10 -0
  524. package/corpus/templates/plan/app/i18n/de-DE.ts +10 -0
  525. package/corpus/templates/plan/app/i18n/en-US.ts +10 -0
  526. package/corpus/templates/plan/app/i18n/es-ES.ts +10 -0
  527. package/corpus/templates/plan/app/i18n/fr-FR.ts +10 -0
  528. package/corpus/templates/plan/app/i18n/hi-IN.ts +10 -0
  529. package/corpus/templates/plan/app/i18n/ja-JP.ts +10 -0
  530. package/corpus/templates/plan/app/i18n/ko-KR.ts +10 -0
  531. package/corpus/templates/plan/app/i18n/pt-BR.ts +10 -0
  532. package/corpus/templates/plan/app/i18n/zh-CN.ts +10 -0
  533. package/corpus/templates/plan/app/i18n/zh-TW.ts +10 -0
  534. package/corpus/templates/plan/app/lib/plan-local-bridge.ts +80 -1
  535. package/corpus/templates/plan/app/pages/PlansPage.tsx +152 -4
  536. package/corpus/templates/plan/app/root.tsx +11 -0
  537. package/corpus/templates/plan/changelog/2026-07-10-restoring-a-plan-version-can-no-longer-leave-a-plan-half-res.md +6 -0
  538. package/corpus/templates/plan/changelog/2026-07-11-local-plans-now-explain-and-recover-from-browser-permission-.md +6 -0
  539. package/corpus/templates/plan/changelog/2026-07-11-plan-edits-now-save-atomically-and-can-no-longer-partially-a.md +6 -0
  540. package/corpus/templates/plan/changelog/2026-07-11-plan-lists-now-show-a-clear-error-with-a-retry-action-when-t.md +6 -0
  541. package/corpus/templates/plan/package.json +1 -2
  542. package/corpus/templates/plan/server/plans.ts +9 -2
  543. package/corpus/templates/plan/shared/plan-content.ts +546 -260
  544. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -1
  545. package/corpus/templates/slides/actions/delete-slide-comment.ts +49 -0
  546. package/corpus/templates/slides/actions/list-decks.ts +28 -0
  547. package/corpus/templates/slides/actions/update-slide-comment.ts +93 -0
  548. package/corpus/templates/slides/actions/view-screen.ts +14 -6
  549. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +33 -10
  550. package/corpus/templates/slides/app/components/deck/MermaidRenderer.tsx +41 -26
  551. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +4 -8
  552. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +3 -5
  553. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +5 -9
  554. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +5 -12
  555. package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -2
  556. package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +3 -6
  557. package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -6
  558. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +2 -5
  559. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +4 -2
  560. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +4 -3
  561. package/corpus/templates/slides/app/context/DeckContext.tsx +56 -4
  562. package/corpus/templates/slides/app/i18n/ar-SA.ts +6 -0
  563. package/corpus/templates/slides/app/i18n/de-DE.ts +6 -0
  564. package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
  565. package/corpus/templates/slides/app/i18n/es-ES.ts +6 -0
  566. package/corpus/templates/slides/app/i18n/fr-FR.ts +6 -0
  567. package/corpus/templates/slides/app/i18n/hi-IN.ts +6 -0
  568. package/corpus/templates/slides/app/i18n/ja-JP.ts +6 -0
  569. package/corpus/templates/slides/app/i18n/ko-KR.ts +6 -0
  570. package/corpus/templates/slides/app/i18n/pt-BR.ts +6 -0
  571. package/corpus/templates/slides/app/i18n/zh-CN.ts +5 -0
  572. package/corpus/templates/slides/app/i18n/zh-TW.ts +5 -0
  573. package/corpus/templates/slides/app/pages/DeckEditor.tsx +11 -30
  574. package/corpus/templates/slides/app/pages/DesignSystems.tsx +23 -2
  575. package/corpus/templates/slides/app/pages/Index.tsx +31 -4
  576. package/corpus/templates/slides/app/root.tsx +0 -5
  577. package/corpus/templates/slides/changelog/2026-07-10-deck-lists-load-much-faster-and-no-longer-re-download-slide-.md +6 -0
  578. package/corpus/templates/slides/changelog/2026-07-11-comment-load-failures-now-show-a-retry-action-instead-of-say.md +6 -0
  579. package/corpus/templates/slides/changelog/2026-07-11-comment-pins-now-clear-with-a-faster-smoother-confirmation.md +6 -0
  580. package/corpus/templates/slides/changelog/2026-07-11-deck-and-design-system-load-failures-now-show-a-retry-action.md +6 -0
  581. package/corpus/templates/slides/changelog/2026-07-11-editor-toggles-and-toolbar-menus-now-animate-smoothly.md +6 -0
  582. package/corpus/templates/slides/changelog/2026-07-11-the-assistant-can-now-resolve-reopen-and-delete-slide-commen.md +6 -0
  583. package/corpus/templates/slides/changelog/2026-07-11-viewing-slides-no-longer-loads-every-deck-s-full-contents-in.md +6 -0
  584. package/corpus/templates/slides/package.json +1 -2
  585. package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +29 -48
  586. package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +29 -65
  587. package/dist/a2a/auth-policy.d.ts +19 -0
  588. package/dist/a2a/auth-policy.d.ts.map +1 -1
  589. package/dist/a2a/auth-policy.js +32 -0
  590. package/dist/a2a/auth-policy.js.map +1 -1
  591. package/dist/action.d.ts +23 -0
  592. package/dist/action.d.ts.map +1 -1
  593. package/dist/action.js +13 -0
  594. package/dist/action.js.map +1 -1
  595. package/dist/agent/durable-background.d.ts +8 -5
  596. package/dist/agent/durable-background.d.ts.map +1 -1
  597. package/dist/agent/durable-background.js +15 -8
  598. package/dist/agent/durable-background.js.map +1 -1
  599. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  600. package/dist/agent/engine/builder-engine.js +3 -0
  601. package/dist/agent/engine/builder-engine.js.map +1 -1
  602. package/dist/agent/engine/context-directives-transform.d.ts +25 -0
  603. package/dist/agent/engine/context-directives-transform.d.ts.map +1 -0
  604. package/dist/agent/engine/context-directives-transform.js +53 -0
  605. package/dist/agent/engine/context-directives-transform.js.map +1 -0
  606. package/dist/agent/engine/continuation-dispatch-retry.d.ts +40 -0
  607. package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -0
  608. package/dist/agent/engine/continuation-dispatch-retry.js +109 -0
  609. package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -0
  610. package/dist/agent/engine/tool-call-journal-seed.d.ts +46 -0
  611. package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -0
  612. package/dist/agent/engine/tool-call-journal-seed.js +60 -0
  613. package/dist/agent/engine/tool-call-journal-seed.js.map +1 -0
  614. package/dist/agent/production-agent.d.ts +7 -0
  615. package/dist/agent/production-agent.d.ts.map +1 -1
  616. package/dist/agent/production-agent.js +102 -222
  617. package/dist/agent/production-agent.js.map +1 -1
  618. package/dist/agent/run-store.d.ts.map +1 -1
  619. package/dist/agent/run-store.js +9 -4
  620. package/dist/agent/run-store.js.map +1 -1
  621. package/dist/audit/actions/export-audit-events.d.ts +27 -0
  622. package/dist/audit/actions/export-audit-events.d.ts.map +1 -0
  623. package/dist/audit/actions/export-audit-events.js +144 -0
  624. package/dist/audit/actions/export-audit-events.js.map +1 -0
  625. package/dist/audit/store.d.ts +1 -0
  626. package/dist/audit/store.d.ts.map +1 -1
  627. package/dist/audit/store.js +8 -3
  628. package/dist/audit/store.js.map +1 -1
  629. package/dist/audit/types.d.ts +3 -0
  630. package/dist/audit/types.d.ts.map +1 -1
  631. package/dist/audit/types.js.map +1 -1
  632. package/dist/cli/doctor.d.ts +83 -0
  633. package/dist/cli/doctor.d.ts.map +1 -0
  634. package/dist/cli/doctor.js +281 -0
  635. package/dist/cli/doctor.js.map +1 -0
  636. package/dist/cli/index.js +50 -0
  637. package/dist/cli/index.js.map +1 -1
  638. package/dist/cli/info.js +3 -3
  639. package/dist/cli/info.js.map +1 -1
  640. package/dist/cli/package-lifecycle.d.ts +50 -0
  641. package/dist/cli/package-lifecycle.d.ts.map +1 -0
  642. package/dist/cli/package-lifecycle.js +560 -0
  643. package/dist/cli/package-lifecycle.js.map +1 -0
  644. package/dist/cli/plan-local.d.ts.map +1 -1
  645. package/dist/cli/plan-local.js +8 -2
  646. package/dist/cli/plan-local.js.map +1 -1
  647. package/dist/cli/skills-content/assets-skill.d.ts +2 -0
  648. package/dist/cli/skills-content/assets-skill.d.ts.map +1 -0
  649. package/dist/cli/skills-content/assets-skill.js +84 -0
  650. package/dist/cli/skills-content/assets-skill.js.map +1 -0
  651. package/dist/cli/skills-content/canvas.d.ts +4 -0
  652. package/dist/cli/skills-content/canvas.d.ts.map +1 -0
  653. package/dist/cli/skills-content/canvas.js +152 -0
  654. package/dist/cli/skills-content/canvas.js.map +1 -0
  655. package/dist/cli/skills-content/connection.d.ts +2 -0
  656. package/dist/cli/skills-content/connection.d.ts.map +1 -0
  657. package/dist/cli/skills-content/connection.js +53 -0
  658. package/dist/cli/skills-content/connection.js.map +1 -0
  659. package/dist/cli/skills-content/content-skill.d.ts +2 -0
  660. package/dist/cli/skills-content/content-skill.d.ts.map +1 -0
  661. package/dist/cli/skills-content/content-skill.js +110 -0
  662. package/dist/cli/skills-content/content-skill.js.map +1 -0
  663. package/dist/cli/skills-content/design-exploration-skill.d.ts +2 -0
  664. package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -0
  665. package/dist/cli/skills-content/design-exploration-skill.js +119 -0
  666. package/dist/cli/skills-content/design-exploration-skill.js.map +1 -0
  667. package/dist/cli/skills-content/design-visual-edit-skill.d.ts +2 -0
  668. package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -0
  669. package/dist/cli/skills-content/design-visual-edit-skill.js +229 -0
  670. package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -0
  671. package/dist/cli/skills-content/document-quality.d.ts +4 -0
  672. package/dist/cli/skills-content/document-quality.d.ts.map +1 -0
  673. package/dist/cli/skills-content/document-quality.js +195 -0
  674. package/dist/cli/skills-content/document-quality.js.map +1 -0
  675. package/dist/cli/skills-content/exemplar.d.ts +4 -0
  676. package/dist/cli/skills-content/exemplar.d.ts.map +1 -0
  677. package/dist/cli/skills-content/exemplar.js +68 -0
  678. package/dist/cli/skills-content/exemplar.js.map +1 -0
  679. package/dist/cli/skills-content/help.d.ts +2 -0
  680. package/dist/cli/skills-content/help.d.ts.map +1 -0
  681. package/dist/cli/skills-content/help.js +78 -0
  682. package/dist/cli/skills-content/help.js.map +1 -0
  683. package/dist/cli/skills-content/index.d.ts +23 -0
  684. package/dist/cli/skills-content/index.d.ts.map +1 -0
  685. package/dist/cli/skills-content/index.js +23 -0
  686. package/dist/cli/skills-content/index.js.map +1 -0
  687. package/dist/cli/skills-content/local-files.d.ts +2 -0
  688. package/dist/cli/skills-content/local-files.d.ts.map +1 -0
  689. package/dist/cli/skills-content/local-files.js +96 -0
  690. package/dist/cli/skills-content/local-files.js.map +1 -0
  691. package/dist/cli/skills-content/plan-setup-auth.d.ts +9 -0
  692. package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -0
  693. package/dist/cli/skills-content/plan-setup-auth.js +81 -0
  694. package/dist/cli/skills-content/plan-setup-auth.js.map +1 -0
  695. package/dist/cli/skills-content/visual-plan-skill.d.ts +2 -0
  696. package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -0
  697. package/dist/cli/skills-content/visual-plan-skill.js +471 -0
  698. package/dist/cli/skills-content/visual-plan-skill.js.map +1 -0
  699. package/dist/cli/skills-content/visual-recap-skill.d.ts +2 -0
  700. package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -0
  701. package/dist/cli/skills-content/visual-recap-skill.js +548 -0
  702. package/dist/cli/skills-content/visual-recap-skill.js.map +1 -0
  703. package/dist/cli/skills-content/visualize-repo-skill.d.ts +2 -0
  704. package/dist/cli/skills-content/visualize-repo-skill.d.ts.map +1 -0
  705. package/dist/cli/skills-content/visualize-repo-skill.js +94 -0
  706. package/dist/cli/skills-content/visualize-repo-skill.js.map +1 -0
  707. package/dist/cli/skills-content/wireframe.d.ts +4 -0
  708. package/dist/cli/skills-content/wireframe.d.ts.map +1 -0
  709. package/dist/cli/skills-content/wireframe.js +347 -0
  710. package/dist/cli/skills-content/wireframe.js.map +1 -0
  711. package/dist/cli/skills.d.ts +2 -10
  712. package/dist/cli/skills.d.ts.map +1 -1
  713. package/dist/cli/skills.js +2 -2710
  714. package/dist/cli/skills.js.map +1 -1
  715. package/dist/client/AgentPanel.d.ts.map +1 -1
  716. package/dist/client/AgentPanel.js +4 -2
  717. package/dist/client/AgentPanel.js.map +1 -1
  718. package/dist/client/CommandMenu.d.ts.map +1 -1
  719. package/dist/client/CommandMenu.js +15 -3
  720. package/dist/client/CommandMenu.js.map +1 -1
  721. package/dist/client/FeedbackButton.js +2 -2
  722. package/dist/client/FeedbackButton.js.map +1 -1
  723. package/dist/client/agent-chat-adapter.js +7 -3
  724. package/dist/client/agent-chat-adapter.js.map +1 -1
  725. package/dist/client/app-providers.d.ts +13 -5
  726. package/dist/client/app-providers.d.ts.map +1 -1
  727. package/dist/client/app-providers.js +9 -6
  728. package/dist/client/app-providers.js.map +1 -1
  729. package/dist/client/chat/tool-call-display.d.ts +4 -0
  730. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  731. package/dist/client/chat/tool-call-display.js +3 -3
  732. package/dist/client/chat/tool-call-display.js.map +1 -1
  733. package/dist/client/composer/PastedTextChip.js +1 -1
  734. package/dist/client/composer/PastedTextChip.js.map +1 -1
  735. package/dist/client/composer/RealtimeVoiceMode.d.ts +3 -1
  736. package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
  737. package/dist/client/composer/RealtimeVoiceMode.js +35 -14
  738. package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
  739. package/dist/client/composer/TiptapComposer.js +1 -1
  740. package/dist/client/composer/TiptapComposer.js.map +1 -1
  741. package/dist/client/composer/VoiceButton.d.ts +2 -0
  742. package/dist/client/composer/VoiceButton.d.ts.map +1 -1
  743. package/dist/client/composer/VoiceButton.js +9 -3
  744. package/dist/client/composer/VoiceButton.js.map +1 -1
  745. package/dist/client/composer/useRealtimeVoiceMode.d.ts +5 -0
  746. package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
  747. package/dist/client/composer/useRealtimeVoiceMode.js +91 -12
  748. package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
  749. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
  750. package/dist/client/context-xray/ContextXRayPanel.js +4 -1
  751. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  752. package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
  753. package/dist/client/extensions/ExtensionEditor.js +15 -5
  754. package/dist/client/extensions/ExtensionEditor.js.map +1 -1
  755. package/dist/client/extensions/ExtensionQueryErrorState.d.ts +8 -0
  756. package/dist/client/extensions/ExtensionQueryErrorState.d.ts.map +1 -0
  757. package/dist/client/extensions/ExtensionQueryErrorState.js +11 -0
  758. package/dist/client/extensions/ExtensionQueryErrorState.js.map +1 -0
  759. package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
  760. package/dist/client/extensions/ExtensionSlot.js +17 -7
  761. package/dist/client/extensions/ExtensionSlot.js.map +1 -1
  762. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  763. package/dist/client/extensions/ExtensionViewer.js +17 -7
  764. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  765. package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
  766. package/dist/client/extensions/ExtensionsListPage.js +5 -3
  767. package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
  768. package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
  769. package/dist/client/extensions/ExtensionsSidebarSection.js +21 -8
  770. package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
  771. package/dist/client/index.d.ts +0 -2
  772. package/dist/client/index.d.ts.map +1 -1
  773. package/dist/client/index.js +0 -5
  774. package/dist/client/index.js.map +1 -1
  775. package/dist/client/progress/RunsTray.d.ts.map +1 -1
  776. package/dist/client/progress/RunsTray.js +7 -3
  777. package/dist/client/progress/RunsTray.js.map +1 -1
  778. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  779. package/dist/client/settings/SettingsTabsPage.js +4 -0
  780. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  781. package/dist/client/settings/useBuilderStatus.d.ts +2 -0
  782. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  783. package/dist/client/settings/useBuilderStatus.js +4 -0
  784. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  785. package/dist/client/tool-cells/EditCell.d.ts.map +1 -1
  786. package/dist/client/tool-cells/EditCell.js +2 -1
  787. package/dist/client/tool-cells/EditCell.js.map +1 -1
  788. package/dist/client/tool-cells/FilesChangedSummary.d.ts.map +1 -1
  789. package/dist/client/tool-cells/FilesChangedSummary.js +2 -1
  790. package/dist/client/tool-cells/FilesChangedSummary.js.map +1 -1
  791. package/dist/client/tool-cells/WriteCell.d.ts.map +1 -1
  792. package/dist/client/tool-cells/WriteCell.js +2 -1
  793. package/dist/client/tool-cells/WriteCell.js.map +1 -1
  794. package/dist/client/visual-style-controls.js +1 -1
  795. package/dist/client/visual-style-controls.js.map +1 -1
  796. package/dist/collab/routes.d.ts +1 -1
  797. package/dist/collab/struct-routes.d.ts +1 -1
  798. package/dist/deploy/build.d.ts.map +1 -1
  799. package/dist/deploy/build.js +36 -14
  800. package/dist/deploy/build.js.map +1 -1
  801. package/dist/guards/db-tool-scoping.d.ts +38 -0
  802. package/dist/guards/db-tool-scoping.d.ts.map +1 -0
  803. package/dist/guards/db-tool-scoping.js +114 -0
  804. package/dist/guards/db-tool-scoping.js.map +1 -0
  805. package/dist/guards/index.d.ts +23 -0
  806. package/dist/guards/index.d.ts.map +1 -0
  807. package/dist/guards/index.js +19 -0
  808. package/dist/guards/index.js.map +1 -0
  809. package/dist/guards/no-drizzle-push.d.ts +14 -0
  810. package/dist/guards/no-drizzle-push.d.ts.map +1 -0
  811. package/dist/guards/no-drizzle-push.js +97 -0
  812. package/dist/guards/no-drizzle-push.js.map +1 -0
  813. package/dist/guards/no-env-credentials.d.ts +36 -0
  814. package/dist/guards/no-env-credentials.d.ts.map +1 -0
  815. package/dist/guards/no-env-credentials.js +204 -0
  816. package/dist/guards/no-env-credentials.js.map +1 -0
  817. package/dist/guards/no-env-mutation.d.ts +23 -0
  818. package/dist/guards/no-env-mutation.d.ts.map +1 -0
  819. package/dist/guards/no-env-mutation.js +90 -0
  820. package/dist/guards/no-env-mutation.js.map +1 -0
  821. package/dist/guards/no-localhost-fallback.d.ts +30 -0
  822. package/dist/guards/no-localhost-fallback.d.ts.map +1 -0
  823. package/dist/guards/no-localhost-fallback.js +105 -0
  824. package/dist/guards/no-localhost-fallback.js.map +1 -0
  825. package/dist/guards/no-unscoped-credentials.d.ts +28 -0
  826. package/dist/guards/no-unscoped-credentials.d.ts.map +1 -0
  827. package/dist/guards/no-unscoped-credentials.js +199 -0
  828. package/dist/guards/no-unscoped-credentials.js.map +1 -0
  829. package/dist/guards/no-unscoped-queries.d.ts +32 -0
  830. package/dist/guards/no-unscoped-queries.d.ts.map +1 -0
  831. package/dist/guards/no-unscoped-queries.js +720 -0
  832. package/dist/guards/no-unscoped-queries.js.map +1 -0
  833. package/dist/guards/scan-utils.d.ts +28 -0
  834. package/dist/guards/scan-utils.d.ts.map +1 -0
  835. package/dist/guards/scan-utils.js +92 -0
  836. package/dist/guards/scan-utils.js.map +1 -0
  837. package/dist/guards/types.d.ts +28 -0
  838. package/dist/guards/types.d.ts.map +1 -0
  839. package/dist/guards/types.js +11 -0
  840. package/dist/guards/types.js.map +1 -0
  841. package/dist/integrations/google-docs-poller.d.ts +7 -0
  842. package/dist/integrations/google-docs-poller.d.ts.map +1 -1
  843. package/dist/integrations/google-docs-poller.js +13 -3
  844. package/dist/integrations/google-docs-poller.js.map +1 -1
  845. package/dist/integrations/plugin.d.ts.map +1 -1
  846. package/dist/integrations/plugin.js +10 -0
  847. package/dist/integrations/plugin.js.map +1 -1
  848. package/dist/integrations/webhook-handler.d.ts +11 -0
  849. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  850. package/dist/integrations/webhook-handler.js +16 -4
  851. package/dist/integrations/webhook-handler.js.map +1 -1
  852. package/dist/jobs/scheduler.d.ts +12 -0
  853. package/dist/jobs/scheduler.d.ts.map +1 -1
  854. package/dist/jobs/scheduler.js +13 -3
  855. package/dist/jobs/scheduler.js.map +1 -1
  856. package/dist/localization/default-messages.d.ts +7 -0
  857. package/dist/localization/default-messages.d.ts.map +1 -1
  858. package/dist/localization/default-messages.js +8 -1
  859. package/dist/localization/default-messages.js.map +1 -1
  860. package/dist/mcp/oauth-token.d.ts +1 -1
  861. package/dist/mcp/oauth-token.d.ts.map +1 -1
  862. package/dist/mcp/oauth-token.js +6 -1
  863. package/dist/mcp/oauth-token.js.map +1 -1
  864. package/dist/notifications/routes.d.ts +2 -2
  865. package/dist/observability/routes.d.ts.map +1 -1
  866. package/dist/observability/routes.js +32 -0
  867. package/dist/observability/routes.js.map +1 -1
  868. package/dist/observability/sentiment.d.ts +42 -0
  869. package/dist/observability/sentiment.d.ts.map +1 -0
  870. package/dist/observability/sentiment.js +196 -0
  871. package/dist/observability/sentiment.js.map +1 -0
  872. package/dist/observability/store.d.ts +5 -0
  873. package/dist/observability/store.d.ts.map +1 -1
  874. package/dist/observability/store.js +17 -0
  875. package/dist/observability/store.js.map +1 -1
  876. package/dist/observability/traces.d.ts +2 -0
  877. package/dist/observability/traces.d.ts.map +1 -1
  878. package/dist/observability/traces.js +42 -57
  879. package/dist/observability/traces.js.map +1 -1
  880. package/dist/observability/tracking-identity.d.ts +3 -0
  881. package/dist/observability/tracking-identity.d.ts.map +1 -0
  882. package/dist/observability/tracking-identity.js +51 -0
  883. package/dist/observability/tracking-identity.js.map +1 -0
  884. package/dist/observability/types.d.ts +10 -0
  885. package/dist/observability/types.d.ts.map +1 -1
  886. package/dist/observability/types.js +3 -0
  887. package/dist/observability/types.js.map +1 -1
  888. package/dist/org/accept-pending.d.ts.map +1 -1
  889. package/dist/org/accept-pending.js +9 -1
  890. package/dist/org/accept-pending.js.map +1 -1
  891. package/dist/org/migrations.d.ts +7 -2
  892. package/dist/org/migrations.d.ts.map +1 -1
  893. package/dist/org/migrations.js +41 -0
  894. package/dist/org/migrations.js.map +1 -1
  895. package/dist/package-lifecycle/index.d.ts +2 -0
  896. package/dist/package-lifecycle/index.d.ts.map +1 -0
  897. package/dist/package-lifecycle/index.js +2 -0
  898. package/dist/package-lifecycle/index.js.map +1 -0
  899. package/dist/package-lifecycle/manifest.d.ts +24 -0
  900. package/dist/package-lifecycle/manifest.d.ts.map +1 -0
  901. package/dist/package-lifecycle/manifest.js +81 -0
  902. package/dist/package-lifecycle/manifest.js.map +1 -0
  903. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  904. package/dist/provider-api/custom-registry.d.ts +32 -1
  905. package/dist/provider-api/custom-registry.d.ts.map +1 -1
  906. package/dist/provider-api/custom-registry.js +41 -1
  907. package/dist/provider-api/custom-registry.js.map +1 -1
  908. package/dist/provider-api/index.d.ts +1 -1
  909. package/dist/provider-api/index.d.ts.map +1 -1
  910. package/dist/provider-api/index.js +1 -1
  911. package/dist/provider-api/index.js.map +1 -1
  912. package/dist/resources/handlers.d.ts +1 -1
  913. package/dist/secrets/storage.d.ts +6 -0
  914. package/dist/secrets/storage.d.ts.map +1 -1
  915. package/dist/secrets/storage.js +105 -29
  916. package/dist/secrets/storage.js.map +1 -1
  917. package/dist/server/action-discovery.d.ts.map +1 -1
  918. package/dist/server/action-discovery.js +4 -0
  919. package/dist/server/action-discovery.js.map +1 -1
  920. package/dist/server/agent-chat/action-filters-a2a.d.ts +50 -0
  921. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -0
  922. package/dist/server/agent-chat/action-filters-a2a.js +127 -0
  923. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -0
  924. package/dist/server/agent-chat/browser-team-tools.d.ts +21 -0
  925. package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -0
  926. package/dist/server/agent-chat/browser-team-tools.js +417 -0
  927. package/dist/server/agent-chat/browser-team-tools.js.map +1 -0
  928. package/dist/server/agent-chat/context-tools.d.ts +33 -0
  929. package/dist/server/agent-chat/context-tools.d.ts.map +1 -0
  930. package/dist/server/agent-chat/context-tools.js +520 -0
  931. package/dist/server/agent-chat/context-tools.js.map +1 -0
  932. package/dist/server/agent-chat/framework-prompts.d.ts +65 -0
  933. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -0
  934. package/dist/server/agent-chat/framework-prompts.js +403 -0
  935. package/dist/server/agent-chat/framework-prompts.js.map +1 -0
  936. package/dist/server/agent-chat/lazy-fs.d.ts +2 -0
  937. package/dist/server/agent-chat/lazy-fs.d.ts.map +1 -0
  938. package/dist/server/agent-chat/lazy-fs.js +11 -0
  939. package/dist/server/agent-chat/lazy-fs.js.map +1 -0
  940. package/dist/server/agent-chat/mcp-glue.d.ts +9 -0
  941. package/dist/server/agent-chat/mcp-glue.d.ts.map +1 -0
  942. package/dist/server/agent-chat/mcp-glue.js +63 -0
  943. package/dist/server/agent-chat/mcp-glue.js.map +1 -0
  944. package/dist/server/agent-chat/plugin-options.d.ts +322 -0
  945. package/dist/server/agent-chat/plugin-options.d.ts.map +1 -0
  946. package/dist/server/agent-chat/plugin-options.js +2 -0
  947. package/dist/server/agent-chat/plugin-options.js.map +1 -0
  948. package/dist/server/agent-chat/process-run-failure.d.ts +12 -0
  949. package/dist/server/agent-chat/process-run-failure.d.ts.map +1 -0
  950. package/dist/server/agent-chat/process-run-failure.js +24 -0
  951. package/dist/server/agent-chat/process-run-failure.js.map +1 -0
  952. package/dist/server/agent-chat/prompt-resources.d.ts +28 -0
  953. package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -0
  954. package/dist/server/agent-chat/prompt-resources.js +514 -0
  955. package/dist/server/agent-chat/prompt-resources.js.map +1 -0
  956. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +5 -0
  957. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts.map +1 -0
  958. package/dist/server/agent-chat/recurring-jobs-runtime.js +53 -0
  959. package/dist/server/agent-chat/recurring-jobs-runtime.js.map +1 -0
  960. package/dist/server/agent-chat/request-surface.d.ts +8 -0
  961. package/dist/server/agent-chat/request-surface.d.ts.map +1 -0
  962. package/dist/server/agent-chat/request-surface.js +56 -0
  963. package/dist/server/agent-chat/request-surface.js.map +1 -0
  964. package/dist/server/agent-chat/run-code-tools.d.ts +17 -0
  965. package/dist/server/agent-chat/run-code-tools.d.ts.map +1 -0
  966. package/dist/server/agent-chat/run-code-tools.js +55 -0
  967. package/dist/server/agent-chat/run-code-tools.js.map +1 -0
  968. package/dist/server/agent-chat/script-entries.d.ts +47 -0
  969. package/dist/server/agent-chat/script-entries.d.ts.map +1 -0
  970. package/dist/server/agent-chat/script-entries.js +633 -0
  971. package/dist/server/agent-chat/script-entries.js.map +1 -0
  972. package/dist/server/agent-chat/shared-thread.d.ts +33 -0
  973. package/dist/server/agent-chat/shared-thread.d.ts.map +1 -0
  974. package/dist/server/agent-chat/shared-thread.js +242 -0
  975. package/dist/server/agent-chat/shared-thread.js.map +1 -0
  976. package/dist/server/agent-chat/skill-frontmatter.d.ts +7 -0
  977. package/dist/server/agent-chat/skill-frontmatter.d.ts.map +1 -0
  978. package/dist/server/agent-chat/skill-frontmatter.js +26 -0
  979. package/dist/server/agent-chat/skill-frontmatter.js.map +1 -0
  980. package/dist/server/agent-chat-plugin.d.ts +45 -486
  981. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  982. package/dist/server/agent-chat-plugin.js +217 -3015
  983. package/dist/server/agent-chat-plugin.js.map +1 -1
  984. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  985. package/dist/server/agent-teams.d.ts +10 -0
  986. package/dist/server/agent-teams.d.ts.map +1 -1
  987. package/dist/server/agent-teams.js +13 -3
  988. package/dist/server/agent-teams.js.map +1 -1
  989. package/dist/server/auth.d.ts.map +1 -1
  990. package/dist/server/auth.js +50 -52
  991. package/dist/server/auth.js.map +1 -1
  992. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  993. package/dist/server/core-routes-plugin.js +23 -12
  994. package/dist/server/core-routes-plugin.js.map +1 -1
  995. package/dist/server/credential-provider.d.ts.map +1 -1
  996. package/dist/server/credential-provider.js +22 -21
  997. package/dist/server/credential-provider.js.map +1 -1
  998. package/dist/server/csrf.d.ts.map +1 -1
  999. package/dist/server/csrf.js +18 -5
  1000. package/dist/server/csrf.js.map +1 -1
  1001. package/dist/server/edge.d.ts +1 -0
  1002. package/dist/server/edge.d.ts.map +1 -1
  1003. package/dist/server/edge.js +1 -0
  1004. package/dist/server/edge.js.map +1 -1
  1005. package/dist/server/framework-request-handler.d.ts.map +1 -1
  1006. package/dist/server/framework-request-handler.js +34 -0
  1007. package/dist/server/framework-request-handler.js.map +1 -1
  1008. package/dist/server/google-realtime-session.d.ts.map +1 -1
  1009. package/dist/server/google-realtime-session.js +2 -34
  1010. package/dist/server/google-realtime-session.js.map +1 -1
  1011. package/dist/server/onboarding-html.d.ts.map +1 -1
  1012. package/dist/server/onboarding-html.js +1 -16
  1013. package/dist/server/onboarding-html.js.map +1 -1
  1014. package/dist/server/poll.d.ts.map +1 -1
  1015. package/dist/server/poll.js +24 -2
  1016. package/dist/server/poll.js.map +1 -1
  1017. package/dist/server/realtime-voice.d.ts +3 -0
  1018. package/dist/server/realtime-voice.d.ts.map +1 -1
  1019. package/dist/server/realtime-voice.js +38 -5
  1020. package/dist/server/realtime-voice.js.map +1 -1
  1021. package/dist/server/request-origin.d.ts +10 -0
  1022. package/dist/server/request-origin.d.ts.map +1 -0
  1023. package/dist/server/request-origin.js +63 -0
  1024. package/dist/server/request-origin.js.map +1 -0
  1025. package/dist/server/ssr-handler.d.ts.map +1 -1
  1026. package/dist/server/ssr-handler.js +47 -2
  1027. package/dist/server/ssr-handler.js.map +1 -1
  1028. package/dist/server/transcribe-voice.d.ts.map +1 -1
  1029. package/dist/server/transcribe-voice.js +2 -48
  1030. package/dist/server/transcribe-voice.js.map +1 -1
  1031. package/dist/sharing/access.d.ts +63 -3
  1032. package/dist/sharing/access.d.ts.map +1 -1
  1033. package/dist/sharing/access.js +53 -15
  1034. package/dist/sharing/access.js.map +1 -1
  1035. package/dist/sharing/registry.d.ts +7 -0
  1036. package/dist/sharing/registry.d.ts.map +1 -1
  1037. package/dist/sharing/registry.js.map +1 -1
  1038. package/dist/styles/agent-native.css +15 -14
  1039. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
  1040. package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
  1041. package/dist/templates/default/app/i18n/de-DE.ts +6 -0
  1042. package/dist/templates/default/app/i18n/en-US.ts +6 -0
  1043. package/dist/templates/default/app/i18n/es-ES.ts +6 -0
  1044. package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
  1045. package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
  1046. package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
  1047. package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
  1048. package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
  1049. package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
  1050. package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
  1051. package/dist/templates/default/package.json +2 -2
  1052. package/dist/templates/headless/package.json +0 -1
  1053. package/dist/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
  1054. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
  1055. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
  1056. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
  1057. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
  1058. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
  1059. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
  1060. package/dist/templates/workspace-core/package.json +0 -1
  1061. package/dist/templates/workspace-core/src/server/index.ts +4 -2
  1062. package/dist/templates/workspace-root/package.json +0 -1
  1063. package/dist/testing.d.ts +16 -0
  1064. package/dist/testing.d.ts.map +1 -0
  1065. package/dist/testing.js +16 -0
  1066. package/dist/testing.js.map +1 -0
  1067. package/dist/triggers/actions.d.ts.map +1 -1
  1068. package/dist/triggers/actions.js +8 -3
  1069. package/dist/triggers/actions.js.map +1 -1
  1070. package/dist/triggers/dispatcher.d.ts +7 -0
  1071. package/dist/triggers/dispatcher.d.ts.map +1 -1
  1072. package/dist/triggers/dispatcher.js +13 -3
  1073. package/dist/triggers/dispatcher.js.map +1 -1
  1074. package/dist/triggers/types.d.ts +7 -1
  1075. package/dist/triggers/types.d.ts.map +1 -1
  1076. package/dist/triggers/types.js.map +1 -1
  1077. package/dist/vite/client.d.ts +16 -1
  1078. package/dist/vite/client.d.ts.map +1 -1
  1079. package/dist/vite/client.js +105 -2
  1080. package/dist/vite/client.js.map +1 -1
  1081. package/docs/content/audit-log.mdx +2 -1
  1082. package/docs/content/authentication.mdx +3 -3
  1083. package/docs/content/automations.mdx +7 -7
  1084. package/docs/content/creating-templates.mdx +1 -1
  1085. package/docs/content/doctor.mdx +170 -0
  1086. package/docs/content/external-agents.mdx +8 -7
  1087. package/docs/content/internationalization.mdx +2 -1
  1088. package/docs/content/locales/ar-SA/audit-log.mdx +2 -1
  1089. package/docs/content/locales/ar-SA/authentication.mdx +2 -2
  1090. package/docs/content/locales/ar-SA/automations.mdx +7 -7
  1091. package/docs/content/locales/ar-SA/external-agents.mdx +8 -7
  1092. package/docs/content/locales/ar-SA/getting-started.mdx +7 -1
  1093. package/docs/content/locales/ar-SA/internationalization.mdx +1 -1
  1094. package/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
  1095. package/docs/content/locales/ar-SA/package-lifecycle.mdx +19 -0
  1096. package/docs/content/locales/ar-SA/sandbox-adapters.mdx +18 -7
  1097. package/docs/content/locales/ar-SA/security.mdx +10 -0
  1098. package/docs/content/locales/de-DE/audit-log.mdx +2 -1
  1099. package/docs/content/locales/de-DE/authentication.mdx +1 -1
  1100. package/docs/content/locales/de-DE/automations.mdx +7 -7
  1101. package/docs/content/locales/de-DE/external-agents.mdx +8 -7
  1102. package/docs/content/locales/de-DE/getting-started.mdx +7 -1
  1103. package/docs/content/locales/de-DE/internationalization.mdx +1 -1
  1104. package/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
  1105. package/docs/content/locales/de-DE/package-lifecycle.mdx +22 -0
  1106. package/docs/content/locales/de-DE/sandbox-adapters.mdx +18 -7
  1107. package/docs/content/locales/de-DE/security.mdx +10 -0
  1108. package/docs/content/locales/es-ES/audit-log.mdx +2 -1
  1109. package/docs/content/locales/es-ES/authentication.mdx +2 -2
  1110. package/docs/content/locales/es-ES/automations.mdx +7 -7
  1111. package/docs/content/locales/es-ES/external-agents.mdx +8 -7
  1112. package/docs/content/locales/es-ES/getting-started.mdx +7 -1
  1113. package/docs/content/locales/es-ES/internationalization.mdx +1 -1
  1114. package/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
  1115. package/docs/content/locales/es-ES/package-lifecycle.mdx +22 -0
  1116. package/docs/content/locales/es-ES/sandbox-adapters.mdx +18 -7
  1117. package/docs/content/locales/es-ES/security.mdx +10 -0
  1118. package/docs/content/locales/fr-FR/audit-log.mdx +2 -1
  1119. package/docs/content/locales/fr-FR/authentication.mdx +1 -1
  1120. package/docs/content/locales/fr-FR/automations.mdx +7 -7
  1121. package/docs/content/locales/fr-FR/external-agents.mdx +8 -7
  1122. package/docs/content/locales/fr-FR/getting-started.mdx +7 -1
  1123. package/docs/content/locales/fr-FR/internationalization.mdx +1 -1
  1124. package/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
  1125. package/docs/content/locales/fr-FR/package-lifecycle.mdx +21 -0
  1126. package/docs/content/locales/fr-FR/sandbox-adapters.mdx +19 -8
  1127. package/docs/content/locales/fr-FR/security.mdx +10 -0
  1128. package/docs/content/locales/hi-IN/audit-log.mdx +2 -1
  1129. package/docs/content/locales/hi-IN/authentication.mdx +2 -2
  1130. package/docs/content/locales/hi-IN/automations.mdx +7 -7
  1131. package/docs/content/locales/hi-IN/external-agents.mdx +8 -7
  1132. package/docs/content/locales/hi-IN/getting-started.mdx +7 -1
  1133. package/docs/content/locales/hi-IN/internationalization.mdx +1 -1
  1134. package/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
  1135. package/docs/content/locales/hi-IN/package-lifecycle.mdx +20 -0
  1136. package/docs/content/locales/hi-IN/sandbox-adapters.mdx +18 -7
  1137. package/docs/content/locales/hi-IN/security.mdx +10 -0
  1138. package/docs/content/locales/ja-JP/audit-log.mdx +2 -1
  1139. package/docs/content/locales/ja-JP/authentication.mdx +2 -2
  1140. package/docs/content/locales/ja-JP/automations.mdx +7 -7
  1141. package/docs/content/locales/ja-JP/external-agents.mdx +8 -7
  1142. package/docs/content/locales/ja-JP/getting-started.mdx +7 -1
  1143. package/docs/content/locales/ja-JP/internationalization.mdx +1 -1
  1144. package/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
  1145. package/docs/content/locales/ja-JP/package-lifecycle.mdx +21 -0
  1146. package/docs/content/locales/ja-JP/sandbox-adapters.mdx +17 -6
  1147. package/docs/content/locales/ja-JP/security.mdx +10 -0
  1148. package/docs/content/locales/ko-KR/audit-log.mdx +2 -1
  1149. package/docs/content/locales/ko-KR/authentication.mdx +2 -2
  1150. package/docs/content/locales/ko-KR/automations.mdx +7 -7
  1151. package/docs/content/locales/ko-KR/external-agents.mdx +8 -7
  1152. package/docs/content/locales/ko-KR/getting-started.mdx +7 -1
  1153. package/docs/content/locales/ko-KR/internationalization.mdx +1 -1
  1154. package/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
  1155. package/docs/content/locales/ko-KR/package-lifecycle.mdx +20 -0
  1156. package/docs/content/locales/ko-KR/sandbox-adapters.mdx +17 -6
  1157. package/docs/content/locales/ko-KR/security.mdx +10 -0
  1158. package/docs/content/locales/pt-BR/audit-log.mdx +2 -1
  1159. package/docs/content/locales/pt-BR/authentication.mdx +2 -2
  1160. package/docs/content/locales/pt-BR/automations.mdx +7 -7
  1161. package/docs/content/locales/pt-BR/external-agents.mdx +8 -7
  1162. package/docs/content/locales/pt-BR/getting-started.mdx +7 -1
  1163. package/docs/content/locales/pt-BR/internationalization.mdx +1 -1
  1164. package/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
  1165. package/docs/content/locales/pt-BR/package-lifecycle.mdx +21 -0
  1166. package/docs/content/locales/pt-BR/sandbox-adapters.mdx +18 -7
  1167. package/docs/content/locales/pt-BR/security.mdx +10 -0
  1168. package/docs/content/locales/zh-CN/audit-log.mdx +2 -1
  1169. package/docs/content/locales/zh-CN/authentication.mdx +2 -2
  1170. package/docs/content/locales/zh-CN/automations.mdx +7 -7
  1171. package/docs/content/locales/zh-CN/external-agents.mdx +8 -7
  1172. package/docs/content/locales/zh-CN/getting-started.mdx +6 -4
  1173. package/docs/content/locales/zh-CN/internationalization.mdx +1 -1
  1174. package/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
  1175. package/docs/content/locales/zh-CN/package-lifecycle.mdx +19 -0
  1176. package/docs/content/locales/zh-CN/sandbox-adapters.mdx +17 -6
  1177. package/docs/content/locales/zh-CN/security.mdx +10 -0
  1178. package/docs/content/locales/zh-TW/audit-log.mdx +2 -1
  1179. package/docs/content/locales/zh-TW/authentication.mdx +2 -2
  1180. package/docs/content/locales/zh-TW/automations.mdx +7 -7
  1181. package/docs/content/locales/zh-TW/external-agents.mdx +8 -7
  1182. package/docs/content/locales/zh-TW/getting-started.mdx +6 -4
  1183. package/docs/content/locales/zh-TW/internationalization.mdx +1 -1
  1184. package/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
  1185. package/docs/content/locales/zh-TW/package-lifecycle.mdx +19 -0
  1186. package/docs/content/locales/zh-TW/sandbox-adapters.mdx +18 -7
  1187. package/docs/content/locales/zh-TW/security.mdx +10 -0
  1188. package/docs/content/mcp-protocol.mdx +1 -1
  1189. package/docs/content/package-lifecycle.mdx +51 -0
  1190. package/docs/content/sandbox-adapters.mdx +16 -5
  1191. package/docs/content/security.mdx +2 -0
  1192. package/package.json +14 -3
  1193. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
  1194. package/src/templates/default/app/i18n/ar-SA.ts +6 -0
  1195. package/src/templates/default/app/i18n/de-DE.ts +6 -0
  1196. package/src/templates/default/app/i18n/en-US.ts +6 -0
  1197. package/src/templates/default/app/i18n/es-ES.ts +6 -0
  1198. package/src/templates/default/app/i18n/fr-FR.ts +6 -0
  1199. package/src/templates/default/app/i18n/hi-IN.ts +6 -0
  1200. package/src/templates/default/app/i18n/ja-JP.ts +6 -0
  1201. package/src/templates/default/app/i18n/ko-KR.ts +6 -0
  1202. package/src/templates/default/app/i18n/pt-BR.ts +6 -0
  1203. package/src/templates/default/app/i18n/zh-CN.ts +6 -0
  1204. package/src/templates/default/app/i18n/zh-TW.ts +6 -0
  1205. package/src/templates/default/package.json +2 -2
  1206. package/src/templates/headless/package.json +0 -1
  1207. package/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
  1208. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
  1209. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
  1210. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
  1211. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
  1212. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
  1213. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
  1214. package/src/templates/workspace-core/package.json +0 -1
  1215. package/src/templates/workspace-core/src/server/index.ts +4 -2
  1216. package/src/templates/workspace-root/package.json +0 -1
  1217. package/corpus/core/src/client/ProductionAgentPanel.tsx +0 -9
  1218. package/corpus/core/src/client/auth-redirect-url.ts +0 -23
  1219. package/corpus/core/src/client/useProductionAgent.ts +0 -253
  1220. package/corpus/core/src/shared/auth-redirect-url.ts +0 -1
  1221. package/corpus/templates/analytics/app/pages/Index.tsx +0 -16
  1222. package/corpus/templates/analytics/seeds/dashboards/agent-observability-llm.json +0 -173
  1223. package/corpus/templates/slides/app/components/ui/toast.tsx +0 -1
  1224. package/corpus/templates/slides/app/components/ui/toaster.tsx +0 -1
  1225. package/corpus/templates/slides/app/hooks/use-toast.ts +0 -1
  1226. package/dist/client/ProductionAgentPanel.d.ts +0 -6
  1227. package/dist/client/ProductionAgentPanel.d.ts.map +0 -1
  1228. package/dist/client/ProductionAgentPanel.js +0 -6
  1229. package/dist/client/ProductionAgentPanel.js.map +0 -1
  1230. package/dist/client/auth-redirect-url.d.ts +0 -2
  1231. package/dist/client/auth-redirect-url.d.ts.map +0 -1
  1232. package/dist/client/auth-redirect-url.js +0 -19
  1233. package/dist/client/auth-redirect-url.js.map +0 -1
  1234. package/dist/client/useProductionAgent.d.ts +0 -24
  1235. package/dist/client/useProductionAgent.d.ts.map +0 -1
  1236. package/dist/client/useProductionAgent.js +0 -179
  1237. package/dist/client/useProductionAgent.js.map +0 -1
  1238. package/dist/shared/auth-redirect-url.d.ts +0 -2
  1239. package/dist/shared/auth-redirect-url.d.ts.map +0 -1
  1240. package/dist/shared/auth-redirect-url.js +0 -2
  1241. package/dist/shared/auth-redirect-url.js.map +0 -1
@@ -15,2717 +15,9 @@ import { CONTEXT_XRAY_SKILL_MD, installLocalContextXray, } from "./context-xray-
15
15
  import { CLIENTS } from "./mcp-config-writers.js";
16
16
  import { PR_VISUAL_RECAP_SETUP, writePrVisualRecapWorkflow } from "./recap.js";
17
17
  import { setupAgentSymlinks } from "./setup-agents.js";
18
+ import { ASSETS_SKILL_MD, CANVAS_REFERENCE_MD, CONNECTION_REFERENCE_MD, CONTENT_SKILL_MD, DESIGN_EXPLORATION_SKILL_MD, DESIGN_VISUAL_EDIT_SKILL_MD, DOCUMENT_QUALITY_REFERENCE_MD, EXEMPLAR_REFERENCE_MD, HELP, LOCAL_FILES_REFERENCE_MD, VISUAL_PLANS_SKILL_MD, VISUAL_RECAP_SKILL_MD, VISUALIZE_REPO_SKILL_MD, WIREFRAME_REFERENCE_MD, } from "./skills-content/index.js";
18
19
  import { createCliTelemetry } from "./telemetry.js";
19
- const HELP = `npx @agent-native/core@latest skills
20
-
21
- Usage:
22
- npx @agent-native/core@latest skills list
23
- npx @agent-native/core@latest skills status [assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--json]
24
- npx @agent-native/core@latest skills update [assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--dry-run] [--json]
25
- npx @agent-native/core@latest skills add assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray [--client codex|claude-code|cowork|cursor|opencode|github-copilot|all] [--scope user|project] [--mode hosted|local-files|self-hosted] [--mcp-url <url>] [--no-connect] [--with-github-action] [--yes] [--dry-run] [--json]
26
- npx @agent-native/core@latest skills add <manifest-or-app-dir|skill-repo> [--skill <name>] [--client ...] [--yes]
27
-
28
- Examples:
29
- npx @agent-native/core@latest skills add assets
30
- npx @agent-native/core@latest skills add content --mode local-files
31
- npx @agent-native/core@latest skills add design-exploration
32
- npx @agent-native/core@latest skills add visual-edit
33
- npx @agent-native/core@latest skills add visual-plan
34
- npx @agent-native/core@latest skills add visual-recap
35
- npx @agent-native/core@latest skills add visualize-repo
36
- npx @agent-native/core@latest skills add visual-recap --with-github-action
37
- npx @agent-native/core@latest skills add visual-plan --mode local-files
38
- npx @agent-native/core@latest skills add visual-plan --mode self-hosted --mcp-url https://my-plan-app.example.com
39
- npx @agent-native/core@latest skills status visual-plan
40
- npx @agent-native/core@latest skills update visual-plan
41
- npx @agent-native/core@latest skills update scaffold --project
42
- npx @agent-native/core@latest skills add visual-plan --no-connect
43
- npx @agent-native/core@latest skills add context-xray --client all
44
- npx @agent-native/core@latest skills add assets --client claude-code
45
- npx @agent-native/core@latest skills add assets --mcp-url https://my-app.ngrok-free.dev
46
- npx @agent-native/core@latest skills add ./dist/assets-skill --client codex
47
- npx @agent-native/core@latest skills add BuilderIO/skills --client codex --scope project
48
- npx @agent-native/core@latest skills add BuilderIO/skills --with-github-action
49
-
50
- The add command installs the SKILL.md instructions, registers the app-backed
51
- MCP connector, and then authenticates it in one step so you do not hit an OAuth
52
- wall on the first tool call. Hosted installs can configure Claude Code, Codex,
53
- Claude Cowork, Cursor, OpenCode, and GitHub Copilot / VS Code; local-files
54
- instruction installs target the shared .agents skill path used by Codex, Pi,
55
- Cursor, OpenCode, Copilot, and similar agents, plus Claude Code's native skill
56
- path when selected. Pass --client to narrow it. Authentication reuses
57
- "npx @agent-native/core@latest connect": OAuth-capable clients (Claude Code,
58
- Cursor, OpenCode, GitHub Copilot / VS Code) get URL-only entries and authenticate
59
- inside that host, while Codex / Cowork run the browser device-code flow. In a
60
- non-interactive shell or CI the auth step is skipped and the exact
61
- "npx @agent-native/core@latest connect <url> --client all" command is printed instead.
62
-
63
- Running "npx @agent-native/skills@latest add ..." uses this same shared install
64
- flow with the broader BuilderIO skills catalog enabled. Pass --no-connect to
65
- register MCP where possible without authenticating (leave auth to the host or run
66
- "npx @agent-native/core@latest connect" later). Pass --mcp-url to register that connector against
67
- a custom origin (an ngrok tunnel, a local dev server, or a self-hosted
68
- deployment) instead of the built-in hosted default — a bare origin gets the
69
- standard /_agent-native/mcp path appended. Use app-skill pack for marketplace
70
- bundles and custom adapter output.
71
-
72
- When installing visual-plan, visual-recap, or visualize-repo interactively, the
73
- CLI asks where Plans artifacts should live: hosted Plans for shareable
74
- links/comments, local files for "No sharing, all local.", or a
75
- self-hosted/custom Plan app URL.
76
- Pass --mode to choose directly. Local-files mode skips MCP registration and
77
- auth and installs instructions that default to a no-auth block catalog fetch,
78
- MDX folders, and the localhost bridge viewer.
79
-
80
- When installing content with --mode local-files, the CLI installs Content
81
- instructions and writes or updates agent-native.json with repo-backed Markdown /
82
- MDX roots for docs, blog, content, and resources. Use a local Content app, Agent
83
- Native Desktop, or another trusted local bridge for Content actions to read and
84
- write those files.
85
-
86
- When installing visual-recap interactively, the CLI offers to add the optional PR
87
- Visual Recap GitHub Action. Pass --with-github-action to write it directly, then
88
- run "npx @agent-native/core@latest recap setup" / "npx @agent-native/core@latest recap doctor" to configure and
89
- verify GitHub Actions. Docs: https://www.agent-native.com/docs/pr-visual-recap.
90
-
91
- The status/update commands inspect copied Agent Native skill folders and refresh
92
- their instruction files from the current @agent-native/core package. In generated
93
- apps/workspaces, "skills update scaffold --project" refreshes the framework
94
- skills copied into the scaffold and repairs AGENTS.md / CLAUDE.md and
95
- .agents/skills / .claude/skills compatibility links.`;
96
- const ASSETS_SKILL_MD = `---
97
- name: assets
98
- description: >-
99
- Use Assets for image or video generation requests, brand-safe media,
100
- human picker UI, search/list/export actions, and cross-app asset selection.
101
- Prefer this over generic image tools when installed.
102
- metadata:
103
- visibility: exported
104
- ---
105
-
106
- # Assets
107
-
108
- Use the Assets app when a workflow needs reusable brand media, a human picker,
109
- or generated image/video assets that another app can reference by ID and URL.
110
- When this skill is available, route plain image-generation requests here instead
111
- of using a generic image generator.
112
-
113
- ## Choose The Path
114
-
115
- - Use \`open-asset-picker\` when a person should browse, search, generate, and
116
- select an asset in UI. Pass \`mediaType: "image"\` by default, or
117
- \`mediaType: "video"\` for video libraries. When the user asks to create a
118
- specific image and choose the best option, pass \`prompt\`,
119
- \`autoGenerate: true\`, and \`count: 3\` so the picker opens with candidates
120
- to preview and select.
121
- - Use unattended actions when the agent already knows what to do:
122
- \`search-assets\`, \`list-assets\`, \`generate-image\`,
123
- \`generate-image-batch\`, \`generate-video\`,
124
- \`refresh-generation-run\`, and \`export-asset\`.
125
- - Use browser/deep-link fallback when the host cannot render MCP Apps inline.
126
- Surface the returned picker link. If it opens in a normal browser tab, have
127
- the user select an asset there and paste back the copied handoff summary.
128
- Treat Codex, Claude Code, and Claude Desktop Code as link-out hosts; do not
129
- promise inline MCP App rendering there.
130
- If the skill instructions are available but the MCP tool namespace has not
131
- appeared yet, use the Assets browser fallback URL shape instead of switching
132
- to a generic generator:
133
- \`https://assets.agent-native.com/library?mediaType=image&prompt=...&autoGenerate=1&count=3\`.
134
- When reporting the final selected image in Codex or Claude Code, include the
135
- asset link and, if an inline preview is important, download the selected
136
- \`previewUrl\`/\`downloadUrl\` to a local temp image and embed that absolute
137
- local path. Remote CDN markdown images can fail to render in code-editor chat
138
- surfaces.
139
-
140
- ## Image And Video Workflows
141
-
142
- 1. Pick or match the library with \`list-libraries\` or \`match-library\`.
143
- 2. For images, call \`generate-image\` or \`generate-image-batch\`. Image
144
- actions are synchronous: one batch call should return the finished image
145
- candidates, so do not poll or regenerate unless a returned slot failed.
146
- 3. For videos, call \`generate-video\` and poll \`refresh-generation-run\`
147
- until the run completes.
148
- 4. Preserve returned \`assetId\`, \`runId\`, \`previewUrl\`, \`downloadUrl\`,
149
- media type, and dimensions so the caller can attach or embed the result.
150
-
151
- ## Cross-App Use
152
-
153
- - Hosted default: connect \`https://assets.agent-native.com/_agent-native/mcp\`.
154
- Do not put shared secrets in skill files.
155
- - For CLI/code-editor clients, keep any \`npx @agent-native/core@latest connect\` command
156
- running until browser authorization finishes. Stopping it early can leave the
157
- browser approved but the local MCP config unwritten. Restart or reload the
158
- agent client after installing or connecting if Assets tools do not appear in
159
- the live session.
160
- - Local customization: use \`npx @agent-native/core@latest app-skill launch --local\` from an
161
- Assets app-skill manifest, or pass \`--into <path>\` for editable source.
162
- - Do not call image/video providers directly from another app. Assets owns
163
- generation, picker UI, search/list/export, and asset context.
164
- - If an Assets tool call returns \`Session terminated\`, \`needs auth\`, or
165
- another connector/session error, do not keep retrying the tool. Stop and give
166
- the user the reconnect step: in Claude Code run \`/mcp\` and choose
167
- Authenticate/Reconnect for the Assets connector; from any terminal run
168
- \`npx -y @agent-native/core@latest reconnect https://assets.agent-native.com\` — this
169
- re-authenticates WITHOUT reinstalling. Never reinstall from scratch just to fix
170
- auth. Continue once the connector is available.
171
- - Do not hand-roll MCP HTTP requests with curl from the agent session. Use the
172
- host-exposed Assets tools after restart/reload, or use the returned
173
- browser/deep-link fallback.
174
- - If a batch image generation request times out in browser fallback, retry with
175
- \`count: 1\` only after telling the user the multi-candidate request timed out.
176
- - If you inspect local MCP config, redact \`Authorization\`, \`http_headers\`,
177
- and token values. Never paste bearer tokens into chat or logs.
178
- `;
179
- const CONTENT_SKILL_MD = `---
180
- name: content
181
- description: >-
182
- Use Content for repo-backed Markdown/MDX docs, blogs, resources, rich
183
- document editing, local components, shareable copies, and Content local-file
184
- workspaces. Prefer Content actions over raw filesystem writes when available.
185
- metadata:
186
- visibility: exported
187
- ---
188
-
189
- # Content
190
-
191
- Use the Content app when a workflow is about authoring, editing, reviewing, or
192
- publishing Markdown/MDX documents: docs sites, blogs, resource libraries,
193
- marketing pages, internal notes, and local MDX components. Content gives the
194
- agent a document tree, a rich editor, normal document actions, and optional
195
- local-file source of truth.
196
-
197
- ## Choose The Path
198
-
199
- - Use Content actions when the Content MCP/action tools are available:
200
- \`list-documents\`, \`search-documents\`, \`get-document\`,
201
- \`pull-document\`, \`create-document\`, \`edit-document\`,
202
- \`update-document\`, \`delete-document\`, \`share-local-file-document\`,
203
- \`list-local-component-files\`, and \`write-local-component-file\`.
204
- - Use \`pull-document\` or \`get-document\` before editing a page. Use
205
- \`edit-document\` for precise find/replace changes and \`update-document\`
206
- for full rewrites or new content.
207
- - In Local File Mode, Content actions read and write the repo files declared in
208
- \`agent-native.json\`; SQL remains cache/history/search glue, not the source of
209
- truth for those pages.
210
- - If Content tools are not visible and no local Content app or Desktop bridge is
211
- running, treat this skill as repo-editing guidance. Edit configured
212
- \`.md\`/\`.mdx\` files directly, preserve frontmatter and MDX imports, and tell
213
- the user the Content action surface was not available.
214
-
215
- ## Action Examples
216
-
217
- Prefer JSON input for action calls:
218
-
219
- \`\`\`bash
220
- pnpm action list-documents
221
- pnpm action get-document '{"id":"local-file:..."}'
222
- pnpm action edit-document '{"id":"local-file:...","find":"old copy","replace":"new copy"}'
223
- pnpm action update-document '{"id":"local-file:...","content":"# Updated\\n\\nBody"}'
224
- pnpm action share-local-file-document '{"id":"local-file:..."}'
225
- \`\`\`
226
-
227
- Run \`refresh-list\` after create/update/delete operations when you need the
228
- open Content UI sidebar to repaint immediately.
229
-
230
- ## Local File Mode
231
-
232
- Install into an existing repo with:
233
-
234
- \`\`\`bash
235
- npx @agent-native/core@latest skills add content --mode local-files --scope project
236
- \`\`\`
237
-
238
- The installer copies this skill and writes or updates \`agent-native.json\` with
239
- Content roots for \`docs/\`, \`blog/\`, \`content/\`, and \`resources/\`, plus a
240
- \`components/\` folder for local MDX components. A typical manifest looks like:
241
-
242
- \`\`\`json
243
- {
244
- "version": 1,
245
- "apps": {
246
- "content": {
247
- "mode": "local-files",
248
- "roots": [
249
- { "name": "Docs", "path": "docs", "kind": "docs", "extensions": [".md", ".mdx"] },
250
- { "name": "Blog", "path": "blog", "kind": "blog", "extensions": [".md", ".mdx"] },
251
- { "name": "Content", "path": "content", "kind": "content", "extensions": [".md", ".mdx"] },
252
- { "name": "Resources", "path": "resources", "kind": "resources", "extensions": [".md", ".mdx"] }
253
- ],
254
- "components": "components",
255
- "extensions": "extensions",
256
- "hide": ["**/_*.md", "**/_*.mdx"]
257
- }
258
- }
259
- }
260
- \`\`\`
261
-
262
- Local File Mode does not make the host language model local, and the hosted
263
- Content app cannot read private repo files by itself. File access requires a
264
- local Content app, Agent Native Desktop, or another trusted local bridge.
265
-
266
- ## MDX And Components
267
-
268
- - Preserve frontmatter keys you do not understand. Preserve MDX imports,
269
- exports, JSX, and expression props unless the user explicitly asks to change
270
- them.
271
- - Use local components from the configured \`components\` folder. Components
272
- should be PascalCase exports from \`.tsx\` files; simple editable input metadata
273
- can live next to them as \`ComponentNameInputs\`.
274
- - Use \`list-local-component-files\` and \`write-local-component-file\` for
275
- component source changes when Content tools are available. Otherwise edit the
276
- component files directly like normal repo source.
277
-
278
- ## Boundaries
279
-
280
- - Moving, renaming, and reordering local-file pages are not first-class Content
281
- UI operations yet. Use normal file operations when the user asks for those,
282
- then let Content rediscover the file tree.
283
- - Do not push/pull Notion, Builder.io, or other provider-backed content unless
284
- the user explicitly asks for provider sync.
285
- - Do not paste secrets, private provider data, or credential-looking values into
286
- docs, generated pages, frontmatter, examples, or local components.
287
- `;
288
- const DESIGN_EXPLORATION_SKILL_MD = `---
289
- name: design-exploration
290
- description: >-
291
- Use Design for UI/UX exploration, side-by-side design directions,
292
- interactive prototype previews, user selection, iteration, and design-to-code
293
- handoff through the hosted Design MCP app.
294
- metadata:
295
- visibility: exported
296
- ---
297
-
298
- # Design Exploration
299
-
300
- Use the Design app when a workflow needs visual UI exploration, prototype
301
- iteration, or a human-in-the-loop choice among design directions.
302
-
303
- ## Choose The Path
304
-
305
- - Use \`create-design\` first to create a project shell. Do not report the
306
- design as ready until it has renderable HTML.
307
- - For open-ended UX exploration, generate distinct, compact, complete HTML
308
- directions (2-5, three by default) and call \`present-design-variants\`. Each
309
- direction should be one representative screen or directional snapshot, not a
310
- full app per variant. Design saves every option as a normal screen on the
311
- overview board and renders an inline chat choice with one button per screen
312
- name. After the user picks, delete the unchosen variant screens and continue
313
- from the kept screen by first calling \`get-design-snapshot\` with that
314
- screen's \`fileId\`, then calling \`edit-design\` on that same \`fileId\` in a
315
- bounded single-file pass. Use \`mode: "replace-file"\` when expanding the
316
- representative placeholder into the full chosen direction. Do not call
317
- \`generate-design\` after a variant pick.
318
- - If the chat choice buttons are not available in the host, ask the user to
319
- tell you the screen name they prefer. The variants are already real screens
320
- on the board, so do not ask them to paste HTML or copy a generated handoff
321
- summary.
322
- - For direct refinements to an already chosen direction, call
323
- \`get-design-snapshot\`, edit from the current tuned HTML, and use
324
- \`edit-design\` for surgical changes or \`mode: "replace-file"\` for a bounded
325
- selected-file replacement. Use \`generate-design\` for new files only.
326
- - Use \`export-coding-handoff\` when the user wants to implement the chosen
327
- design in a codebase.
328
-
329
- ## Exploration Defaults
330
-
331
- 1. Default to three variants unless the user asks for a different count
332
- (\`present-design-variants\` accepts 2-5; three is the sweet spot).
333
- 2. Make variants structurally and stylistically distinct, not just color swaps.
334
- 3. Each variant must be a compact, complete standalone HTML document that
335
- renders without a build step.
336
- 4. For product UI redesigns, prefer cleaner hierarchy, progressive disclosure,
337
- and realistic controls over decorative mockups.
338
- 5. After \`present-design-variants\`, wait for the user's pick before
339
- generating the next version. Keep the chosen screen, delete the other
340
- variant screens, call \`get-design-snapshot\` with \`fileId\` for the kept
341
- screen, then call \`edit-design\` on that same \`fileId\` in a bounded pass.
342
- Use \`mode: "replace-file"\` when expanding the representative placeholder
343
- into the full chosen direction. Do not call \`generate-design\` after a
344
- variant pick. Stop after the first successful \`edit-design\` save.
345
-
346
- ## Design Quality Bar
347
-
348
- Generic "AI slop" comes from letting one prompt set taste, explore, and emit code
349
- at once — so the model returns the training-average (Inter, an indigo/violet
350
- gradient, a centered hero, three rounded cards). The variant flow above exists to
351
- separate those jobs; use it, and hold this bar:
352
-
353
- - Before generating, name the concrete audience, the screen's primary job, and
354
- the visual thesis. If the brief is vague, make a reasonable choice and state
355
- it instead of producing a generic dashboard/landing-page default.
356
- - Refuse the defaults, and pair every "don't" with a "do" (banning Inter alone
357
- just makes you reach for Roboto). Avoid Inter/Roboto/system fonts, the
358
- indigo/violet slop palette (\`#6366F1\`/\`#8B5CF6\`/\`#A855F7\`) and purple-on-white
359
- gradients, and centered-hero + three-icon-card layouts; instead pick a
360
- distinctive font pairing, one non-default palette family with a single decisive
361
- accent, and an asymmetric layout with a clear focal point.
362
- - Make each direction distinct in structure and behavior, not just palette.
363
- Give every variant one memorable signature choice, then keep the surrounding
364
- chrome disciplined. Even your creative picks converge (Space Grotesk
365
- everywhere) — vary deliberately so two directions never share a fingerprint.
366
- - For existing products, inspect the current screen, design system, tokens, and
367
- component language before inventing a new direction. Treat any drift back to a
368
- default as a missing token to pin, and vary layout per screen so on-brand does
369
- not become same-in-your-colors.
370
- - Treat copy, data, and imagery as design material. Use realistic domain
371
- content and first-party/generated assets when images matter; avoid lorem
372
- ipsum, vague SaaS filler, and decorative placeholder boxes.
373
- - Build to a quiet quality floor: responsive desktop/mobile layout, visible
374
- keyboard focus, useful loading/empty/error states for app UI, and reduced
375
- motion support when custom motion is present.
376
- - After broad generation or refinement, inspect the rendered Design surface or
377
- a screenshot-capable host before calling it ready. Fix obvious hierarchy,
378
- overflow, contrast, broken interaction, and placeholder-content issues first.
379
-
380
- ## Cross-App Use
381
-
382
- - Hosted default: connect \`https://design.agent-native.com/_agent-native/mcp\`.
383
- Do not put shared secrets in skill files.
384
- - For CLI/code-editor clients, keep any \`npx @agent-native/core@latest connect\` command
385
- running until browser authorization finishes. Stopping it early can leave the
386
- browser approved but the local MCP config unwritten. Restart or reload the
387
- agent client after installing or connecting if Design tools do not appear in
388
- the live session.
389
- - Dispatch can expose Design alongside other apps. Use Design for UI/UX design
390
- tasks, Assets for image/media selection, Slides for decks, and so on.
391
- - Keep the loop visual: surface the inline MCP App or the returned "Open
392
- design" link instead of pasting large HTML blobs into chat.
393
- - If a Design tool call returns \`Session terminated\`, \`needs auth\`, or
394
- another connector/session error, do not keep retrying the tool. Stop and give
395
- the user the reconnect step: in Claude Code run \`/mcp\` and choose
396
- Authenticate/Reconnect for the Design connector; from any terminal run
397
- \`npx -y @agent-native/core@latest reconnect https://design.agent-native.com\` — this
398
- re-authenticates WITHOUT reinstalling. Never reinstall from scratch just to fix
399
- auth. Continue once the connector is available.
400
- - Do not hand-roll MCP HTTP requests with curl from the agent session. Use the
401
- host-exposed Design tools after restart/reload, or use the returned
402
- browser/deep-link fallback.
403
- - If you inspect local MCP config, redact \`Authorization\`, \`http_headers\`,
404
- and token values. Never paste bearer tokens into chat or logs.
405
- `;
406
- const DESIGN_VISUAL_EDIT_SKILL_MD = `---
407
- name: visual-edit
408
- description: >-
409
- Open a running local app in Design overview mode as URL-backed iframe screens
410
- for visual editing, flow review, duplication, and route-state exploration.
411
- Use when the user asks to inspect, compare, or edit a real local app visually
412
- in Design.
413
- metadata:
414
- visibility: exported
415
- ---
416
-
417
- # Visual Edit
418
-
419
- Use \`/visual-edit\` when the user wants to inspect or edit a real local app
420
- visually instead of generating standalone Alpine HTML. The source of truth is
421
- the running localhost app plus its route URLs. Design shows those routes as
422
- iframe-backed screens on the infinite canvas.
423
-
424
- ## Core Model
425
-
426
- - Each screen is a URL-backed iframe, not copied HTML.
427
- - Each screen keeps URL metadata: \`connectionId\`, \`routeId\`, \`path\`,
428
- \`url\`, \`bridgeUrl\`, title, and viewport size.
429
- - Start in Design's screen overview mode. In overview, screens are static
430
- design frames; full-screen focus is for scrolling and app interaction.
431
- - Alt-drag duplicates a screen. For localhost screens, duplication copies the
432
- iframe frame and URL metadata; change the copy's path/query for a new state.
433
- - Flow visualization is multiple URL states: \`/checkout?step=shipping\`,
434
- \`/checkout?step=payment\`, \`/checkout?step=done\`, etc.
435
- - When the user gives a named flow or numbered screen list, preserve that order
436
- and create one screen per URL/path. Shorthand like
437
- \`localhost:1234/onboarding/1\` means
438
- \`http://localhost:1234/onboarding/1\`.
439
-
440
- ## Review Quality
441
-
442
- - Treat the running app as the truth. Preserve its component language, tokens,
443
- route state, and real content unless the user explicitly asks for a new visual
444
- direction.
445
- - Use multiple URL states to reveal meaningful UX moments: empty/loading/error
446
- states, focused panels, modals, responsive breakpoints, and completed flow
447
- steps when those matter to the review.
448
- - For visual edits, compare before/after at the relevant viewport sizes and
449
- check key hover/focus/scroll states when the app exposes them.
450
-
451
- ## Account And Sharing Model
452
-
453
- - The \`/visual-edit\` entry route can open before the viewer signs in. Public
454
- \`/design/:id\` editor links can also render read-only public designs without a
455
- session.
456
- - Prefer links returned by Design actions or \`/_agent-native/open\` deep links.
457
- Do not surface URLs with \`_session=\` tokens. Query sessions are only a
458
- fallback after normal cookie resolution, so an existing browser session can
459
- still open the design as a different user and show "Design not found".
460
- - Do not attempt anonymous write actions. Bridge registration, design creation,
461
- screen placement, generation, saving, and sharing are account-backed. If a
462
- signed-out visitor wants to save or share, send them through the framework
463
- sign-in return flow, then save or copy the design into that account before
464
- opening the share dialog.
465
-
466
- ## Required Local Bridge
467
-
468
- The live-edit bridge is unlocked by a shared secret (the "bridge token") that
469
- must match on two sides: the local bridge process, and the user's connection row
470
- in Design (which the browser reads to authorize \`/live-edit-bridge\`,
471
- \`/read-file\`, \`/write-file\`). Get them to match by letting the
472
- **authenticated** \`open-visual-edit\` action mint the token, then starting the
473
- bridge with it. This is the only ordering that works for the remote-MCP flow —
474
- the bridge cannot push its own token to the server without a CLI auth token, so
475
- the server mints instead and the bridge adopts.
476
-
477
- From the target app repo, make sure its dev server is running, then:
478
-
479
- **1. Discover routes without starting a durable bridge** (one-shot, exits):
480
-
481
- \`\`\`bash
482
- npx @agent-native/core@latest design connect --url http://localhost:5173 --root . --json
483
- \`\`\`
484
-
485
- This prints the manifest (routes + capabilities). Parse it to build
486
- \`routeManifest\` for the next step. (Skip this if the user already gave explicit
487
- paths/URLs to place.)
488
-
489
- **2. Call \`open-visual-edit\`** (see Action Flow below) with NO \`bridgeToken\`.
490
- The server mints one, stores it on the user's connection row, copies it into the
491
- placed screens' metadata, and returns it to you as \`bridgeToken\`. Capture it.
492
-
493
- **3. Start the persistent bridge adopting that token** (single line; prefer the
494
- env var so the secret does not appear in \`ps\`):
495
-
496
- \`\`\`bash
497
- AGENT_NATIVE_BRIDGE_TOKEN="<bridgeToken from step 2>" npx @agent-native/core@latest design connect --url http://localhost:5173 --root . --daemon
498
- \`\`\`
499
-
500
- (Equivalently, pass \`--bridge-token <token>\`.) This starts a detached bridge on
501
- \`http://127.0.0.1:7331\`, adopts the server-minted token — so bridge and row
502
- agree and live-edit authorizes with no self-registration — and stays alive after
503
- the command exits.
504
-
505
- For a manual health/manifest check on the running bridge:
506
-
507
- \`\`\`bash
508
- curl http://127.0.0.1:7331/manifest.json
509
- \`\`\`
510
-
511
- Only use \`--json\` for the step-1 route probe. Never use \`--json\`, \`--once\`,
512
- or \`--dry-run\` for the durable step-3 bridge: they print the manifest and exit,
513
- so Design falls back to a non-editable live iframe.
514
-
515
- ## Action Flow
516
-
517
- Prefer the single authenticated \`open-visual-edit\` action. It registers or
518
- refreshes the localhost bridge connection, mints and stores the bridge token,
519
- creates or reuses a Design project, places URL-backed screens, stores the active
520
- visual-edit context, and navigates to overview mode in one call. This avoids
521
- creating a private design under a synthetic CLI user and then handing the browser
522
- a tokenized URL that may be shadowed by an existing session.
523
-
524
- Call it BEFORE starting the durable bridge (step 3 above): it does not contact
525
- the bridge, so the bridge need not be running yet, and you need its returned
526
- \`bridgeToken\` to start the bridge with a matching secret. Omit \`bridgeToken\`
527
- on the call so the server mints one.
528
-
529
- \`\`\`bash
530
- pnpm action open-visual-edit '{
531
- "title": "Docs homepage visual edit",
532
- "devServerUrl": "http://localhost:5173",
533
- "bridgeUrl": "http://127.0.0.1:7331",
534
- "rootPath": "/absolute/path/to/app",
535
- "routeManifest": { "...": "from /manifest.json" },
536
- "paths": ["/", "/pricing", "/checkout?step=payment"]
537
- }'
538
- \`\`\`
539
-
540
- The action returns \`designId\`, \`connectionId\`, \`bridgeToken\`, \`screens\`,
541
- \`urlPath\`, and \`openUrl\`. Keep \`designId\`/\`connectionId\` in the chat context
542
- for follow-ups, and pass \`bridgeToken\` to \`design connect\` (step 3) to start
543
- the bridge. On follow-up calls reusing an existing \`connectionId\`, the same
544
- token is returned (it is minted once and reused), so the running bridge stays
545
- valid.
546
-
547
- For a numbered flow the user describes in chat, keep the labels and order:
548
-
549
- \`\`\`bash
550
- pnpm action open-visual-edit '{
551
- "designId": "<existing-design-id>",
552
- "connectionId": "<existing-connection-id>",
553
- "devServerUrl": "http://localhost:1234",
554
- "routes": [
555
- { "url": "localhost:1234/onboarding/1", "title": "Screen 1" },
556
- { "url": "localhost:1234/onboarding/2", "title": "Screen 2" },
557
- { "url": "localhost:1234/onboarding/3", "title": "Screen 3" }
558
- ]
559
- }'
560
- \`\`\`
561
-
562
- For responsive follow-ups, call \`open-visual-edit\` again with the same
563
- \`designId\` and \`connectionId\`, plus explicit viewport dimensions:
564
-
565
- \`\`\`bash
566
- pnpm action open-visual-edit '{
567
- "designId": "<existing-design-id>",
568
- "connectionId": "<existing-connection-id>",
569
- "devServerUrl": "http://localhost:5173",
570
- "paths": ["/"],
571
- "defaultWidth": 390,
572
- "defaultHeight": 844,
573
- "startX": 1600,
574
- "startY": 0
575
- }'
576
- \`\`\`
577
-
578
- If no \`routes\` or \`paths\` are supplied, \`open-visual-edit\` uses every route
579
- from the localhost manifest.
580
-
581
- Fallback, only when \`open-visual-edit\` is unavailable:
582
-
583
- 1. Register or refresh the bridge with \`connect-localhost\`, passing the
584
- \`/manifest.json\` result as \`routeManifest\` and \`capabilities\`.
585
- 2. Create or reuse a Design project with \`create-design\`.
586
- 3. Place URL-backed screens with \`add-localhost-screens\`.
587
- 4. Navigate to overview mode with \`navigate\`.
588
-
589
- ## Open The Design Surface
590
-
591
- - Use the \`link\`, \`deepLink\`, or MCP App embed returned by Design actions so
592
- the user sees the canvas. In Codex Desktop or VS Code, prefer opening that
593
- Design URL in the available preview/webview panel; otherwise surface the
594
- "Open design" link.
595
- - Return or open the \`openUrl\` / action link, not a hand-built
596
- \`/design/:id?_session=...\` URL.
597
- - If the user is working in VS Code, the Agent Native extension can open the
598
- same URL via
599
- \`vscode://builder.agent-native/open?url=<encoded-design-url>\`. Its
600
- \`Agent Native: Open Design Canvas\` command also starts the local bridge and
601
- opens hosted Design in the VS Code side panel.
602
- - After \`add-localhost-screens\`, confirm the Design editor is in overview mode
603
- with the requested URL-backed frames visible. Do not stop at "screens added"
604
- when the user asked to inspect or edit visually.
605
-
606
- ## Editing URLs
607
-
608
- Keep localhost screens as URL files plus \`screenMetadata[fileId]\`. Do not
609
- replace them with copied \`srcdoc\` HTML unless the user explicitly asks for a
610
- frozen snapshot. To change a state, rerun \`add-localhost-screens\` with the new
611
- path/query or duplicate the screen and update the copy's URL metadata.
612
-
613
- ## React Source Writeback
614
-
615
- - Use compiler/debug provenance (project-relative file, line, column,
616
- component, and runtime multiplicity) to locate React/TSX source. Treat it as
617
- evidence, not as permission for a generic AST structural transform.
618
- - Reparenting, grouping/ungrouping, wrappers, dynamic expressions, repeated
619
- \`.map()\` instances, shared components, and cross-file changes go through the
620
- coding agent with exact subject/target anchors and their runtime
621
- relationship.
622
- - Before each write, read the file and pass its exact \`versionHash\` to
623
- \`write-local-file\` with \`requireExpectedVersionHash: true\`; on conflict,
624
- re-read and re-plan. Keep the optimistic preview until HMR/runtime confirms
625
- the result. Human write consent remains mandatory and agents cannot grant it.
626
-
627
- ## Verification
628
-
629
- - \`list-localhost-connections\` returns the expected connection and routes.
630
- - The Design editor opens in overview mode.
631
- - Every requested screen renders the intended localhost URL.
632
- - Alt-dragging a screen copies the URL-backed frame, not an inline HTML clone.
633
- `;
634
- /**
635
- * Setup/auth block for the `/visual-plan` skill. Interpolated into
636
- * `VISUAL_PLANS_SKILL_MD` below so the install + one-step authenticate
637
- * instructions are single-sourced. The materialized SKILL.md copies under
638
- * `templates/plan/.agents/skills/*`, top-level `skills/*`, and
639
- * `.agents/skills/*` are guarded byte-identical by `skills.sync.spec.ts`.
640
- */
641
- const PLAN_SETUP_AUTH_MD = `## Setup & Authentication
642
-
643
- There are two ways into Plans.
644
-
645
- **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
646
- installs the Plans skills, registers the hosted Plans MCP connector, and runs
647
- auth/setup for the selected local client(s) in the same step (a one-time browser
648
- sign-in at setup — this is intended), so the first tool call in that client does
649
- not hit an OAuth wall:
650
-
651
- \`\`\`bash
652
- npx @agent-native/core@latest skills add visual-plans
653
- \`\`\`
654
-
655
- After that, \`/visual-plan\`, \`/visual-recap\`, and \`/visualize-repo\` are the
656
- installed slash commands. If you only need one command, use
657
- \`skills add visual-plan\`, \`skills add visual-recap\`, or
658
- \`skills add visualize-repo\` instead. The other planning modes
659
- (\`create-ui-plan\`, \`create-prototype-plan\`, \`create-plan-design\`,
660
- \`create-visual-questions\`) are MCP tools reachable from \`/visual-plan\`, not
661
- separate slash commands. Pass \`--no-connect\` to register the connector without
662
- authenticating, then run
663
- \`npx @agent-native/core@latest connect https://plan.agent-native.com --client all\`
664
- whenever you are ready, or choose a narrower \`--client\`. Auth and MCP tool
665
- loading are per client config/session.
666
-
667
- **Local-only / text installs.** If the user wants no sharing and all local files,
668
- install with \`--mode local-files\`:
669
-
670
- \`\`\`bash
671
- npx @agent-native/core@latest skills add visual-plans --mode local-files
672
- \`\`\`
673
-
674
- This mode does not register the Plan MCP connector. Before authoring structured
675
- MDX, fetch the no-auth, schema-only block catalog with
676
- \`npx @agent-native/core@latest plan blocks --out plan-blocks.md\`, read that file,
677
- write the MDX folder locally, run \`plan local check\`, then run \`plan local serve\`.
678
- For repo-wide visual docs, run
679
- \`npx @agent-native/core@latest visualize-repo --open\` to create/update
680
- \`agent-native.json\`, seed \`.agent-native/visual-docs/repo-overview\`, and open
681
- the local bridge.
682
- Plain text skill
683
- installs (Vercel Skills CLI, copied GitHub files, etc.) can follow that same
684
- local flow if \`@agent-native/core\` is available. Text alone cannot register
685
- MCP tools; hosted/shareable Plans still need the Agent-Native CLI
686
- install/reconnect step above.
687
-
688
- **Browser (people you share with).** Open the Plans editor and create & edit
689
- with no sign-up — you work as a guest. Sign in only when you want to save or
690
- share; signing in claims the plans you made as a guest into your account.
691
-
692
- Sharing and commenting require an account: public/shared plans are viewable by
693
- anyone with the link, but commenting on them needs an agent-native account.
694
-
695
- For no-account, no-DB plan storage, use local-files mode and the local bridge
696
- command. The optional \`plan blocks\` lookup reads only public schema metadata.
697
- If network access is unavailable, use the bundled references and a local Plan
698
- app/runtime for validation.
699
-
700
- If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`,
701
- do not keep retrying the tool. Stop and give the user the reconnect step for the
702
- client they are using: Codex/Codex Desktop should run
703
- \`npx -y @agent-native/core@latest reconnect https://plan.agent-native.com --client codex\`
704
- and start a new Codex session; Claude Code should run \`/mcp\` and choose
705
- Authenticate/Reconnect for the plan connector, or run the reconnect command with
706
- \`--client claude-code\` and restart Claude. To refresh every local client config
707
- that already has the Plan entry, use \`--client all\`, then restart/reload each
708
- client. Reconnect re-authenticates WITHOUT reinstalling and finds the entry by
709
- URL regardless of connector name. Never reinstall from scratch just to fix auth.
710
- Continue once the connector is available.
711
-
712
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
713
- not put shared secrets in skill files.`;
714
- // Single-source shared cores. Each partial is a heading-less BODY string that
715
- // begins and ends with its own SHARED-CORE marker comment, so the marker-region
716
- // sync guard can extract and compare it across the skills that consume it. The
717
- // skill constants below interpolate these partials at module-eval time; the
718
- // distributed artifact stays a flat string, so distribution is unchanged.
719
- //
720
- // Consumers:
721
- // WIREFRAME_QUALITY_CORE — visual-plan, visual-recap (surface-agnostic)
722
- // CANVAS_SURFACE_CORE — visual-plan modes (canvas/artboard mechanics)
723
- // DOCUMENT_QUALITY_CORE — visual-plan
724
- // EXEMPLAR_CORE — visual-plan
725
- // Surface-agnostic HTML wireframe quality rules. Applies equally to a standalone
726
- // WireframeBlock/<Screen> (visual-recap) and to a canvas artboard (visual-plan).
727
- // Do not put canvas/artboard placement mechanics here.
728
- const WIREFRAME_QUALITY_CORE = `<!-- SHARED-CORE:wireframe-quality START -->
729
-
730
- **A wireframe is an HTML mockup. The renderer owns the look; you write the
731
- content.** Set \`data.html\` to a self-contained, semantic HTML fragment of the
732
- screen and set \`data.surface\`. The renderer owns the surface footprint/aspect,
733
- the dark/light theme, the hand-drawn font, and the rough.js sketch overlay — you
734
- never write \`<html>\`/\`<body>\`/\`<script>\`/\`<style>\` tags or any
735
- width/height/coordinates. You write real HTML layout and real product
736
- content; the renderer styles and roughens it.
737
-
738
- **A wireframe block's data is an HTML screen plus a surface:**
739
-
740
- \`\`\`json
741
- {
742
- "surface": "browser",
743
- "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>"
744
- }
745
- \`\`\`
746
-
747
- **Write PLAIN semantic HTML and let the renderer style it.** Bare elements
748
- (\`h1\`/\`h2\`/\`h3\`, \`p\`, \`button\`, \`input\`, \`<input type="checkbox">\`, \`a\`, \`hr\`)
749
- are auto-themed — no classes needed. Helper classes carry the rest:
750
-
751
- - \`.wf-card\` / \`.wf-box\` — a bordered, padded container (a panel, a list item).
752
- - \`.wf-pill\` / \`.wf-chip\` — a rounded tag or filter; add \`.accent\`
753
- (\`<span class="wf-pill accent">\`) for the accent-filled variant.
754
- - \`.wf-muted\` — secondary/muted text (or use \`<small>\`).
755
- - \`button.primary\` or any element with \`[data-primary]\` — the accent-filled
756
- primary button.
757
-
758
- **No decorative shadows around mockups.** Do not put \`box-shadow\`, \`filter:
759
- drop-shadow(...)\`, Tailwind \`shadow-*\` classes, or other fake depth effects on a
760
- wireframe frame, root container, \`.wf-card\` / \`.wf-box\`, or canvas artboard.
761
- Mockups should read as flat, bordered surfaces; use spacing, borders, labels,
762
- and annotations for separation. Only show a shadow when the real product UI
763
- already has that shadow and it is essential to the change being reviewed.
764
-
765
- **Use renderer icons, not visible icon words.** For icon-only buttons or leading
766
- icons inside fields, chips, menu items, and toolbars, write an empty marker such
767
- as \`<span data-icon="mail" aria-label="Email"></span>\` or
768
- \`<i data-icon="lock"></i>\`. The renderer replaces it with a Tabler-style SVG and
769
- the \`.wf-icon\` class sizes it to the surrounding text. Supported names and
770
- aliases: \`mail\`/\`email\`, \`lock\`/\`password\`, \`search\`, \`plus\`/\`add\`, \`x\`/\`close\`,
771
- \`check\`, \`chevronDown\`, \`chevronUp\`, \`chevronLeft\`, \`chevronRight\`, \`dots\`/\`more\`,
772
- \`chevron\`/\`caret\`/\`dropdown\` (down chevron), \`user\`, \`settings\`, \`calendar\`,
773
- \`bell\`, \`send\`, \`edit\`, \`arrowLeft\`, and \`arrowRight\`. Do not put visible words
774
- like "email", "lock", "search", "chevron", or "more" where the product UI would
775
- show an icon; use text only when it is a real label a user would read.
776
-
777
- **Use the \`--wf-*\` tokens for any custom color, never hex.** The renderer flips
778
- these on light/dark, so reading them is what keeps a mockup correct in both
779
- themes. For any inline border, background, or text color, reference a token:
780
- \`style="border:1.4px solid var(--wf-line)"\`. The tokens are \`--wf-ink\` (text),
781
- \`--wf-muted\` (secondary text), \`--wf-line\` (borders/dividers), \`--wf-paper\`
782
- (page background), \`--wf-card\` (container surface), \`--wf-accent\` /
783
- \`--wf-accent-fg\` / \`--wf-accent-soft\` (brand action), \`--wf-warn\`, \`--wf-ok\`,
784
- and \`--wf-radius\`. Never hard-code a hex color and never set \`font-family\` — the
785
- renderer owns the sketch/clean font.
786
-
787
- **Never use host/Tailwind theme classes in wireframe HTML.** Classes such as
788
- \`bg-white\`, \`bg-zinc-50\`, \`bg-slate-950\`, \`text-zinc-950\`,
789
- \`text-slate-400\`, \`border-zinc-200\`, \`hover:bg-slate-800\`, \`shadow-xl\`,
790
- or arbitrary color utilities like \`bg-[#fff]\` leak the host app's CSS into the
791
- mockup and can make dark-mode canvas frames unreadable. Use bare semantic
792
- elements, \`.wf-*\` helper classes, and \`--wf-*\` color tokens instead. Before
793
- publishing, scan every wireframe \`class\` and \`style\` attribute: if a class sets
794
- background, text, border, ring, fill, stroke, gradient, placeholder, decoration,
795
- or shadow color, rewrite it to renderer tokens or remove it. Layout-only classes
796
- are still discouraged; inline flex/grid styles are safer and easier to review.
797
-
798
- **Keep Rough.js sparse.** The renderer sketches the outer frame, standard
799
- \`.wf-*\` primitives, controls, and inline border dividers by default. Do not add
800
- \`data-rough\` to broad root wrappers, dialog shells, page panels, grid cells, or
801
- nested containers unless that single container is the visual point. Use
802
- \`data-rough\` only for a deliberate one-off shape. If a mockup starts looking
803
- like stacked/overlapping sketch lines, remove rough targets from parent
804
- containers and let backgrounds plus spacing separate the surfaces.
805
-
806
- **Use literal CSS lengths for spacing.** The \`--wf-*\` tokens are for colors and
807
- renderer-owned visual styling, not layout spacing. Do not use guessed spacing
808
- tokens such as \`var(--wf-space-4)\`, Tailwind spacing classes, or theme spacing
809
- variables inside wireframe HTML; if a token is unavailable in the Plan renderer,
810
- padding collapses and content hugs the border. Use explicit CSS lengths for
811
- layout: \`padding:16px\`, \`gap:12px\`, \`margin-top:18px\`, \`minmax(0,1fr)\`.
812
-
813
- **Lay out with inline \`style\` flex/grid.** You write the real layout —
814
- \`display:flex; flex-direction:column; gap:10px; padding:16px\` and so on — and the
815
- renderer never repositions anything. Compose the actual product: reproduce the
816
- current screen, then show the modification. Real labels, real counts, real dates,
817
- real button text grounded in the screen you read; not lorem or gray bars.
818
-
819
- **Surface presets — match the real footprint, never default to desktop+mobile.**
820
- Pick the \`surface\` that matches what the user will actually see:
821
-
822
- - \`browser\`: a web page that needs a browser chrome frame around it.
823
- - \`desktop\`: a full desktop app page or app shell.
824
- - \`mobile\`: a phone screen, only when the work is genuinely mobile.
825
- - \`popover\`: a small floating menu, dropdown, or inline popover.
826
- - \`panel\`: a side panel, inspector, or sidebar widget.
827
-
828
- A sidebar popover renders as a small surface, not a desktop page and a phone
829
- frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
830
- actually changes the layout. For a component or widget, show one broader
831
- app-context frame only when placement affects understanding, then the focused
832
- component states.
833
-
834
- **Model the actual component shell for small surfaces.** A rendered UI change
835
- belongs in a wireframe; reserve \`diagram\` for architecture, dependency, state,
836
- or data-flow relationships. Popovers, dropdown menus, command palettes, and
837
- context menus use \`surface: "popover"\` unless the surrounding page placement is
838
- the point of the change. Dialogs, sheets, inspectors, sidebars, and long
839
- property panels use the matching \`panel\` / \`desktop\` surface as appropriate.
840
- Show the real chrome: trigger or anchor when it matters, title/header row,
841
- top-right actions, separators, fields, options, selected states, body content,
842
- and footer actions that are visible in the workflow.
843
-
844
- **Modify, don't redesign.** When the task changes an existing screen, reproduce
845
- the current screen's real layout and footprint FIRST, then change only the delta
846
- and call it out with a single annotation. Do not restack the page into a new
847
- layout. For net-new surfaces, compose from the real app shell. Inspect the
848
- actual app components before drawing an existing product: sidebar density,
849
- toolbar actions, overflow menus, property panels, and framework chrome should
850
- match the product unless the plan intentionally changes them.
851
-
852
- **Keep product screens pure.** A product wireframe shows the app state a user
853
- would actually see. Do not embed file contracts, architecture arrows, repo pills,
854
- mode explanations, or implementation callouts inside the screen just to explain
855
- the plan. Put those in canvas annotations, a separate diagram, or the document
856
- body. Secondary UI such as properties, history, sync, export, or agent controls
857
- should appear where the real product would put them: an overflow popover, sheet,
858
- panel, or separate framework sidebar state, not a generic permanent right
859
- inspector unless that inspector is the actual design.
860
-
861
- **Classify mockup scope before implementation.** Before turning a plan mockup
862
- into source code, decide whether each artboard represents the whole page/app
863
- shell, a route body inside an existing shell, or a component/sub-surface. If an
864
- artboard includes navigation, sidebars, auth banners, or a signup/login form,
865
- map those pieces to the real shared shell/auth components instead of nesting the
866
- entire mockup inside the current page. When a mockup references the product's
867
- standard signup/login page, find and reuse that existing implementation; do not
868
- approximate it from the wireframe.
869
-
870
- **Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a
871
- popover, menu, dialog, toast), show the full screen once, then add a small
872
- separate artboard whose \`html\` contains ONLY that sub-surface — do not re-draw
873
- the whole page around it, and do not scale a duplicate up. Pick the matching
874
- \`surface\` (e.g. \`popover\`) so the footprint is right; never widen a popover to
875
- page width.
876
-
877
- **Loading / skeleton states.** Set \`data.skeleton: true\` on the wireframe and
878
- fill the \`html\` with neutral, textless placeholder geometry — boxes and bars
879
- built as \`<div>\`s with \`background:var(--wf-line)\` and explicit heights/widths,
880
- no labels or copy. The renderer drops borders, sketch, and color into the
881
- skeleton register automatically. Never escape to a \`custom-html\` document block
882
- to fake a loader.
883
-
884
- **Editing an existing mockup.** In hosted mode, to change one element, text, or
885
- color in an existing html mockup, do not regenerate the frame — call
886
- \`update-visual-plan\` with
887
- \`contentPatches: [{ op: "patch-wireframe-html", blockId, edits: [{ find,
888
- replace }] }]\`. Each \`find\` is a unique snippet of the current html (read it
889
- first with \`get-visual-plan\`); set \`all: true\` on an edit to replace every
890
- occurrence. The result is re-sanitized. In local-files privacy mode, do not call
891
- hosted Plan tools; edit the local MDX source directly and rerun the local
892
- check/serve or verify command for \`<plan-dir>\`.
893
-
894
- **Choose the outer frame deliberately.** Wireframe and diagram data accept
895
- \`frame: "auto" | "show" | "hide"\` in block data (\`<Screen frame="hide">\` in
896
- MDX wireframes, \`<Diagram frame="hide">\` for MDX diagrams). Leave it unset or
897
- \`auto\` when the host context should decide: Plan and recap surfaces default to a
898
- drawn outer frame; docs surfaces default to no outer frame. Use \`show\` for
899
- standalone product screens, before/after recap comparisons, screenshot-like
900
- artifacts, and visuals that need containment from surrounding prose. Use \`hide\`
901
- when a docs page, tab, column, card, canvas artboard, or the visual's own
902
- internal chrome already supplies the boundary. Do not use \`hide\` to compensate
903
- for cramped content; fix the layout instead.
904
-
905
- **Inner padding and borders still matter.** Always wrap HTML wireframe content
906
- in a root container with real inner padding before drawing cards, fields, pills,
907
- labels, or controls. Use at least 14-16px of padding, \`box-sizing: border-box\`,
908
- \`height: 100%\`, and \`gap\` between child rows on the root node itself so the
909
- first row never sits flush against the screen edge. Do not rely on padding on a
910
- nested page section as the first visible inset; the outermost element must
911
- create the breathing room. Keep text away from borders: every container, field,
912
- button, menu item, and annotation needs enough padding and line-height to read
913
- cleanly in the rendered Plan view.
914
-
915
- **For feature-cloud or abundance visuals, optimize the composition over line-by-line
916
- reading.** Some marketing/product sections need to feel like a large surface area
917
- of capability rather than a precise app workflow. In those cases, use one padded
918
- root with a short headline and a dense, aesthetic cloud of short feature labels,
919
- chips, rings, or columns. Vary scale and opacity with tokens, cluster by meaning,
920
- and let many labels be glanceable rather than individually essential. Do not
921
- force dozens of features into equal cards with long wrapped sentences; that
922
- usually creates a messy unreadable mockup.
923
-
924
- **Lay out children safely so they never collide.** Use HTML flex/grid with
925
- \`gap\`, \`min-width: 0\`, and sensible overflow. Avoid negative margins, absolute
926
- positioning, or fixed child widths that can collide when the renderer switches
927
- between light/dark, sketch/clean, or different zoom levels.
928
-
929
- **Do not wrap intentionally single-line labels.** For toolbars, tab rails,
930
- breadcrumbs, chip/filter rows, branch and file names, file chips, and code
931
- filenames — any deliberately single-line row — do not let long text wrap. Put
932
- \`white-space: nowrap\` on the row (and \`overflow: hidden; text-overflow: ellipsis\`
933
- on the individual labels that can grow), so the wireframe demonstrates the actual
934
- layout behavior instead of producing ugly stacked or vertical text. Use
935
- horizontally scrollable or clipped rails for overflow.
936
-
937
- **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).
938
-
939
- **Persistent chrome bars span the full frame width.** Top bars, app headers,
940
- toolbars, and bottom tab/nav bars are full-width chrome, not centered content.
941
- Lay each one out as a single flex row that fills the frame
942
- (\`style="display:flex;align-items:center;width:100%"\`) and push trailing actions
943
- to the right edge with a flex spacer (\`<div style="flex:1"></div>\`) between the
944
- leading group and the trailing group — never center a bar inside a narrow,
945
- centered block, and never let it collapse to the width of its contents. In a
946
- Before/After pair the bar stays full-width in BOTH states even when one state has
947
- fewer controls; the spacer absorbs the difference so the remaining controls hold
948
- their edge alignment instead of sliding to the center.
949
-
950
- **Pin bottom bars to the bottom of the frame.** For mobile tab bars, footers, and
951
- any persistent bottom action row, make the frame itself a flex column at
952
- \`height:100%\` (\`style="display:flex;flex-direction:column;height:100%"\`), give the
953
- scrolling body \`flex:1\` so it absorbs the slack, and place the bar as the LAST
954
- child of the frame (or set \`margin-top:auto\` on it). The bar then sits flush at
955
- the bottom of the surface instead of floating directly under the content with an
956
- empty band beneath it.
957
-
958
- **Before / after must be comparable.** When showing a state change, preserve the
959
- unchanged controls in both states so the reviewer can see exactly what moved or
960
- appeared; do not show an added control as a generic box floating elsewhere in
961
- the surface. Place the new/changed affordance where the implementation puts it —
962
- for example, a new \`Edit with AI\` action in a popover header belongs in the
963
- top-right header slot, aligned with the title, not in the body or footer. Use
964
- the same frame size, scale, outer padding, border radius, and visual density on
965
- both sides unless the change itself alters those properties, and let the frame
966
- height fit the content rather than leaving a tall empty lower half.
967
-
968
- **Name the states with the column header, never inside the frame.** For
969
- document-body wireframes (recaps), put the two
970
- states in a \`columns\` block and set each column's \`label\` to \`Before\` and
971
- \`After\` — the renderer draws that label as an \`h4\` heading above each frame. Do
972
- NOT bake a \`Before\`/\`After\` pill, title, or heading into the wireframe \`html\`: a
973
- label placed inside reads as part of the product UI, lands in a random corner,
974
- and clutters the comparison. The column header is the one and only place the
975
- state name belongs. On a canvas, place the two state artboards as neighbors with
976
- frame labels — never encode Before/After inside the html.
977
-
978
- **Let the surface choose side-by-side vs. stacked.** For document-body
979
- wireframes (recaps), the \`columns\` renderer lays
980
- narrow surfaces (\`mobile\`, \`popover\`, \`panel\`) out side by side, and
981
- automatically stacks wide surfaces (\`desktop\`, \`browser\`) vertically at full
982
- document width so a large frame is never crushed into a half-width column and
983
- cropped. Author both wireframes with the real \`surface\` and the matching
984
- \`Before\`/\`After\` column labels; do not hand-stack the pair into separate
985
- top-level wireframes or duplicate the state name as body content.
986
-
987
- **Good example — a contacts list, surface \`browser\`.** A small, real screen
988
- composed from the helper classes and tokens, layout in inline flex, no fonts or
989
- hex colors:
990
-
991
- \`\`\`html
992
- <div
993
- style="display:flex;flex-direction:column;gap:12px;padding:16px;height:100%"
994
- >
995
- <div style="display:flex;align-items:center;justify-content:space-between">
996
- <h1>Contacts</h1>
997
- <button class="primary">New contact</button>
998
- </div>
999
- <div style="display:flex;gap:6px">
1000
- <span class="wf-pill accent">All 128</span>
1001
- <span class="wf-pill">Favorites</span>
1002
- <span class="wf-pill">Archived</span>
1003
- </div>
1004
- <div
1005
- class="wf-card"
1006
- style="display:flex;flex-direction:column;gap:0;padding:0"
1007
- >
1008
- <div
1009
- style="display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)"
1010
- >
1011
- <div
1012
- style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"
1013
- ></div>
1014
- <div style="flex:1">
1015
- <strong>Jane Cooper</strong><br /><small>jane@acme.co</small>
1016
- </div>
1017
- <span class="wf-pill">Lead</span>
1018
- </div>
1019
- <div style="display:flex;align-items:center;gap:10px;padding:10px 12px">
1020
- <div
1021
- style="width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)"
1022
- ></div>
1023
- <div style="flex:1">
1024
- <strong>Marcus Lee</strong><br /><small>marcus@globex.io</small>
1025
- </div>
1026
- <span class="wf-pill">Customer</span>
1027
- </div>
1028
- </div>
1029
- </div>
1030
- \`\`\`
1031
-
1032
- <!-- SHARED-CORE:wireframe-quality END -->`;
1033
- // Progressive-disclosure reference file. `WIREFRAME_QUALITY_CORE` is the single
1034
- // source of truth for HTML wireframe quality; it is materialized verbatim into a
1035
- // sibling `references/wireframe.md` in EVERY plan skill dir (visual-plan and
1036
- // visual-recap), instead of being interpolated inline into each SKILL.md body.
1037
- // The SKILL.md bodies carry only `WIREFRAME_REFERENCE_POINTER`, which tells the
1038
- // agent to read this file before authoring any wireframe. Keeping the reference
1039
- // body byte-identical to the core (markers included) lets the sync guard assert
1040
- // the on-disk copies never drift from the canonical constant.
1041
- export const WIREFRAME_REFERENCE_MD = `# HTML wireframe quality — single source of truth
1042
-
1043
- This file is the canonical quality bar for HTML wireframes / \`<Screen>\` /
1044
- \`WireframeBlock\` content, shared word for word by \`/visual-plan\` and
1045
- \`/visual-recap\`. Read it in full before authoring ANY wireframe; do not
1046
- author wireframes from memory or paraphrase these rules per command.
1047
-
1048
- ${WIREFRAME_QUALITY_CORE}
1049
- `;
1050
- // Short pointer that replaces the inline wireframe-quality core in each SKILL.md
1051
- // body. Authoring quality lives in the sibling reference file so the SKILL.md
1052
- // stays lean (progressive disclosure); the agent loads the detail on demand.
1053
- const WIREFRAME_REFERENCE_POINTER = `UI recap/plan wireframes must meet a strict quality bar — full-width chrome,
1054
- pinned bottom bars, real product content, before/after comparability, the right
1055
- \`surface\` preset, \`--wf-*\` tokens instead of hex, and no \`<html>\`/\`<style>\`/font
1056
- tags. Before authoring ANY wireframe / \`<Screen>\` / \`WireframeBlock\`, READ
1057
- \`references/wireframe.md\` in this skill directory — it is the single source of
1058
- truth for HTML wireframe quality, shared word for word with \`/visual-plan\`
1059
- and \`/visual-recap\`. Do not author wireframes from memory.`;
1060
- // Canvas/artboard placement mechanics. Used only by visual-plan modes
1061
- // (visual-recap renders standalone wireframes, not a canvas).
1062
- const CANVAS_SURFACE_CORE = `<!-- SHARED-CORE:canvas-surface START -->
1063
-
1064
- **The coordinate rule.** The \`surface\` locks each artboard's footprint and
1065
- aspect — never set artboard width/height and never use coordinates inside the
1066
- wireframe HTML; board-level artboard \`x\`/\`y\` IS allowed when it creates clear
1067
- lanes. Let canvas auto-placement handle simple one-row boards.
1068
-
1069
- **Lay out mixed canvases in lanes.** When a canvas contains broad browser /
1070
- desktop frames plus compact \`mobile\`, \`popover\`, or \`panel\` surfaces, do not put
1071
- everything in one horizontal strip. Use board-level artboard \`x\`/\`y\` to reserve
1072
- lanes with generous empty space: main flow on one row, compact surfaces in their
1073
- own column or row, and loading/error states in a lower row. Keep at least 96px
1074
- between rendered artboard rectangles plus room for annotation gutters; when a
1075
- broad browser/desktop frame sits beside a compact panel/popover, leave at least
1076
- 160px so frame borders, labels, and hover controls never touch. Connect only
1077
- neighboring steps; never draw a long connector that skips across unrelated
1078
- frames. Connector labels must sit in open canvas space. If the label would touch
1079
- or cross either artboard, remove the label and explain the transition with a
1080
- nearby annotation instead. Before handoff, inspect the top canvas at default zoom
1081
- and move any frame whose label, connector, or annotation crosses another frame.
1082
-
1083
- **Board-unit spacing defaults.** The canvas coordinate system uses approximately 2 board units per screen pixel. \`browser\` frames occupy roughly 700 × 600 board units; \`desktop\` frames roughly 900 × 700 board units. Apply these minimum x/y gaps when placing frames explicitly — any less and frames will touch or overlap:
1084
-
1085
- - x-gap between \`browser\` frames: **≥ 1100** (700-unit frame + 400-unit gutter)
1086
- - x-gap between \`desktop\` frames: **≥ 1300** (900-unit frame + 400-unit gutter)
1087
- - y-gap between rows of any surface: **≥ 1400** (includes frame height + section header + buffer)
1088
-
1089
- When in doubt, use larger values — the canvas auto-zooms to fit everything.
1090
-
1091
- **Canvas annotations are designer notes on the artboard.** When a top canvas is
1092
- present, sprinkle design-review notes near the frames they explain: a short
1093
- heading, supporting text, and bullets — plain text layers, never bordered or
1094
- shadowed cards, and never a box around a frame. The renderer spaces notes away
1095
- from frames, so place each note by the frame it describes. Use an arrow only to
1096
- point at one specific control or transition; for a broad frame-level note, write
1097
- text beside the frame with no connector. Connectors are for real sequences only —
1098
- never fake "Step 1 → Step 2" lines between independent states.
1099
-
1100
- **Do not create overlapping annotations.** Anchor each ordinary note to the
1101
- frame it explains with \`targetId\` + \`placement\` (top/right/bottom/left), and
1102
- omit \`type\` or use \`type: "note"\`. The renderer parks notes in a gutter beside
1103
- the frame and lays them out automatically. Do not use \`type: "callout"\`,
1104
- \`type: "text"\`, \`type: "arrow"\`, x/y, or points for ordinary notes; those are
1105
- freeform review-markup layers and must be reserved for intentional markup in
1106
- open canvas space. Reserve arrows for a note that must point at one specific
1107
- control inside a frame; a note that simply sits beside its frame needs no arrow.
1108
-
1109
- **Patching.** Edit one wireframe, canvas annotation, diagram, or block with targeted \`contentPatches\`
1110
- (for example \`patch-wireframe-html\`, \`patch-diagram-html\`, \`update-block\`,
1111
- \`replace-blocks\`, \`update-canvas-annotation\`) rather
1112
- than regenerating the whole plan. \`contentPatches\` are part of the public MCP
1113
- action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
1114
- edits. If an agent is working from exported source files, use
1115
- \`read-visual-plan-source\` / \`patch-visual-plan-source\`: \`plan.mdx\` holds
1116
- frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
1117
- \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
1118
- patch action normalizes the MDX back into the same JSON runtime model. JSON is
1119
- the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
1120
- In the browser, humans edit \`rich-text\` prose inline; agents should still use
1121
- \`update-rich-text\` content patches or source patches for prose, and use
1122
- comments/structured patches for canvas, artboard, wireframe, and diagram edits.
1123
- Never send a partial top-level \`content\` object as a shortcut to add a canvas,
1124
- frame, or block: \`content\` is a full structured replacement, so omitted blocks
1125
- or surfaces can disappear. If a full replacement is truly unavoidable, read the
1126
- complete source/JSON first, include every existing block and surface in the new
1127
- payload, and verify the source/export immediately after the update.
1128
-
1129
- **Never emit a titled artboard with no interior wireframe content.** Every artboard
1130
- you place on the canvas must carry an \`html\` wireframe or reference a wireframe
1131
- block via \`blockId\`; when using \`blockId\`, the referenced \`wireframe\` /
1132
- \`legacy-wireframe\` block must remain in the plan. If you remove a duplicate
1133
- wireframe from the document body, first move its \`data\` inline onto the
1134
- corresponding \`content.canvas.frames[*].wireframe\` / \`legacyWireframe\`. A
1135
- label-only frame or a frame pointing at a deleted block renders empty and is
1136
- rejected at parse time. If you only have a title, write it as a section header or
1137
- annotation, not an empty artboard.
1138
-
1139
- **UI mockups belong in the top visual review area.** Static UI/product visuals
1140
- live on the canvas; multi-step UI flows get both canvas wireframes and a
1141
- prototype. When the user asks for a mockup, UI state, loading state, layout,
1142
- screen, or visual comparison, make the canvas the primary home for that static
1143
- visual. When the user asks for a prototype or the plan contains a sequence the
1144
- reviewer must feel, keep the canvas artboards and add \`content.prototype\` so the
1145
- top surface shows Wireframes / Prototype tabs. Architecture/code diagrams stay
1146
- inline in the document (the SKILL.md Visual Surface Choice section owns that
1147
- rule) unless the user explicitly asks for a spatial board. Document blocks
1148
- can explain, compare, or map implementation, but they should not host the
1149
- primary UI mockup or prototype just because \`custom-html\`, screenshots, or prose
1150
- are easier to produce. If the canvas/prototype surface cannot represent the
1151
- requested UI fidelity, still keep the closest top-surface representation and
1152
- call out or extend the needed renderer capability. A skeleton/loading mockup
1153
- also lives in a canvas artboard — never move a mockup out of the canvas.
1154
-
1155
- **Storyboards are canvas artifacts, not document diagrams.** When the requested
1156
- output is a product flow, onboarding journey, "light storyboard", or canvas
1157
- wireframe, author the flow as multiple top-canvas artboards with real screen
1158
- content and neighboring connectors. Keep document-body \`diagram\` blocks for
1159
- architecture and mechanics that are not themselves user-visible screens. A
1160
- storyboard made from a single inline HTML diagram is the wrong surface.
1161
-
1162
- For abstract product concepts, use the canvas to create the first "I get it"
1163
- moment: one real app state near the top showing how the concept appears to a
1164
- user, followed by separate annotations or diagrams for mechanics. Do not make
1165
- the first artboard a hybrid of app UI and architecture notes; the app screen
1166
- should be inspectable as product UI on its own.
1167
-
1168
- **Legacy kit tree.** Older plans set a \`screen\` array of \`{ el, ...props }\` kit
1169
- nodes instead of \`html\`; the renderer still accepts and displays it so saved
1170
- plans round-trip, but new plans emit \`html\`. Do not author fresh kit-tree
1171
- screens, and do not put nested kit components such as \`<FrameScreen>\`, \`<Card>\`,
1172
- \`<Row>\`, \`<Title>\`, or \`<Btn>\` inside a canvas \`<Screen>\`. A new canvas artboard
1173
- with kit-tree children is a defect: replace it with
1174
- \`<Screen surface="..." html={...} />\` using the HTML wireframe rules. The HTML
1175
- path is the one that gets the renderer-owned surface sizing, theme tokens,
1176
- sketch/clean toggle, and safe text layout used by good document-body
1177
- wireframes. Likewise, old or imported plans may carry coordinate-based regions
1178
- or free-float x/y on notes; those are legacy escape hatches the renderer still
1179
- shows but you must never produce. The gutter parks notes by \`targetId\` +
1180
- \`placement\`, and the coordinate rule at the top of this file governs all
1181
- new-plan placement.
1182
-
1183
- <!-- SHARED-CORE:canvas-surface END -->`;
1184
- const DOCUMENT_QUALITY_CORE = `<!-- SHARED-CORE:document-quality START -->
1185
-
1186
- **The document is a serious technical plan, not marketing.** Write it the way a
1187
- strong Claude or Codex implementation plan reads: outcome-first, prose-first,
1188
- self-contained, and specific. State the objective and what "done" means, the
1189
- scope and non-goals, the proposed approach with the key decisions and their
1190
- rationale, ordered steps that name real files, symbols, actions, and data
1191
- shapes, the risks, and a closing verification step (tests, build, or a checkable
1192
- behavior). Replace vague prose with specifics; never ship a step like "make it
1193
- work." No hero art, gradients, logos, nav bars, slogans, value props, giant
1194
- landing-page headings, or marketing cards unless the user explicitly asks.
1195
-
1196
- **Every published plan must stand alone.** Even when the agent is revising an
1197
- existing plan, the output is a plan to do the work, not a changelog of the
1198
- conversation. Do not write phrases like "preserve the previous plan", "do not
1199
- drop the old idea", "as discussed above", "this revision", "unlike the prior
1200
- version", or "correction from the earlier plan". Fold the right decisions into
1201
- the plan as normal objective, architecture, scope, and roadmap prose. A reviewer
1202
- who opens the plan from a link with no chat history should understand it. Avoid
1203
- negative framing that only makes sense against absent context ("not the old
1204
- mode", "not just X") unless the contrast is defined in the plan and genuinely
1205
- helps; state the positive model directly.
1206
-
1207
- **Make abstract plans instantly legible.** If the idea is broad, strategic, or
1208
- intended for a third-party reviewer, put one concrete product snapshot near the
1209
- top before dense architecture, mode tables, manifests, or roadmaps. For
1210
- UI-capable concepts, that snapshot is usually a top-canvas app state plus a
1211
- short paragraph that says what the user sees and what changes under the hood.
1212
- Then put mechanics, data flow, sync boundaries, and implementation detail in
1213
- separate diagrams or document sections.
1214
-
1215
- **Preserve the user's level of abstraction.** A motivating use case is not
1216
- automatically the architecture. When the prompt describes a broader framework,
1217
- product mode, or reusable primitive, separate the reusable core from specific
1218
- apps, providers, customers, scripts, or launch examples. Use the concrete
1219
- example to make the plan understandable, then make clear which parts are core,
1220
- which are app-specific adapters, and which are future examples.
1221
-
1222
- **When top visuals exist, they and the document never duplicate each other.**
1223
- For UI work, the UI story lives in the top visual surface: canvas artboards for
1224
- static inspection, plus prototype tabs when the flow should be functional. The
1225
- document carries the technical depth the visuals cannot show — concrete
1226
- file/symbol maps, API and data contracts, code snippets, migration or
1227
- implementation phases, risks, and validation. For architecture/code reviews,
1228
- invert that: the document is the visual surface, and each recommendation
1229
- carries its own nearby inline \`diagram\` / \`data-model\` block plus file
1230
- evidence (the \`diagram\` bullet below owns how to author those diagrams).
1231
- Repeat a wireframe in the document only for a genuinely new detail view or
1232
- comparison. Skip the visual surface entirely for non-visual work and write a
1233
- clean rich document. For a simple binary UI visual choice, show the two
1234
- directions in the canvas only; do not repeat the same options as body
1235
- wireframes or prose. Put the actual choice in the bottom "Open Questions" form.
1236
-
1237
- **Use the right block, and make it carry substance.** For the authoritative,
1238
- machine-checked list of block types and their data schemas, call \`get-plan-blocks\`
1239
- — it returns the live registry vocabulary (type, MDX tag, placement, key fields)
1240
- so you never emit a block the editor cannot render or round-trip:
1241
-
1242
- - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
1243
- - \`annotated-code\` for the file map: when a load-bearing file is worth
1244
- highlighting, prefer the annotated walkthrough over a bare \`code\` block — carry
1245
- the real, syntax-highlighted code AND anchor short margin notes to the lines
1246
- that actually change (the new action, the changed schema, the wiring point), so
1247
- the reader sees what matters and why instead of code for code's sake. Each
1248
- annotation is \`{ lines: "12" | "12-18"; label?; note }\`; keep a few high-signal
1249
- notes per file, not one per line. Highlight only the files worth reading; never
1250
- an exhaustive list of every touched file, and never a prose-only description of
1251
- a file. Drop to a plain \`code\` block only for a throwaway snippet with nothing
1252
- to call out. When more than one file matters, group the blocks in a vertical
1253
- \`tabs\` block (the standard tab primitive) rather than a bespoke container. If
1254
- the exact code is unknown, show the smallest plausible planned shape or a
1255
- commented stub naming what to fill in. (\`code-tabs\` and \`implementation-map\`
1256
- are legacy: their renderers stay for old plans, but do not author new ones.)
1257
- - For a decision: if the reviewer must still pick between a genuinely-open
1258
- either/or, put it in the bottom Open Questions \`question-form\` as a \`single\`
1259
- question — one option per real alternative, each with a short detail and
1260
- \`recommended: true\` on the one you would choose; do not also restate the same
1261
- choice elsewhere. If you have already committed to an approach, state it as
1262
- settled prose or a \`callout\` with \`tone="decision"\`, optionally with a
1263
- \`columns\` block for a side-by-side comparison of the options you weighed — not
1264
- as a confusing mid-document form for a question you have already answered.
1265
- - \`columns\` for side-by-side before/after or current/target comparisons where
1266
- each side needs real nested blocks; label the columns clearly and avoid
1267
- stacking comparison blocks vertically when parallel reading is the point.
1268
- - \`diagram\` for two-dimensional architecture, dependency, data-flow, or state
1269
- relationships, only when it clarifies something real. Prefer standard
1270
- two-dimensional layouts — paired before/after panels, layered diagrams,
1271
- swimlanes, dependency maps, matrices, or grouped regions; do not default to
1272
- left-to-right chains, and use a line only when the relationship is truly a
1273
- sequence. Do not use a body \`diagram\` as the primary artifact for a requested
1274
- product canvas, light storyboard, UI flow, screen flow, or wireframe; those
1275
- belong in the top canvas as artboards with \`Screen\` wireframes first. Use
1276
- diagrams below that canvas only for architecture, data flow, or implementation
1277
- mechanics. For architecture/code
1278
- diagrams, prefer \`data.html\` / \`data.css\` with semantic HTML and inline SVG so
1279
- the diagram can use panels, layers, matrices, arrows, annotations, and
1280
- responsive layout directly. Author diagram HTML with renderer-owned primitives
1281
- like \`.diagram-panel\`, \`.diagram-card\`, \`.diagram-node\`, \`.diagram-box\`,
1282
- \`.diagram-pill\`, \`.diagram-muted\`, and \`[data-rough]\`; they map to the plan's
1283
- Tailwind theme variables through \`--wf-ink\`, \`--wf-muted\`, \`--wf-line\`,
1284
- \`--wf-paper\`, \`--wf-card\`, \`--wf-accent\`, \`--wf-accent-soft\`, \`--wf-warn\`, and
1285
- \`--wf-ok\`, and switch to Excalifont plus rough.js outlines in sketchy mode. Do not
1286
- set \`font-family\` and do not hard-code hex, rgb, or hsl colors in diagram HTML
1287
- or CSS. Choose the outer \`frame\` intentionally: use \`show\` when the diagram
1288
- stands alone in a recap, comparison, or prose section; use \`hide\` when the
1289
- diagram sits inside docs chrome, columns, tabs, cards, a canvas surface, or
1290
- already has visible \`.diagram-panel\` / \`.diagram-box\` structure. Leave room
1291
- for the sketch font: keep labels short, give nodes generous width, and place
1292
- boundary/annotation labels in unused space instead of over nodes; labels must
1293
- not overlap nodes, connectors, or each other. For small text/SVG changes to an
1294
- existing HTML diagram, use \`patch-diagram-html\` with a unique
1295
- \`find\`/\`replace\` snippet instead of resending the whole \`data.html\` string.
1296
- Use legacy \`nodes\` / \`edges\` only for small previews or truly
1297
- sequential flows. In architecture/code plans, prefer a repeated section rhythm:
1298
- recommendation title, confidence and category badges, code-path evidence, a
1299
- local before/after or current/target spatial diagram, then concise
1300
- Problem/Solution/Why text.
1301
- - \`tabs\` for multiple states, directions, or comparisons. A tab that reveals
1302
- only prose usually means the plan is under-specified — include a relevant
1303
- visual unless the tab is intentionally document-only.
1304
- - \`table\`, \`checklist\`, \`callout\` for scannable structure.
1305
-
1306
- **Open questions live at the bottom as a form when answers would change the
1307
- plan.** Surface answerable unresolved decisions in a final \`question-form\`
1308
- block titled "Open Questions" so the renderer presents it as a distinct section.
1309
- That bottom form is the ONLY place that enumerates the open questions: never add
1310
- a second "Open Questions" heading, list, or recap of the same questions earlier
1311
- in the document. A one-line pointer in the overview prose ("a few decisions are
1312
- still open — see Open Questions below") is fine, but do not reproduce the
1313
- question list or a parallel questions/decisions section above it.
1314
- Use \`single\` or \`multi\` for clear choices, \`freeform\` for constraints,
1315
- \`recommended: true\` for the default you would pick, and option \`wireframe\` /
1316
- \`diagram\` previews only when the options are not already visible in the top
1317
- canvas. \`single\` and \`multi\` questions always render a write-in field so a
1318
- reviewer can answer with a custom option — never add an explicit "Other" option
1319
- yourself; set \`allowOther: false\` only when a free-text answer makes no sense.
1320
- Keep non-answerable assumptions or risks as concise \`callout\` blocks in
1321
- the relevant section. Never bury a questions/decisions wall inside the plan
1322
- narrative, and never ask the same question twice.
1323
-
1324
- For complex plans, do not end without an open-question audit. If architecture,
1325
- scope, UX, data shape, rollout, provider mapping, or ownership still depends on
1326
- a choice, either commit to a recommendation with rationale or add it to the
1327
- bottom form with a recommended default. A complex plan with no open questions is
1328
- fine only when every meaningful decision has been explicitly made.
1329
-
1330
- **Verification must exercise the real workflow.** The final verification section
1331
- should go beyond typecheck/unit tests when the plan changes UI, local files,
1332
- sync, providers, browser behavior, or multi-app flows. Include at least one
1333
- end-to-end smoke that matches the user journey, such as a fresh repo/folder,
1334
- real manifest or data fixture, browser interaction, save/sync action, and an
1335
- on-disk or database assertion. Name the command or manual browser path when it
1336
- is known.
1337
-
1338
- **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
1339
- inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a generic
1340
- placeholder, density demo, or proof that custom HTML works. Prefer the native
1341
- blocks for normal plans. For architecture/code reviews, use \`diagram\`
1342
- \`data.html\` / \`data.css\` for rich local HTML/SVG diagrams instead of
1343
- \`custom-html\`. For UI/product work, \`custom-html\` is never the primary home for a
1344
- requested mockup, UI state, or visual comparison. If UI fidelity requires
1345
- HTML/CSS, image capture, or real React/CSS, the product fix is canvas support
1346
- for that artifact type, not moving the mockup into the document.
1347
- When \`custom-html\` is genuinely needed, author it against the sandbox-provided
1348
- theme tokens (\`--wf-paper\`, \`--wf-card\`, \`--wf-ink\`, \`--wf-muted\`,
1349
- \`--wf-line\`, \`--wf-radius\`, and the matching \`--plan-*\` aliases). Do not hardcode
1350
- hex/rgb/hsl light palettes such as white cards with dark ink; the same fragment
1351
- must read in dark mode without a plan-specific patch.
1352
-
1353
- **Before handoff, open the plan and check it.** Fix overlap, excessive
1354
- whitespace, clipped fragments, misleading inactive controls, poor contrast, and
1355
- unreadable diagrams before asking for approval. Check the top canvas in the
1356
- current Plan theme, especially dark mode: white mockup panels, low-contrast
1357
- muted text, or invisible controls are defects. If a frame only works in one
1358
- theme, rewrite the HTML with \`--wf-*\` tokens and semantic helper classes before
1359
- surfacing the plan.
1360
-
1361
- <!-- SHARED-CORE:document-quality END -->`;
1362
- const EXEMPLAR_CORE = `<!-- SHARED-CORE:exemplar START -->
1363
-
1364
- **GOOD.** A UI-first plan for a todo app: a canvas with a \`desktop\` artboard whose
1365
- \`data.html\` is a real flex layout — a sidebar of links (\`Inbox 12\`, \`Today 4\`,
1366
- \`Done\`), a main column with an \`<h1>Today</h1>\`, accent \`.wf-pill\`s for the
1367
- filters, a muted section label \`OVERDUE\`, and \`.wf-card\` task rows carrying real
1368
- titles, due dates, and a primary \`button.primary\` — styled only through bare
1369
- elements, helper classes, and \`--wf-*\` tokens, so the renderer applies the
1370
- correct desktop footprint, theme, and one subtle whole-frame wobble. Plain-text
1371
- designer notes sit spaced off the frame, pointing only at the controls that need
1372
- explanation. Below it, a Claude/Codex-grade document: objective and
1373
- done-criteria, a few \`code\` blocks (grouped in a vertical \`tabs\` block when
1374
- more than one) showing the real shape of the load-bearing files, a \`callout\`
1375
- with \`tone="decision"\` stating the chosen approach with a \`columns\` block
1376
- weighing the two real options behind it,
1377
- and a validation step — none of it repeating the canvas. If the task also
1378
- changes a multi-step completion flow, the same top area includes a Prototype tab
1379
- whose screens use the same labels and states as the canvas artboards, with
1380
- \`data-goto\` controls for the sequence. This is the bar.
1381
-
1382
- **GOOD.** A broad product-architecture plan opens with a plain recommendation
1383
- and one concrete app state before the abstraction. The first canvas artboard is
1384
- pure product UI that matches the current app shell; nearby notes explain the
1385
- user-visible delta. A separate diagram below shows the mechanics, such as file
1386
- or data flow. The document then separates the reusable core from app/provider
1387
- adapters and examples, covers contracts, folder or schema shape, sync
1388
- boundaries, roadmap, non-goals, a bottom Open Questions form for unresolved
1389
- decisions, and a verification section with at least one realistic end-to-end
1390
- smoke. A reviewer who was not in the chat gets the idea from the top snapshot
1391
- before reading the technical plan.
1392
-
1393
- **GOOD.** A \`/visual-plan\` for a backend architecture review: no top canvas.
1394
- The document opens with context and a legend, then repeats recommendation cards:
1395
- title, confidence/category badges, a monospace grid of real file paths, one
1396
- inline two-dimensional before/after or layered architecture diagram, and terse
1397
- Problem/Solution/Why bullets using the codebase's vocabulary. The diagram uses
1398
- space to show boundaries, layers, and ownership; it is not a default
1399
- left-to-right chain. The plan ends with a top recommendation and a bottom
1400
- question-form only if the next architecture direction is genuinely open. This is
1401
- better than a top canvas because each diagram is local to the claim it supports.
1402
-
1403
- **BAD.** A \`data.html\` with hard-coded hex colors, a \`font-family\`, or fixed
1404
- pixel width/height; gray placeholder bars "insinuating" text on a non-skeleton
1405
- frame; a forced desktop + mobile pair for a popover; floating bordered
1406
- annotation cards hugging the frames; a fresh hand-authored kit-tree \`screen\`
1407
- instead of \`html\`; a multi-step UI flow with only static frames and no prototype
1408
- tab; a mockup escaped into a document \`custom-html\` block; and a marketing-style
1409
- document with a hero heading and value props that just restates what the canvas
1410
- already shows. Also bad: an architecture-only plan forced into a top canvas of
1411
- labeled boxes with overlapping text, where the actual code evidence and
1412
- recommendations live elsewhere; a product wireframe that mixes a real screen
1413
- with repo names, file-contract arrows, architecture explanations, or a made-up
1414
- permanent inspector; and a plan that describes itself as a revision of a prior
1415
- conversation instead of a standalone proposal. Never produce this.
1416
-
1417
- <!-- SHARED-CORE:exemplar END -->`;
1418
- // Progressive-disclosure reference files. Like `WIREFRAME_REFERENCE_MD`, each of
1419
- // the canvas / document-quality / exemplar cores is the single source of truth
1420
- // for its topic and is materialized verbatim into a sibling `references/*.md`
1421
- // file in the visual-plan skill dir instead of being interpolated inline into
1422
- // the SKILL.md body. The body carries only the matching `*_REFERENCE_POINTER`.
1423
- // Keeping each reference body byte-identical to its core (markers included) lets
1424
- // the sync guard assert the on-disk copies never drift from the constant.
1425
- export const CANVAS_REFERENCE_MD = `# Canvas & artboard placement — single source of truth
1426
-
1427
- This file is the canonical guide for how the visual-plan canvas works: artboard
1428
- placement, lane layout, annotations, patching, and the legacy kit tree. Read it
1429
- in full before authoring or editing any canvas/artboard content; do not author
1430
- canvas layouts from memory or paraphrase these rules per mode.
1431
-
1432
- ${CANVAS_SURFACE_CORE}
1433
- `;
1434
- export const DOCUMENT_QUALITY_REFERENCE_MD = `# Plan document quality — single source of truth
1435
-
1436
- This file is the canonical quality bar for the plan document below the canvas:
1437
- how it reads, which blocks to use, how open questions are surfaced, and the
1438
- pre-handoff check. Read it in full before authoring the plan document; it is the
1439
- quality bar. Do not write the document from memory or paraphrase these rules per
1440
- mode.
1441
-
1442
- ${DOCUMENT_QUALITY_CORE}
1443
- `;
1444
- export const EXEMPLAR_REFERENCE_MD = `# Good vs. bad exemplar — single source of truth
1445
-
1446
- This file is the canonical worked example of a great plan (and the anti-patterns
1447
- to avoid). Read it alongside the document-quality and canvas references before
1448
- authoring a plan; it is the bar these plans must clear.
1449
-
1450
- ${EXEMPLAR_CORE}
1451
- `;
1452
- // Short pointers that replace the inline canvas / document-quality / exemplar
1453
- // cores in the SKILL.md body. Authoring detail lives in the sibling reference
1454
- // files so the SKILL.md stays lean (progressive disclosure); the agent loads the
1455
- // detail on demand.
1456
- const CANVAS_REFERENCE_POINTER = `The canvas is the single source of truth for static UI mockups: the \`surface\`
1457
- locks each artboard's footprint, mixed surfaces lay out
1458
- in lanes, annotations are plain-text designer notes anchored by
1459
- \`targetId\`/\`placement\`, and edits are surgical \`contentPatches\`. Before
1460
- authoring or editing ANY canvas, artboard, or annotation, READ
1461
- \`references/canvas.md\` in this skill directory — it is the single source of truth
1462
- for canvas/artboard mechanics. Do not author canvas layouts from memory.`;
1463
- const DOCUMENT_QUALITY_REFERENCE_POINTER = `The document is a serious technical plan, not marketing: outcome-first,
1464
- prose-first, self-contained, built from the right native blocks, with open
1465
- questions in a single bottom \`question-form\` and a pre-handoff visual check.
1466
- Before authoring the plan document, READ \`references/document-quality.md\` in this
1467
- skill directory — it is the single source of truth for the document quality bar.
1468
- Do not write the document from memory.`;
1469
- const EXEMPLAR_REFERENCE_POINTER = `For a worked example of the bar — a great UI-first plan and \`/visual-plan\`, plus
1470
- the anti-patterns to avoid — READ \`references/exemplar.md\` in this skill
1471
- directory before authoring a plan.`;
1472
- export const CONNECTION_REFERENCE_MD = `# Connecting & publishing — single source of truth
1473
-
1474
- This file is the canonical rule for the never-inline deliverable, finding the
1475
- Plan MCP connector, and restoring it when its tools are missing. It is shared
1476
- word for word by \`/visual-plan\` and \`/visual-recap\`. Read it when you are about
1477
- to publish, or whenever a connector or auth error appears; do not improvise an
1478
- inline fallback from memory.
1479
-
1480
- <!-- SHARED-CORE:connection START -->
1481
-
1482
- **The deliverable is ALWAYS a published Agent-Native Plan, never inline chat
1483
- content.** Do not hand the plan or recap to the user as Markdown prose, an ASCII
1484
- sketch, a table, a fenced "wireframe", or a "here's the summary" paragraph. The
1485
- entire value is the hosted, interactive, annotatable Plan; an inline summary is
1486
- the thing a Plan replaces, not a degraded version of one. The only supported
1487
- output is to publish through the Plan MCP connector and return its absolute URL.
1488
- Local-files privacy mode (\`references/local-files.md\`) is the one exception.
1489
-
1490
- **The connector is usually the \`plan\` server**, but older installed agents may
1491
- expose the same hosted connector as \`agent-native-plans\` — both names are valid,
1492
- so never report the connector as missing just because it is named
1493
- \`agent-native-plans\` instead of \`plan\`. Some clients also lazy-load connector
1494
- tools through a deferred tool registry instead of showing the namespace upfront.
1495
- Before declaring the connector missing, search/load tools with the host's
1496
- discovery surface (\`tool_search\` when available) for \`create_visual_plan\`,
1497
- \`create_visual_recap\`, or \`get_plan_blocks\`, then use the tools it exposes.
1498
-
1499
- **If the tools are still missing after discovery, do NOT fall back to inline
1500
- output.** The usual cause is a connector that did not finish connecting this
1501
- session (it registers zero tools), NOT necessarily an auth problem — so do not
1502
- assume the user must re-authenticate. Stop and give the user the exact restore
1503
- step for their current client:
1504
-
1505
- - **Codex / Codex Desktop:** run
1506
- \`npx -y @agent-native/core@latest reconnect https://plan.agent-native.com --client codex\`
1507
- and start a new Codex session.
1508
- - **Claude Code:** run \`/mcp\` and choose Authenticate/Reconnect, or run the same
1509
- reconnect command with \`--client claude-code\` and restart Claude.
1510
-
1511
- The same applies when a Plan tool returns \`needs auth\`, \`Unauthorized\`, or
1512
- \`Session terminated\`: stop retrying the tool and give the reconnect step instead.
1513
-
1514
- Auth is stored per client config/session, so one client's reconnect does not make
1515
- another running client load tools. \`--client all\` refreshes every local client
1516
- config that already has the Plan entry, but each running client still has to
1517
- reload its MCP tools afterward. Reconnect re-authenticates WITHOUT reinstalling
1518
- and finds the entry by URL regardless of connector name — never reinstall from
1519
- scratch just to fix auth. Publish once the tool is reachable. Falling back to
1520
- inline content is a defect, not a degraded mode.
1521
-
1522
- <!-- SHARED-CORE:connection END -->
1523
- `;
1524
- export const LOCAL_FILES_REFERENCE_MD = `# Local-files privacy mode — single source of truth
1525
-
1526
- This file is the canonical contract for fully local, no-database planning and
1527
- recaps. It is shared word for word by \`/visual-plan\` and \`/visual-recap\`. Read it
1528
- in full before using local-files mode; do not call any hosted Plan tool for a
1529
- local plan/recap except the schema-only block-catalog lookup described below.
1530
-
1531
- <!-- SHARED-CORE:local-files START -->
1532
-
1533
- **When to use it.** Use local-files privacy mode when the user explicitly asks
1534
- for no DB writes, no hosted Plan database writes, no Plan MCP publish, fully local
1535
- files, offline/private work, or repo-owned/source-controlled artifacts, or when
1536
- \`AGENT_NATIVE_PLANS_MODE=local-files\` is set. Also use it when a user or repo
1537
- policy says the work must stay under their own brand, domain, source control, or
1538
- infrastructure. In this mode the plan/recap data must never be sent to the Plan
1539
- MCP server or the Plan app action surface. This is the only exception to the
1540
- always-publish rule in \`references/connection.md\`.
1541
-
1542
- The local-files contract:
1543
-
1544
- - **Read context locally.** Read source, diff, and stat context from local files
1545
- and shell commands only. For recaps, the
1546
- \`npx @agent-native/core@latest recap collect-diff\`, \`scan\`, and
1547
- \`build-prompt --local-files\` helpers are safe — they operate on local files and
1548
- do not write to the Plan database.
1549
- - **Fetch the block catalog first** (it sends no plan content). Use the MCP
1550
- \`get-plan-blocks\` tool if it is already available, or run
1551
- \`npx @agent-native/core@latest plan blocks --out plan-blocks.md\` and read that
1552
- file before authoring MDX; it calls the public no-auth \`get-plan-blocks\` route.
1553
- Use \`--format schema\` when you need exact nested fields. If network access is
1554
- unavailable, use the bundled \`references/*.md\` and rely on \`plan local check\` to
1555
- catch invalid tags. Copy the catalog examples verbatim for the fields the
1556
- registry table cannot encode: \`checklist\` items need \`id\` and \`label\`;
1557
- \`question-form\` questions need \`id\`, \`title\`, and \`mode\`, and each option needs
1558
- \`id\` and \`label\`; and \`Code\` / \`AnnotatedCode\` / \`Diff\` are whitespace-sensitive
1559
- — encode multiline code as JSON string attributes such as \`code={"const x =\\n y"}\`
1560
- (a static template literal is accepted only when it has no \`\${...}\`
1561
- interpolation). \`plan local check\` is a quick OFFLINE lint (a subset of the
1562
- renderer schema), so a green \`check\` does not guarantee the plan renders;
1563
- \`plan local verify\` is the authoritative validation against the real renderer
1564
- schema.
1565
- - **Write a local MDX folder.** Use \`plans/<slug>/\` to check the artifact into the
1566
- repo, or a repo-ignored/temporary folder such as \`.agent-native/plans/<slug>/\`
1567
- or \`/tmp/agent-native-plans/<slug>/\` when it should not be checked in. The
1568
- folder holds \`plan.mdx\`, optional \`canvas.mdx\`, optional \`prototype.mdx\`, and
1569
- optional \`.plan-state.json\`. For a recap, set \`kind: "recap"\` and
1570
- \`localOnly: true\` in the frontmatter/state. Use that exact folder as
1571
- \`<plan-dir>\` in every command below.
1572
- - **Check, then serve.** Run
1573
- \`npx @agent-native/core@latest plan local check --dir <plan-dir>\` before any
1574
- preview, then
1575
- \`npx @agent-native/core@latest plan local serve --dir <plan-dir> --kind <plan|recap> --open\`
1576
- (use \`--kind plan\` for plans, \`--kind recap\` for recaps). Report the local
1577
- bridge URL from stdout or \`<plan-dir>/.plan-url\`; treat \`.plan-url\` as a local
1578
- token file and do not commit it. The URL opens the hosted Plan UI but reads from
1579
- the localhost bridge on this machine, so it is not shareable across machines. On
1580
- macOS \`--open\` prefers Chromium browsers; if Safari opens, switch to
1581
- Chrome/Chromium because Safari can block the hosted HTTPS page from fetching the
1582
- HTTP localhost bridge. If the Plan app itself is running locally with the same
1583
- \`PLAN_LOCAL_DIR\`, the \`/local-plans/<slug>\` route is also valid. In a truly
1584
- offline environment, hand off the \`<plan-dir>\` path after \`plan local check\` and
1585
- note that interactive preview requires network access to the hosted Plan UI or a
1586
- running local Plan app.
1587
- - **Headless verify.** Run
1588
- \`npx @agent-native/core@latest plan local verify --dir <plan-dir> --kind <plan|recap>\`.
1589
- It starts the bridge, checks the private-network preflight and JSON payload, AND
1590
- validates the content against the real renderer schema via the Plan app's
1591
- \`validate-local-plan-source\` action. A non-\`ok\` result with
1592
- \`validation.valid: false\` lists the renderer's exact schema-path issues (e.g.
1593
- \`blocks[1].data.tabs[0]...\`); fix those before handing off. If \`validation.ran\`
1594
- is \`false\`, the Plan app did not expose the validate endpoint (older/unreachable
1595
- deploy) — point \`--app-url\` at a current Plan app (e.g. a local
1596
- \`http://localhost:8096\`) for the authoritative check. If the browser hangs on
1597
- "Loading plan", fetch the \`bridgeUrl\` from the verify/serve JSON to read the
1598
- concrete validation error.
1599
- - **Never call hosted tools for that plan/recap.** Do not call
1600
- \`create-visual-plan\`, \`create-ui-plan\`, \`create-prototype-plan\`,
1601
- \`create-plan-design\`, \`create-visual-recap\`, \`create-visual-questions\`,
1602
- \`import-visual-plan-source\`, \`update-visual-plan\`, \`patch-visual-plan-source\`,
1603
- \`get-plan-feedback\`, \`export-visual-plan\`, \`set-resource-visibility\`, or any
1604
- other hosted Plan tool — except the schema-only block-catalog lookup above.
1605
- - **Feedback is file/chat feedback.** Update the MDX files directly, rerun
1606
- \`plan local check\`, and rerun \`serve\` or \`verify\` when that preview path is
1607
- available. Summarize the new local URL when one exists; otherwise summarize the
1608
- checked \`<plan-dir>\` path. Hosted comments, sharing, screenshots, history, usage
1609
- attachment, and publish/export receipts are unavailable until the user
1610
- explicitly opts into publishing.
1611
-
1612
- Local-files mode only prevents plan/recap content from reaching the Agent-Native
1613
- Plan database. It does not by itself make the coding agent's language model local;
1614
- for that stronger boundary the host agent/model must also be local or otherwise
1615
- approved by the user.
1616
-
1617
- <!-- SHARED-CORE:local-files END -->
1618
- `;
1619
- export const VISUAL_PLANS_SKILL_MD = `---
1620
- name: visual-plan
1621
- description: >-
1622
- Turn ordinary text plans into rich interactive visual plans with diagrams,
1623
- file maps, annotated code, open questions, and UI/prototype review when
1624
- useful.
1625
- metadata:
1626
- visibility: exported
1627
- ---
1628
-
1629
- # Agent-Native Plans
1630
-
1631
- Agent-Native Plans is structured visual planning mode for coding agents. Build
1632
- the plan you would normally write in Markdown, but as a scannable document with
1633
- editable blocks mixed in: inline diagrams, code snippets,
1634
- open questions, and an optional top visual review area (wireframe canvas, live
1635
- prototype, or both in tabs). Architecture and backend plans stay document-only;
1636
- UI and product plans start with the top canvas/prototype (the Visual Surface
1637
- Choice section owns that rule).
1638
-
1639
- \`/visual-plan\` is the packaged command and main entry point. Choose the review
1640
- mode from the task: UI-first when the work is primarily product UI and review
1641
- should start with screens, prototype-first when review should start with a
1642
- functional live prototype, design-first when review needs full-fidelity branded
1643
- screens, or visual-intake when the user explicitly wants a questionnaire before
1644
- planning. When a Codex, Claude Code, Markdown, or pasted plan already exists,
1645
- \`/visual-plan\` uses that source plan as the starting point and builds the review
1646
- surface from it instead of starting over.
1647
-
1648
- ## When To Use
1649
-
1650
- Create or adapt a visual plan whenever the plan would be better as a reviewable
1651
- artifact than a chat paragraph. This includes modest work such as a single UI
1652
- surface with states, a small workflow, a before/after product change, or a
1653
- component/API/data-shape decision that needs alignment, plus larger multi-file,
1654
- ambiguous, long-running, risky, or UI-heavy work. Use it when architecture /
1655
- data flow / UI direction / options / open questions would benefit from inline
1656
- diagrams or structured blocks, when the user needs to react to a direction
1657
- before you implement, or when an existing text plan needs a richer review
1658
- surface.
1659
-
1660
- ## Plan Discipline
1661
-
1662
- - **Gate thoughtfully.** A visual plan is a richer review surface, not only a
1663
- tool for giant projects. Use it when the user needs to see, compare, comment
1664
- on, or approve a direction before code, even for a modest UI/state/workflow
1665
- change. Skip it for truly trivial, unambiguous work — typos, one-line fixes, a
1666
- single well-specified function, anything whose diff you could describe in one
1667
- sentence — and just make the change. Never pad a plan with filler and never
1668
- ship a single-step plan.
1669
- - **Research before you draft.** Read the real files, actions, schema, and
1670
- patterns first; name actual files, symbols, and data shapes instead of
1671
- inventing them. Check existing \`actions/\` before proposing endpoints and prefer
1672
- named client helpers over raw fetch. Delegate wide exploration to a sub-agent.
1673
- Lead with reuse: for each step, name what it reuses — existing actions, schema,
1674
- components, helpers — before what it adds, so the plan explains the genuinely new
1675
- delta instead of redescribing what already exists.
1676
- - **Decide the hard-to-reverse bets first.** For non-trivial backend, data, or API
1677
- work, sketch where the feature is headed, then call out the decisions that are
1678
- expensive to undo once data or callers depend on them — wire format, public ids,
1679
- data-model shape, auth and ownership boundaries — and get those right in the plan
1680
- even if most of the feature ships later. Then scope to the smallest first cut that
1681
- proves the approach without foreclosing it, stating both what is in and what is
1682
- explicitly deferred.
1683
- - **Keep examples at the right altitude.** When the user's idea is a broad
1684
- framework, product, or operating-model change, do not collapse it into the
1685
- first concrete example, provider, or sync path they mention. Separate the core
1686
- abstraction from motivating examples and app/provider adapters. Use examples
1687
- to make the plan legible, but label them as examples unless they are the whole
1688
- requested scope.
1689
- - **Publish standalone plans.** If the user pasted, referenced, or already has a
1690
- Codex / Claude Code / Markdown plan, treat it as source material, but rewrite
1691
- the published plan as a clean standalone proposal. Preserve the source plan's
1692
- useful intent and codebase facts, label inferred visuals as inferred, and avoid
1693
- revision language such as "preserve the prior plan", "do not drop the old
1694
- idea", "unlike the previous version", or "this revision changes...". A reader
1695
- who never saw the chat or earlier drafts should understand the plan.
1696
- - **Make the first read concrete.** If the plan is meant to be shared with
1697
- someone outside the chat, or if the concept is abstract, lead near the top with
1698
- one concrete product example before mode tables, architecture, or roadmaps. For
1699
- UI-capable concepts, that usually means a top-canvas app state that shows the
1700
- real user workflow in product terms. Do not rely on phrases that only make
1701
- sense in conversation, and do not frame the plan as "not the old idea"; state
1702
- the positive model directly.
1703
- - **Planning is read-only.** Make no source edits while building or reviewing the
1704
- plan. Start editing only after the user approves the direction.
1705
- - **Clarify vs. assume.** Do not ask how to build it — explore and present the
1706
- approach and options in the plan. Ask a clarifying question only when an
1707
- ambiguity would change the design and you cannot resolve it from the code; use
1708
- the host agent's normal ask-user-question flow and batch 2-4 high-leverage
1709
- questions before finalizing. Do not call \`create-visual-questions\` for
1710
- ordinary clarification or preflight; reserve it for the visual-intake mode when
1711
- the user explicitly asks for a visual intake questionnaire. Otherwise state the
1712
- assumption explicitly and proceed, and keep anything unresolved in the plan's
1713
- single bottom \`question-form\` Open Questions block. For complex plans, do a
1714
- final open-question pass before handoff: if a decision would affect
1715
- architecture, scope, UX, data shape, or rollout, either decide it in the plan
1716
- with rationale or put it in that bottom form with a recommended default.
1717
- - **The plan is the approval gate.** After surfacing it, ask the user to review
1718
- and approve before you write code, and name which files/areas the work touches.
1719
- Presenting the plan and requesting sign-off is the approval step — do not ask a
1720
- separate "does this look good?" question.
1721
- - **The document is the source of truth, not the chat.** When scope shifts,
1722
- update the plan with \`update-visual-plan\` rather than only changing course in
1723
- chat, and make the updated document stand alone. Do not describe the update as
1724
- a correction to an earlier draft inside the plan itself. Re-read the approved
1725
- plan before major steps.
1726
-
1727
- ## Create A Structured Agent-Native Plan — Never Inline
1728
-
1729
- The deliverable is ALWAYS a structured Agent-Native Plan, not a chat-only plan.
1730
- The hosted Plan MCP connector (\`plan\` server, or legacy \`agent-native-plans\`) is
1731
- the default collaboration and commenting surface; it is not a reason to reject
1732
- the planning pattern as an external dependency or rented layer. Plans are
1733
- portable source artifacts (\`plan.mdx\`, optional \`canvas.mdx\` /
1734
- \`prototype.mdx\`, JSON, and HTML export), and ownership-sensitive workflows can
1735
- use local-files mode or a self-hosted/custom Plan app URL without abandoning the
1736
- skill's review discipline. Do not advise the user to skip \`/visual-plan\` because
1737
- the default surface is hosted; choose the right Plan mode for the user's
1738
- ownership, privacy, sharing, and branding needs.
1739
-
1740
- By default, create the plan via the Plan MCP connector and NEVER hand it over as
1741
- inline chat content — no Markdown prose, ASCII sketch, table, or fenced
1742
- wireframe. If the \`plan\` (or legacy \`agent-native-plans\`) tools are not visible,
1743
- discover them through the host's \`tool_search\` first; if they are still missing,
1744
- STOP and give the user the client-specific reconnect step rather than improvising
1745
- an inline plan. Before publishing, or whenever a connector or auth error appears,
1746
- READ \`references/connection.md\` in this skill directory — it is the single source
1747
- of truth for the never-inline rule, connector discovery, and the per-client
1748
- reconnect steps. Local-files privacy mode (after Tool Guidance) is the exception.
1749
-
1750
- ## Core Workflow
1751
-
1752
- This section describes the default hosted Plan MCP workflow. If
1753
- \`AGENT_NATIVE_PLANS_MODE=local-files\` is set, or the user asks for fully local
1754
- files/no hosted Plan writes, use **Local-Files Privacy Mode** instead; carry
1755
- forward only the code-research and plan-composition guidance here.
1756
-
1757
- 1. Follow the host agent's normal planning flow: inspect the codebase, delegate
1758
- wide exploration when useful, gather the info needed, and ask native
1759
- clarifying questions as needed before generating the plan. If a source plan
1760
- already exists, gather its exact text from the user's paste, a referenced
1761
- file, or recent visible agent context; do not invent source text.
1762
- 2. Call \`get-plan-blocks\` for the authoritative block catalog — do not author
1763
- from memorized tags. Then call the mode-matched create tool:
1764
- \`create-visual-plan\` for document-first plans (architecture, backend, data,
1765
- refactor, API), \`create-ui-plan\` for UI-first plans, \`create-prototype-plan\`
1766
- for prototype-first plans, \`create-plan-design\` for design-first plans,
1767
- \`create-visual-questions\` only when the user explicitly asks for a visual
1768
- intake questionnaire. When a source plan already exists,
1769
- pass it as \`planText\` and preserve the original plan's useful intent while
1770
- producing a standalone plan document, not a revision memo.
1771
- 3. For UI/product plans, compose the top canvas first with the primary
1772
- wireframes and annotated states, then write the document with native blocks
1773
- (see \`references/canvas.md\` and \`references/document-quality.md\`). For
1774
- broad product architecture plans with a user-facing implication, add a
1775
- concrete "what this looks like in the app" visual before the abstract
1776
- architecture or mode tables. Keep the document close to the standalone
1777
- Markdown plan the agent would normally output. If an existing plan was
1778
- provided, carry forward the right facts and decisions without referring to
1779
- the previous draft or explaining how this version differs. For non-visual
1780
- plans, skip the top visual surface (Visual Surface Choice below owns the rule)
1781
- and put \`diagram\`, \`data-model\`,
1782
- \`api-endpoint\`, \`diff\`, \`file-tree\`, \`code\`, and \`annotated-code\` blocks
1783
- directly next to the relevant prose.
1784
- Wide document layout is renderer-owned and intentionally allowlisted: only
1785
- literal code-review surfaces (\`diff\`, \`annotated-code\`) and \`tabs\` blocks
1786
- with vertical orientation or diff-like children break out wider than prose.
1787
- Keep \`api-endpoint\`, \`openapi-spec\`, \`data-model\`, \`json-explorer\`,
1788
- \`wireframe\`, question, and \`custom-html\` blocks in normal document flow unless
1789
- their own renderer says otherwise.
1790
- 4. Surface the returned Plans link or inline MCP App and ask the user to review.
1791
- Always include the actual URL in chat so the next step is a click in CLI or
1792
- other text-only hosts. When the host exposes an embedded browser/preview panel
1793
- and a tool can open arbitrary URLs there, open the returned plan URL
1794
- automatically for convenient review — a convenience and smoke test, never the
1795
- only handoff or the access
1796
- model. Plans should load out of the box for the local agent and local browser
1797
- session; if a signed-in embedded browser cannot read a local plan that an
1798
- anonymous/tool check can read, fix the app/action ownership or access path
1799
- rather than patching one plan by hand. For high-stakes plans (architecture,
1800
- backend, data, multi-file, or risky), also kick off the self-review pass in
1801
- **Self-Review Before Handoff** while the user reads, instead of blocking the
1802
- handoff on it.
1803
- 5. For hosted plans, call \`get-plan-feedback\` before editing, after review,
1804
- after any long pause,
1805
- and before the final response. Treat \`anchorDetails\`, resolver intent, recent
1806
- review events, and any focused screenshots from browser handoff as the source
1807
- of truth for exactly what changed and exactly what each comment points at.
1808
- 6. For hosted plans, apply changes with \`update-visual-plan\`, preferring
1809
- targeted \`contentPatches\`.
1810
- Treat the top-level \`content\` payload as a full replacement, not a merge; do
1811
- not send a partial \`content\` object to add a canvas or one block. If a full
1812
- replacement is unavoidable, first read the complete plan source/content, carry
1813
- forward every existing block and visual surface, and verify the source/export
1814
- afterward so the document body was not truncated. When the user wants
1815
- source-control friendly edits, use \`patch-visual-plan-source\` against the MDX
1816
- files instead of regenerating the plan.
1817
- 7. For hosted plans, export with \`export-visual-plan\` only when the user wants a
1818
- shareable receipt or repo-check-in artifacts.
1819
-
1820
- ## Self-Review Before Handoff
1821
-
1822
- For high-stakes plans — architecture, backend, data-model, migration, multi-file,
1823
- or otherwise risky work — run one adversarial self-review pass before treating the
1824
- plan as final. Skip it for small, UI-only, or single-decision plans where the cost
1825
- outweighs the value. Keep the pass cheap and non-blocking:
1826
-
1827
- - **Surface the plan first, review concurrently.** Post the link and let the user
1828
- start reading, then run the review in parallel — never make the user wait on it.
1829
- - **Review the written plan; do not re-research.** Critique the plan text and its
1830
- own blocks. The grounding was already done while drafting, so the review checks
1831
- the output instead of re-exploring the repo.
1832
- - **Spawn one skeptical reviewer** whose only job is to find what is weak, missing,
1833
- or wrong — not to praise. Point it at: hard-to-reverse decisions made implicitly
1834
- or not at all (wire format, public ids, data-model shape, auth, ownership); steps
1835
- not anchored in real files or symbols; a menu of options where the plan should
1836
- commit to one; obvious missing decisions ("what happens when X?", "why not Y?");
1837
- and padding or single-step filler.
1838
- - **Fix vs. ask.** Apply clear-cut fixes yourself with \`update-visual-plan\`
1839
- \`contentPatches\` — vague non-goals, unanchored claims, an obvious missing
1840
- decision. Route genuine judgment calls back to the user instead: add them to the
1841
- bottom \`question-form\` Open Questions block or batch them into the normal
1842
- ask-user-question flow. Do not silently decide them.
1843
- - **Do not surprise the user mid-read.** On a large plan, apply the patches before
1844
- the editor loads; otherwise note briefly that a self-review is running so the
1845
- plan changing under them is expected. When you next respond, summarize what the
1846
- review changed and what it surfaced for the user to decide.
1847
-
1848
- ## Visual Surface Choice
1849
-
1850
- Choose the surface before creating the plan or after reading the source plan. Do
1851
- not add visual chrome by default:
1852
-
1853
- For UI/product plans, the top canvas is usually the primary review surface. Put
1854
- the first meaningful wireframes there, not buried as document-body blocks. Use
1855
- multiple canvas artboards when states matter, such as the default view, an
1856
- overflow menu or popover, a side panel, loading, or error. Put short annotations
1857
- beside frames with \`targetId\` plus \`placement\`; keep implementation details,
1858
- tradeoffs, file maps, data contracts, risks, and verification in the document
1859
- body below the canvas.
1860
-
1861
- When the user asks for a flow, storyboard, journey, wireframe, canvas, or "what
1862
- this looks like", treat that as a canvas-first request. Make one artboard per
1863
- user-visible state, connect only adjacent transitions, and use short canvas
1864
- annotations for the product notes. Do not substitute a document-body \`diagram\`
1865
- block for the requested storyboard just because HTML diagrams are faster to
1866
- write; diagrams belong below the canvas for backend mechanics, architecture, or
1867
- data-flow explanation.
1868
-
1869
- Keep product wireframes and explanatory/meta diagrams separate. Start with pure
1870
- screens that look like the app state under discussion, without callout prose or
1871
- architecture notes embedded inside the UI. Put arrows, labels, contracts, data
1872
- flow, and mode explanations in separate annotations, separate canvas diagrams,
1873
- or the document body.
1874
-
1875
- When the plan touches an existing app, inspect the current shell/components
1876
- before drawing. The first artboard should look like the real app at the same
1877
- density: existing sidebars, toolbar placement, overflow menus, app chrome, and
1878
- framework agent chrome stay in their real places. Model secondary surfaces as
1879
- separate states, such as a top-right overflow popover, sheet, panel, loading
1880
- state, or separate AgentSidebar, rather than inventing a permanent inspector or
1881
- folding framework chrome into the product UI.
1882
-
1883
- - **No visual surface** for architecture-only, backend-only, data migration,
1884
- copy-only, or otherwise non-visual plans. Do not use the top canvas for
1885
- architecture diagrams, dependency maps, file plans, API contracts, or
1886
- data-flow-only reviews. Use a strong document with local inline diagrams
1887
- only when relationships need a visual explanation, usually one spatial diagram
1888
- per recommendation or decision. Prefer grouped regions, layers, quadrants,
1889
- matrices, or before/after panels over a single-axis chain unless the
1890
- relationship is truly sequential.
1891
- - **Canvas only** for one static screen, a before/after comparison, a component
1892
- state, a small popover, or a visual direction that does not require clicking.
1893
- Put those wireframes in \`content.canvas\` and omit \`content.prototype\`.
1894
- - **Canvas + prototype** for multi-step UI flows, onboarding, wizards,
1895
- review/approval flows, navigation changes, or anything where the reviewer
1896
- needs to operate the behavior. Keep the static wireframes in
1897
- \`content.canvas\`, add the aligned functional prototype in
1898
- \`content.prototype\`, and rely on the top visual tabs to switch between them.
1899
- - **Prototype-first** when the user asks to operate the UI or when interaction is
1900
- the main question. Use \`create-prototype-plan\`, which still preserves static
1901
- mocks where useful.
1902
-
1903
- For mixed canvas + prototype plans, reuse the same real labels, app statuses,
1904
- and screen ids across both surfaces. The canvas is the inspectable static reference;
1905
- the prototype is the interactive version of that same flow, not a separate
1906
- design direction.
1907
-
1908
- ## Wireframe quality — read \`references/wireframe.md\`
1909
-
1910
- UI recap/plan wireframes must meet a strict quality bar — full-width chrome,
1911
- pinned bottom bars, real product content, before/after comparability, the right
1912
- \`surface\` preset, \`--wf-*\` tokens instead of hex, and no \`<html>\`/\`<style>\`/font
1913
- tags. Before authoring ANY wireframe / \`<Screen>\` / \`WireframeBlock\`, READ
1914
- \`references/wireframe.md\` in this skill directory — it is the single source of
1915
- truth for HTML wireframe quality, shared word for word with \`/visual-plan\`
1916
- and \`/visual-recap\`. Do not author wireframes from memory.
1917
-
1918
- ## Canvas — read \`references/canvas.md\`
1919
-
1920
- The canvas is the single source of truth for static UI mockups: the \`surface\`
1921
- locks each artboard's footprint, mixed surfaces lay out
1922
- in lanes, annotations are plain-text designer notes anchored by
1923
- \`targetId\`/\`placement\`, and edits are surgical \`contentPatches\`. Before
1924
- authoring or editing ANY canvas, artboard, or annotation, READ
1925
- \`references/canvas.md\` in this skill directory — it is the single source of truth
1926
- for canvas/artboard mechanics. Do not author canvas layouts from memory.
1927
- Canvas artboards use the same HTML wireframe path as document-body
1928
- \`WireframeBlock\` screens: author \`<Screen surface="..." html={...} />\` with a
1929
- semantic HTML fragment. Do not author fresh kit-tree children such as
1930
- \`<FrameScreen>\`, \`<Card>\`, \`<Row>\`, or \`<Btn>\` inside canvas \`<Screen>\` tags;
1931
- those are legacy compatibility markup for old plans and produce brittle canvas
1932
- layouts.
1933
-
1934
- ## Document quality — read \`references/document-quality.md\`
1935
-
1936
- The document is a serious technical plan, not marketing: outcome-first,
1937
- prose-first, self-contained, built from the right native blocks, with open
1938
- questions in a single bottom \`question-form\` and a pre-handoff visual check.
1939
- Before authoring the plan document, READ \`references/document-quality.md\` in this
1940
- skill directory — it is the single source of truth for the document quality bar.
1941
- Do not write the document from memory.
1942
-
1943
- ## Good vs. bad exemplar — read \`references/exemplar.md\`
1944
-
1945
- For a worked example of the bar — a great UI-first plan and \`/visual-plan\`, plus
1946
- the anti-patterns to avoid — READ \`references/exemplar.md\` in this skill
1947
- directory before authoring a plan.
1948
-
1949
- ## Tool Guidance
1950
-
1951
- - \`create-visual-plan\`: start one structured visual plan per agent task/run, or
1952
- import an existing text plan by passing \`planText\`; \`content\` may include no
1953
- visual surface, canvas only, or canvas + prototype.
1954
- - \`create-ui-plan\`: start a UI-first plan when the work is primarily product UI.
1955
- - \`create-prototype-plan\`: start a prototype-first plan with a functional top
1956
- review surface.
1957
- - \`create-plan-design\`: start a full-fidelity branded Design-tab plan with an
1958
- optional matching Prototype tab.
1959
- - \`convert-visual-plan-to-prototype\`: convert an existing HTML wireframe canvas
1960
- into a prototype plan.
1961
- - \`create-visual-questions\`: use only when the user explicitly asks for a visual
1962
- intake questionnaire, not as \`/visual-plan\` preflight.
1963
- - \`update-visual-plan\`: revise content, status, or comments with targeted
1964
- \`contentPatches\` (see Core Workflow step 6).
1965
- - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
1966
- optional \`canvas.mdx\`, optional \`.plan-state.json\`, and JSON.
1967
- - \`patch-visual-plan-source\`: apply granular MDX AST patches by stable block,
1968
- artboard, annotation, component, or wireframe-node id.
1969
- - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
1970
- - \`get-visual-plan\`: read the current structured plan, exported HTML, and
1971
- annotations; it also returns the MDX folder for source workflows.
1972
- - \`get-plan-feedback\`: read unconsumed human feedback. Use it frequently; it
1973
- returns grouped threads, exact anchor details, expected resolver, and recent
1974
- review-event payloads so agents can act only on the comments meant for them.
1975
- - \`get-plan-blocks\`: resolve block tags before authoring — do not memorize tags;
1976
- call this first to get the authoritative tag names, required fields, and prop
1977
- shapes from the live block registry.
1978
- - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
1979
- files for repo check-in.
1980
-
1981
- When the user critiques a plan's look or structure, fix the renderer or this
1982
- skill — never hand-edit one stored plan. Turn feedback into better guidance.
1983
-
1984
- ## Local-Files Privacy Mode — read \`references/local-files.md\`
1985
-
1986
- When the user wants no hosted Plan database writes — no DB writes, no Plan MCP
1987
- publish, fully local/offline/private planning, repo-owned source-controlled
1988
- artifacts, or \`AGENT_NATIVE_PLANS_MODE=local-files\` — do not call any hosted Plan
1989
- tool except the schema-only \`get-plan-blocks\` catalog lookup. Author a local MDX
1990
- folder and
1991
- preview it with \`plan local check\` / \`plan local serve\` / \`plan local verify\`.
1992
- Before using local-files mode, READ \`references/local-files.md\` in this skill
1993
- directory — it is the single source of truth for the full contract (catalog
1994
- lookup, MDX folder layout, the local bridge commands, and the hosted tools you
1995
- must not call). Carry forward only the code-research and plan-composition
1996
- guidance from Core Workflow; everything hosted is replaced by the local bridge.
1997
-
1998
- ## Interpreting comment anchors
1999
-
2000
- This section applies to hosted plans with \`get-plan-feedback\` /
2001
- \`update-visual-plan\`. In local-files mode, do not call hosted feedback or update
2002
- tools; interpret file/chat feedback directly, edit the MDX files, rerun the
2003
- local bridge check/serve/verify command, and report the new local URL.
2004
-
2005
- \`get-plan-feedback\` returns rich anchors — read them before acting on any comment.
2006
-
2007
- - **Coordinate frames.** \`targetX\`/\`targetY\` are percentages *within* the
2008
- element named by \`targetSelector\`/\`targetKind\`. Bare \`x\`/\`y\` are percentages
2009
- of the whole plan document. \`canvasX\`/\`canvasY\` are raw board-world pixels on
2010
- the design canvas (board size given when available).
2011
- - **Wireframe pins.** Anchors on wireframes include \`targetNodeId\` and
2012
- \`targetNodePath\` (e.g. \`card > list > listItem "Acme Inc"\`) identifying the
2013
- exact kit node. Use \`targetNodeId\` directly with wireframe node patch ops;
2014
- use \`data-design-id\` values from design artboards with
2015
- \`update-design-element-style\`. Prefer the node id/path over raw coordinates;
2016
- fall back to coordinates plus the focused screenshot (red ring marks the exact
2017
- point) only when no node id is present.
2018
- - **Text quotes.** Resolve \`textQuote\` against current prose using
2019
- \`contextBefore\`/\`contextAfter\` for disambiguation. If \`ambiguous: true\`, ask
2020
- the user — do not guess which occurrence is meant.
2021
- - **Detached comments.** \`get-plan-feedback\` flags threads whose quoted text no
2022
- longer exists as \`detached\` (in \`detachedThreads\`). Reconcile these against
2023
- rewritten content — never silently drop them.
2024
- - **Routing.** \`resolutionTarget\` is the only routing signal: act on \`agent\`,
2025
- treat \`human\` as context only. \`@mentions\` are people to notify, never a
2026
- routing signal.
2027
- - **Two-axis state.** Mark every ingested comment as consumed
2028
- (\`consumedCommentIds\` on \`update-visual-plan\`). Set \`status=resolved\` only on
2029
- agent-targeted comments you actually addressed; leave human-targeted comments
2030
- open.
2031
-
2032
- ## Visibility & Sharing
2033
-
2034
- Use \`set-resource-visibility\` to change who can see a plan (e.g. public, login,
2035
- or org-scoped). Use \`share-resource\` to grant specific users or roles access
2036
- by email or role. Gate visibility before sharing any plan that covers
2037
- unreleased or private work — default to the narrowest scope that meets the
2038
- review need.
2039
-
2040
- ## Setup & Authentication
2041
-
2042
- There are two ways into Plans.
2043
-
2044
- **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
2045
- installs the Plans skills, registers the hosted Plans MCP connector, and runs
2046
- auth/setup for the selected local client(s) in the same step (a one-time browser
2047
- sign-in at setup — this is intended), so the first tool call in that client does
2048
- not hit an OAuth wall:
2049
-
2050
- \`\`\`bash
2051
- npx @agent-native/core@latest skills add visual-plans
2052
- \`\`\`
2053
-
2054
- After that, \`/visual-plan\`, \`/visual-recap\`, and \`/visualize-repo\` are the
2055
- installed slash commands. If you only need one command, use
2056
- \`skills add visual-plan\`, \`skills add visual-recap\`, or
2057
- \`skills add visualize-repo\` instead. The other planning modes
2058
- (\`create-ui-plan\`, \`create-prototype-plan\`, \`create-plan-design\`,
2059
- \`create-visual-questions\`) are MCP tools reachable from \`/visual-plan\`, not
2060
- separate slash commands. Pass \`--no-connect\` to register the connector without
2061
- authenticating, then run
2062
- \`npx @agent-native/core@latest connect https://plan.agent-native.com --client all\`
2063
- whenever you are ready, or choose a narrower \`--client\`. Auth and MCP tool
2064
- loading are per client config/session.
2065
-
2066
- **Browser (people you share with).** Open the Plans editor and create & edit
2067
- with no sign-up — you work as a guest. Sign in only when you want to save or
2068
- share; signing in claims the plans you made as a guest into your account.
2069
-
2070
- Sharing and commenting require an account: public/shared plans are viewable by
2071
- anyone with the link, but commenting on them needs an agent-native account.
2072
-
2073
- For fully offline, no-account use, run the Plans app locally and sync plans to
2074
- your repo as MDX. This local mode is a separate advanced path, not the default
2075
- hosted flow.
2076
-
2077
- For repo-wide visual docs, run
2078
- \`npx @agent-native/core@latest visualize-repo --open\` to create/update
2079
- \`agent-native.json\`, seed \`.agent-native/visual-docs/repo-overview\`, and open
2080
- the local bridge.
2081
-
2082
- If a Plans tool returns \`needs auth\`, \`Unauthorized\`, or \`Session terminated\`, do
2083
- not keep retrying it — stop and give the user the per-client reconnect step from
2084
- \`references/connection.md\`, then continue once the connector is available.
2085
-
2086
- Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
2087
- not put shared secrets in skill files.
2088
- `;
2089
- export const VISUAL_RECAP_SKILL_MD = `---
2090
- name: visual-recap
2091
- description: >-
2092
- Turn a PR, branch, commit, or git diff into an interactive visual recap with
2093
- diagrams, file maps, API/schema summaries, annotated diffs, and focused review
2094
- notes.
2095
- metadata:
2096
- visibility: exported
2097
- ---
2098
-
2099
- # Visual Recap
2100
-
2101
- \`/visual-recap\` creates a visual plan built **from** a diff, not toward one. It
2102
- is the reverse of forward planning: instead of describing the change you are
2103
- about to make, you describe the change that was just made, at a higher altitude
2104
- than line-by-line review. The same plan data model serves both directions —
2105
- schema, API, file, and architecture changes become the same \`data-model\`,
2106
- \`api-endpoint\`, \`file-tree\`, and \`diagram\` blocks a forward plan would use, only
2107
- now they summarize work that exists. A reviewer scans the shape of the change
2108
- before spending attention on the literal lines.
2109
-
2110
- ## Publish As An Agent-Native Plan — Never Inline
2111
-
2112
- The deliverable is ALWAYS a published Agent-Native Plan, created with
2113
- \`create-visual-recap\` on the Plan MCP connector — NEVER inline chat content (not
2114
- Markdown prose, an ASCII sketch, a table, a fenced "wireframe", or a "here's the
2115
- recap" summary). A recap's entire value is the hosted, interactive, annotatable
2116
- plan; an inline summary is not a degraded recap, it is the thing a recap
2117
- replaces. If the \`plan\` (or legacy \`agent-native-plans\`) tools are not visible,
2118
- discover them through the host's \`tool_search\` first; if they are still missing,
2119
- STOP and give the user the client-specific reconnect step rather than improvising
2120
- an inline recap. Before publishing, or whenever a connector or auth error
2121
- appears, READ \`references/connection.md\` in this skill directory — it is the
2122
- single source of truth for the never-inline rule, connector discovery, and the
2123
- per-client reconnect steps. Local-files privacy mode (below) is the one
2124
- exception.
2125
-
2126
- ## Local-Files Privacy Mode — read \`references/local-files.md\`
2127
-
2128
- When the user wants no hosted Plan database writes — no DB writes, no Plan MCP
2129
- publish, fully local/offline/private recaps, or \`AGENT_NATIVE_PLANS_MODE=local-files\`
2130
- — do not call any hosted Plan tool except the schema-only \`get-plan-blocks\`
2131
- catalog lookup. Read the diff with the local \`recap collect-diff\` / \`scan\` /
2132
- \`build-prompt --local-files\` helpers, author a local MDX folder (set
2133
- \`kind: "recap"\` and \`localOnly: true\`), and preview it with \`plan local check\`,
2134
- \`plan local serve --kind recap\`, and \`plan local verify --kind recap\`. Before
2135
- using local-files mode, READ \`references/local-files.md\` in this skill directory
2136
- — it is the single source of truth for the full contract.
2137
-
2138
- ## When To Use
2139
-
2140
- Build a recap when a PR or commit is large, multi-file, or touches schema, API
2141
- contracts, or architecture, and a reviewer would benefit from seeing the change
2142
- mapped to structured blocks before reading the raw diff. A GitHub Action can
2143
- generate one automatically from a PR diff; an agent can generate one on request
2144
- ("recap this PR", "show me what this branch changed"). Skip it for small,
2145
- single-file, or obvious diffs — a recap is review overhead, and a tiny change
2146
- reviews faster as plain diff.
2147
-
2148
- ## Recap The Whole Work Unit
2149
-
2150
- When \`/visual-recap\` is invoked in a chat thread after work has already happened,
2151
- the default scope is the whole current work unit/thread, not only the most recent
2152
- user message, tool action, or follow-up fix. Gather the thread-owned changes
2153
- across the conversation: original implementation work, later bug fixes, UI
2154
- follow-ups, tests, changesets, skill/instruction updates, generated plan/source
2155
- artifacts, and any local import/linking fixes needed to make the recap open.
2156
-
2157
- Use the current diff plus conversation context to separate thread-owned changes
2158
- from unrelated dirty work that existed before the thread. Exclude unrelated
2159
- pre-existing edits. If the scope is genuinely ambiguous and cannot be inferred,
2160
- state the assumption or ask a concise question before publishing.
2161
-
2162
- When updating an existing recap after feedback, revise the recap so it still
2163
- covers the whole thread/work unit plus the new correction. Do not replace a broad
2164
- recap with a narrow recap of only the latest feedback unless the user explicitly
2165
- asks for that narrower scope.
2166
-
2167
- ## Keep The Recap Body Lean
2168
-
2169
- Do not add boilerplate intro, disclaimer, provenance, or summary prose blocks to
2170
- the generated plan body. In particular, do not create a \`rich-text\` block just to
2171
- say the recap is an aid, that the reviewer should still review the diff, how many
2172
- files changed, or which ref/working tree generated the recap. The plan title,
2173
- brief, and \`file-tree\` (which carries the per-file change stats) already carry
2174
- that context.
2175
-
2176
- Only add prose blocks when they tell the reviewer something specific about the
2177
- change that the structured blocks do not: the objective, a real compatibility
2178
- risk, an important decision visible in the diff, or a grounded review note.
2179
-
2180
- ## Recaps Must Be Substantial
2181
-
2182
- Lean is not the same as thin. A recap is not a single wireframe plus one
2183
- sentence — that under-serves the reviewer as much as boilerplate prose over-serves
2184
- them. Alongside the visual/structural headline (wireframes, \`data-model\`,
2185
- \`api-endpoint\`, \`diagram\`), a substantial recap also carries the implementation
2186
- evidence:
2187
-
2188
- - A short surface/state inventory before authoring: list the changed routes,
2189
- components, popovers/dialogs, role/access states, empty/error states, and
2190
- shared abstractions visible in the diff. The final recap must either represent
2191
- each meaningful item with a block or intentionally omit it because it is tiny,
2192
- redundant, or not user-visible.
2193
- - A \`file-tree\` of the changed files with each entry's \`change\` flag, so the
2194
- reviewer sees the footprint of the work at a glance.
2195
- - The split \`diff\` of the KEY changed files, grouped under a \`## Key changes\`
2196
- \`rich-text\` heading in a single horizontal \`tabs\` block (the default
2197
- orientation, one file per tab), with a one-line \`summary\` and a few
2198
- \`annotations\` on each — so the reviewer can drop from the high-altitude shape
2199
- straight into the load-bearing code. Use horizontal file tabs, not a vertical
2200
- side rail, so the selected file has enough width for the side-by-side diff.
2201
-
2202
- Skip the diff appendix only for a genuinely tiny change that reviews faster as
2203
- plain diff (see "When To Use"); for any change worth recapping, the file-tree and
2204
- key-change diffs belong in the plan.
2205
-
2206
- ## Canonical Shape And Budgets
2207
-
2208
- A strong recap follows one skeleton, top to bottom:
2209
-
2210
- 1. UI-impact headline — wireframes first, when the diff changed rendered UI.
2211
- 2. Short outcome narrative (\`rich-text\`): what changed and why, 1-3 paragraphs.
2212
- 3. \`data-model\` / \`api-endpoint\` blocks for schema and contract changes.
2213
- 4. \`file-tree\` of the changed files with \`change\` flags.
2214
- 5. \`## Key changes\` — one horizontal \`tabs\` block of \`diff\` / \`annotated-code\`.
2215
-
2216
- Budgets that keep the recap reviewable:
2217
-
2218
- - 3-8 key-change tabs. Fewer than 3 on a large change under-serves the
2219
- reviewer; more than 8 stops being a summary.
2220
- - Keep each diff/annotated-code excerpt focused — prefer under ~150 lines per
2221
- tab; summarize or link the rest of a long file instead of dumping it.
2222
- - Title at most ~70 characters; brief 1-3 sentences.
2223
-
2224
- **GOOD.** A 25-file auth change: Before/After wireframes of the login surface,
2225
- a two-paragraph narrative, a diff-aware \`data-model\` of the sessions table, an
2226
- \`api-endpoint\` for the new refresh route, a \`file-tree\` with change flags, and
2227
- \`## Key changes\` with five focused tabs, each with a one-line \`summary\` and a
2228
- few annotations on the load-bearing hunks.
2229
-
2230
- **BAD.** One giant unsegmented diff dump with no summaries or annotations; or a
2231
- sparse three-block recap of a 40-file change (one wireframe, one sentence, one
2232
- file list) that forces the reviewer back into the raw diff anyway.
2233
-
2234
- ## UI Impact Needs Wireframes
2235
-
2236
- When the diff changes rendered UI, layout, density, visual state, interaction
2237
- affordances, navigation, controls, menus, dialogs, or design tokens, the recap
2238
- MUST include one or more wireframes. Prose and file diffs are not a substitute
2239
- for showing what changed visually.
2240
-
2241
- Before choosing wireframes, make a UI coverage pass from the diff:
2242
-
2243
- - Identify the entry surface where the change appears, such as a page header,
2244
- list row, toolbar, route shell, or menu trigger.
2245
- - Identify the interaction surface that opens or changes, such as a popover,
2246
- dialog, tab, sheet, dropdown, inline editor, or toast.
2247
- - Identify the resulting destination or persistent state, such as a public page,
2248
- read-only view, empty state, error state, loading state, permission-denied
2249
- state, or saved/shared state.
2250
- - Identify access or role variants when permissions change. Owner/admin/editor
2251
- versus viewer/non-manager differences are visual behavior and need a compact
2252
- matrix, paired wireframes, or clearly labeled state sequence.
2253
-
2254
- For UI-heavy PRs, a single before/after of the entry surface is not enough.
2255
- Show the changed entry point, the main changed interaction surface, and the
2256
- resulting/destination state. Add more states when the diff adds tabs, role-based
2257
- controls, public/private visibility, invite/manage flows, destructive controls,
2258
- or empty/error branches.
2259
-
2260
- Choose the smallest visual surface that makes the review clear:
2261
-
2262
- - Use a \`Before\` / \`After\` wireframe pair when the reviewer benefits from direct
2263
- comparison, such as a removed or added control, a changed state, layout
2264
- density, ordering, navigation, or a visible component replacement.
2265
- \`references/wireframe.md\` owns how to lay that pair out (columns vs.
2266
- vertical stack by geometry).
2267
- - Use an after-only wireframe when the change is purely additive or the "before"
2268
- state would only show absence without adding review value.
2269
- - Use more than two wireframes when the UI change is flow-dependent, responsive,
2270
- or stateful; show the meaningful states in order instead of forcing a single
2271
- before/after pair.
2272
- - For tiny surfaces like menus, popovers, dialogs, toasts, or panels, use the
2273
- matching \`surface\` (\`popover\`, \`panel\`, etc.) and show the focused sub-surface.
2274
- Do not redraw a full page unless placement in the page is itself part of the
2275
- change.
2276
-
2277
- Ground each wireframe in the changed UI behavior, component names, file paths,
2278
- and diff-visible labels/states. If exact pixels are inferred rather than
2279
- captured, say so in the wireframe caption or a concise annotation. For
2280
- local/manual recaps, import or update the plan source that holds the wireframes
2281
- so the rendered recap opens with the UI visual available.
2282
-
2283
- ## Wireframe Quality — read \`references/wireframe.md\`
2284
-
2285
- UI recap/plan wireframes must meet a strict quality bar — full-width chrome,
2286
- pinned bottom bars, real product content, before/after comparability, the right
2287
- \`surface\` preset, \`--wf-*\` tokens instead of hex, and no \`<html>\`/\`<style>\`/font
2288
- tags. Before authoring ANY wireframe / \`<Screen>\` / \`WireframeBlock\`, READ
2289
- \`references/wireframe.md\` in this skill directory — it is the single source of
2290
- truth for HTML wireframe quality, shared word for word with \`/visual-plan\`
2291
- and \`/visual-recap\`. Do not author wireframes from memory.
2292
-
2293
- Use the standard \`WireframeBlock\` / \`<Screen>\` format so the Plan viewer owns the
2294
- surface frame, theme, and sketchy/clean toggle. HTML wireframes are appropriate
2295
- when placement precision matters, especially popovers, menus, dialogs, and dense
2296
- forms. For HTML
2297
- wireframes, keep \`renderMode\` unset or \`wireframe\` unless a design-only editable
2298
- mockup is explicitly required, because \`renderMode="design"\` disables the
2299
- sketchy rough overlay.
2300
-
2301
- When a browser tool is available, render a UI-impact recap in the Plan viewer
2302
- and visually inspect it at the current theme before sharing. If any label,
2303
- annotation, toolbar, or wireframe content overlaps another element, fix the MDX
2304
- and re-import before reporting the link. A text-match screenshot is not enough;
2305
- visually inspect the captured image. When no browser is available (for example
2306
- a headless CI agent), state that in the recap handoff instead.
2307
-
2308
- ## Top Canvas Recaps — read \`../visual-plan/references/canvas.md\`
2309
-
2310
- When a recap includes a top canvas, storyboard, or flow view, READ
2311
- \`../visual-plan/references/canvas.md\` before authoring \`canvas.mdx\`. Recap
2312
- canvas artboards must use the same HTML wireframe path as good document-body
2313
- wireframes: \`<Screen surface="..." html={...} />\` with a semantic HTML fragment.
2314
- Do not author fresh kit-tree children such as \`<FrameScreen>\`, \`<Card>\`,
2315
- \`<Row>\`, \`<Title>\`, or \`<Btn>\` inside canvas \`<Screen>\` tags. Those components
2316
- are legacy compatibility markup for old plans; in new canvas storyboards they
2317
- can produce cramped or overlapping layouts even when the inline body wireframe
2318
- looks good. If a canvas mockup looks worse than the same screen below the fold,
2319
- assume it used the legacy kit path and replace it with an HTML screen.
2320
-
2321
- ## Open And Report The Recap
2322
-
2323
- In local-files privacy mode, run \`plan local check\` first, then report the local
2324
- bridge URL from
2325
- \`npx @agent-native/core@latest plan local serve --dir <plan-dir> --kind recap --open\`
2326
- or from \`<plan-dir>/.plan-url\`. It opens the hosted Plan UI but reads from the
2327
- localhost bridge on this machine, so it is not shareable across machines. If the
2328
- Plan app itself is running locally with the same \`PLAN_LOCAL_DIR\`, the
2329
- \`/local-plans/<slug>\` route is also valid. Do not invent a hosted database URL
2330
- and do not publish just to get an absolute Plan link.
2331
-
2332
- After creating the recap, link the reviewer to the rendered plan with an
2333
- **absolute URL on the origin whose database actually holds the plan**. That
2334
- origin is the Plan MCP server you just created the recap through — NOT whatever
2335
- dev server you happen to know is running. The create tool returns the correct
2336
- link; report THAT. Never make the primary link a local \`plan.mdx\` file, a local
2337
- mirror folder, or a relative path such as \`/plans/<id>\`.
2338
-
2339
- When the recap is posted to a PR for a private repo, the plan link is not a
2340
- public URL. Make the PR comment/handoff copy explicit: reviewers may need to
2341
- sign in to Agent-Native Plans with an account that has access to the owning
2342
- organization before the link loads. Use wording like: "Private repo recap:
2343
- sign in with access to this org if the plan does not open." Do not imply the
2344
- link is broken or public when access is gated by repo/org visibility.
2345
-
2346
- A recap lives only in the database of the MCP that created it. A separately
2347
- running local dev server (e.g. \`http://localhost:8081\`) has its OWN database and
2348
- will NOT contain a recap created through the hosted MCP, so a hand-built
2349
- \`localhost\` link returns "Plan not found". This is the most common recap
2350
- mistake — do not guess an origin you have not confirmed shares the MCP's data.
2351
-
2352
- Resolve the URL in this order:
2353
-
2354
- 1. Use the absolute URL the create tool RETURNS — \`openLink.webUrl\`, else the
2355
- \`visualUrl\` in the returned \`plan.mdx\` frontmatter, else \`url\`/\`path\`
2356
- resolved against the MCP server's own origin (for the hosted MCP that is
2357
- \`https://plan.agent-native.com\`). This always points at the database that has
2358
- the plan.
2359
- 2. Use a \`localhost\`/dev origin ONLY when the recap was created through a Plan
2360
- MCP bound to that same origin — i.e. that MCP's url is
2361
- \`http://localhost:<port>/_agent-native/mcp\`. Creating through the hosted MCP
2362
- and linking to localhost is the exact mismatch that 404s.
2363
- 3. If only a plan id is available, build the MCP origin's absolute URL
2364
- (hosted: \`https://plan.agent-native.com/plans/<id>\`) and say it was inferred.
2365
-
2366
- If the user wants to review on localhost but the recap was created through the
2367
- hosted MCP, say so plainly: the local dev server cannot see it. To view a recap
2368
- on localhost (e.g. to exercise un-deployed local renderer changes), they must
2369
- connect a LOCAL Plan MCP (\`http://localhost:<port>/_agent-native/mcp\`) and
2370
- re-create the recap through it so it lands in the local database; offer to do
2371
- that rather than handing over a localhost URL that will not resolve.
2372
-
2373
- When running in Codex and the Browser/in-app side browser tools are available,
2374
- open the returned absolute recap URL there automatically after creation. Still
2375
- include the same absolute URL in the final response. Local mirror files like
2376
- \`plans/<slug>/plan.mdx\` may be mentioned only as secondary source-control
2377
- artifacts, not as the main way to open the recap.
2378
-
2379
- ## Diff → Block Mapping
2380
-
2381
- Map each kind of change to the block that carries it, derived mechanically from
2382
- the actual diff. The names below are the CONCEPTUAL block types, not the JSX
2383
- tags — resolve every conceptual name to its exact tag + prop schema with the
2384
- \`get-plan-blocks\` tool (see "Block reference" below) before authoring.
2385
-
2386
- - **Schema / migration change** → \`data-model\` for the resulting entities,
2387
- fields, and relations. Flag what moved per field/entity with
2388
- \`change: "added" | "modified" | "removed" | "renamed"\`, and for a changed type
2389
- set \`was\` to the prior value (e.g. the old column type) — grounded in the real
2390
- migration diff. That diff-aware \`data-model\` is the headline; reach for a split
2391
- \`diff\` of the literal SQL only when the exact statement still matters, not by
2392
- default.
2393
- - **API / action / route change** → \`api-endpoint\` with the method, path,
2394
- params, request, and responses as they are after the change. Flag each changed
2395
- param/response with \`change\` (and \`was\` on a param whose type/shape changed),
2396
- and set \`change\` on the endpoint root for a wholly added or removed route. Mark
2397
- removed endpoints with \`deprecated: true\` and explain in prose.
2398
- Keep multiple API endpoints in the normal single-column document flow unless
2399
- they are an explicit before/after contract comparison.
2400
- Author each request/response example as a SINGLE valid JSON value — one
2401
- top-level object or array, parseable on its own — so it renders in the
2402
- collapsible JSON explorer. Do not put \`//\` or \`/* */\` comments, prose,
2403
- trailing commas, or two or more concatenated top-level objects inside one
2404
- example; a non-parseable body falls back to flat text and loses the explorer.
2405
- When an endpoint has several distinct message shapes (for example separate
2406
- websocket frame types, or a success body versus an error body), give each its
2407
- OWN example with its own label rather than cramming them into one body.
2408
- - **Compatibility-sensitive change** → short \`rich-text\` notes beside the
2409
- relevant \`data-model\` / \`api-endpoint\` block. Name the changed field,
2410
- endpoint, or behavior and mark whether it is breaking, risky, or non-breaking;
2411
- pair that note with a split \`diff\` for the literal lines.
2412
- - **Any meaningful code hunk** → \`diff\` with \`mode: "split"\`, carrying the real
2413
- \`before\` / \`after\` text and the \`filename\` / \`language\`. Split mode is the
2414
- default for recap code review because before/after legibility is the point;
2415
- use \`mode: "unified"\` only for a genuinely narrow standalone hunk where
2416
- side-by-side would hide the code. Give every \`diff\` a one-line \`summary\`
2417
- saying what the hunk changes and why; it renders as a description above the
2418
- code so the reviewer reads intent first. Never leave a diff unlabeled.
2419
- For the KEY changed files, attach \`annotations\` to the \`diff\` so the recap
2420
- calls out what each important hunk does — this is the headline affordance for
2421
- annotating the key files updated. Each annotation anchors to the AFTER-side
2422
- line numbers by default (set \`side: "before"\` to point at removed lines). Keep
2423
- it to a few high-signal notes per file, not one per line.
2424
- When several key files each need a substantial diff, introduce the group with a
2425
- \`rich-text\` heading block whose markdown is \`## Key changes\`, then place the
2426
- \`diff\` blocks under it in a reusable \`tabs\` block with horizontal orientation
2427
- (the default — omit \`orientation\`) so the selected file's split diff gets the
2428
- full document width. Let that heading label the section — do NOT also set a
2429
- \`title\` on the \`tabs\` block. Keep each tab label to the file path or a short
2430
- basename plus directory hint.
2431
- The renderer's wide document layout is intentionally allowlisted: \`diff\`,
2432
- \`annotated-code\`, vertical \`tabs\`, and \`tabs\` containing diff-like children
2433
- break out wider than prose. Do not put API endpoints, OpenAPI specs, data
2434
- models, JSON explorers, wireframes, question forms, or custom HTML into tabs
2435
- merely to make them wide.
2436
- If the recap ends with more than one supporting diff, that trailing diff
2437
- appendix should be one horizontal \`tabs\` block under its own \`## Key changes\`
2438
- heading, not a stack of separate \`diff\` blocks.
2439
- - **Brand-new file or a substantial added block with no meaningful "before"** →
2440
- \`annotated-code\` rather than a one-sided split \`diff\`. Carry the real new code
2441
- with its \`filename\` / \`language\` and anchor a few high-signal notes to the lines
2442
- that matter so the reviewer reads what the new code does, not code for code's
2443
- sake. Keep split \`diff\` for true before/after hunks where the removed lines
2444
- still carry meaning, and group several annotated walkthroughs in a horizontal
2445
- \`tabs\` block the same way diffs are grouped.
2446
- - **Files added / removed / renamed** → \`file-tree\` with each entry's \`change\`
2447
- flag (\`added\`, \`removed\`, \`modified\`, \`renamed\`) and a short \`note\`; attach a
2448
- \`snippet\` only when one tells the reviewer something the path does not.
2449
- - **Rendered UI / interaction change** → one or more wireframes showing the
2450
- visible UI delta before the reviewer reads code. Use \`Before\` / \`After\`
2451
- wireframes when the comparison clarifies the change; otherwise use after-only
2452
- or a short state/flow sequence. Use realistic UI surfaces: for a popover
2453
- change, show a popover with its title row, top-right actions, options/fields,
2454
- tabs, selected/disabled states, people/lists/rows, and any opened prompt/menu
2455
- anchored to the correct trigger. If a route was added, show the route body and
2456
- the unavailable/empty state when the diff implements one. If permissions
2457
- changed, show what managers can do and what viewers/non-managers see instead.
2458
- Keep the body lean: the wireframe carries the UI story, while the file tree
2459
- and \`diff\` blocks carry implementation evidence.
2460
- - **Architecture or data-flow shift** → \`diagram\` with \`data.html\` / \`data.css\`
2461
- as a two-panel before/after, layered, or swimlane layout, or \`mermaid\` for a
2462
- quick graph. Use two-dimensional layouts; do not reduce a structural change to
2463
- a left-to-right chain. Do not use \`diagram\` as a stand-in for rendered UI
2464
- controls; UI changes need \`wireframe\` blocks.
2465
- Author diagram HTML/CSS with the renderer-owned \`.diagram-*\` primitives
2466
- (\`.diagram-panel\`, \`.diagram-node\`, \`.diagram-pill\`, \`[data-rough]\`, …) and
2467
- the same \`--wf-*\` theme tokens \`references/wireframe.md\` defines — never
2468
- \`font-family\`, hex, rgb/hsl literals, or one-off dark/light palettes. Choose
2469
- the outer \`frame\` intentionally: recap diagrams usually benefit from
2470
- \`frame: "show"\` when they stand alone, but use \`frame: "hide"\` when columns,
2471
- tabs, a card, or the diagram's own panels already provide the boundary.
2472
- - **Outcome-first narrative** → \`rich-text\` for the "what changed and why" prose:
2473
- the objective the diff served, the key decisions visible in it, and the risks a
2474
- reviewer should weigh. This is the only place the model writes freely.
2475
-
2476
- ## Block reference — call \`get-plan-blocks\`, do not memorize tags
2477
-
2478
- The conceptual block names above (\`api-endpoint\`, \`data-model\`, \`json-explorer\`,
2479
- \`tabs\`, …) are NOT the JSX tags you author with, and the exact tags, required
2480
- fields, and prop shapes change as the block library evolves. Do not author from
2481
- memorized tags — they drift and silently produce a wrong tag (\`ApiEndpoint\`
2482
- instead of \`Endpoint\`, \`JsonExplorer\` instead of \`Json\`, \`Tabs\` instead of
2483
- \`TabsBlock\`) that errors on import.
2484
-
2485
- **Before writing any structured plan content, fetch/read the block catalog.** In
2486
- hosted or self-hosted mode, call \`get-plan-blocks\` on the Plan MCP connector
2487
- (\`plan\` or legacy \`agent-native-plans\`). If no Plan tools are visible yet in a
2488
- lazy-loading client, search/load them through the host's tool discovery surface
2489
- first (\`tool_search\` when available). In local-files mode, or when the skill was
2490
- installed as plain text and no MCP tools are registered after discovery, run
2491
- \`npx @agent-native/core@latest plan blocks --out plan-blocks.md\` and read that
2492
- file first. The CLI command calls the public no-auth \`get-plan-blocks\` route and
2493
- sends no plan/recap content. If network access is unavailable, use the bundled
2494
- references and validate with \`plan local check\`; run \`plan local serve\` only
2495
- when the hosted Plan UI is reachable or a local Plan app is already running.
2496
-
2497
- The catalog returns the authoritative, always-current block vocabulary generated
2498
- live from the app's own block registry — the same config the renderer and MDX
2499
- round-trip use — so it can never be stale even if this SKILL.md is an old
2500
- installed copy:
2501
-
2502
- - \`get-plan-blocks\` (default \`format: "reference"\`) → a compact table of every
2503
- block's runtime \`type\`, exact MDX \`<Tag>\`, placement, and key data fields.
2504
- This is your map from each conceptual name above to its real tag and props.
2505
- - \`get-plan-blocks\` with \`format: "schema"\` → the full per-block JSON Schema
2506
- plus a worked example for each block, when you need exact field types,
2507
- enums, or nesting (e.g. \`Diff.annotations\`, \`Endpoint.params[].in\`,
2508
- \`DataModel.entities[].fields[]\`).
2509
-
2510
- Author the recap source against the tags and schemas that call returns. The
2511
- complete set of valid block-level tags is whatever \`get-plan-blocks\` lists;
2512
- any other capitalized tag at the block level is rejected on import with an
2513
- "Unknown plan block" / "did you mean" error. Lowercase HTML tags inside
2514
- \`rich-text\`/markdown prose (\`<div>\`, \`<span>\`, \`<code>\`, \`<br>\`, …) are always
2515
- fine — only capitalized component-style block tags are validated.
2516
-
2517
- A few recap-specific authoring rules the registry table cannot encode:
2518
-
2519
- - Every structured block takes a REQUIRED \`id\` (unique across the whole plan)
2520
- plus the shared optional \`summary\` / \`editable\` envelope. Ordinary top-level
2521
- Markdown prose imports as rich-text automatically; use \`<RichText id="...">\`
2522
- only when prose needs explicit metadata or a preserved referenced block id.
2523
- - Every capitalized block component must be self-closing (\`<Diagram ... />\`) or
2524
- explicitly closed around children (\`<RichText ...>...</RichText>\`). Never
2525
- leave a bare opening tag like \`<RichText ...>\` in a paragraph; MDX treats it
2526
- as unclosed JSX and import fails before the recap can render.
2527
- - Code-bearing blocks (\`Code\`, \`AnnotatedCode\`, and \`Diff\`) are
2528
- whitespace-sensitive. Prefer the exact MDX form from the \`get-plan-blocks\`
2529
- examples / source exporter, where multiline code is encoded as JSON string
2530
- attributes such as \`code={"const x =\\n y"}\`. Static template literals are
2531
- accepted only when they are static strings with no \`\${...}\` interpolation.
2532
- - \`Endpoint\`: prose \`description\` is the MDX **children** (body between the
2533
- tags), not an attribute; for a WebSocket upgrade use \`method="GET"\`. Each
2534
- request/response \`example\` is a JSON **string** (the renderer parses it into
2535
- the JSON explorer), so keep it a single parseable JSON value.
2536
- - \`TabsBlock\`: the whole \`tabs\` array (including nested child blocks) is ONE
2537
- JSON \`tabs={[…]}\` prop — there is NO nested \`<Tab>\` element.
2538
- - \`WireframeBlock\`: its body is a single \`<Screen surface ... html=… />\` subtree
2539
- (nested MDX, not a flat prop); \`html\` must be a single-quoted string or static
2540
- template literal, never a dynamic \`html={someVar}\` expression. See
2541
- \`references/wireframe.md\` for the HTML rules.
2542
- - \`Diagram\`: the whole payload is one \`data={{ html?, css?, nodes?, edges?, … }}\`
2543
- attribute and requires either \`html\` or at least one node; \`Mermaid\` is its
2544
- own separate block (\`source\` text), not a \`Diagram\` prop.
2545
-
2546
- ## Before / After Is The Headline
2547
-
2548
- The recap's center of gravity is the before/after comparison. For document-body
2549
- comparisons there are two primitives, and they cover the whole need together:
2550
-
2551
- - **\`columns\`** — the side-by-side container, for **structured** comparisons.
2552
- Use two columns labeled \`Before\` and \`After\`, each holding a block (commonly a
2553
- \`data-model\`, \`api-endpoint\`, or \`rich-text\`), so the reviewer reads the old
2554
- shape against the new shape in one glance. This is the right primitive for
2555
- "the schema went from X to Y" or "the endpoint contract changed like this."
2556
- Do not use \`columns\` simply to compact or group a list of API endpoints.
2557
- - **\`diff\`** — for **code**. It renders the literal removed and added lines. Use
2558
- it for the actual hunks. Use split mode by default for recap code review;
2559
- reserve \`mode: "unified"\` for genuinely narrow standalone hunks where
2560
- side-by-side would hide the code. Key-file diff groups should use horizontal
2561
- tabs so split diffs get the full document width.
2562
-
2563
- For UI diffs, wireframes are the visual comparison primitive. Use before/after
2564
- wireframes when the comparison clarifies the change; use after-only or a state
2565
- sequence when that better matches the change. The visual headline must show
2566
- exact placement, realistic chrome, and adequate padding before any abstract
2567
- explanation. Do not stop at the first visible affordance when the diff adds a
2568
- flow; show the entry point, the opened surface, and the resulting state or page
2569
- so the reviewer can trace the actual user path. \`references/wireframe.md\` owns
2570
- the before/after layout choice —
2571
- the \`columns\` renderer keeps narrow surfaces side by side and auto-stacks wide
2572
- \`desktop\`/\`browser\` frames vertically; never hand-build a side-by-side
2573
- wireframe layout in \`custom-html\`. For document-body
2574
- comparisons, there is no other multi-column primitive — \`columns\` plus the
2575
- \`diff\` block are the whole comparison vocabulary. Do not hand-build side-by-side
2576
- layouts in \`custom-html\`, and do not stack two \`data-model\` blocks vertically
2577
- and call it a comparison when \`columns\` exists to put them side by side.
2578
-
2579
- ## Grounding Rule
2580
-
2581
- Structured blocks are **true by construction** only if they are derived from the
2582
- actual changed lines. The \`diff\`, \`data-model\`, \`api-endpoint\`, and \`file-tree\`
2583
- blocks MUST be built mechanically from the real diff — real paths, real fields,
2584
- real method/path, real before/after text — never inferred, rounded, or invented.
2585
- The model writes only the prose: the "why", the narrative, the risk read. A
2586
- confidently wrong recap is dangerous in a review context, because a reviewer who
2587
- trusts the summary may skip the very line the summary got wrong. When the diff
2588
- does not contain a fact, leave it out rather than guess; mark anything the model
2589
- inferred (not extracted) as inferred in prose.
2590
-
2591
- ## Security
2592
-
2593
- - **Gate visibility.** Recaps of a private repo are org/login-gated — set the
2594
- plan's visibility to the owning org or login, never auto-public. A recap can
2595
- expose unreleased schema, internal endpoints, and architecture; treat it like
2596
- the source it summarizes. Any PR comment or handoff that links to the recap
2597
- must say that private-repo recaps require signing in with access to the owning
2598
- org if the link does not load.
2599
- - **Never transcribe secrets.** A diff can contain API keys, tokens, webhook
2600
- URLs, signing secrets, \`.env\` values, or credential-looking literals. Do not
2601
- copy any of these into a \`diff\`, \`file-tree\` snippet, \`api-endpoint\`, or prose
2602
- block — redact them (\`sk-•••\`, \`<redacted>\`). This mirrors the repo's
2603
- hardcoded-secret rule: obviously fake placeholders only, never the real value,
2604
- in any block, caption, or note.
2605
-
2606
- ## Bidirectional Loop
2607
-
2608
- In hosted mode, because a recap is a real, editable plan, the same review loop
2609
- as forward plans applies: a reviewer can annotate any block, and the coding
2610
- agent reads \`get-plan-feedback\` to drive fixes back into the code — annotation →
2611
- agent → diff, the same close-the-loop flow forward plans use. After a reviewer
2612
- annotates a block, call \`get-plan-feedback\` to read the structured feedback,
2613
- then either update the recap with \`create-visual-recap\` (passing the existing
2614
- \`planId\` to replace it in place) or apply targeted changes with
2615
- \`update-visual-plan\`. The loop is live and wired. In local-files privacy mode,
2616
- do not call those hosted tools; read review notes from chat or local files, edit
2617
- \`<plan-dir>/*.mdx\` directly, and rerun \`plan local check\`, \`serve\`, or \`verify\`
2618
- for \`<plan-dir>\`. The one thing not yet automatic is PR-comment-triggered
2619
- re-runs: the GitHub Action creates an initial recap per PR, but it does not yet
2620
- re-run automatically when new review feedback is posted in GitHub — that
2621
- auto-re-run is the remaining fast-follow.
2622
-
2623
- ## Related Skills
2624
-
2625
- - **visual-plan** — the canonical command and the source of the shared Wireframe
2626
- & Canvas and Document Quality cores; a recap follows the same block discipline
2627
- in reverse.
2628
- - **comment anchors** — recap comments use the same anchor rules as forward
2629
- plans; see "Interpreting comment anchors" in the visual-plan skill for
2630
- coordinate frames, wireframe node ids, text-quote resolution, detached
2631
- threads, routing via \`resolutionTarget\`, and two-axis consumed/resolved state.
2632
- - **security** — data scoping, secret handling, and the hardcoded-secret rule the
2633
- recap's redaction and visibility gating mirror.
2634
- - **sharing** — org/login-gated visibility for the plan that holds the recap.
2635
- `;
2636
- export const VISUALIZE_REPO_SKILL_MD = `---
2637
- name: visualize-repo
2638
- description: >-
2639
- Open or create a repo-native visual documentation workspace backed by local
2640
- Plan MDX files. Use when the user asks to visualize a repository, create
2641
- durable visual docs for APIs/components/models/flows, launch a visual repo
2642
- viewer, review repo docs like a visual IDE, or collect Plan comments that
2643
- should become coding-agent changes.
2644
- metadata:
2645
- visibility: exported
2646
- ---
2647
-
2648
- # Visualize Repo
2649
-
2650
- \`/visualize-repo\` opens a local, source-controlled visual documentation layer
2651
- for a repository. It is for durable repo understanding, not a one-off plan:
2652
- components can have wireframes, APIs can have specs, models can have schema
2653
- views, and reviewers can comment on those docs before sending work to a coding
2654
- agent.
2655
-
2656
- ## Default Command
2657
-
2658
- Run the Agent-Native CLI from the repo root:
2659
-
2660
- \`\`\`bash
2661
- npx @agent-native/core@latest visualize-repo --open
2662
- \`\`\`
2663
-
2664
- Useful variants:
2665
-
2666
- \`\`\`bash
2667
- npx @agent-native/core@latest visualize-repo init
2668
- npx @agent-native/core@latest visualize-repo --target actions --target server/db/schema.ts
2669
- npx @agent-native/core@latest visualize-repo check
2670
- npx @agent-native/core@latest visualize-repo verify
2671
- npx @agent-native/core@latest visualize-repo --no-open
2672
- \`\`\`
2673
-
2674
- The command writes or updates \`agent-native.json\` with an
2675
- \`apps.visualize-repo\` local-files section, creates a starter MDX folder at
2676
- \`.agent-native/visual-docs/repo-overview\`, then serves it through the Plan
2677
- local bridge. The hosted Plan UI can render the review surface, but the plan
2678
- source stays in local files and bridge comments stay in \`comments.json\`.
2679
-
2680
- ## When There Is No Manifest
2681
-
2682
- If \`agent-native.json\` does not exist, let the CLI bootstrap one. It scans for
2683
- high-value starting points such as \`actions/\`, \`app/components/\`,
2684
- \`app/pages/\`, \`server/db/schema.ts\`, \`src/\`, \`packages/\`, \`templates/\`,
2685
- \`docs/\`, and \`content/\`. Keep the first run targeted. Prefer 5-20 visualized
2686
- nodes over a generated wall of repo prose.
2687
-
2688
- Use explicit targets when the user already knows the important surface:
2689
-
2690
- \`\`\`bash
2691
- npx @agent-native/core@latest visualize-repo \\
2692
- --target actions/webhooks.ts \\
2693
- --target server/db/schema.ts \\
2694
- --target app/components/PromptComposer.tsx
2695
- \`\`\`
2696
-
2697
- ## Agent Workflow
2698
-
2699
- 1. Inspect \`agent-native.json\` and the generated \`plan.mdx\`.
2700
- 2. Read the source anchors listed for each target before changing the visual
2701
- docs.
2702
- 3. Add only the visual blocks that earn their keep: \`api-endpoint\` for stable
2703
- APIs, \`data-model\` for durable schema, \`wireframe\` for user-facing
2704
- components/flows, \`diagram\` for architecture, and \`annotated-code\` for
2705
- load-bearing implementation.
2706
- 4. Run \`npx @agent-native/core@latest visualize-repo check\` after editing MDX.
2707
- 5. Use \`verify\` before handoff when renderer correctness matters.
2708
-
2709
- When acting on comments, treat local \`comments.json\` as the feedback inbox.
2710
- Agent-targeted comments should become code changes plus matching MDX updates so
2711
- the visual docs and executable code stay in sync.
2712
-
2713
- ## Privacy Boundary
2714
-
2715
- \`visualize-repo check\` is local/offline lint. \`visualize-repo --open\` starts a
2716
- localhost bridge and opens the Plan UI against local files; it does not publish
2717
- the plan to hosted storage and performs no hosted Plan database writes.
2718
- \`visualize-repo verify\` may send the MDX folder to the Plan app's public
2719
- validation action so the real renderer schema can check it. For no hosted
2720
- content egress, pass \`--app-url\` pointing at a local Plan app or skip
2721
- \`verify\` and rely on \`check\`.
2722
-
2723
- Do not call hosted Plan write tools for this workflow unless the user explicitly
2724
- asks to publish or share the docs. Avoid \`create-visual-plan\`,
2725
- \`update-visual-plan\`, \`import-visual-plan-source\`, \`patch-visual-plan-source\`,
2726
- and \`get-plan-feedback\` for local repo docs; edit the MDX files directly and
2727
- use the local bridge.
2728
- `;
20
+ export { CANVAS_REFERENCE_MD, CONNECTION_REFERENCE_MD, DOCUMENT_QUALITY_REFERENCE_MD, EXEMPLAR_REFERENCE_MD, LOCAL_FILES_REFERENCE_MD, VISUAL_PLANS_SKILL_MD, VISUAL_RECAP_SKILL_MD, VISUALIZE_REPO_SKILL_MD, WIREFRAME_REFERENCE_MD, };
2729
21
  export const BUILT_IN_APP_SKILLS = {
2730
22
  assets: {
2731
23
  skillName: "assets",