@agent-native/core 0.37.1 → 0.37.3

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 (39) hide show
  1. package/dist/brand-kit/fig/decode.d.ts +33 -0
  2. package/dist/brand-kit/fig/decode.d.ts.map +1 -0
  3. package/dist/brand-kit/fig/decode.js +358 -0
  4. package/dist/brand-kit/fig/decode.js.map +1 -0
  5. package/dist/brand-kit/fig/extract-design-system.d.ts +44 -0
  6. package/dist/brand-kit/fig/extract-design-system.d.ts.map +1 -0
  7. package/dist/brand-kit/fig/extract-design-system.js +752 -0
  8. package/dist/brand-kit/fig/extract-design-system.js.map +1 -0
  9. package/dist/brand-kit/fig/fig-to-html.d.ts +246 -0
  10. package/dist/brand-kit/fig/fig-to-html.d.ts.map +1 -0
  11. package/dist/brand-kit/fig/fig-to-html.js +1506 -0
  12. package/dist/brand-kit/fig/fig-to-html.js.map +1 -0
  13. package/dist/brand-kit/fig/index.d.ts +30 -0
  14. package/dist/brand-kit/fig/index.d.ts.map +1 -0
  15. package/dist/brand-kit/fig/index.js +43 -0
  16. package/dist/brand-kit/fig/index.js.map +1 -0
  17. package/dist/cli/skills.d.ts +4 -0
  18. package/dist/cli/skills.d.ts.map +1 -1
  19. package/dist/cli/skills.js +841 -378
  20. package/dist/cli/skills.js.map +1 -1
  21. package/dist/client/AssistantChat.d.ts.map +1 -1
  22. package/dist/client/AssistantChat.js +6 -104
  23. package/dist/client/AssistantChat.js.map +1 -1
  24. package/dist/client/context-xray/ContextMeter.js +1 -1
  25. package/dist/client/context-xray/ContextMeter.js.map +1 -1
  26. package/dist/client/context-xray/ContextSegmentRow.d.ts.map +1 -1
  27. package/dist/client/context-xray/ContextSegmentRow.js +4 -4
  28. package/dist/client/context-xray/ContextSegmentRow.js.map +1 -1
  29. package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
  30. package/dist/client/context-xray/ContextTreemap.js +2 -2
  31. package/dist/client/context-xray/ContextTreemap.js.map +1 -1
  32. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
  33. package/dist/client/context-xray/ContextXRayPanel.js +19 -18
  34. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  35. package/dist/client/sharing/ShareButton.d.ts +4 -0
  36. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  37. package/dist/client/sharing/ShareButton.js +6 -4
  38. package/dist/client/sharing/ShareButton.js.map +1 -1
  39. package/package.json +6 -1
@@ -15,13 +15,13 @@ const HELP = `agent-native skills
15
15
 
16
16
  Usage:
17
17
  agent-native skills list
18
- agent-native skills add assets|design-exploration|plans|visual-plan|ui-plan|visualize-plan|context-xray [--client codex|claude-code|claude-code-cli|cowork|all] [--scope user|project] [--mcp-url <url>] [--yes] [--dry-run] [--json]
18
+ agent-native skills add assets|design-exploration|visual-plan|visual-questions|ui-plan|visualize-plan|context-xray [--client codex|claude-code|claude-code-cli|cowork|all] [--scope user|project] [--mcp-url <url>] [--yes] [--dry-run] [--json]
19
19
  agent-native skills add <manifest-or-app-dir> [--client ...] [--yes]
20
20
 
21
21
  Examples:
22
22
  agent-native skills add assets
23
23
  agent-native skills add design-exploration
24
- agent-native skills add plans
24
+ agent-native skills add visual-plan
25
25
  agent-native skills add context-xray --client all
26
26
  agent-native skills add assets --client claude-code
27
27
  agent-native skills add assets --mcp-url https://my-app.ngrok-free.dev
@@ -185,191 +185,291 @@ iteration, or a human-in-the-loop choice among design directions.
185
185
  - If you inspect local MCP config, redact \`Authorization\`, \`http_headers\`,
186
186
  and token values. Never paste bearer tokens into chat or logs.
187
187
  `;
188
- const VISUAL_PLANS_SKILL_MD = `---
189
- name: visual-plans
188
+ export const VISUAL_PLANS_SKILL_MD = `---
189
+ name: visual-plan
190
190
  description: >-
191
- Use Agent-Native Plans when coding-agent work needs an interactive HTML plan
192
- document with diagrams, wireframes, mockups, prototypes, annotations, and
193
- comments.
191
+ Use Agent-Native Plans when coding-agent work needs an interactive structured
192
+ plan document with diagrams, wireframes, mockups, prototypes, annotations,
193
+ and comments.
194
194
  metadata:
195
195
  visibility: exported
196
196
  ---
197
197
 
198
198
  # Agent-Native Plans
199
199
 
200
- Agent-Native Plans is HTML plan mode for coding agents. Generate the kind of
201
- plan you would normally write in Markdown, but as a scannable HTML plan
202
- document with visual blocks mixed in: diagrams, wireframes, mockups, prototype
203
- options, tradeoff cards, file/symbol implementation maps, code previews, and
204
- annotation prompts. It is a plan document, not a marketing page.
200
+ Agent-Native Plans is structured visual planning mode for coding agents. Build
201
+ the plan you would normally write in Markdown, but as a scannable document with
202
+ editable blocks mixed in: an optional pan/zoom wireframe canvas on top and a
203
+ Notion-like technical document below. The user reacts to visuals first and reads
204
+ prose only where it helps.
205
205
 
