@agent-native/core 0.97.0 → 0.98.1

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