@agent-native/core 0.37.2 → 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/cli/skills.d.ts +4 -0
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +766 -537
- package/dist/cli/skills.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/skills.js
CHANGED
|
@@ -185,7 +185,7 @@ 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 = `---
|
|
188
|
+
export const VISUAL_PLANS_SKILL_MD = `---
|
|
189
189
|
name: visual-plan
|
|
190
190
|
description: >-
|
|
191
191
|
Use Agent-Native Plans when coding-agent work needs an interactive structured
|
|
@@ -197,255 +197,279 @@ metadata:
|
|
|
197
197
|
|
|
198
198
|
# Agent-Native Plans
|
|
199
199
|
|
|
200
|
-
Agent-Native Plans is structured visual planning mode for coding agents.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
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.
|
|
206
205
|
|
|
207
|
-
|
|
208
|
-
and
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
\`\`\`bash
|
|
213
|
-
npx @agent-native/core@latest skills add visual-plan
|
|
214
|
-
\`\`\`
|
|
215
|
-
|
|
216
|
-
Then start typing \`/visual-plan\` for a fresh general plan, \`/ui-plan\` for a
|
|
217
|
-
UI-first high-fidelity plan, \`/visual-questions\` to force visual intake before
|
|
218
|
-
a plan, or \`/visualize-plan\` to turn an existing Codex, Claude Code, Markdown,
|
|
219
|
-
or pasted plan into a visual companion. The hosted MCP app opens inline where
|
|
220
|
-
supported and falls back to a browser link everywhere else.
|
|
221
|
-
|
|
222
|
-
## Slash Commands
|
|
223
|
-
|
|
224
|
-
- \`/visual-plan\`: create a fresh rich visual plan before implementation. Include
|
|
225
|
-
a docs-level plan, visual architecture/flow diagrams, detailed wireframes or
|
|
226
|
-
mockups when UI is involved, an implementation map with files/symbols/snippets,
|
|
227
|
-
tradeoffs, open questions, and clear feedback prompts.
|
|
228
|
-
- \`/visual-questions\`: manually force the visual intake step before a plan.
|
|
229
|
-
Use it for chip questions, freeform answers, mockup choice tabs, sketch
|
|
230
|
-
diagrams, and a generated answer summary that can feed \`/visual-plan\`,
|
|
231
|
-
\`/ui-plan\`, \`/visualize-plan\`, or an existing plan update.
|
|
232
|
-
- \`/ui-plan\`: create a UI-first high-fidelity visual plan before implementation.
|
|
233
|
-
Use an optional top pan/zoom wireframe or diagram canvas when visuals clarify
|
|
234
|
-
the flow, then continue as a refined Notion-like document with rich tabs,
|
|
235
|
-
comments/drawing prompts, code tabs, and agent handoff notes.
|
|
236
|
-
- \`/visualize-plan\`: import an existing Codex, Claude Code, Markdown, or pasted
|
|
237
|
-
text plan and turn it into a visual companion. Preserve the plan's intent,
|
|
238
|
-
then add diagrams, wireframes, option cards, file/symbol maps, and annotation
|
|
239
|
-
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.
|
|
240
211
|
|
|
241
212
|
## When To Use
|
|
242
213
|
|
|
243
|
-
Create
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
- work is multi-file, ambiguous, long-running, risky, or UI-heavy;
|
|
248
|
-
- the user needs to react quickly to direction rather than read prose;
|
|
249
|
-
- architecture, data flow, UI direction, options, or open questions would be
|
|
250
|
-
clearer visually;
|
|
251
|
-
- you need the user to react before implementation.
|
|
252
|
-
|
|
253
|
-
The companion \`visual-questions\` and \`visualize-plan\` skills are installed
|
|
254
|
-
with this one. Use \`visual-questions\` as the manual override when the user or
|
|
255
|
-
agent wants intake first; use \`visualize-plan\` when the user already has a
|
|
256
|
-
Codex, Claude Code, Markdown, or pasted text plan and wants a visual companion
|
|
257
|
-
instead of a fresh plan.
|
|
258
|
-
|
|
259
|
-
## Automatic Visual-Question Preflight
|
|
260
|
-
|
|
261
|
-
\`/visual-plan\` stays the main entry point. Before calling
|
|
262
|
-
\`create-visual-plan\`, decide whether a visual-question preflight would make the
|
|
263
|
-
plan meaningfully better.
|
|
264
|
-
|
|
265
|
-
Run \`create-visual-questions\` first when:
|
|
266
|
-
|
|
267
|
-
- UI direction, form factor, layout model, feature scope, visual style,
|
|
268
|
-
architecture shape, or flow depth is fuzzy enough that 2-6 answers would
|
|
269
|
-
change the plan;
|
|
270
|
-
- there are multiple plausible visual options and the user would benefit from
|
|
271
|
-
comparing mockups, diagrams, or chips before reading a plan;
|
|
272
|
-
- the user asks to see choices, answer questions, pick a direction, or review
|
|
273
|
-
intake before planning.
|
|
274
|
-
|
|
275
|
-
Skip the preflight when the work is trivial, the right answer is clear from the
|
|
276
|
-
codebase, the missing details can be safely stated as assumptions in the plan,
|
|
277
|
-
or asking questions would only slow down an otherwise concrete task. If the user
|
|
278
|
-
types \`/visual-questions\`, honor it as a manual override even if the heuristic
|
|
279
|
-
would normally skip intake.
|
|
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.
|
|
280
218
|
|
|
281
219
|
## Plan Discipline
|
|
282
220
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
unfamiliar. Skip it for trivial, unambiguous work — typos, one-line fixes, a
|
|
289
|
-
single well-specified function, anything whose diff you could describe in one
|
|
290
|
-
sentence — and just make the change. A polished visual plan is the most
|
|
291
|
-
expensive plan form; only invest when a wrong direction is costly. Never pad a
|
|
292
|
-
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.
|
|
293
226
|
- **Research before you draft.** Read the real files, actions, schema, and
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
- **
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
verification step (tests, build, or a checkable behavior). Replace vague prose
|
|
312
|
-
with specifics; never ship a step like "make it work."
|
|
313
|
-
- **The plan is the approval gate.** After surfacing the plan, explicitly ask
|
|
314
|
-
the user to review and approve before you write any code, and name which
|
|
315
|
-
files/areas and permissions the work will touch so approval grants scope.
|
|
316
|
-
Presenting the plan and requesting sign-off is the approval step — do not ask
|
|
317
|
-
a separate "does this look good?" question.
|
|
318
|
-
- **The document is the source of truth, not the chat.** When scope shifts
|
|
319
|
-
during review or implementation, update the plan with \`update-visual-plan\`
|
|
320
|
-
rather than only changing course in chat, and re-read the approved plan before
|
|
321
|
-
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.
|
|
322
244
|
|
|
323
245
|
## Core Workflow
|
|
324
246
|
|
|
325
247
|
1. Call \`create-visual-plan\` with the title, brief, source, repo path, and
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
\`visual-questions\`, and bounded \`custom-html\` blocks. Do not send a full
|
|
332
|
-
standalone HTML document unless importing a legacy artifact.
|
|
333
|
-
3. Surface the returned Plans link or inline MCP App. In CLI hosts, ask the user
|
|
334
|
-
to review the plan visually.
|
|
335
|
-
4. Prefer diagrams, wireframes, UI mockups, option cards, implementation maps,
|
|
336
|
-
and small interactive prototypes over paragraphs.
|
|
337
|
-
5. Call \`get-plan-feedback\` before editing, after review, after any long pause,
|
|
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,
|
|
338
253
|
and before the final response.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
\`
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
-
|
|
403
|
-
|
|
404
|
-
|
|
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 -->
|
|
405
446
|
|
|
406
447
|
## Tool Guidance
|
|
407
448
|
|
|
408
449
|
- \`create-visual-plan\`: start one structured visual plan per agent task/run.
|
|
409
|
-
- \`create-ui-plan\`: start a UI-first plan
|
|
410
|
-
- \`create-visual-questions\`:
|
|
411
|
-
|
|
412
|
-
- \`
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
\`
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
- \`
|
|
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.
|
|
419
462
|
- \`get-plan-feedback\`: read unconsumed human feedback. Use it frequently.
|
|
420
|
-
- \`export-visual-plan\`: export HTML, Markdown fallback,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
\`html\`, \`head\`, \`body\`, or \`script\` tags in custom fragments.
|
|
429
|
-
- \`sketch-diagram\` blocks must be legible: labels cannot overlap nodes,
|
|
430
|
-
connectors, rough lines, or each other; omit the diagram when it does not
|
|
431
|
-
clarify a real architecture, sequence, dependency, or state relationship.
|
|
432
|
-
- Match Agent-Native's restrained theme unless the user asks otherwise.
|
|
433
|
-
- Keep the first viewport legible and plan-like: title, brief, concise scope,
|
|
434
|
-
and a useful diagram/checklist/table when it helps.
|
|
435
|
-
- Use tabs or small interactions only when they make review faster.
|
|
436
|
-
- Do not paste huge artifacts into chat. Store the plan in Plans and surface the
|
|
437
|
-
MCP app or link.
|
|
438
|
-
|
|
439
|
-
## Guardrails
|
|
440
|
-
|
|
441
|
-
- Keep it simple. Do not build a ten-tab dashboard unless the user asks.
|
|
442
|
-
- Do not hand-roll MCP HTTP requests with curl. Use host-exposed tools after
|
|
443
|
-
restart/reload, or use the returned browser/deep-link fallback.
|
|
444
|
-
- Hosted default: connect
|
|
445
|
-
\`https://plan.agent-native.com/_agent-native/mcp\`. Do not put shared
|
|
446
|
-
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.
|
|
447
471
|
`;
|
|
448
|
-
const UI_PLAN_SKILL_MD = `---
|
|
472
|
+
export const UI_PLAN_SKILL_MD = `---
|
|
449
473
|
name: ui-plan
|
|
450
474
|
description: >-
|
|
451
475
|
Use Agent-Native Plans for UI-first planning with an optional top pan/zoom
|
|
@@ -458,248 +482,303 @@ metadata:
|
|
|
458
482
|
# UI Plan
|
|
459
483
|
|
|
460
484
|
Use \`/ui-plan\` when the task is primarily about product UI, user flows,
|
|
461
|
-
interaction states, component layout,
|
|
462
|
-
|
|
463
|
-
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
|
|
464
487
|
react to.
|
|
465
488
|
|
|
466
|
-
\`/visual-plan\` remains the general
|
|
467
|
-
|
|
468
|
-
|
|
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.
|
|
469
492
|
|
|
470
493
|
## Plan Discipline
|
|
471
494
|
|
|
472
|
-
- **
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
- **Research before you draft.** Read the real components, routes, design
|
|
477
|
-
tokens
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
in the plan and proceed.
|
|
488
|
-
- **The plan is the approval gate.** Explicitly ask the user to review and
|
|
489
|
-
approve the UI direction before you write any code, and name the files/areas
|
|
490
|
-
the work will touch. Presenting the plan and requesting sign-off is the
|
|
491
|
-
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.
|
|
492
510
|
|
|
493
511
|
## UI-First Workflow
|
|
494
512
|
|
|
495
|
-
1. Call \`create-ui-plan\` with a UI-specific title, brief, source, repo path,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
-
|
|
564
|
-
|
|
565
|
-
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
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
|
-
|
|
632
|
-
|
|
633
|
-
-
|
|
634
|
-
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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 -->
|
|
640
718
|
|
|
641
719
|
## Tool Guidance
|
|
642
720
|
|
|
643
721
|
- \`create-ui-plan\`: create the UI-first structured visual plan.
|
|
644
|
-
- \`
|
|
645
|
-
|
|
646
|
-
|
|
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.
|
|
647
732
|
- \`get-plan-feedback\`: read unconsumed reviewer comments before coding.
|
|
648
|
-
- \`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.
|
|
649
738
|
|
|
650
739
|
Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
|
|
651
740
|
`;
|
|
652
|
-
const VISUAL_QUESTIONS_SKILL_MD = `---
|
|
741
|
+
export const VISUAL_QUESTIONS_SKILL_MD = `---
|
|
653
742
|
name: visual-questions
|
|
654
743
|
description: >-
|
|
655
744
|
Use Agent-Native Plans to ask rich visual intake questions before creating a
|
|
656
745
|
UI plan or visual plan.
|
|
657
746
|
metadata:
|
|
658
|
-
visibility:
|
|
747
|
+
visibility: both
|
|
659
748
|
---
|
|
660
749
|
|
|
661
750
|
# Visual Questions
|
|
662
751
|
|
|
663
752
|
Use \`/visual-questions\` when the next best step is not a plan yet, but a
|
|
664
753
|
reviewable visual intake: single-choice chips, multi-select chips, freeform
|
|
665
|
-
notes,
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
\`/visual-questions\` is the manual override for the automatic preflight that
|
|
669
|
-
\`/visual-plan\` may run. Use it when the user explicitly asks for intake first
|
|
670
|
-
or when the plan would be materially better after 2-6 visual choices.
|
|
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\`.
|
|
671
757
|
|
|
672
758
|
## When To Use
|
|
673
759
|
|
|
674
760
|
- The user asks to be shown options before the agent writes a plan.
|
|
675
|
-
- UI direction, form factor, layout model, feature set,
|
|
676
|
-
|
|
677
|
-
materially change the 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.
|
|
678
763
|
- The user would benefit from choosing between visual mockups or diagrams rather
|
|
679
|
-
than answering text-only
|
|
680
|
-
- The next flow should be: answer questions -> create UI plan, answer questions
|
|
681
|
-
-> create visual plan, answer questions -> update/visualize an existing plan.
|
|
764
|
+
than answering text-only prompts.
|
|
682
765
|
|
|
683
|
-
|
|
684
|
-
answer, prefer \`/
|
|
685
|
-
the plan.
|
|
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.
|
|
686
769
|
|
|
687
770
|
## Workflow
|
|
688
771
|
|
|
689
772
|
1. Call \`create-visual-questions\` with a clear title, brief, source, and repo
|
|
690
773
|
path when known.
|
|
691
|
-
2. Omit \`questions\` for the default UI intake. Provide a custom \`questions\`
|
|
692
|
-
|
|
774
|
+
2. Omit \`questions\` for the default UI intake. Provide a custom \`questions\` array
|
|
775
|
+
only when the task has domain-specific choices.
|
|
693
776
|
3. Surface the returned Plans link and ask the user to answer visually.
|
|
694
|
-
4. The
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
- call \`update-visual-plan\` with targeted \`contentPatches\` when the active
|
|
700
|
-
plan should absorb answers.
|
|
701
|
-
5. If the user leaves comments on the visual questionnaire, call
|
|
702
|
-
\`get-plan-feedback\` before using the answers.
|
|
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.
|
|
703
782
|
|
|
704
783
|
## Question Types
|
|
705
784
|
|
|
@@ -708,24 +787,24 @@ Supported \`questions\` entries:
|
|
|
708
787
|
- \`single\`: chip group where one option wins.
|
|
709
788
|
- \`multi\`: chip group where multiple options can be selected.
|
|
710
789
|
- \`freeform\`: textarea for constraints, inspirations, or things to avoid.
|
|
711
|
-
- \`visual\`: visual options with sketch previews
|
|
712
|
-
|
|
790
|
+
- \`visual\`: visual options with sketch previews — use for layout direction, flow
|
|
791
|
+
depth, surface choice, or diagram choices.
|
|
713
792
|
|
|
714
793
|
Each option can include \`label\`, \`value\`, \`description\`, \`recommended\`,
|
|
715
|
-
\`preview\`, and \`bullets\`. Valid \`preview\` values
|
|
716
|
-
\`mobile\`, \`split\`, \`flow\`, and
|
|
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.
|
|
717
798
|
|
|
718
799
|
## Quality Bar
|
|
719
800
|
|
|
720
|
-
- Ask only decision-changing questions. A beautiful form with low-value
|
|
721
|
-
|
|
801
|
+
- Ask only decision-changing questions. A beautiful form with low-value questions
|
|
802
|
+
is still friction.
|
|
722
803
|
- Prefer visible, answerable options over abstract prose.
|
|
723
|
-
- Use visual tabs when users need to compare layout
|
|
804
|
+
- Use visual tabs when users need to compare layout or flow shapes.
|
|
724
805
|
- Keep the output calm and document-like, not a landing page.
|
|
725
|
-
-
|
|
726
|
-
|
|
727
|
-
- The generated answer summary is not the final plan; it is the intake prompt
|
|
728
|
-
for the next agent step.
|
|
806
|
+
- The generated answer summary is not the final plan; it is the intake prompt for
|
|
807
|
+
the next agent step.
|
|
729
808
|
|
|
730
809
|
## Tool Guidance
|
|
731
810
|
|
|
@@ -735,11 +814,17 @@ Each option can include \`label\`, \`value\`, \`description\`, \`recommended\`,
|
|
|
735
814
|
- \`create-ui-plan\`: create a UI-first plan from the answers.
|
|
736
815
|
- \`create-visual-plan\`: create a general visual plan from the answers.
|
|
737
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.
|
|
821
|
+
|
|
822
|
+
Hosted default: connect \`https://plan.agent-native.com/_agent-native/mcp\`.
|
|
738
823
|
`;
|
|
739
|
-
const VISUALIZE_PLAN_SKILL_MD = `---
|
|
824
|
+
export const VISUALIZE_PLAN_SKILL_MD = `---
|
|
740
825
|
name: visualize-plan
|
|
741
826
|
description: >-
|
|
742
|
-
Convert an existing Codex, Claude Code, Markdown, or pasted plan into
|
|
827
|
+
Convert an existing Codex, Claude Code, Markdown, or pasted plan into an
|
|
743
828
|
Agent-Native Plans visual companion with diagrams, wireframes, annotations, and
|
|
744
829
|
feedback.
|
|
745
830
|
metadata:
|
|
@@ -748,108 +833,252 @@ metadata:
|
|
|
748
833
|
|
|
749
834
|
# Visualize Plan
|
|
750
835
|
|
|
751
|
-
Use
|
|
752
|
-
Claude Code plan can stay
|
|
753
|
-
a structured visual
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
This is for impatient review. Default to things the user can scan and react to.
|
|
757
|
-
It should still read like a plan, not a marketing page.
|
|
758
|
-
|
|
759
|
-
Install with the Agent-Native CLI if Plans is not already available:
|
|
760
|
-
|
|
761
|
-
\`\`\`bash
|
|
762
|
-
npx @agent-native/core@latest skills add visual-plan
|
|
763
|
-
\`\`\`
|
|
764
|
-
|
|
765
|
-
That installs \`/visual-plan\`, \`/visual-questions\`, \`/ui-plan\`, and
|
|
766
|
-
\`/visualize-plan\` plus the MCP connector.
|
|
767
|
-
|
|
768
|
-
## When To Use
|
|
769
|
-
|
|
770
|
-
Use \`visualize-plan\` when:
|
|
771
|
-
|
|
772
|
-
- the user has an existing Codex, Claude Code, Markdown, or pasted plan;
|
|
773
|
-
- the user asks to visualize, annotate, plannotate, mock up, diagram, or make a
|
|
774
|
-
plan easier to review;
|
|
775
|
-
- the plan is long enough that the user may not read it closely;
|
|
776
|
-
- UI direction, architecture, data flow, risky assumptions, or open questions
|
|
777
|
-
would be clearer visually;
|
|
778
|
-
- the user wants feedback on wireframes, design/prototype options, diagrams, or
|
|
779
|
-
tradeoffs before implementation.
|
|
780
|
-
|
|
781
|
-
If there is no existing plan text available, ask for it, use \`visual-plan\`
|
|
782
|
-
to create a fresh general plan, or use \`ui-plan\` when the work is UI-heavy and
|
|
783
|
-
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.
|
|
784
841
|
|
|
785
842
|
## Plan Discipline
|
|
786
843
|
|
|
787
|
-
- **
|
|
788
|
-
|
|
789
|
-
|
|
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.
|
|
790
847
|
- **Stay grounded and read-only.** Preserve the source plan's intent, do not
|
|
791
848
|
invent codebase facts, and label anything inferred as inferred. Make no source
|
|
792
849
|
edits while building or reviewing the companion.
|
|
793
850
|
- **The companion is the approval gate.** Ask the user to review and approve the
|
|
794
|
-
direction before you write
|
|
795
|
-
|
|
796
|
-
|
|
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.
|
|
797
854
|
|
|
798
855
|
## Workflow
|
|
799
856
|
|
|
800
857
|
1. Gather the existing plan text from the user's paste, a referenced file, or
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
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.
|
|
804
862
|
3. Surface the returned Plans link or inline MCP App.
|
|
805
|
-
4. Enrich the
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
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\`.
|
|
853
1082
|
`;
|
|
854
1083
|
const BUILT_IN_APP_SKILLS = {
|
|
855
1084
|
assets: {
|