206
- The goal is impatient review. The user should be able to react to visuals first
207
- and read prose only where it helps.
208
-
209
- Install with the Agent-Native CLI. It adds the skills and the MCP connector:
210
-
211
- \`\`\`bash
212
- npx @agent-native/core@latest skills add plans
213
- \`\`\`
214
-
215
- Then start typing \`/visual-plan\` for a fresh general plan, \`/ui-plan\` for a
216
- UI-first high-fidelity plan, or \`/visualize-plan\` to turn an existing Codex,
217
- Claude Code, Markdown, or pasted plan into a visual companion. The hosted MCP
218
- app opens inline where supported and falls back to a browser link everywhere
219
- else.
220
-
221
- ## Slash Commands
222
-
223
- - \`/visual-plan\`: create a fresh rich HTML plan before implementation. Include
224
- a docs-level plan, visual architecture/flow diagrams, detailed wireframes or
225
- mockups when UI is involved, an implementation map with files/symbols/snippets,
226
- tradeoffs, open questions, and clear feedback prompts.
227
- - \`/ui-plan\`: create a UI-first high-fidelity HTML plan before implementation.
228
- Use an optional top pan/zoom wireframe or diagram canvas when visuals clarify
229
- the flow, then continue as a refined Notion-like document with rich tabs,
230
- comments/drawing prompts, code tabs, and agent handoff notes.
231
- - \`/visualize-plan\`: import an existing Codex, Claude Code, Markdown, or pasted
232
- text plan and turn it into a visual companion. Preserve the plan's intent,
233
- then add diagrams, wireframes, option cards, file/symbol maps, and annotation
234
- prompts.
206
+ \`/visual-plan\` is the canonical command and the main entry point. Use \`/ui-plan\`
207
+ when the work is primarily product UI and review should start with the screens.
208
+ Use \`/visual-questions\` to run a visual intake form first. Use \`/visualize-plan\`
209
+ to turn an existing Codex, Claude Code, Markdown, or pasted plan into a visual
210
+ companion.
235
211
 
236
212
  ## When To Use
237
213
 
238
- Create or update a visual plan when:
239
-
240
- - the user asks for a plan, visual plan, HTML plan, plannotate-style review,
241
- diagrams, wireframes, mockups, prototype options, comments, or annotations;
242
- - work is multi-file, ambiguous, long-running, risky, or UI-heavy;
243
- - the user needs to react quickly to direction rather than read prose;
244
- - architecture, data flow, UI direction, options, or open questions would be
245
- clearer visually;
246
- - you need the user to react before implementation.
247
-
248
- The companion \`visualize-plan\` skill is installed with this one. Use it when
249
- the user already has a Codex, Claude Code, Markdown, or pasted text plan and
250
- wants a visual companion instead of a fresh plan.
214
+ Create a visual plan when work is multi-file, ambiguous, long-running, risky, or
215
+ UI-heavy, when architecture / data flow / UI direction / options / open
216
+ questions would be clearer visually, or when the user needs to react to a
217
+ direction before you implement.
251
218
 
252
219
  ## Plan Discipline
253
220
 
254
- Plan mode protects the user from wasted work; it is not ceremony. Hold this
255
- discipline before and around the plan document:
256
-
257
- - **Right-size first.** Build a visual plan when work is multi-file, ambiguous,
258
- risky, architectural, UI-heavy, has multiple valid approaches, or the code is
259
- unfamiliar. Skip it for trivial, unambiguous work — typos, one-line fixes, a
260
- single well-specified function, anything whose diff you could describe in one
261
- sentence — and just make the change. A polished HTML plan is the most
262
- expensive plan form; only invest when a wrong direction is costly. Never pad a
263
- plan with filler or ship a single-step plan.
221
+ - **Gate hard.** A polished visual plan is the most expensive plan form; only
222
+ invest when a wrong direction is costly. Skip it for trivial, unambiguous work
223
+ — typos, one-line fixes, a single well-specified function, anything whose diff
224
+ you could describe in one sentence and just make the change. Never pad a plan
225
+ with filler and never ship a single-step plan.
264
226
  - **Research before you draft.** Read the real files, actions, schema, and
265
- existing patterns first, and name actual files, symbols, and data shapes in
266
- the plan instead of inventing them. Check existing \`actions/\` before proposing
267
- endpoints and prefer named client helpers over raw fetch. Delegate wide
268
- exploration to a sub-agent so the main context stays clear.
269
- - **Planning is read-only.** Make no source edits while building or reviewing
270
- the plan. Start editing code only after the user approves the direction.
271
- - **Clarify vs. assume.** Do not ask the user how to build it explore and
272
- present the approach and options in the plan. Ask a clarifying question only
273
- when an ambiguity would change the design and you cannot resolve it from the
274
- code or a sensible default; batch a small set (2-4) of high-leverage,
275
- decision-changing questions before finalizing. Otherwise state the most
276
- reasonable assumption explicitly and proceed. Put anything still unresolved in
277
- a dedicated open-questions / needs-clarification blocknever guess silently,
278
- and never fill it with detail you could infer.
279
- - **Be specific.** Every plan states the objective and what "done" means,
280
- explicit scope and non-goals, ordered verifiable steps that name real files,
281
- symbols, and actions, the key choices with rationale, risks, and a closing
282
- verification step (tests, build, or a checkable behavior). Replace vague prose
283
- with specifics; never ship a step like "make it work."
284
- - **The plan is the approval gate.** After surfacing the plan, explicitly ask
285
- the user to review and approve before you write any code, and name which
286
- files/areas and permissions the work will touch so approval grants scope.
287
- Presenting the plan and requesting sign-off is the approval step — do not ask
288
- a separate "does this look good?" question.
289
- - **The document is the source of truth, not the chat.** When scope shifts
290
- during review or implementation, update the plan with \`update-visual-plan\`
291
- rather than only changing course in chat, and re-read the approved plan before
292
- major steps so the work does not drift.
227
+ patterns first; name actual files, symbols, and data shapes instead of
228
+ inventing them. Check existing \`actions/\` before proposing endpoints and prefer
229
+ named client helpers over raw fetch. Delegate wide exploration to a sub-agent.
230
+ - **Planning is read-only.** Make no source edits while building or reviewing the
231
+ plan. Start editing only after the user approves the direction.
232
+ - **Clarify vs. assume.** Do not ask how to build it — explore and present the
233
+ approach and options in the plan. Ask a clarifying question only when an
234
+ ambiguity would change the design and you cannot resolve it from the code; batch
235
+ 2-4 high-leverage questions before finalizing. Otherwise state the assumption
236
+ explicitly and proceed, and put anything unresolved in an open-questions block.
237
+ - **The plan is the approval gate.** After surfacing it, ask the user to review
238
+ and approve before you write code, and name which files/areas the work touches.
239
+ Presenting the plan and requesting sign-off is the approval step do not ask a
240
+ separate "does this look good?" question.
241
+ - **The document is the source of truth, not the chat.** When scope shifts,
242
+ update the plan with \`update-visual-plan\` rather than only changing course in
243
+ chat, and re-read the approved plan before major steps.
293
244
 
294
245
  ## Core Workflow
295
246
 
296
- 1. Call \`create-visual-plan\` with the title, brief, source, repo path, and plan
297
- sections before implementation.
298
- 2. Put the best possible plan document in \`html\` when you can. It should feel
299
- like a bespoke HTML version of a strong Markdown implementation plan, not a
300
- dashboard or landing page.
301
- 3. Surface the returned Plans link or inline MCP App. In CLI hosts, ask the user
302
- to review the plan visually.
303
- 4. Prefer diagrams, wireframes, UI mockups, option cards, implementation maps,
304
- and small interactive prototypes over paragraphs.
305
- 5. Call \`get-plan-feedback\` before editing, after review, after any long pause,
247
+ 1. Call \`create-visual-plan\` with the title, brief, source, repo path, and
248
+ structured \`content\` blocks.
249
+ 2. Compose the canvas from the kit and write the document with native blocks
250
+ (see the two cores below). Skip the canvas for non-visual work.
251
+ 3. Surface the returned Plans link or inline MCP App and ask the user to review.
252
+ 4. Call \`get-plan-feedback\` before editing, after review, after any long pause,
306
253
  and before the final response.
307
- 6. Incorporate comments/corrections with \`update-visual-plan\`; update the HTML
308
- document when feedback changes the direction.
309
- 7. Export an HTML/JSON/Markdown receipt with \`export-visual-plan\` when the
310
- user wants a shareable summary.
311
-
312
- ## Visual Defaults
313
-
314
- - Use implementation-plan structure first: objective, scope/non-goals, proposed
315
- approach, phases or steps, files/symbols/snippets, risks, open questions, and
316
- validation.
317
- - UI work gets detailed wireframes, mockups, or prototype options before coding.
318
- - Use \`/ui-plan\` when UI direction is the center of the work. \`/visual-plan\`
319
- stays the general plan command for architecture, backend, refactors, and
320
- mixed implementation planning.
321
- - Wireframes should be concrete enough to critique: layout regions, controls,
322
- states, empty/loading/error paths, review affordances, and copy placeholders.
323
- - Backend/refactor work gets architecture and data-flow diagrams.
324
- - Complex tradeoffs get two or three option cards with consequences.
325
- - Open questions are surfaced as visual callouts, not buried in paragraphs.
326
- - Long prose is split into readable document sections with clear headings.
327
- - Visuals should be review aids, not decoration. Avoid decorative hero art,
328
- gradient/hero backgrounds, brand/logo chrome, nav bars, slogans, fluffy value
329
- props, huge landing-page H1s, or marketing-style cards unless the user
330
- explicitly asks.
331
- - Implementation plans include a file map: file path, symbols/components to
332
- touch, reason for the change, risk/coordination notes when relevant, and short
333
- syntax-highlighted snippets for the code shape the agent expects to modify.
334
- - File previews should be concise and reviewable. Do not paste entire large
335
- files; show the key region, public API, component boundary, schema, action, or
336
- selector that matters for review.
337
- - Include README-like detail when helpful: command names, tool behavior,
338
- install flow, MCP/link fallback, data shape, and what is in or out of scope.
339
- - Comments, corrections, replacements, and annotations should feel
340
- plannotator-style: fast to mark up, structured enough for the agent to
341
- consume, and easy to share when the user chooses.
254
+ 5. Apply changes with \`update-visual-plan\`, preferring targeted \`contentPatches\`.
255
+ When the user wants source-control friendly edits, use
256
+ \`patch-visual-plan-source\` against the MDX files instead of regenerating the
257
+ plan.
258
+ 6. Export with \`export-visual-plan\` only when the user wants a shareable receipt
259
+ or repo-check-in artifacts.
260
+
261
+ <!-- SHARED-CORE:wireframe-canvas START -->
262
+ ## Wireframe & Canvas Core
263
+
264
+ This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
265
+ \`/visualize-plan\`. It is the single source of truth for how wireframes and the
266
+ canvas work. Do not paraphrase it per command.
267
+
268
+ **The renderer owns all visual quality. You emit content, never styling.** Flex
269
+ layout, fonts, density, spacing, theme, and the hand-drawn wobble all live in
270
+ the app renderer. Never emit coordinates, CSS, pixel sizes, or raw HTML for a
271
+ wireframe's internals. Your job is to pick a surface, compose real product
272
+ content from the kit, and annotate nothing else.
273
+
274
+ **A wireframe block's data is a declarative kit tree, not geometry:**
275
+
276
+ \`\`\`json
277
+ {
278
+ "surface": "desktop",
279
+ "screen": [
280
+ { "el": "browserBar", "title": "tasklist" },
281
+ { "el": "row", "children": [
282
+ { "el": "sidebar", "children": [
283
+ { "el": "navItem", "label": "Inbox", "count": 12, "active": true },
284
+ { "el": "navItem", "label": "Today", "count": 4 },
285
+ { "el": "navItem", "label": "Done" }
286
+ ] },
287
+ { "el": "main", "children": [
288
+ { "el": "title", "text": "Today", "script": true },
289
+ { "el": "chips", "items": [
290
+ { "label": "All", "active": true }, { "label": "Active" }, { "label": "Done" }
291
+ ] },
292
+ { "el": "section", "label": "OVERDUE", "tone": "warn" },
293
+ { "el": "taskRow", "title": "Send invoice to Acme Co.", "due": "Yesterday", "dueTone": "warn", "prio": 1 },
294
+ { "el": "taskRow", "title": "Reply to design feedback", "due": "Today", "prio": 2 }
295
+ ] }
296
+ ] }
297
+ ]
298
+ }
299
+ \`\`\`
300
+
301
+ The renderer maps each node to a flex kit component and applies one whole-frame
302
+ wobble. Layout is always flex: \`row\`, \`col\`, \`sidebar\`, and \`main\` set the flex
303
+ direction; everything aligns by construction, so you never get overlap or drift.
304
+
305
+ **Surface presets — match the real footprint, never default to desktop+mobile.**
306
+ Pick the \`surface\` that matches what the user will actually see:
307
+
308
+ - \`desktop\`: a full page or app shell.
309
+ - \`mobile\`: a phone screen, only when the work is genuinely mobile.
310
+ - \`popover\`: a small floating menu, dropdown, or inline popover.
311
+ - \`panel\`: a side panel, inspector, or sidebar widget.
312
+ - \`browser\`: a page that needs a browser chrome frame around it.
313
+
314
+ A sidebar popover renders as a small surface, not a desktop page and a phone
315
+ frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
316
+ actually changes the layout. For a component or widget, show one broader
317
+ app-context frame only when placement affects understanding, then the focused
318
+ component states.
319
+
320
+ **Node vocabulary (\`el\` values).** Every node is \`{ el, ...props, children? }\`:
321
+
322
+ - Layout: \`screen\`, \`row\`, \`col\`, \`sidebar\`, \`main\`, \`card{children}\`,
323
+ \`column{title,count?,children}\`, \`box{children,dashed?}\`, \`divider\`.
324
+ - Chrome: \`browserBar{title}\`, \`statusBar\`, \`searchBar\`, \`toolbar\`.
325
+ - Navigation: \`navItem{label,count?,active?,dot?}\`, \`tabs\`/\`chips{items:[{label,active?}]}\`,
326
+ \`chip{label,active?}\`, \`pill{label,tone?}\`.
327
+ - Content: \`title{text,script?}\`, \`text{value,color?,weight?}\`,
328
+ \`lines{n?,widths?}\`, \`section{label,tone?}\`,
329
+ \`taskRow{title,note?,due?,dueTone?,prio?,done?}\`, \`kv{rows:[{k,v}]}\`,
330
+ \`avatar\`, \`iconSquare{active?}\`.
331
+ - Inputs: \`field{label?,value?,placeholder?,area?}\`, \`check{done?,shape?}\`,
332
+ \`btn{label,solid?,full?}\`, \`fab{icon?}\`.
333
+
334
+ Put **real product content** in props: real labels, real dates, real counts,
335
+ real button text grounded in the actual screen or component you read. Use
336
+ \`lines\`/\`text\` (with no \`value\`) only for genuine placeholder body copy — never
337
+ fill a screen with gray placeholder bars. Buttons (\`btn\`, \`fab\`) must read as
338
+ actionable controls.
339
+
340
+ **Default crisp.** Sketchiness is a low default (a subtle single wobble over the
341
+ whole frame), not a heavy scribble. Do not ask for or assume a heavy sketch
342
+ look.
343
+
344
+ **Canvas annotations are designer notes on the artboard.** When a top canvas is
345
+ present, sprinkle Figma-style notes near the frames they explain: a short
346
+ heading, supporting text, and bullets — plain text layers, never bordered or
347
+ shadowed cards, and never a box around a frame. The renderer spaces notes away
348
+ from frames, so place each note by the frame it describes. Use an arrow only to
349
+ point at one specific control or transition; for a broad frame-level note, write
350
+ text beside the frame with no connector. Connectors are for real sequences only —
351
+ never fake "Step 1 → Step 2" lines between independent states.
352
+
353
+ **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
354
+ (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
355
+ than regenerating the whole plan. \`contentPatches\` are part of the public MCP
356
+ action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
357
+ edits. If an agent is working from exported source files, use
358
+ \`read-visual-plan-source\` / \`patch-visual-plan-source\`: \`plan.mdx\` holds
359
+ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
360
+ \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
361
+ patch action normalizes the MDX back into the same JSON runtime model. JSON is
362
+ the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
363
+
364
+ **Legacy imports only.** Old or imported plans may carry coordinate-based
365
+ regions or a full standalone HTML document; the renderer still displays them.
366
+ Never emit geometry, regions, or a standalone HTML document for a new plan —
367
+ compose the kit tree instead.
368
+ <!-- SHARED-CORE:wireframe-canvas END -->
369
+
370
+ <!-- SHARED-CORE:document-quality START -->
371
+ ## Document Quality Core
372
+
373
+ This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
374
+ \`/visualize-plan\`. It is the single source of truth for the document below the
375
+ canvas. Do not paraphrase it per command.
376
+
377
+ **The document is a serious technical plan, not marketing.** Write it the way a
378
+ strong Claude or Codex implementation plan reads: outcome-first, prose-first,
379
+ self-contained, and specific. State the objective and what "done" means, the
380
+ scope and non-goals, the proposed approach with the key decisions and their
381
+ rationale, ordered steps that name real files, symbols, actions, and data
382
+ shapes, the risks, and a closing verification step (tests, build, or a checkable
383
+ behavior). Replace vague prose with specifics; never ship a step like "make it
384
+ work." No hero art, gradients, logos, nav bars, slogans, value props, giant
385
+ landing-page headings, or marketing cards unless the user explicitly asks.
386
+
387
+ **Canvas and document never duplicate each other.** The UI story lives on the
388
+ canvas with on-canvas annotations; the document carries the technical depth the
389
+ canvas cannot show — concrete file/symbol maps, API and data contracts, code
390
+ snippets, migration or implementation phases, risks, and validation. Repeat a
391
+ wireframe in the document only for a genuinely new detail view or comparison.
392
+ Skip the canvas entirely for non-visual work and write a clean rich document.
393
+
394
+ **Use the right block, and make it carry substance:**
395
+
396
+ - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
397
+ - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
398
+ symbols/components to touch, the reason, risk/coordination notes, and a
399
+ concise syntax-highlighted snippet of the code shape — never the whole file,
400
+ never a prose-only file list.
401
+ - \`decision\` for two or three option cards with consequences. These are static
402
+ records; do not style them like clickable tabs or chips unless the renderer
403
+ truly supports changing the selection.
404
+ - \`diagram\` for architecture, sequence, data-flow, dependency, or state
405
+ relationships, only when it clarifies something real. Labels must not overlap
406
+ nodes, connectors, or each other.
407
+ - \`tabs\` for multiple states, directions, or comparisons. A tab that reveals
408
+ only prose usually means the plan is under-specified — include a relevant
409
+ visual unless the tab is intentionally document-only.
410
+ - \`table\`, \`checklist\`, \`callout\` for scannable structure.
411
+
412
+ **Open questions are callouts, not buried prose.** Surface anything unresolved in
413
+ a dedicated open-questions / needs-clarification block. Never put a
414
+ questions/decisions wall inside the plan narrative.
415
+
416
+ **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
417
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a placeholder,
418
+ density demo, or proof that custom HTML works. Prefer the native blocks; they
419
+ cover real plans.
420
+
421
+ **Before handoff, open the plan and check it.** Fix overlap, excessive
422
+ whitespace, clipped fragments, misleading inactive controls, poor contrast, and
423
+ unreadable diagrams before asking for approval.
424
+ <!-- SHARED-CORE:document-quality END -->
425
+
426
+ <!-- SHARED-CORE:exemplar START -->
427
+ ## Good vs. Bad Exemplar
428
+
429
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard
430
+ composed from the kit — a sidebar of real \`navItem\`s (\`Inbox 12\`, \`Today 4\`,
431
+ \`Done\`), a \`main\` with a scripted \`title\`, real \`chips\`, a \`section\` labeled
432
+ \`OVERDUE\`, and \`taskRow\`s carrying real titles, due dates, and priorities — one
433
+ subtle whole-frame wobble, correct desktop footprint, and plain-text designer
434
+ notes spaced off the frames pointing only at the controls that need explanation.
435
+ Below it, a Claude/Codex-grade document: objective and done-criteria, an
436
+ \`implementation-map\` naming the real components and actions with short
437
+ highlighted snippets, a \`decision\` card weighing two real approaches, and a
438
+ validation step — none of it repeating the canvas. This is the bar.
439
+
440
+ **BAD.** Empty coordinate boxes placed by \`x/y/width/height\`, gray placeholder
441
+ bars "insinuating" text, crisp double-bordered rectangles or a heavy scribble, a
442
+ forced desktop + mobile pair for a popover, floating bordered annotation cards
443
+ hugging the frames, and a marketing-style document with a hero heading and value
444
+ props that just restates what the canvas already shows. Never produce this.
445
+ <!-- SHARED-CORE:exemplar END -->
342
446
 
343
447
  ## Tool Guidance
344
448
 
345
- - \`create-visual-plan\`: start one HTML plan per agent task/run.
346
- - \`create-ui-plan\`: start a UI-first plan with high-fidelity screen/state tabs.
347
- - \`visualize-plan\`: create a visual companion from an existing text plan.
348
- - \`update-visual-plan\`: revise the plan document, sections, status, or comments.
349
- - \`get-visual-plan\`: read the current plan document and annotations.
449
+ - \`create-visual-plan\`: start one structured visual plan per agent task/run.
450
+ - \`create-ui-plan\`: start a UI-first plan when the work is primarily product UI.
451
+ - \`create-visual-questions\`: run a visual intake form before planning.
452
+ - \`visualize-plan\`: build a visual companion from an existing text plan.
453
+ - \`update-visual-plan\`: revise content, status, or comments; prefer
454
+ \`contentPatches\` over regenerating the whole plan.
455
+ - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
456
+ optional \`canvas.mdx\`, optional \`.plan-state.json\`, and JSON.
457
+ - \`patch-visual-plan-source\`: apply granular MDX AST patches by stable block,
458
+ artboard, annotation, component, or wireframe-node id.
459
+ - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
460
+ - \`get-visual-plan\`: read the current structured plan, exported HTML, and
461
+ annotations; it also returns the MDX folder for source workflows.
350
462
  - \`get-plan-feedback\`: read unconsumed human feedback. Use it frequently.
351
- - \`export-visual-plan\`: export HTML, Markdown fallback, and structured JSON.
352
-
353
- ## HTML Guidance
354
-
355
- - Prefer semantic HTML with scoped CSS inside the document.
356
- - Match Agent-Native's dark, restrained theme unless the user asks otherwise.
357
- - Keep the first viewport legible and plan-like: title, brief, concise scope,
358
- and a useful diagram/checklist/table when it helps.
359
- - Use tabs, accordions, or small interactions only when they make review faster.
360
- - Do not paste huge HTML into chat. Store it in Plans and surface the MCP app or
361
- link.
362
-
363
- ## Guardrails
364
-
365
- - Keep it simple. Do not build a ten-tab dashboard unless the user asks.
366
- - Do not hand-roll MCP HTTP requests with curl. Use host-exposed tools after
367
- restart/reload, or use the returned browser/deep-link fallback.
368
- - Hosted default: connect
369
- \`https://plan.agent-native.com/_agent-native/mcp\`. Do not put shared
370
- secrets in skill files.
463
+ - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
464
+ files for repo check-in.
465
+
466
+ When the user critiques a plan's look or structure, fix the renderer or this
467
+ skill — never hand-edit one stored plan. Turn feedback into better guidance.
468
+
469
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`. Do
470
+ not put shared secrets in skill files.
371
471
  `;
372
- const UI_PLAN_SKILL_MD = `---
472
+ export const UI_PLAN_SKILL_MD = `---
373
473
  name: ui-plan
374
474
  description: >-
375
475
  Use Agent-Native Plans for UI-first planning with an optional top pan/zoom
@@ -382,253 +482,603 @@ metadata:
382
482
  # UI Plan
383
483
 
384
484
  Use \`/ui-plan\` when the task is primarily about product UI, user flows,
385
- interaction states, component layout, responsive behavior, or visual direction.
386
- This is a specialized Agent-Native Plans workflow: the reviewable UI comes
387
- first, and implementation details come after the user has something concrete to
485
+ interaction states, component layout, or visual direction. The reviewable UI
486
+ comes first; implementation detail comes after the user has something concrete to
388
487
  react to.
389
488
 
390
- \`/visual-plan\` remains the general rich planning command for architecture,
391
- backend, refactors, migrations, and mixed work. Use \`/visualize-plan\` when a
392
- text plan already exists and should become an HTML companion.
489
+ \`/visual-plan\` remains the general command for architecture, backend, refactors,
490
+ and mixed work. Use \`/visual-questions\` first when the user should answer intake
491
+ questions, and \`/visualize-plan\` when a text plan already exists.
393
492
 
394
493
  ## Plan Discipline
395
494
 
396
- - **Right-size first.** Use a UI plan when the surface is new, ambiguous, spans
397
- several screens or states, or the direction needs agreement before coding.
398
- Skip it for cosmetic one-liners — a color, a label, a spacing tweak — and just
399
- make the change.
400
- - **Research before you draft.** Read the real components, routes, design
401
- tokens, and existing patterns first, and ground mockups and the file map in
402
- actual files and symbols rather than inventing them. Delegate wide exploration
403
- to a sub-agent when the surface is large.
404
- - **Planning is read-only.** Make no source edits while building or reviewing
405
- the plan. Start editing only after the user approves the UI direction.
406
- - **Clarify vs. assume.** Do not ask the user how to build the UI — explore and
407
- present the direction and options as mockups and tabs. Ask a clarifying
408
- question only when an ambiguity would change the design and you cannot resolve
409
- it from the code or a sensible default; batch 2-4 high-leverage,
410
- decision-changing questions before finalizing. Otherwise state the assumption
411
- in the plan and proceed.
412
- - **The plan is the approval gate.** Explicitly ask the user to review and
413
- approve the UI direction before you write any code, and name the files/areas
414
- the work will touch. Presenting the plan and requesting sign-off is the
415
- approval step — do not ask a separate "does this look good?" question.
495
+ - **Gate hard.** Use a UI plan when the surface is new, ambiguous, spans several
496
+ screens or states, or the direction needs agreement before coding. Skip it for
497
+ cosmetic one-liners — a color, a label, a spacing tweak — and just make the
498
+ change. Never ship a single-step or filler plan.
499
+ - **Research before you draft.** Read the real components, routes, and design
500
+ tokens first; ground every mockup and the file map in actual files and symbols.
501
+ Delegate wide exploration to a sub-agent when the surface is large.
502
+ - **Planning is read-only.** Make no source edits while building or reviewing.
503
+ Start editing only after the user approves the UI direction.
504
+ - **Clarify vs. assume.** Do not ask how to build the UI — present the direction
505
+ and options as mockups and tabs. Ask a clarifying question only when an
506
+ ambiguity would change the design; batch 2-4 before finalizing. Otherwise state
507
+ the assumption in the plan and proceed.
508
+ - **The plan is the approval gate.** Ask the user to review and approve the UI
509
+ direction before you write code, and name the files/areas the work touches.
416
510
 
417
511
  ## UI-First Workflow
418
512
 
419
- 1. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path,
420
- and a complete bespoke \`html\` document whenever possible.
421
- 2. When the plan has meaningful UI flows, screens, or diagrams, make the top
422
- of the document a bounded pan/zoom sketch canvas with the key artboards,
423
- connectors, margin notes, and commentable visual anchors.
424
- 3. Continue below the canvas as a restrained, Notion-like interactive document:
425
- clear prose, horizontal state tabs, inline wireframes, sketchy diagrams,
426
- tables, vertical code tabs, and concise implementation notes.
427
- 4. Skip the top canvas when wireframes or diagrams would not clarify the work;
428
- in that case, keep the plan as a clean rich document.
429
- 5. Put files, symbols, data/actions, migrations, risks, and validation lower in
430
- the document after the visual review area.
431
- 6. Call \`get-plan-feedback\` before implementation, after review, after a long
432
- pause, and before the final response. Apply changes with
433
- \`update-visual-plan\`.
434
-
435
- ## Mockup Quality Bar
436
-
437
- - Build high-fidelity screen sections with realistic spacing, controls,
438
- hierarchy, text, and state-specific content. Avoid vague gray boxes.
439
- - Show the actual workflow the user will use: navigation, toolbar actions,
440
- forms, dialogs, empty states, error recovery, loading affordances, and
441
- confirmation/success states.
442
- - Include desktop and mobile/responsive states when layout decisions could
443
- change. Put them in tabs or adjacent panels rather than burying them in prose.
444
- - Use concrete labels and copy placeholders that expose content length,
445
- truncation, disabled states, and destructive actions.
446
- - Make state tabs span the plan content width. Small cards are fine for repeated
447
- items, but the primary UI preview should not be trapped in a tiny thumbnail.
448
- - Keep visuals review-focused, not decorative. Do not make a marketing page,
449
- hero section, brand deck, or abstract mood board unless the user asks.
450
-
451
- ## State Tabs
452
-
453
- When showing multiple UI states, use the Plans tab attributes so the iframe
454
- runtime wires up the interaction:
455
-
456
- - Put \`data-plan-tabs\` on the tab group.
457
- - Put \`data-tab-target\` on each tab button.
458
- - Put matching \`data-tab-panel\` values on panels.
459
-
460
- Good state tab sets include:
461
-
462
- - \`Default\`, \`Loading\`, \`Empty\`, \`Error\`
463
- - \`List\`, \`Detail\`, \`Edit\`, \`Confirm\`
464
- - \`Desktop\`, \`Tablet\`, \`Mobile\`
465
- - \`Owner\`, \`Reviewer\`, \`Signed out\`
466
-
467
- ## UI Flow Document
468
-
469
- Generated \`/ui-plan\` documents use one default shape: an optional Figma-style
470
- pan/zoom visual preface followed by a refined Notion-like document. There is no
471
- mode boolean. Provide \`states\` and \`components\` when the top canvas will help
472
- the reviewer understand the flow; omit them when the plan should be
473
- document-only. You may pass \`sketchiness\` from \`0\` to \`100\`; omit it for the
474
- default hand-drawn strength.
475
-
476
- The document below the canvas should still include the same planning substance:
477
- screen states, component notes, implementation map, review prompts, comments,
478
- drawing-friendly space, and agent handoff. Treat it like a designer handed over
479
- a Figma file plus a crisp product spec: the reviewer should understand the UI
480
- flow from a bird's-eye view, then keep scrolling into a clean interactive
481
- document with notes explaining how the screens work together.
482
-
483
- ## Comments, Drawing, And Handoff
484
-
485
- - Add visible annotation prompts beside the mockups: "Comment on layout",
486
- "Circle unclear copy", "Mark missing state", or "Pick this option".
487
- - Leave enough whitespace around key UI regions for drawing and callouts.
488
- - Label important regions so comments can reference them without ambiguity.
489
- - Include an "Agent Handoff" section after the mockups that summarizes the
490
- chosen UI direction, unresolved visual questions, and feedback that must be
491
- read before code changes.
492
- - Never claim feedback has been applied until \`get-plan-feedback\` or the user
493
- has supplied the feedback in chat.
494
-
495
- ## Implementation Details Lower Down
496
-
497
- After the visual canvas and document review blocks, include a concise
498
- implementation section:
499
-
500
- - file paths and symbols/components to touch;
501
- - data/actions/hooks/routes needed for the UI;
502
- - state ownership, optimistic updates, and sync expectations;
503
- - accessibility, responsive, and keyboard considerations;
504
- - test and verification plan;
505
- - short code-shape snippets only where they clarify the implementation.
506
-
507
- Do not paste whole files or let implementation prose crowd out the mockups.
508
- The purpose of \`/ui-plan\` is to get visual direction approved before the agent
509
- starts editing.
513
+ 1. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path, and
514
+ structured \`content\`. The canvas comes first, the document second.
515
+ 2. Compose the top canvas from the kit (see the cores below): the key artboards
516
+ with real product content, designer notes, and connectors only for real
517
+ sequences. Skip the canvas when wireframes would not clarify the work.
518
+ 3. Continue below as a concise technical document — not a second copy of the
519
+ canvas covering concrete files, contracts, phases, risks, and validation.
520
+ 4. Call \`get-plan-feedback\` before implementation, after review, after a long
521
+ pause, and before the final response. Apply changes with \`update-visual-plan\`,
522
+ preferring \`contentPatches\` for one frame, annotation, node, tab, or block. When the user
523
+ wants source-control friendly edits, use \`patch-visual-plan-source\` against
524
+ the MDX files instead of regenerating the plan.
525
+
526
+ ## Agent Handoff
527
+
528
+ After the canvas and document, add a short handoff that names the chosen UI
529
+ direction, unresolved visual questions, and feedback that must be read before
530
+ code changes. Never claim feedback has been applied until \`get-plan-feedback\` or
531
+ the user has supplied it.
532
+
533
+ <!-- SHARED-CORE:wireframe-canvas START -->
534
+ ## Wireframe & Canvas Core
535
+
536
+ This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
537
+ \`/visualize-plan\`. It is the single source of truth for how wireframes and the
538
+ canvas work. Do not paraphrase it per command.
539
+
540
+ **The renderer owns all visual quality. You emit content, never styling.** Flex
541
+ layout, fonts, density, spacing, theme, and the hand-drawn wobble all live in
542
+ the app renderer. Never emit coordinates, CSS, pixel sizes, or raw HTML for a
543
+ wireframe's internals. Your job is to pick a surface, compose real product
544
+ content from the kit, and annotate — nothing else.
545
+
546
+ **A wireframe block's data is a declarative kit tree, not geometry:**
547
+
548
+ \`\`\`json
549
+ {
550
+ "surface": "desktop",
551
+ "screen": [
552
+ { "el": "browserBar", "title": "tasklist" },
553
+ { "el": "row", "children": [
554
+ { "el": "sidebar", "children": [
555
+ { "el": "navItem", "label": "Inbox", "count": 12, "active": true },
556
+ { "el": "navItem", "label": "Today", "count": 4 },
557
+ { "el": "navItem", "label": "Done" }
558
+ ] },
559
+ { "el": "main", "children": [
560
+ { "el": "title", "text": "Today", "script": true },
561
+ { "el": "chips", "items": [
562
+ { "label": "All", "active": true }, { "label": "Active" }, { "label": "Done" }
563
+ ] },
564
+ { "el": "section", "label": "OVERDUE", "tone": "warn" },
565
+ { "el": "taskRow", "title": "Send invoice to Acme Co.", "due": "Yesterday", "dueTone": "warn", "prio": 1 },
566
+ { "el": "taskRow", "title": "Reply to design feedback", "due": "Today", "prio": 2 }
567
+ ] }
568
+ ] }
569
+ ]
570
+ }
571
+ \`\`\`
572
+
573
+ The renderer maps each node to a flex kit component and applies one whole-frame
574
+ wobble. Layout is always flex: \`row\`, \`col\`, \`sidebar\`, and \`main\` set the flex
575
+ direction; everything aligns by construction, so you never get overlap or drift.
576
+
577
+ **Surface presets — match the real footprint, never default to desktop+mobile.**
578
+ Pick the \`surface\` that matches what the user will actually see:
579
+
580
+ - \`desktop\`: a full page or app shell.
581
+ - \`mobile\`: a phone screen, only when the work is genuinely mobile.
582
+ - \`popover\`: a small floating menu, dropdown, or inline popover.
583
+ - \`panel\`: a side panel, inspector, or sidebar widget.
584
+ - \`browser\`: a page that needs a browser chrome frame around it.
585
+
586
+ A sidebar popover renders as a small surface, not a desktop page and a phone
587
+ frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
588
+ actually changes the layout. For a component or widget, show one broader
589
+ app-context frame only when placement affects understanding, then the focused
590
+ component states.
591
+
592
+ **Node vocabulary (\`el\` values).** Every node is \`{ el, ...props, children? }\`:
593
+
594
+ - Layout: \`screen\`, \`row\`, \`col\`, \`sidebar\`, \`main\`, \`card{children}\`,
595
+ \`column{title,count?,children}\`, \`box{children,dashed?}\`, \`divider\`.
596
+ - Chrome: \`browserBar{title}\`, \`statusBar\`, \`searchBar\`, \`toolbar\`.
597
+ - Navigation: \`navItem{label,count?,active?,dot?}\`, \`tabs\`/\`chips{items:[{label,active?}]}\`,
598
+ \`chip{label,active?}\`, \`pill{label,tone?}\`.
599
+ - Content: \`title{text,script?}\`, \`text{value,color?,weight?}\`,
600
+ \`lines{n?,widths?}\`, \`section{label,tone?}\`,
601
+ \`taskRow{title,note?,due?,dueTone?,prio?,done?}\`, \`kv{rows:[{k,v}]}\`,
602
+ \`avatar\`, \`iconSquare{active?}\`.
603
+ - Inputs: \`field{label?,value?,placeholder?,area?}\`, \`check{done?,shape?}\`,
604
+ \`btn{label,solid?,full?}\`, \`fab{icon?}\`.
605
+
606
+ Put **real product content** in props: real labels, real dates, real counts,
607
+ real button text grounded in the actual screen or component you read. Use
608
+ \`lines\`/\`text\` (with no \`value\`) only for genuine placeholder body copy — never
609
+ fill a screen with gray placeholder bars. Buttons (\`btn\`, \`fab\`) must read as
610
+ actionable controls.
611
+
612
+ **Default crisp.** Sketchiness is a low default (a subtle single wobble over the
613
+ whole frame), not a heavy scribble. Do not ask for or assume a heavy sketch
614
+ look.
615
+
616
+ **Canvas annotations are designer notes on the artboard.** When a top canvas is
617
+ present, sprinkle Figma-style notes near the frames they explain: a short
618
+ heading, supporting text, and bullets — plain text layers, never bordered or
619
+ shadowed cards, and never a box around a frame. The renderer spaces notes away
620
+ from frames, so place each note by the frame it describes. Use an arrow only to
621
+ point at one specific control or transition; for a broad frame-level note, write
622
+ text beside the frame with no connector. Connectors are for real sequences only —
623
+ never fake "Step 1 → Step 2" lines between independent states.
624
+
625
+ **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
626
+ (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
627
+ than regenerating the whole plan. \`contentPatches\` are part of the public MCP
628
+ action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
629
+ edits. If an agent is working from exported source files, use
630
+ \`read-visual-plan-source\` / \`patch-visual-plan-source\`: \`plan.mdx\` holds
631
+ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
632
+ \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
633
+ patch action normalizes the MDX back into the same JSON runtime model. JSON is
634
+ the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
635
+
636
+ **Legacy imports only.** Old or imported plans may carry coordinate-based
637
+ regions or a full standalone HTML document; the renderer still displays them.
638
+ Never emit geometry, regions, or a standalone HTML document for a new plan —
639
+ compose the kit tree instead.
640
+ <!-- SHARED-CORE:wireframe-canvas END -->
641
+
642
+ <!-- SHARED-CORE:document-quality START -->
643
+ ## Document Quality Core
644
+
645
+ This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
646
+ \`/visualize-plan\`. It is the single source of truth for the document below the
647
+ canvas. Do not paraphrase it per command.
648
+
649
+ **The document is a serious technical plan, not marketing.** Write it the way a
650
+ strong Claude or Codex implementation plan reads: outcome-first, prose-first,
651
+ self-contained, and specific. State the objective and what "done" means, the
652
+ scope and non-goals, the proposed approach with the key decisions and their
653
+ rationale, ordered steps that name real files, symbols, actions, and data
654
+ shapes, the risks, and a closing verification step (tests, build, or a checkable
655
+ behavior). Replace vague prose with specifics; never ship a step like "make it
656
+ work." No hero art, gradients, logos, nav bars, slogans, value props, giant
657
+ landing-page headings, or marketing cards unless the user explicitly asks.
658
+
659
+ **Canvas and document never duplicate each other.** The UI story lives on the
660
+ canvas with on-canvas annotations; the document carries the technical depth the
661
+ canvas cannot show — concrete file/symbol maps, API and data contracts, code
662
+ snippets, migration or implementation phases, risks, and validation. Repeat a
663
+ wireframe in the document only for a genuinely new detail view or comparison.
664
+ Skip the canvas entirely for non-visual work and write a clean rich document.
665
+
666
+ **Use the right block, and make it carry substance:**
667
+
668
+ - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
669
+ - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
670
+ symbols/components to touch, the reason, risk/coordination notes, and a
671
+ concise syntax-highlighted snippet of the code shape — never the whole file,
672
+ never a prose-only file list.
673
+ - \`decision\` for two or three option cards with consequences. These are static
674
+ records; do not style them like clickable tabs or chips unless the renderer
675
+ truly supports changing the selection.
676
+ - \`diagram\` for architecture, sequence, data-flow, dependency, or state
677
+ relationships, only when it clarifies something real. Labels must not overlap
678
+ nodes, connectors, or each other.
679
+ - \`tabs\` for multiple states, directions, or comparisons. A tab that reveals
680
+ only prose usually means the plan is under-specified — include a relevant
681
+ visual unless the tab is intentionally document-only.
682
+ - \`table\`, \`checklist\`, \`callout\` for scannable structure.
683
+
684
+ **Open questions are callouts, not buried prose.** Surface anything unresolved in
685
+ a dedicated open-questions / needs-clarification block. Never put a
686
+ questions/decisions wall inside the plan narrative.
687
+
688
+ **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
689
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a placeholder,
690
+ density demo, or proof that custom HTML works. Prefer the native blocks; they
691
+ cover real plans.
692
+
693
+ **Before handoff, open the plan and check it.** Fix overlap, excessive
694
+ whitespace, clipped fragments, misleading inactive controls, poor contrast, and
695
+ unreadable diagrams before asking for approval.
696
+ <!-- SHARED-CORE:document-quality END -->
697
+
698
+ <!-- SHARED-CORE:exemplar START -->
699
+ ## Good vs. Bad Exemplar
700
+
701
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard
702
+ composed from the kit — a sidebar of real \`navItem\`s (\`Inbox 12\`, \`Today 4\`,
703
+ \`Done\`), a \`main\` with a scripted \`title\`, real \`chips\`, a \`section\` labeled
704
+ \`OVERDUE\`, and \`taskRow\`s carrying real titles, due dates, and priorities — one
705
+ subtle whole-frame wobble, correct desktop footprint, and plain-text designer
706
+ notes spaced off the frames pointing only at the controls that need explanation.
707
+ Below it, a Claude/Codex-grade document: objective and done-criteria, an
708
+ \`implementation-map\` naming the real components and actions with short
709
+ highlighted snippets, a \`decision\` card weighing two real approaches, and a
710
+ validation step — none of it repeating the canvas. This is the bar.
711
+
712
+ **BAD.** Empty coordinate boxes placed by \`x/y/width/height\`, gray placeholder
713
+ bars "insinuating" text, crisp double-bordered rectangles or a heavy scribble, a
714
+ forced desktop + mobile pair for a popover, floating bordered annotation cards
715
+ hugging the frames, and a marketing-style document with a hero heading and value
716
+ props that just restates what the canvas already shows. Never produce this.
717
+ <!-- SHARED-CORE:exemplar END -->
510
718
 
511
719
  ## Tool Guidance
512
720
 
513
- - \`create-ui-plan\`: create the UI-first HTML plan.
514
- - \`update-visual-plan\`: revise mockups, state tabs, comments, or handoff notes.
515
- - \`get-visual-plan\`: inspect the current plan and annotations.
721
+ - \`create-ui-plan\`: create the UI-first structured visual plan.
722
+ - \`create-visual-questions\`: run a visual intake form before the UI plan.
723
+ - \`update-visual-plan\`: revise content, mockups, comments, or handoff notes;
724
+ prefer targeted \`contentPatches\`.
725
+ - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
726
+ optional \`canvas.mdx\`, optional \`.plan-state.json\`, and JSON.
727
+ - \`patch-visual-plan-source\`: apply granular MDX AST patches by stable block,
728
+ artboard, annotation, component, or wireframe-node id.
729
+ - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
730
+ - \`get-visual-plan\`: inspect the current structured plan, exported HTML, and
731
+ annotations; it also returns the MDX folder for source workflows.
516
732
  - \`get-plan-feedback\`: read unconsumed reviewer comments before coding.
517
- - \`export-visual-plan\`: export a review receipt when needed.
733
+ - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
734
+ files for repo check-in.
735
+
736
+ When the user critiques a plan's look or structure, fix the renderer or this
737
+ skill — never hand-edit one stored plan. Turn feedback into better guidance.
518
738
 
519
739
  Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
520
740
  `;
