@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.
- package/dist/brand-kit/fig/decode.d.ts +33 -0
- package/dist/brand-kit/fig/decode.d.ts.map +1 -0
- package/dist/brand-kit/fig/decode.js +358 -0
- package/dist/brand-kit/fig/decode.js.map +1 -0
- package/dist/brand-kit/fig/extract-design-system.d.ts +44 -0
- package/dist/brand-kit/fig/extract-design-system.d.ts.map +1 -0
- package/dist/brand-kit/fig/extract-design-system.js +752 -0
- package/dist/brand-kit/fig/extract-design-system.js.map +1 -0
- package/dist/brand-kit/fig/fig-to-html.d.ts +246 -0
- package/dist/brand-kit/fig/fig-to-html.d.ts.map +1 -0
- package/dist/brand-kit/fig/fig-to-html.js +1506 -0
- package/dist/brand-kit/fig/fig-to-html.js.map +1 -0
- package/dist/brand-kit/fig/index.d.ts +30 -0
- package/dist/brand-kit/fig/index.d.ts.map +1 -0
- package/dist/brand-kit/fig/index.js +43 -0
- package/dist/brand-kit/fig/index.js.map +1 -0
- package/dist/cli/skills.d.ts +4 -0
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +841 -378
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +6 -104
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/context-xray/ContextMeter.js +1 -1
- package/dist/client/context-xray/ContextMeter.js.map +1 -1
- package/dist/client/context-xray/ContextSegmentRow.d.ts.map +1 -1
- package/dist/client/context-xray/ContextSegmentRow.js +4 -4
- package/dist/client/context-xray/ContextSegmentRow.js.map +1 -1
- package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
- package/dist/client/context-xray/ContextTreemap.js +2 -2
- package/dist/client/context-xray/ContextTreemap.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +19 -18
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +4 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +6 -4
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/package.json +6 -1
package/dist/cli/skills.js
CHANGED
|
@@ -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|
|
|
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
|
|
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-
|
|
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
|
|
192
|
-
document with diagrams, wireframes, mockups, prototypes, annotations,
|
|
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
|
|
201
|
-
plan you would normally write in Markdown, but as a scannable
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
207
|
-
and
|
|
208
|
-
|
|
209
|
-
|
|
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
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
- **
|
|
280
|
-
|
|
281
|
-
|
|
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
|
|
297
|
-
|
|
298
|
-
2.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
|
346
|
-
- \`create-ui-plan\`: start a UI-first plan
|
|
347
|
-
- \`
|
|
348
|
-
- \`
|
|
349
|
-
- \`
|
|
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,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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,
|
|
386
|
-
|
|
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
|
|
391
|
-
|
|
392
|
-
|
|
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
|
-
- **
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
- **Research before you draft.** Read the real components, routes, design
|
|
401
|
-
tokens
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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
|
-
|
|
421
|
-
2.
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
3. Continue below
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
the
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
489
|
-
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
-
|
|
501
|
-
|
|
502
|
-
-
|
|
503
|
-
-
|
|
504
|
-
|
|
505
|
-
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
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
|
|
514
|
-
- \`
|
|
515
|
-
- \`
|
|
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
|
|
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
|
|
522
|
-
name:
|
|
741
|
+
export const VISUAL_QUESTIONS_SKILL_MD = `---
|
|
742
|
+
name: visual-questions
|
|
523
743
|
description: >-
|
|
524
|
-
|
|
525
|
-
|
|
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:
|
|
747
|
+
visibility: both
|
|
529
748
|
---
|
|
530
749
|
|
|
531
|
-
#
|
|
750
|
+
# Visual Questions
|
|
532
751
|
|
|
533
|
-
Use
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
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
|
-
|
|
539
|
-
It should still read like a plan, not a marketing page.
|
|
758
|
+
## When To Use
|
|
540
759
|
|
|
541
|
-
|
|
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
|
-
|
|
544
|
-
|
|
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
|
-
|
|
548
|
-
|
|
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
|
-
##
|
|
809
|
+
## Tool Guidance
|
|
551
810
|
|
|
552
|
-
|
|
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
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
-
|
|
561
|
-
|
|
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
|
-
|
|
564
|
-
|
|
565
|
-
|
|
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
|
-
- **
|
|
570
|
-
|
|
571
|
-
|
|
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
|
|
577
|
-
|
|
578
|
-
|
|
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
|
-
|
|
584
|
-
|
|
585
|
-
|
|
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
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
5. Ask the user to react
|
|
595
|
-
|
|
596
|
-
6. Treat
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
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
|
-
"
|
|
1325
|
+
"visual-plan",
|
|
1326
|
+
"visual-questions",
|
|
864
1327
|
"ui-plan",
|
|
865
1328
|
"visualize-plan",
|
|
866
1329
|
"html-plan",
|