521
- const VISUALIZE_PLAN_SKILL_MD = `---
522
- name: visualize-plan
741
+ export const VISUAL_QUESTIONS_SKILL_MD = `---
742
+ name: visual-questions
523
743
  description: >-
524
- Convert an existing Codex, Claude Code, Markdown, or pasted plan into a
525
- Agent-Native Plans HTML companion with diagrams, wireframes, annotations, and
526
- feedback.
744
+ Use Agent-Native Plans to ask rich visual intake questions before creating a
745
+ UI plan or visual plan.
527
746
  metadata:
528
- visibility: exported
747
+ visibility: both
529
748
  ---
530
749
 
531
- # Visualize Plan
750
+ # Visual Questions
532
751
 
533
- Use this as the visual companion for an existing text plan. The native Codex or
534
- Claude Code plan can stay exactly where it is; Agent-Native Plans turns it into
535
- an interactive HTML review surface with diagrams, wireframes, prototype options,
536
- annotations, questions, and feedback.
752
+ Use \`/visual-questions\` when the next best step is not a plan yet, but a
753
+ reviewable visual intake: single-choice chips, multi-select chips, freeform
754
+ notes, mockup choices, sketch diagrams, and a generated answer summary that feeds
755
+ the next planning prompt. It composes with \`/visual-plan\`, \`/ui-plan\`, and
756
+ \`/visualize-plan\`.
537
757
 
538
- This is for impatient review. Default to things the user can scan and react to.
539
- It should still read like a plan, not a marketing page.
758
+ ## When To Use
540
759
 
541
- Install with the Agent-Native CLI if Plans is not already available:
760
+ - The user asks to be shown options before the agent writes a plan.
761
+ - UI direction, form factor, layout model, feature set, or visual style is fuzzy
762
+ enough that 2-6 answers would materially change the plan.
763
+ - The user would benefit from choosing between visual mockups or diagrams rather
764
+ than answering text-only prompts.
542
765
 
543
- \`\`\`bash
544
- npx @agent-native/core@latest skills add plans
545
- \`\`\`
766
+ Gate hard: skip this for tiny, unambiguous changes. If the agent can reasonably
767
+ infer the answer, prefer \`/ui-plan\` or \`/visual-plan\` directly and put
768
+ assumptions in the plan.
769
+
770
+ ## Workflow
546
771
 
547
- That installs \`/visual-plan\`, \`/ui-plan\`, and \`/visualize-plan\` plus the
548
- MCP connector.
772
+ 1. Call \`create-visual-questions\` with a clear title, brief, source, and repo
773
+ path when known.
774
+ 2. Omit \`questions\` for the default UI intake. Provide a custom \`questions\` array
775
+ only when the task has domain-specific choices.
776
+ 3. Surface the returned Plans link and ask the user to answer visually.
777
+ 4. The generated summary drives the next step: \`create-ui-plan\` for UI flows,
778
+ \`create-visual-plan\` for general plans, \`visualize-plan\` when a text plan
779
+ already exists, or \`update-visual-plan\` with targeted \`contentPatches\` to fold
780
+ answers into an active plan.
781
+ 5. If the user leaves comments, call \`get-plan-feedback\` before using the answers.
782
+
783
+ ## Question Types
784
+
785
+ Supported \`questions\` entries:
786
+
787
+ - \`single\`: chip group where one option wins.
788
+ - \`multi\`: chip group where multiple options can be selected.
789
+ - \`freeform\`: textarea for constraints, inspirations, or things to avoid.
790
+ - \`visual\`: visual options with sketch previews — use for layout direction, flow
791
+ depth, surface choice, or diagram choices.
792
+
793
+ Each option can include \`label\`, \`value\`, \`description\`, \`recommended\`,
794
+ \`preview\`, and \`bullets\`. Valid \`preview\` values match the wireframe surfaces:
795
+ \`desktop\`, \`mobile\`, \`popover\`, \`panel\`, \`component\`, \`split\`, \`flow\`, and
796
+ \`diagram\`. Pick the preview that matches the real footprint — do not offer a
797
+ desktop/mobile pair for a popover, panel, or component.
798
+
799
+ ## Quality Bar
800
+
801
+ - Ask only decision-changing questions. A beautiful form with low-value questions
802
+ is still friction.
803
+ - Prefer visible, answerable options over abstract prose.
804
+ - Use visual tabs when users need to compare layout or flow shapes.
805
+ - Keep the output calm and document-like, not a landing page.
806
+ - The generated answer summary is not the final plan; it is the intake prompt for
807
+ the next agent step.
549
808
 
550
- ## When To Use
809
+ ## Tool Guidance
551
810
 
552
- Use \`visualize-plan\` when:
811
+ - \`create-visual-questions\`: create the interactive intake plan.
812
+ - \`get-visual-plan\`: inspect the current visual question plan.
813
+ - \`get-plan-feedback\`: read comments before creating or updating the next plan.
814
+ - \`create-ui-plan\`: create a UI-first plan from the answers.
815
+ - \`create-visual-plan\`: create a general visual plan from the answers.
816
+ - \`visualize-plan\`: enrich an existing text plan after answers are gathered.
817
+ - \`export-visual-plan\`: export answer plans as HTML, Markdown fallback,
818
+ structured JSON, and MDX files when the intake needs to be checked into a repo.
819
+ - \`read-visual-plan-source\` / \`patch-visual-plan-source\`: inspect or patch the
820
+ MDX source if another agent is operating from checked-in plan files.
553
821
 
554
- - the user has an existing Codex, Claude Code, Markdown, or pasted plan;
555
- - the user asks to visualize, annotate, plannotate, mock up, diagram, or make a
556
- plan easier to review;
557
- - the plan is long enough that the user may not read it closely;
558
- - UI direction, architecture, data flow, risky assumptions, or open questions
559
- would be clearer visually;
560
- - the user wants feedback on wireframes, design/prototype options, diagrams, or
561
- tradeoffs before implementation.
822
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
823
+ `;
824
+ export const VISUALIZE_PLAN_SKILL_MD = `---
825
+ name: visualize-plan
826
+ description: >-
827
+ Convert an existing Codex, Claude Code, Markdown, or pasted plan into an
828
+ Agent-Native Plans visual companion with diagrams, wireframes, annotations, and
829
+ feedback.
830
+ metadata:
831
+ visibility: exported
832
+ ---
833
+
834
+ # Visualize Plan
562
835
 
563
- If there is no existing plan text available, ask for it, use \`visual-plans\`
564
- to create a fresh general plan, or use \`ui-plan\` when the work is UI-heavy and
565
- should start with high-fidelity state mockups.
836
+ Use \`/visualize-plan\` when a plan already exists and the user wants it easier to
837
+ review. The native Codex or Claude Code plan can stay where it is; Agent-Native
838
+ Plans creates a structured visual companion beside it — diagrams, wireframes,
839
+ state sketches, option cards, and comment prompts instead of a wall of text. It
840
+ still reads like a plan, not a marketing page.
566
841
 
567
842
  ## Plan Discipline
568
843
 
569
- - **Right-size first.** If the source plan is for trivial, unambiguous work,
570
- skip the companion and just implement. A visual companion is worth it only
571
- when the plan is long, risky, or hard to react to as text.
844
+ - **Gate hard.** A visual companion is worth it only when the source plan is
845
+ long, risky, or hard to react to as text. If the source plan is for trivial,
846
+ unambiguous work, skip the companion and just implement.
572
847
  - **Stay grounded and read-only.** Preserve the source plan's intent, do not
573
848
  invent codebase facts, and label anything inferred as inferred. Make no source
574
849
  edits while building or reviewing the companion.
575
850
  - **The companion is the approval gate.** Ask the user to review and approve the
576
- direction before you write any code, and name which files/areas the work will
577
- touch. Carry unresolved assumptions and open questions into a clear block
578
- instead of guessing silently.
851
+ direction before you write code, and name which files/areas the work touches.
852
+ Carry unresolved assumptions and open questions into a clear block instead of
853
+ guessing silently.
579
854
 
580
855
  ## Workflow
581
856
 
582
857
  1. Gather the existing plan text from the user's paste, a referenced file, or
583
- the recent agent-visible plan. Do not invent a source plan.
584
- 2. Call \`visualize-plan\` with \`planText\`, \`title\`, \`goal\`, \`source\`,
585
- and \`repoPath\` when available.
858
+ recent visible agent context. Do not invent the source plan. If no plan text
859
+ exists and the work is UI-heavy, use \`/ui-plan\` instead.
860
+ 2. Call \`visualize-plan\` with \`planText\`, \`title\`, \`brief\`, \`source\`, and
861
+ \`repoPath\` when available.
586
862
  3. Surface the returned Plans link or inline MCP App.
587
- 4. Enrich the imported plan with \`update-visual-plan\` when helpful:
588
- - diagrams for architecture, data flow, state machines, or dependencies;
589
- - detailed wireframes/mockups for user-visible UI changes, including layout,
590
- controls, states, empty/loading/error paths, and copy placeholders;
591
- - two or three option cards when there are real tradeoffs;
592
- - small prototype sketches for interactions, states, or animation choices;
593
- - reviewable assumptions and open questions;
594
- 5. Ask the user to react in the visual plan. Then call \`get-plan-feedback\`
595
- before implementing, after review, and before final response.
596
- 6. Treat the imported text as source material. Structured Plans state is
597
- canonical for feedback, assumptions, and decisions.
598
-
599
- If there is no existing plan text and the work is UI-heavy, use \`/ui-plan\`
600
- instead so full-width state mockups, comments/drawing affordances, and agent
601
- handoff come before file implementation details.
602
-
603
- ## Visual Defaults
604
-
605
- - Keep the first screen simple and plan-like: title, brief, concise scope, and
606
- one useful diagram/checklist/table when it helps.
607
- - Prefer one strong diagram or wireframe over a wall of sections.
608
- - Preserve the source plan's implementation substance: phases or steps,
609
- files/symbols/snippets, risks, open questions, and validation.
610
- - Hide long prose behind disclosure controls or source references when it helps
611
- review speed.
612
- - Add README-like detail when the source is too terse: slash commands, tool
613
- behavior, install flow, MCP/link fallback, data shape, and scope.
614
- - Avoid decorative hero art, gradient/hero backgrounds, logos, nav bars,
615
- slogans, fluffy value props, huge landing-page H1s, and marketing-style cards
616
- unless the user explicitly asks.
617
- - Visuals should be review aids, not decoration.
618
- - Label inferred items as possible, not confirmed.
619
- - Ask for feedback with targeted prompts: "Which option?", "Is this flow
620
- right?", "What assumption is wrong?", "What should change?"
621
- - Preserve native-agent momentum: this companion should make the plan easier to
622
- approve or revise, not force a giant planning ceremony.
623
-
624
- ## Guardrails
625
-
626
- - Do not replace a native plan unless the user asks. Build beside it.
627
- - Do not pretend the companion has feedback until \`get-plan-feedback\` returns
628
- it or the user pastes it back.
629
- - Do not use visual polish as a substitute for clarity. The point is review.
630
- - Do not hand-roll MCP HTTP requests with curl. Use host-exposed tools after
631
- restart/reload, or use the returned browser/deep-link fallback.
863
+ 4. Enrich the import with \`update-visual-plan\` (prefer targeted \`contentPatches\`):
864
+ add a canvas with wireframes for user-visible UI, diagrams for architecture or
865
+ data flow, option cards for real tradeoffs, and explicit open questions. Apply
866
+ the two cores below the companion must meet the same quality bar as a fresh
867
+ plan, not be a thinner ruleset. Label inferred visuals as inferred. When the
868
+ user wants source-control friendly edits, use \`patch-visual-plan-source\`
869
+ against the MDX files instead of regenerating the plan.
870
+ 5. Ask the user to react, then call \`get-plan-feedback\` before implementing,
871
+ after review, and before the final response.
872
+ 6. Treat imported text as source material. The structured visual plan and
873
+ comments are the review surface; HTML is the export receipt. Do not replace a
874
+ native plan unless the user asks.
875
+
876
+ <!-- SHARED-CORE:wireframe-canvas START -->
877
+ ## Wireframe & Canvas Core
878
+
879
+ This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
880
+ \`/visualize-plan\`. It is the single source of truth for how wireframes and the
881
+ canvas work. Do not paraphrase it per command.
882
+
883
+ **The renderer owns all visual quality. You emit content, never styling.** Flex
884
+ layout, fonts, density, spacing, theme, and the hand-drawn wobble all live in
885
+ the app renderer. Never emit coordinates, CSS, pixel sizes, or raw HTML for a
886
+ wireframe's internals. Your job is to pick a surface, compose real product
887
+ content from the kit, and annotate — nothing else.
888
+
889
+ **A wireframe block's data is a declarative kit tree, not geometry:**
890
+
891
+ \`\`\`json
892
+ {
893
+ "surface": "desktop",
894
+ "screen": [
895
+ { "el": "browserBar", "title": "tasklist" },
896
+ { "el": "row", "children": [
897
+ { "el": "sidebar", "children": [
898
+ { "el": "navItem", "label": "Inbox", "count": 12, "active": true },
899
+ { "el": "navItem", "label": "Today", "count": 4 },
900
+ { "el": "navItem", "label": "Done" }
901
+ ] },
902
+ { "el": "main", "children": [
903
+ { "el": "title", "text": "Today", "script": true },
904
+ { "el": "chips", "items": [
905
+ { "label": "All", "active": true }, { "label": "Active" }, { "label": "Done" }
906
+ ] },
907
+ { "el": "section", "label": "OVERDUE", "tone": "warn" },
908
+ { "el": "taskRow", "title": "Send invoice to Acme Co.", "due": "Yesterday", "dueTone": "warn", "prio": 1 },
909
+ { "el": "taskRow", "title": "Reply to design feedback", "due": "Today", "prio": 2 }
910
+ ] }
911
+ ] }
912
+ ]
913
+ }
914
+ \`\`\`
915
+
916
+ The renderer maps each node to a flex kit component and applies one whole-frame
917
+ wobble. Layout is always flex: \`row\`, \`col\`, \`sidebar\`, and \`main\` set the flex
918
+ direction; everything aligns by construction, so you never get overlap or drift.
919
+
920
+ **Surface presets — match the real footprint, never default to desktop+mobile.**
921
+ Pick the \`surface\` that matches what the user will actually see:
922
+
923
+ - \`desktop\`: a full page or app shell.
924
+ - \`mobile\`: a phone screen, only when the work is genuinely mobile.
925
+ - \`popover\`: a small floating menu, dropdown, or inline popover.
926
+ - \`panel\`: a side panel, inspector, or sidebar widget.
927
+ - \`browser\`: a page that needs a browser chrome frame around it.
928
+
929
+ A sidebar popover renders as a small surface, not a desktop page and a phone
930
+ frame. Do not emit \`desktop\` + \`mobile\` variants unless responsive behavior
931
+ actually changes the layout. For a component or widget, show one broader
932
+ app-context frame only when placement affects understanding, then the focused
933
+ component states.
934
+
935
+ **Node vocabulary (\`el\` values).** Every node is \`{ el, ...props, children? }\`:
936
+
937
+ - Layout: \`screen\`, \`row\`, \`col\`, \`sidebar\`, \`main\`, \`card{children}\`,
938
+ \`column{title,count?,children}\`, \`box{children,dashed?}\`, \`divider\`.
939
+ - Chrome: \`browserBar{title}\`, \`statusBar\`, \`searchBar\`, \`toolbar\`.
940
+ - Navigation: \`navItem{label,count?,active?,dot?}\`, \`tabs\`/\`chips{items:[{label,active?}]}\`,
941
+ \`chip{label,active?}\`, \`pill{label,tone?}\`.
942
+ - Content: \`title{text,script?}\`, \`text{value,color?,weight?}\`,
943
+ \`lines{n?,widths?}\`, \`section{label,tone?}\`,
944
+ \`taskRow{title,note?,due?,dueTone?,prio?,done?}\`, \`kv{rows:[{k,v}]}\`,
945
+ \`avatar\`, \`iconSquare{active?}\`.
946
+ - Inputs: \`field{label?,value?,placeholder?,area?}\`, \`check{done?,shape?}\`,
947
+ \`btn{label,solid?,full?}\`, \`fab{icon?}\`.
948
+
949
+ Put **real product content** in props: real labels, real dates, real counts,
950
+ real button text grounded in the actual screen or component you read. Use
951
+ \`lines\`/\`text\` (with no \`value\`) only for genuine placeholder body copy — never
952
+ fill a screen with gray placeholder bars. Buttons (\`btn\`, \`fab\`) must read as
953
+ actionable controls.
954
+
955
+ **Default crisp.** Sketchiness is a low default (a subtle single wobble over the
956
+ whole frame), not a heavy scribble. Do not ask for or assume a heavy sketch
957
+ look.
958
+
959
+ **Canvas annotations are designer notes on the artboard.** When a top canvas is
960
+ present, sprinkle Figma-style notes near the frames they explain: a short
961
+ heading, supporting text, and bullets — plain text layers, never bordered or
962
+ shadowed cards, and never a box around a frame. The renderer spaces notes away
963
+ from frames, so place each note by the frame it describes. Use an arrow only to
964
+ point at one specific control or transition; for a broad frame-level note, write
965
+ text beside the frame with no connector. Connectors are for real sequences only —
966
+ never fake "Step 1 → Step 2" lines between independent states.
967
+
968
+ **Patching.** Edit one wireframe node, canvas annotation, or block with targeted \`contentPatches\`
969
+ (for example \`update-wireframe-node\`, \`update-block\`, \`replace-blocks\`) rather
970
+ than regenerating the whole plan. \`contentPatches\` are part of the public MCP
971
+ action schema, so Claude Code, Codex, Cursor, and other hosts can make surgical
972
+ edits. If an agent is working from exported source files, use
973
+ \`read-visual-plan-source\` / \`patch-visual-plan-source\`: \`plan.mdx\` holds
974
+ frontmatter plus markdown/document blocks, \`canvas.mdx\` holds
975
+ \`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>\`, and the
976
+ patch action normalizes the MDX back into the same JSON runtime model. JSON is
977
+ the canonical runtime shape; MDX is the repo-friendly authoring/export surface.
978
+
979
+ **Legacy imports only.** Old or imported plans may carry coordinate-based
980
+ regions or a full standalone HTML document; the renderer still displays them.
981
+ Never emit geometry, regions, or a standalone HTML document for a new plan —
982
+ compose the kit tree instead.
983
+ <!-- SHARED-CORE:wireframe-canvas END -->
984
+
985
+ <!-- SHARED-CORE:document-quality START -->
986
+ ## Document Quality Core
987
+
988
+ This section is shared, word for word, by \`/visual-plan\`, \`/ui-plan\`, and
989
+ \`/visualize-plan\`. It is the single source of truth for the document below the
990
+ canvas. Do not paraphrase it per command.
991
+
992
+ **The document is a serious technical plan, not marketing.** Write it the way a
993
+ strong Claude or Codex implementation plan reads: outcome-first, prose-first,
994
+ self-contained, and specific. State the objective and what "done" means, the
995
+ scope and non-goals, the proposed approach with the key decisions and their
996
+ rationale, ordered steps that name real files, symbols, actions, and data
997
+ shapes, the risks, and a closing verification step (tests, build, or a checkable
998
+ behavior). Replace vague prose with specifics; never ship a step like "make it
999
+ work." No hero art, gradients, logos, nav bars, slogans, value props, giant
1000
+ landing-page headings, or marketing cards unless the user explicitly asks.
1001
+
1002
+ **Canvas and document never duplicate each other.** The UI story lives on the
1003
+ canvas with on-canvas annotations; the document carries the technical depth the
1004
+ canvas cannot show — concrete file/symbol maps, API and data contracts, code
1005
+ snippets, migration or implementation phases, risks, and validation. Repeat a
1006
+ wireframe in the document only for a genuinely new detail view or comparison.
1007
+ Skip the canvas entirely for non-visual work and write a clean rich document.
1008
+
1009
+ **Use the right block, and make it carry substance:**
1010
+
1011
+ - \`rich-text\` for plan prose with real bold/italic/code/links and nested lists.
1012
+ - \`implementation-map\` / \`code-tabs\` for the file map: file path, the
1013
+ symbols/components to touch, the reason, risk/coordination notes, and a
1014
+ concise syntax-highlighted snippet of the code shape — never the whole file,
1015
+ never a prose-only file list.
1016
+ - \`decision\` for two or three option cards with consequences. These are static
1017
+ records; do not style them like clickable tabs or chips unless the renderer
1018
+ truly supports changing the selection.
1019
+ - \`diagram\` for architecture, sequence, data-flow, dependency, or state
1020
+ relationships, only when it clarifies something real. Labels must not overlap
1021
+ nodes, connectors, or each other.
1022
+ - \`tabs\` for multiple states, directions, or comparisons. A tab that reveals
1023
+ only prose usually means the plan is under-specified — include a relevant
1024
+ visual unless the tab is intentionally document-only.
1025
+ - \`table\`, \`checklist\`, \`callout\` for scannable structure.
1026
+
1027
+ **Open questions are callouts, not buried prose.** Surface anything unresolved in
1028
+ a dedicated open-questions / needs-clarification block. Never put a
1029
+ questions/decisions wall inside the plan narrative.
1030
+
1031
+ **\`custom-html\` is a bounded escape hatch only** — a single complete fragment
1032
+ inside a block, never \`html\`/\`head\`/\`body\`/\`script\` tags, never a placeholder,
1033
+ density demo, or proof that custom HTML works. Prefer the native blocks; they
1034
+ cover real plans.
1035
+
1036
+ **Before handoff, open the plan and check it.** Fix overlap, excessive
1037
+ whitespace, clipped fragments, misleading inactive controls, poor contrast, and
1038
+ unreadable diagrams before asking for approval.
1039
+ <!-- SHARED-CORE:document-quality END -->
1040
+
1041
+ <!-- SHARED-CORE:exemplar START -->
1042
+ ## Good vs. Bad Exemplar
1043
+
1044
+ **GOOD.** A \`/ui-plan\` for a todo app: a canvas with a \`desktop\` artboard
1045
+ composed from the kit — a sidebar of real \`navItem\`s (\`Inbox 12\`, \`Today 4\`,
1046
+ \`Done\`), a \`main\` with a scripted \`title\`, real \`chips\`, a \`section\` labeled
1047
+ \`OVERDUE\`, and \`taskRow\`s carrying real titles, due dates, and priorities — one
1048
+ subtle whole-frame wobble, correct desktop footprint, and plain-text designer
1049
+ notes spaced off the frames pointing only at the controls that need explanation.
1050
+ Below it, a Claude/Codex-grade document: objective and done-criteria, an
1051
+ \`implementation-map\` naming the real components and actions with short
1052
+ highlighted snippets, a \`decision\` card weighing two real approaches, and a
1053
+ validation step — none of it repeating the canvas. This is the bar.
1054
+
1055
+ **BAD.** Empty coordinate boxes placed by \`x/y/width/height\`, gray placeholder
1056
+ bars "insinuating" text, crisp double-bordered rectangles or a heavy scribble, a
1057
+ forced desktop + mobile pair for a popover, floating bordered annotation cards
1058
+ hugging the frames, and a marketing-style document with a hero heading and value
1059
+ props that just restates what the canvas already shows. Never produce this.
1060
+ <!-- SHARED-CORE:exemplar END -->
1061
+
1062
+ ## Tool Guidance
1063
+
1064
+ - \`visualize-plan\`: create the visual companion from the existing text plan.
1065
+ - \`update-visual-plan\`: enrich the import; prefer targeted \`contentPatches\` over
1066
+ replacing the whole content.
1067
+ - \`read-visual-plan-source\`: read the normalized plan as \`plan.mdx\`,
1068
+ optional \`canvas.mdx\`, optional \`.plan-state.json\`, and JSON.
1069
+ - \`patch-visual-plan-source\`: apply granular MDX AST patches by stable block,
1070
+ artboard, annotation, component, or wireframe-node id.
1071
+ - \`import-visual-plan-source\`: create or replace a plan from an MDX folder.
1072
+ - \`get-visual-plan\`: inspect the current structured plan, exported HTML, and
1073
+ annotations; it also returns the MDX folder for source workflows.
1074
+ - \`get-plan-feedback\`: read unconsumed reviewer comments before coding.
1075
+ - \`export-visual-plan\`: export HTML, Markdown fallback, structured JSON, and MDX
1076
+ files for repo check-in.
1077
+
1078
+ When the user critiques a plan's look or structure, fix the renderer or this
1079
+ skill — never hand-edit one stored plan. Turn feedback into better guidance.
1080
+
1081
+ Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
632
1082
  `;
633
1083
  const BUILT_IN_APP_SKILLS = {
634
1084
  assets: {
@@ -718,8 +1168,9 @@ const BUILT_IN_APP_SKILLS = {
718
1168
  skillMarkdown: DESIGN_EXPLORATION_SKILL_MD,
719
1169
  },
720
1170
  "visual-plans": {
721
- skillName: "visual-plans",
1171
+ skillName: "visual-plan",
722
1172
  extraSkills: {
1173
+ "visual-questions": VISUAL_QUESTIONS_SKILL_MD,
723
1174
  "ui-plan": UI_PLAN_SKILL_MD,
724
1175
  "visualize-plan": VISUALIZE_PLAN_SKILL_MD,
725
1176
  },
@@ -727,7 +1178,7 @@ const BUILT_IN_APP_SKILLS = {
727
1178
  schemaVersion: 1,
728
1179
  id: "visual-plans",
729
1180
  displayName: "Agent-Native Plans",
730
- description: "Generate and review coding-agent plans as interactive HTML with diagrams, wireframes, prototypes, annotations, and feedback.",
1181
+ description: "Generate and review coding-agent plans as structured visual documents with diagrams, wireframes, prototypes, annotations, feedback, and HTML export.",
731
1182
  hosted: {
732
1183
  url: "https://plan.agent-native.com",
733
1184
  mcpUrl: "https://plan.agent-native.com/_agent-native/mcp",
@@ -735,7 +1186,7 @@ const BUILT_IN_APP_SKILLS = {
735
1186
  mcp: { serverName: "agent-native-plans" },
736
1187
  auth: {
737
1188
  mode: "oauth",
738
- setup: "Install with the Agent-Native CLI to add /visual-plan, /ui-plan, and /visualize-plan skills plus the Plans MCP connector. Authenticate only for hosted/account-backed sharing.",
1189
+ setup: "Install with the Agent-Native CLI to add /visual-plan, /visual-questions, /ui-plan, and /visualize-plan skills plus the Plans MCP connector. Authenticate only for hosted/account-backed sharing.",
739
1190
  },
740
1191
  surfaces: [
741
1192
  {
@@ -743,6 +1194,12 @@ const BUILT_IN_APP_SKILLS = {
743
1194
  action: "create-visual-plan",
744
1195
  path: "/plans",
745
1196
  },
1197
+ {
1198
+ id: "visual-questions",
1199
+ action: "create-visual-questions",
1200
+ path: "/plans",
1201
+ description: "Create a visual intake questionnaire before generating or updating an Agent-Native plan.",
1202
+ },
746
1203
  {
747
1204
  id: "ui-plan",
748
1205
  action: "create-ui-plan",
@@ -757,9 +1214,14 @@ const BUILT_IN_APP_SKILLS = {
757
1214
  ],
758
1215
  skills: [
759
1216
  {
760
- path: "skills/visual-plans",
1217
+ path: "skills/visual-plan",
1218
+ visibility: "exported",
1219
+ exportAs: "visual-plan",
1220
+ },
1221
+ {
1222
+ path: "skills/visual-questions",
761
1223
  visibility: "exported",
762
- exportAs: "visual-plans",
1224
+ exportAs: "visual-questions",
763
1225
  },
764
1226
  {
765
1227
  path: "skills/ui-plan",
@@ -834,12 +1296,12 @@ const BUILT_IN_APP_SKILL_ALIASES = {
834
1296
  "agent-native-design-exploration": "design",
835
1297
  "visual-plans": "visual-plans",
836
1298
  "visual-plan": "visual-plans",
1299
+ "visual-questions": "visual-plans",
1300
+ "visual-question": "visual-plans",
837
1301
  "ui-plan": "visual-plans",
838
1302
  "ui-plans": "visual-plans",
839
1303
  "visualize-plan": "visual-plans",
840
1304
  "visualize-plans": "visual-plans",
841
- plans: "visual-plans",
842
- plan: "visual-plans",
843
1305
  "html-plan": "visual-plans",
844
1306
  "plan-mode": "visual-plans",
845
1307
  plannotate: "visual-plans",
@@ -860,7 +1322,8 @@ const BUILT_IN_APP_SKILL_DISPLAY_ALIASES = {
860
1322
  "agent-native-design-exploration",
861
1323
  ],
862
1324
  "visual-plans": [
863
- "plans",
1325
+ "visual-plan",
1326
+ "visual-questions",
864
1327
  "ui-plan",
865
1328
  "visualize-plan",
866
1329
  "html-plan",