@agent-native/core 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +8 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/skills.d.ts +5 -4
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +450 -125
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/blocks/BlockView.d.ts +13 -4
- package/dist/client/blocks/BlockView.d.ts.map +1 -1
- package/dist/client/blocks/BlockView.js +34 -13
- package/dist/client/blocks/BlockView.js.map +1 -1
- package/dist/client/blocks/SchemaBlockEditor.d.ts.map +1 -1
- package/dist/client/blocks/SchemaBlockEditor.js +96 -3
- package/dist/client/blocks/SchemaBlockEditor.js.map +1 -1
- package/dist/client/blocks/index.d.ts +18 -1
- package/dist/client/blocks/index.d.ts.map +1 -1
- package/dist/client/blocks/index.js +26 -1
- package/dist/client/blocks/index.js.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts +6 -0
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/AnnotatedCodeBlock.js +135 -0
- package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -0
- package/dist/client/blocks/library/ApiEndpointBlock.d.ts +20 -0
- package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/ApiEndpointBlock.js +131 -0
- package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -0
- package/dist/client/blocks/library/DataModelBlock.d.ts +28 -0
- package/dist/client/blocks/library/DataModelBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/DataModelBlock.js +222 -0
- package/dist/client/blocks/library/DataModelBlock.js.map +1 -0
- package/dist/client/blocks/library/DiffBlock.d.ts +6 -0
- package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/DiffBlock.js +293 -0
- package/dist/client/blocks/library/DiffBlock.js.map +1 -0
- package/dist/client/blocks/library/FileTreeBlock.d.ts +23 -0
- package/dist/client/blocks/library/FileTreeBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/FileTreeBlock.js +225 -0
- package/dist/client/blocks/library/FileTreeBlock.js.map +1 -0
- package/dist/client/blocks/library/JsonExplorerBlock.d.ts +19 -0
- package/dist/client/blocks/library/JsonExplorerBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/JsonExplorerBlock.js +171 -0
- package/dist/client/blocks/library/JsonExplorerBlock.js.map +1 -0
- package/dist/client/blocks/library/MermaidBlock.d.ts +17 -0
- package/dist/client/blocks/library/MermaidBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/MermaidBlock.js +131 -0
- package/dist/client/blocks/library/MermaidBlock.js.map +1 -0
- package/dist/client/blocks/library/OpenApiSpecBlock.d.ts +19 -0
- package/dist/client/blocks/library/OpenApiSpecBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/OpenApiSpecBlock.js +494 -0
- package/dist/client/blocks/library/OpenApiSpecBlock.js.map +1 -0
- package/dist/client/blocks/library/annotated-code.config.d.ts +58 -0
- package/dist/client/blocks/library/annotated-code.config.d.ts.map +1 -0
- package/dist/client/blocks/library/annotated-code.config.js +53 -0
- package/dist/client/blocks/library/annotated-code.config.js.map +1 -0
- package/dist/client/blocks/library/api-endpoint.config.d.ts +71 -0
- package/dist/client/blocks/library/api-endpoint.config.d.ts.map +1 -0
- package/dist/client/blocks/library/api-endpoint.config.js +91 -0
- package/dist/client/blocks/library/api-endpoint.config.js.map +1 -0
- package/dist/client/blocks/library/checklist.d.ts.map +1 -1
- package/dist/client/blocks/library/checklist.js +3 -1
- package/dist/client/blocks/library/checklist.js.map +1 -1
- package/dist/client/blocks/library/code-tabs.js +1 -1
- package/dist/client/blocks/library/code-tabs.js.map +1 -1
- package/dist/client/blocks/library/data-model.config.d.ts +72 -0
- package/dist/client/blocks/library/data-model.config.d.ts.map +1 -0
- package/dist/client/blocks/library/data-model.config.js +59 -0
- package/dist/client/blocks/library/data-model.config.js.map +1 -0
- package/dist/client/blocks/library/dev-doc-ui.d.ts +49 -0
- package/dist/client/blocks/library/dev-doc-ui.d.ts.map +1 -0
- package/dist/client/blocks/library/dev-doc-ui.js +50 -0
- package/dist/client/blocks/library/dev-doc-ui.js.map +1 -0
- package/dist/client/blocks/library/diff.config.d.ts +41 -0
- package/dist/client/blocks/library/diff.config.d.ts.map +1 -0
- package/dist/client/blocks/library/diff.config.js +34 -0
- package/dist/client/blocks/library/diff.config.js.map +1 -0
- package/dist/client/blocks/library/file-tree.config.d.ts +59 -0
- package/dist/client/blocks/library/file-tree.config.d.ts.map +1 -0
- package/dist/client/blocks/library/file-tree.config.js +45 -0
- package/dist/client/blocks/library/file-tree.config.js.map +1 -0
- package/dist/client/blocks/library/html.d.ts.map +1 -1
- package/dist/client/blocks/library/html.js +4 -1
- package/dist/client/blocks/library/html.js.map +1 -1
- package/dist/client/blocks/library/json-explorer.config.d.ts +46 -0
- package/dist/client/blocks/library/json-explorer.config.d.ts.map +1 -0
- package/dist/client/blocks/library/json-explorer.config.js +28 -0
- package/dist/client/blocks/library/json-explorer.config.js.map +1 -0
- package/dist/client/blocks/library/mermaid.config.d.ts +32 -0
- package/dist/client/blocks/library/mermaid.config.d.ts.map +1 -0
- package/dist/client/blocks/library/mermaid.config.js +24 -0
- package/dist/client/blocks/library/mermaid.config.js.map +1 -0
- package/dist/client/blocks/library/openapi-spec.config.d.ts +49 -0
- package/dist/client/blocks/library/openapi-spec.config.d.ts.map +1 -0
- package/dist/client/blocks/library/openapi-spec.config.js +24 -0
- package/dist/client/blocks/library/openapi-spec.config.js.map +1 -0
- package/dist/client/blocks/library/server-specs.d.ts +35 -0
- package/dist/client/blocks/library/server-specs.d.ts.map +1 -0
- package/dist/client/blocks/library/server-specs.js +171 -0
- package/dist/client/blocks/library/server-specs.js.map +1 -0
- package/dist/client/blocks/library/specs.d.ts +29 -0
- package/dist/client/blocks/library/specs.d.ts.map +1 -0
- package/dist/client/blocks/library/specs.js +229 -0
- package/dist/client/blocks/library/specs.js.map +1 -0
- package/dist/client/blocks/library/table.d.ts.map +1 -1
- package/dist/client/blocks/library/table.js +3 -1
- package/dist/client/blocks/library/table.js.map +1 -1
- package/dist/client/blocks/library/tabs.js +1 -1
- package/dist/client/blocks/library/tabs.js.map +1 -1
- package/dist/client/blocks/registry.d.ts +8 -0
- package/dist/client/blocks/registry.d.ts.map +1 -1
- package/dist/client/blocks/registry.js +15 -0
- package/dist/client/blocks/registry.js.map +1 -1
- package/dist/client/blocks/server.d.ts +9 -0
- package/dist/client/blocks/server.d.ts.map +1 -1
- package/dist/client/blocks/server.js +16 -0
- package/dist/client/blocks/server.js.map +1 -1
- package/dist/client/blocks/types.d.ts +40 -0
- package/dist/client/blocks/types.d.ts.map +1 -1
- package/dist/client/blocks/types.js.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +10 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/rich-markdown-editor/DragHandle.d.ts +52 -0
- package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +1 -0
- package/dist/client/rich-markdown-editor/DragHandle.js +403 -0
- package/dist/client/rich-markdown-editor/DragHandle.js.map +1 -0
- package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts +97 -0
- package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -0
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js +214 -0
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -0
- package/dist/client/rich-markdown-editor/RunId.d.ts +28 -0
- package/dist/client/rich-markdown-editor/RunId.d.ts.map +1 -0
- package/dist/client/rich-markdown-editor/RunId.js +60 -0
- package/dist/client/rich-markdown-editor/RunId.js.map +1 -0
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +25 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js +14 -5
- package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -1
- package/dist/client/rich-markdown-editor/gfmDoc.d.ts +24 -0
- package/dist/client/rich-markdown-editor/gfmDoc.d.ts.map +1 -0
- package/dist/client/rich-markdown-editor/gfmDoc.js +83 -0
- package/dist/client/rich-markdown-editor/gfmDoc.js.map +1 -0
- package/dist/client/rich-markdown-editor/index.d.ts +5 -0
- package/dist/client/rich-markdown-editor/index.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/index.js +5 -0
- package/dist/client/rich-markdown-editor/index.js.map +1 -1
- package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts +46 -0
- package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts.map +1 -0
- package/dist/client/rich-markdown-editor/registrySlashCommands.js +13 -0
- package/dist/client/rich-markdown-editor/registrySlashCommands.js.map +1 -0
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +33 -0
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/docs/content/template-plan.md +19 -4
- package/docs/content/visual-plans.md +3 -1
- package/package.json +1 -1
package/dist/cli/skills.d.ts
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* command handles the common "install Assets for my agent" path in one step.
|
|
5
5
|
*/
|
|
6
6
|
import { type ClientId } from "./mcp-config-writers.js";
|
|
7
|
-
export declare const VISUAL_PLANS_SKILL_MD = "---\nname: visual-plan\ndescription: >-\n Use Agent-Native Plans when coding-agent work needs an interactive structured\n plan document with diagrams, wireframes, mockups, prototypes, annotations,\n and comments.\nmetadata:\n visibility: exported\n---\n\n# Agent-Native Plans\n\nAgent-Native Plans is structured visual planning mode for coding agents. Build\nthe plan you would normally write in Markdown, but as a scannable document with\neditable blocks mixed in: an optional pan/zoom wireframe canvas on top and a\nNotion-like technical document below. The user reacts to visuals first and reads\nprose only where it helps.\n\n`/visual-plan` is the canonical command and the main entry point. Use `/ui-plan`\nwhen the work is primarily product UI and review should start with the screens.\nUse `/visual-questions` only when the user explicitly wants a visual intake form\nbefore planning. Use `/visualize-plan` to turn an existing Codex, Claude Code,\nMarkdown, or pasted plan into a visual companion.\n\n## When To Use\n\nCreate a visual plan when work is multi-file, ambiguous, long-running, risky, or\nUI-heavy, when architecture / data flow / UI direction / options / open\nquestions would be clearer visually, or when the user needs to react to a\ndirection before you implement.\n\n## Plan Discipline\n\n- **Gate hard.** A polished visual plan is the most expensive plan form; only\n invest when a wrong direction is costly. Skip it for trivial, unambiguous work\n \u2014 typos, one-line fixes, a single well-specified function, anything whose diff\n you could describe in one sentence \u2014 and just make the change. Never pad a plan\n with filler and never ship a single-step plan.\n- **Research before you draft.** Read the real files, actions, schema, and\n patterns first; name actual files, symbols, and data shapes instead of\n inventing them. Check existing `actions/` before proposing endpoints and prefer\n named client helpers over raw fetch. Delegate wide exploration to a sub-agent.\n- **Planning is read-only.** Make no source edits while building or reviewing the\n plan. Start editing only after the user approves the direction.\n- **Clarify vs. assume.** Do not ask how to build it \u2014 explore and present the\n approach and options in the plan. Ask a clarifying question only when an\n ambiguity would change the design and you cannot resolve it from the code; use\n the host agent's normal ask-user-question flow and batch 2-4 high-leverage\n questions before finalizing. Do not create visual questions from `/visual-plan`.\n Otherwise state the assumption explicitly and proceed, and put anything\n unresolved in an open-questions block.\n- **The plan is the approval gate.** After surfacing it, ask the user to review\n and approve before you write code, and name which files/areas the work touches.\n Presenting the plan and requesting sign-off is the approval step \u2014 do not ask a\n separate \"does this look good?\" question.\n- **The document is the source of truth, not the chat.** When scope shifts,\n update the plan with `update-visual-plan` rather than only changing course in\n chat, and re-read the approved plan before major steps.\n\n## Core Workflow\n\n1. Follow the host agent's normal planning flow: inspect the codebase, delegate\n wide exploration when useful, gather the info needed, and ask native\n clarifying questions as needed before generating the plan.\n2. Call `create-visual-plan` with the title, brief, source, repo path, and\n structured `content` blocks.\n3. Compose the canvas from the kit and write the document with native blocks\n (see the two cores below). Keep the document close to the Markdown plan the\n agent would normally output; add diagrams, wireframes, and visual callouts\n only where they clarify the plan. Skip the canvas for non-visual work.\n4. Surface the returned Plans link or inline MCP App and ask the user to review.\n Always include the actual URL in chat so the next step is a click in CLI or\n other text-only hosts. When the host exposes an embedded browser/preview panel\n and a tool can open arbitrary URLs there, open the returned plan URL\n automatically for convenient review; do not rely on this as the only handoff.\n5. Call `get-plan-feedback` before editing, after review, after any long pause,\n and before the final response.\n6. Apply changes with `update-visual-plan`, preferring targeted `contentPatches`.\n When the user wants source-control friendly edits, use\n `patch-visual-plan-source` against the MDX files instead of regenerating the\n plan.\n7. Export with `export-visual-plan` only when the user wants a shareable receipt\n or repo-check-in artifacts.\n\n<!-- SHARED-CORE:wireframe-canvas START -->\n\n## Wireframe & Canvas Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for how wireframes and the\ncanvas work. Do not paraphrase it per command.\n\n**A wireframe is an HTML mockup. The renderer owns the look; you write the\ncontent.** Set `data.html` to a self-contained, semantic HTML fragment of the\nscreen and set `data.surface`. The renderer owns the surface footprint/aspect,\nthe dark/light theme, the hand-drawn font, and the rough.js sketch overlay \u2014 you\nnever write `<html>`/`<body>`/`<script>`/`<style>` tags, font-family, hex colors,\nor any width/height/coordinates. You write real HTML layout and real product\ncontent; the renderer styles and roughens it.\n\n**A wireframe block's data is an HTML screen plus a surface:**\n\n```json\n{\n \"surface\": \"browser\",\n \"html\": \"<div style=\\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\\"><h1>Sign in</h1><p class=\\\"wf-muted\\\">Use your work email to continue.</p><div class=\\\"wf-card\\\" style=\\\"display:flex;flex-direction:column;gap:10px\\\"><label>Email<input value=\\\"jane@acme.co\\\" /></label><label>Password<input value=\\\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\\\" /></label><label style=\\\"display:flex;align-items:center;gap:8px\\\"><input type=\\\"checkbox\\\" checked /> Remember me</label><button class=\\\"primary\\\">Sign in</button></div><a href=\\\"#\\\">Forgot password?</a></div>\"\n}\n```\n\n**Write PLAIN semantic HTML and let the renderer style it.** Bare elements\n(`h1`/`h2`/`h3`, `p`, `button`, `input`, `<input type=\"checkbox\">`, `a`, `hr`)\nare auto-themed \u2014 no classes needed. Helper classes carry the rest:\n\n- `.wf-card` / `.wf-box` \u2014 a bordered, padded container (a panel, a list item).\n- `.wf-pill` / `.wf-chip` \u2014 a rounded tag or filter; add `.accent`\n (`<span class=\"wf-pill accent\">`) for the accent-filled variant.\n- `.wf-muted` \u2014 secondary/muted text (or use `<small>`).\n- `button.primary` or any element with `[data-primary]` \u2014 the accent-filled\n primary button.\n\n**Use the `--wf-*` tokens for any custom color, never hex.** The renderer flips\nthese on light/dark, so reading them is what keeps a mockup correct in both\nthemes. For any inline border, background, or text color, reference a token:\n`style=\"border:1.4px solid var(--wf-line)\"`. The tokens are `--wf-ink` (text),\n`--wf-muted` (secondary text), `--wf-line` (borders/dividers), `--wf-paper`\n(page background), `--wf-card` (raised surface), `--wf-accent` /\n`--wf-accent-fg` / `--wf-accent-soft` (brand action), `--wf-warn`, `--wf-ok`,\nand `--wf-radius`. Never hard-code a hex color and never set `font-family` \u2014 the\nrenderer owns the sketch/clean font.\n\n**Lay out with inline `style` flex/grid.** You write the real layout \u2014\n`display:flex; flex-direction:column; gap:10px; padding:16px` and so on \u2014 and the\nrenderer never repositions anything. Compose the actual product: reproduce the\ncurrent screen, then show the modification. Real labels, real counts, real dates,\nreal button text grounded in the screen you read; not lorem or gray bars.\n\n**Surface presets \u2014 match the real footprint, never default to desktop+mobile.**\nPick the `surface` that matches what the user will actually see:\n\n- `browser`: a web page that needs a browser chrome frame around it.\n- `desktop`: a full desktop app page or app shell.\n- `mobile`: a phone screen, only when the work is genuinely mobile.\n- `popover`: a small floating menu, dropdown, or inline popover.\n- `panel`: a side panel, inspector, or sidebar widget.\n\nThe surface locks the footprint and aspect; never set width/height/coordinates.\nA sidebar popover renders as a small surface, not a desktop page and a phone\nframe. Do not emit `desktop` + `mobile` variants unless responsive behavior\nactually changes the layout. For a component or widget, show one broader\napp-context frame only when placement affects understanding, then the focused\ncomponent states.\n\n**Modify, don't redesign.** When the task changes an existing screen, reproduce\nthe current screen's real layout and footprint FIRST, then change only the delta\nand call it out with a single annotation. Do not restack the page into a new\nlayout. For net-new surfaces, compose from the real app shell.\n\n**Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a\npopover, menu, dialog, toast), show the full screen once, then add a small\nseparate artboard whose `html` contains ONLY that sub-surface \u2014 do not re-draw\nthe whole page around it, and do not scale a duplicate up. Pick the matching\n`surface` (e.g. `popover`) so the footprint is right; never widen a popover to\npage width.\n\n**Loading / skeleton states.** Set `data.skeleton: true` on the wireframe and\nfill the `html` with neutral, textless placeholder geometry \u2014 boxes and bars\nbuilt as `<div>`s with `background:var(--wf-line)` and explicit heights/widths,\nno labels or copy. The renderer drops borders, sketch, and color into the\nskeleton register automatically. Never escape to a `custom-html` document block\nto fake a loader, and never move a mockup out of the canvas \u2014 mockups always\nlive in canvas artboards.\n\n**Editing an existing mockup.** To change one element, text, or color in an\nexisting html mockup, do NOT regenerate the frame \u2014 call `update-visual-plan`\nwith `contentPatches: [{ op: \"patch-wireframe-html\", blockId, edits: [{ find,\nreplace }] }]`. Each `find` is a unique snippet of the current html (read it\nfirst with `get-visual-plan`); set `all: true` on an edit to replace every\noccurrence. The result is re-sanitized.\n\n**Canvas annotations are designer notes on the artboard.** When a top canvas is\npresent, sprinkle Figma-style notes near the frames they explain: a short\nheading, supporting text, and bullets \u2014 plain text layers, never bordered or\nshadowed cards, and never a box around a frame. The renderer spaces notes away\nfrom frames, so place each note by the frame it describes. Use an arrow only to\npoint at one specific control or transition; for a broad frame-level note, write\ntext beside the frame with no connector. Connectors are for real sequences only \u2014\nnever fake \"Step 1 \u2192 Step 2\" lines between independent states.\n\n**Do not create overlapping annotations.** Anchor each note to the frame it\nexplains with `targetId` + `placement` (top/right/bottom/left). The renderer\nparks notes in a gutter beside the frame and lays them out automatically \u2014 never\nsupply x/y or points for anchored notes; hand-placed coordinates fight the\nauto-layout and cause the overlap you're trying to avoid. Reserve arrows for a\nnote that must point at a specific control inside a frame; a note that simply\nsits beside its frame needs no arrow.\n\n**Patching.** Edit one wireframe, canvas annotation, or block with targeted `contentPatches`\n(for example `update-block`, `replace-blocks`, `update-canvas-annotation`) rather\nthan regenerating the whole plan. `contentPatches` are part of the public MCP\naction schema, so Claude Code, Codex, Cursor, and other hosts can make surgical\nedits. If an agent is working from exported source files, use\n`read-visual-plan-source` / `patch-visual-plan-source`: `plan.mdx` holds\nfrontmatter plus markdown/document blocks, `canvas.mdx` holds\n`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>`, and the\npatch action normalizes the MDX back into the same JSON runtime model. JSON is\nthe canonical runtime shape; MDX is the repo-friendly authoring/export surface.\nIn the browser, humans edit `rich-text` prose inline; agents should still use\n`update-rich-text` content patches or source patches for prose, and use\ncomments/structured patches for canvas, artboard, wireframe, and diagram edits.\n\n**Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an `html` wireframe (or reference a wireframe block via `blockId`) \u2014 a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.\n\n**Fill the frame; keep labels short.** Each artboard is a fixed-size surface \u2014 compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (`flex:1`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column \u2014 shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).\n\n**Good example \u2014 a contacts list, surface `browser`.** A small, real screen\ncomposed from the helper classes and tokens, layout in inline flex, no fonts or\nhex colors:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:12px;padding:16px;height:100%\">\n <div style=\"display:flex;align-items:center;justify-content:space-between\">\n <h1>Contacts</h1>\n <button class=\"primary\">New contact</button>\n </div>\n <div style=\"display:flex;gap:6px\">\n <span class=\"wf-pill accent\">All 128</span>\n <span class=\"wf-pill\">Favorites</span>\n <span class=\"wf-pill\">Archived</span>\n </div>\n <div class=\"wf-card\" style=\"display:flex;flex-direction:column;gap:0;padding:0\">\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>\n <span class=\"wf-pill\">Lead</span>\n </div>\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>\n <span class=\"wf-pill\">Customer</span>\n </div>\n </div>\n</div>\n```\n\n**Mockups belong on the canvas.** When the user asks for a mockup, UI state,\nloading state, prototype, layout, screen, or visual comparison, make the top\ncanvas the primary home for that visual. Document blocks can explain, compare,\nor map implementation, but they should not host the primary mockup just because\n`custom-html`, screenshots, or prose are easier to produce. If the canvas cannot\nrepresent the requested fidelity, still keep a canvas artboard and call out or\nextend the needed canvas renderer capability.\n\n**Legacy kit tree.** Older plans set a `screen` array of `{ el, ...props }` kit\nnodes instead of `html`; the renderer still accepts and displays it, but new\nplans emit `html`. Do not author fresh kit-tree screens \u2014 write the HTML mockup\ninstead. Likewise, old or imported plans may carry coordinate-based regions or\nfree-float x/y on notes or artboards; those are legacy escape hatches the\nrenderer still shows but you must never produce. The `surface` drives the aspect\nand footprint, the canvas auto-places artboards, and the gutter parks notes by\n`targetId` + `placement`; never supply width, height, or coordinates for a new\nplan.\n\n<!-- SHARED-CORE:wireframe-canvas END -->\n\n<!-- SHARED-CORE:document-quality START -->\n\n## Document Quality Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for the document below the\ncanvas. Do not paraphrase it per command.\n\n**The document is a serious technical plan, not marketing.** Write it the way a\nstrong Claude or Codex implementation plan reads: outcome-first, prose-first,\nself-contained, and specific. State the objective and what \"done\" means, the\nscope and non-goals, the proposed approach with the key decisions and their\nrationale, ordered steps that name real files, symbols, actions, and data\nshapes, the risks, and a closing verification step (tests, build, or a checkable\nbehavior). Replace vague prose with specifics; never ship a step like \"make it\nwork.\" No hero art, gradients, logos, nav bars, slogans, value props, giant\nlanding-page headings, or marketing cards unless the user explicitly asks.\n\n**Canvas and document never duplicate each other.** The UI story lives on the\ncanvas with on-canvas annotations; the document carries the technical depth the\ncanvas cannot show \u2014 concrete file/symbol maps, API and data contracts, code\nsnippets, migration or implementation phases, risks, and validation. Repeat a\nwireframe in the document only for a genuinely new detail view or comparison.\nSkip the canvas entirely for non-visual work and write a clean rich document.\n\n**Use the right block, and make it carry substance.** For the authoritative,\nmachine-checked list of block types and their data schemas, call `get-plan-blocks`\n\u2014 it returns the live registry vocabulary (type, MDX tag, placement, key fields)\nso you never emit a block the editor cannot render or round-trip:\n\n- `rich-text` for plan prose with real bold/italic/code/links and nested lists.\n- `implementation-map` / `code-tabs` for the file map: file path, the\n symbols/components to touch, the reason, risk/coordination notes, and a\n concise syntax-highlighted snippet of the code shape \u2014 never the whole file,\n never a prose-only file list.\n- `decision` for two or three option cards with consequences. These are static\n records; do not style them like clickable tabs or chips unless the renderer\n truly supports changing the selection.\n- `diagram` for architecture, sequence, data-flow, dependency, or state\n relationships, only when it clarifies something real. Labels must not overlap\n nodes, connectors, or each other.\n- `tabs` for multiple states, directions, or comparisons. A tab that reveals\n only prose usually means the plan is under-specified \u2014 include a relevant\n visual unless the tab is intentionally document-only.\n- `table`, `checklist`, `callout` for scannable structure.\n\n**Open questions are callouts, not buried prose.** Surface anything unresolved in\na dedicated open-questions / needs-clarification block. Never put a\nquestions/decisions wall inside the plan narrative.\n\n**`custom-html` is a bounded escape hatch only** \u2014 a single complete fragment\ninside a block, never `html`/`head`/`body`/`script` tags, never a generic\nplaceholder, density demo, or proof that custom HTML works. Prefer the native\nblocks for normal plans. It may support supplemental demos or references, but it\nis never the primary home for a requested mockup, UI state, or visual\ncomparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the\nproduct fix is canvas support for that artifact type, not moving the mockup into\nthe document.\n\n**Before handoff, open the plan and check it.** Fix overlap, excessive\nwhitespace, clipped fragments, misleading inactive controls, poor contrast, and\nunreadable diagrams before asking for approval.\n\n<!-- SHARED-CORE:document-quality END -->\n\n<!-- SHARED-CORE:exemplar START -->\n\n## Good vs. Bad Exemplar\n\n**GOOD.** A `/ui-plan` for a todo app: a canvas with a `desktop` artboard whose\n`data.html` is a real flex layout \u2014 a sidebar of links (`Inbox 12`, `Today 4`,\n`Done`), a main column with an `<h1>Today</h1>`, accent `.wf-pill`s for the\nfilters, a muted section label `OVERDUE`, and `.wf-card` task rows carrying real\ntitles, due dates, and a primary `button.primary` \u2014 styled only through bare\nelements, helper classes, and `--wf-*` tokens, so the renderer applies the\ncorrect desktop footprint, theme, and one subtle whole-frame wobble. Plain-text\ndesigner notes sit spaced off the frame, pointing only at the controls that need\nexplanation. Below it, a Claude/Codex-grade document: objective and\ndone-criteria, an `implementation-map` naming the real components and actions\nwith short highlighted snippets, a `decision` card weighing two real approaches,\nand a validation step \u2014 none of it repeating the canvas. This is the bar.\n\n**BAD.** A `data.html` with hard-coded hex colors, a `font-family`, or fixed\npixel width/height; gray placeholder bars \"insinuating\" text on a non-skeleton\nframe; a forced desktop + mobile pair for a popover; floating bordered\nannotation cards hugging the frames; a fresh hand-authored kit-tree `screen`\ninstead of `html`; a mockup escaped into a document `custom-html` block; and a\nmarketing-style document with a hero heading and value props that just restates\nwhat the canvas already shows. Never produce this.\n\n<!-- SHARED-CORE:exemplar END -->\n\n## Tool Guidance\n\n- `create-visual-plan`: start one structured visual plan per agent task/run.\n- `create-ui-plan`: start a UI-first plan when the work is primarily product UI.\n- `create-visual-questions`: use only for the explicit `/visual-questions`\n command, not as `/visual-plan` preflight.\n- `visualize-plan`: build a visual companion from an existing text plan.\n- `update-visual-plan`: revise content, status, or comments; prefer\n `contentPatches` over regenerating the whole plan.\n- `read-visual-plan-source`: read the normalized plan as `plan.mdx`,\n optional `canvas.mdx`, optional `.plan-state.json`, and JSON.\n- `patch-visual-plan-source`: apply granular MDX AST patches by stable block,\n artboard, annotation, component, or wireframe-node id.\n- `import-visual-plan-source`: create or replace a plan from an MDX folder.\n- `get-visual-plan`: read the current structured plan, exported HTML, and\n annotations; it also returns the MDX folder for source workflows.\n- `get-plan-feedback`: read unconsumed human feedback. Use it frequently.\n- `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX\n files for repo check-in.\n\nWhen the user critiques a plan's look or structure, fix the renderer or this\nskill \u2014 never hand-edit one stored plan. Turn feedback into better guidance.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/visual-questions`,\n`/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
8
|
-
export declare const UI_PLAN_SKILL_MD = "---\nname: ui-plan\ndescription: >-\n Use Agent-Native Plans for UI-first planning with an optional top pan/zoom\n wireframe canvas, a refined Notion-like document, rich tabs, diagrams,\n comments, drawing, and agent handoff.\nmetadata:\n visibility: exported\n---\n\n# UI Plan\n\nUse `/ui-plan` when the task is primarily about product UI, user flows,\ninteraction states, component layout, or visual direction. The reviewable UI\ncomes first; implementation detail comes after the user has something concrete to\nreact to.\n\n`/visual-plan` remains the general command for architecture, backend, refactors,\nand mixed work. Use `/visual-questions` only when the user explicitly wants\nvisual intake before planning, and `/visualize-plan` when a text plan already\nexists.\n\n## Plan Discipline\n\n- **Gate hard.** Use a UI plan when the surface is new, ambiguous, spans several\n screens or states, or the direction needs agreement before coding. Skip it for\n cosmetic one-liners \u2014 a color, a label, a spacing tweak \u2014 and just make the\n change. Never ship a single-step or filler plan.\n- **Research before you draft.** Read the real components, routes, and design\n tokens first; ground every mockup and the file map in actual files and symbols.\n Delegate wide exploration to a sub-agent when the surface is large.\n- **Planning is read-only.** Make no source edits while building or reviewing.\n Start editing only after the user approves the UI direction.\n- **Clarify vs. assume.** Do not ask how to build the UI \u2014 present the direction\n and options as mockups and tabs. Ask a clarifying question only when an\n ambiguity would change the design; use the host agent's normal\n ask-user-question flow and batch 2-4 before finalizing. Do not create visual\n questions from `/ui-plan`. Otherwise state the assumption in the plan and\n proceed.\n- **The plan is the approval gate.** Ask the user to review and approve the UI\n direction before you write code, and name the files/areas the work touches.\n\n## UI-First Workflow\n\n1. Follow the host agent's normal planning flow: inspect the codebase, gather\n the UI/component context needed, and ask native clarifying questions as needed\n before generating the plan.\n2. Call `create-ui-plan` with a UI-specific title, brief, source, repo path, and\n structured `content`. The canvas comes first, the document second.\n3. Compose the top canvas from the kit (see the cores below): the key artboards\n with real product content, designer notes, and connectors only for real\n sequences. Skip the canvas when wireframes would not clarify the work.\n4. Continue below as a concise technical document that stays close to the\n Markdown plan the agent would normally output \u2014 not a second copy of the\n canvas \u2014 covering concrete files, contracts, phases, risks, and validation.\n5. Call `get-plan-feedback` before implementation, after review, after a long\n pause, and before the final response. Apply changes with `update-visual-plan`,\n preferring `contentPatches` for one frame, annotation, node, tab, or block. When the user\n wants source-control friendly edits, use `patch-visual-plan-source` against\n the MDX files instead of regenerating the plan.\n\n## Agent Handoff\n\nAfter the canvas and document, add a short handoff that names the chosen UI\ndirection, unresolved visual questions, and feedback that must be read before\ncode changes. Never claim feedback has been applied until `get-plan-feedback` or\nthe user has supplied it.\n\n<!-- SHARED-CORE:wireframe-canvas START -->\n\n## Wireframe & Canvas Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for how wireframes and the\ncanvas work. Do not paraphrase it per command.\n\n**A wireframe is an HTML mockup. The renderer owns the look; you write the\ncontent.** Set `data.html` to a self-contained, semantic HTML fragment of the\nscreen and set `data.surface`. The renderer owns the surface footprint/aspect,\nthe dark/light theme, the hand-drawn font, and the rough.js sketch overlay \u2014 you\nnever write `<html>`/`<body>`/`<script>`/`<style>` tags, font-family, hex colors,\nor any width/height/coordinates. You write real HTML layout and real product\ncontent; the renderer styles and roughens it.\n\n**A wireframe block's data is an HTML screen plus a surface:**\n\n```json\n{\n \"surface\": \"browser\",\n \"html\": \"<div style=\\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\\"><h1>Sign in</h1><p class=\\\"wf-muted\\\">Use your work email to continue.</p><div class=\\\"wf-card\\\" style=\\\"display:flex;flex-direction:column;gap:10px\\\"><label>Email<input value=\\\"jane@acme.co\\\" /></label><label>Password<input value=\\\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\\\" /></label><label style=\\\"display:flex;align-items:center;gap:8px\\\"><input type=\\\"checkbox\\\" checked /> Remember me</label><button class=\\\"primary\\\">Sign in</button></div><a href=\\\"#\\\">Forgot password?</a></div>\"\n}\n```\n\n**Write PLAIN semantic HTML and let the renderer style it.** Bare elements\n(`h1`/`h2`/`h3`, `p`, `button`, `input`, `<input type=\"checkbox\">`, `a`, `hr`)\nare auto-themed \u2014 no classes needed. Helper classes carry the rest:\n\n- `.wf-card` / `.wf-box` \u2014 a bordered, padded container (a panel, a list item).\n- `.wf-pill` / `.wf-chip` \u2014 a rounded tag or filter; add `.accent`\n (`<span class=\"wf-pill accent\">`) for the accent-filled variant.\n- `.wf-muted` \u2014 secondary/muted text (or use `<small>`).\n- `button.primary` or any element with `[data-primary]` \u2014 the accent-filled\n primary button.\n\n**Use the `--wf-*` tokens for any custom color, never hex.** The renderer flips\nthese on light/dark, so reading them is what keeps a mockup correct in both\nthemes. For any inline border, background, or text color, reference a token:\n`style=\"border:1.4px solid var(--wf-line)\"`. The tokens are `--wf-ink` (text),\n`--wf-muted` (secondary text), `--wf-line` (borders/dividers), `--wf-paper`\n(page background), `--wf-card` (raised surface), `--wf-accent` /\n`--wf-accent-fg` / `--wf-accent-soft` (brand action), `--wf-warn`, `--wf-ok`,\nand `--wf-radius`. Never hard-code a hex color and never set `font-family` \u2014 the\nrenderer owns the sketch/clean font.\n\n**Lay out with inline `style` flex/grid.** You write the real layout \u2014\n`display:flex; flex-direction:column; gap:10px; padding:16px` and so on \u2014 and the\nrenderer never repositions anything. Compose the actual product: reproduce the\ncurrent screen, then show the modification. Real labels, real counts, real dates,\nreal button text grounded in the screen you read; not lorem or gray bars.\n\n**Surface presets \u2014 match the real footprint, never default to desktop+mobile.**\nPick the `surface` that matches what the user will actually see:\n\n- `browser`: a web page that needs a browser chrome frame around it.\n- `desktop`: a full desktop app page or app shell.\n- `mobile`: a phone screen, only when the work is genuinely mobile.\n- `popover`: a small floating menu, dropdown, or inline popover.\n- `panel`: a side panel, inspector, or sidebar widget.\n\nThe surface locks the footprint and aspect; never set width/height/coordinates.\nA sidebar popover renders as a small surface, not a desktop page and a phone\nframe. Do not emit `desktop` + `mobile` variants unless responsive behavior\nactually changes the layout. For a component or widget, show one broader\napp-context frame only when placement affects understanding, then the focused\ncomponent states.\n\n**Modify, don't redesign.** When the task changes an existing screen, reproduce\nthe current screen's real layout and footprint FIRST, then change only the delta\nand call it out with a single annotation. Do not restack the page into a new\nlayout. For net-new surfaces, compose from the real app shell.\n\n**Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a\npopover, menu, dialog, toast), show the full screen once, then add a small\nseparate artboard whose `html` contains ONLY that sub-surface \u2014 do not re-draw\nthe whole page around it, and do not scale a duplicate up. Pick the matching\n`surface` (e.g. `popover`) so the footprint is right; never widen a popover to\npage width.\n\n**Loading / skeleton states.** Set `data.skeleton: true` on the wireframe and\nfill the `html` with neutral, textless placeholder geometry \u2014 boxes and bars\nbuilt as `<div>`s with `background:var(--wf-line)` and explicit heights/widths,\nno labels or copy. The renderer drops borders, sketch, and color into the\nskeleton register automatically. Never escape to a `custom-html` document block\nto fake a loader, and never move a mockup out of the canvas \u2014 mockups always\nlive in canvas artboards.\n\n**Editing an existing mockup.** To change one element, text, or color in an\nexisting html mockup, do NOT regenerate the frame \u2014 call `update-visual-plan`\nwith `contentPatches: [{ op: \"patch-wireframe-html\", blockId, edits: [{ find,\nreplace }] }]`. Each `find` is a unique snippet of the current html (read it\nfirst with `get-visual-plan`); set `all: true` on an edit to replace every\noccurrence. The result is re-sanitized.\n\n**Canvas annotations are designer notes on the artboard.** When a top canvas is\npresent, sprinkle Figma-style notes near the frames they explain: a short\nheading, supporting text, and bullets \u2014 plain text layers, never bordered or\nshadowed cards, and never a box around a frame. The renderer spaces notes away\nfrom frames, so place each note by the frame it describes. Use an arrow only to\npoint at one specific control or transition; for a broad frame-level note, write\ntext beside the frame with no connector. Connectors are for real sequences only \u2014\nnever fake \"Step 1 \u2192 Step 2\" lines between independent states.\n\n**Do not create overlapping annotations.** Anchor each note to the frame it\nexplains with `targetId` + `placement` (top/right/bottom/left). The renderer\nparks notes in a gutter beside the frame and lays them out automatically \u2014 never\nsupply x/y or points for anchored notes; hand-placed coordinates fight the\nauto-layout and cause the overlap you're trying to avoid. Reserve arrows for a\nnote that must point at a specific control inside a frame; a note that simply\nsits beside its frame needs no arrow.\n\n**Patching.** Edit one wireframe, canvas annotation, or block with targeted `contentPatches`\n(for example `update-block`, `replace-blocks`, `update-canvas-annotation`) rather\nthan regenerating the whole plan. `contentPatches` are part of the public MCP\naction schema, so Claude Code, Codex, Cursor, and other hosts can make surgical\nedits. If an agent is working from exported source files, use\n`read-visual-plan-source` / `patch-visual-plan-source`: `plan.mdx` holds\nfrontmatter plus markdown/document blocks, `canvas.mdx` holds\n`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>`, and the\npatch action normalizes the MDX back into the same JSON runtime model. JSON is\nthe canonical runtime shape; MDX is the repo-friendly authoring/export surface.\nIn the browser, humans edit `rich-text` prose inline; agents should still use\n`update-rich-text` content patches or source patches for prose, and use\ncomments/structured patches for canvas, artboard, wireframe, and diagram edits.\n\n**Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an `html` wireframe (or reference a wireframe block via `blockId`) \u2014 a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.\n\n**Fill the frame; keep labels short.** Each artboard is a fixed-size surface \u2014 compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (`flex:1`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column \u2014 shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).\n\n**Good example \u2014 a contacts list, surface `browser`.** A small, real screen\ncomposed from the helper classes and tokens, layout in inline flex, no fonts or\nhex colors:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:12px;padding:16px;height:100%\">\n <div style=\"display:flex;align-items:center;justify-content:space-between\">\n <h1>Contacts</h1>\n <button class=\"primary\">New contact</button>\n </div>\n <div style=\"display:flex;gap:6px\">\n <span class=\"wf-pill accent\">All 128</span>\n <span class=\"wf-pill\">Favorites</span>\n <span class=\"wf-pill\">Archived</span>\n </div>\n <div class=\"wf-card\" style=\"display:flex;flex-direction:column;gap:0;padding:0\">\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>\n <span class=\"wf-pill\">Lead</span>\n </div>\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>\n <span class=\"wf-pill\">Customer</span>\n </div>\n </div>\n</div>\n```\n\n**Mockups belong on the canvas.** When the user asks for a mockup, UI state,\nloading state, prototype, layout, screen, or visual comparison, make the top\ncanvas the primary home for that visual. Document blocks can explain, compare,\nor map implementation, but they should not host the primary mockup just because\n`custom-html`, screenshots, or prose are easier to produce. If the canvas cannot\nrepresent the requested fidelity, still keep a canvas artboard and call out or\nextend the needed canvas renderer capability.\n\n**Legacy kit tree.** Older plans set a `screen` array of `{ el, ...props }` kit\nnodes instead of `html`; the renderer still accepts and displays it, but new\nplans emit `html`. Do not author fresh kit-tree screens \u2014 write the HTML mockup\ninstead. Likewise, old or imported plans may carry coordinate-based regions or\nfree-float x/y on notes or artboards; those are legacy escape hatches the\nrenderer still shows but you must never produce. The `surface` drives the aspect\nand footprint, the canvas auto-places artboards, and the gutter parks notes by\n`targetId` + `placement`; never supply width, height, or coordinates for a new\nplan.\n\n<!-- SHARED-CORE:wireframe-canvas END -->\n\n<!-- SHARED-CORE:document-quality START -->\n\n## Document Quality Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for the document below the\ncanvas. Do not paraphrase it per command.\n\n**The document is a serious technical plan, not marketing.** Write it the way a\nstrong Claude or Codex implementation plan reads: outcome-first, prose-first,\nself-contained, and specific. State the objective and what \"done\" means, the\nscope and non-goals, the proposed approach with the key decisions and their\nrationale, ordered steps that name real files, symbols, actions, and data\nshapes, the risks, and a closing verification step (tests, build, or a checkable\nbehavior). Replace vague prose with specifics; never ship a step like \"make it\nwork.\" No hero art, gradients, logos, nav bars, slogans, value props, giant\nlanding-page headings, or marketing cards unless the user explicitly asks.\n\n**Canvas and document never duplicate each other.** The UI story lives on the\ncanvas with on-canvas annotations; the document carries the technical depth the\ncanvas cannot show \u2014 concrete file/symbol maps, API and data contracts, code\nsnippets, migration or implementation phases, risks, and validation. Repeat a\nwireframe in the document only for a genuinely new detail view or comparison.\nSkip the canvas entirely for non-visual work and write a clean rich document.\n\n**Use the right block, and make it carry substance.** For the authoritative,\nmachine-checked list of block types and their data schemas, call `get-plan-blocks`\n\u2014 it returns the live registry vocabulary (type, MDX tag, placement, key fields)\nso you never emit a block the editor cannot render or round-trip:\n\n- `rich-text` for plan prose with real bold/italic/code/links and nested lists.\n- `implementation-map` / `code-tabs` for the file map: file path, the\n symbols/components to touch, the reason, risk/coordination notes, and a\n concise syntax-highlighted snippet of the code shape \u2014 never the whole file,\n never a prose-only file list.\n- `decision` for two or three option cards with consequences. These are static\n records; do not style them like clickable tabs or chips unless the renderer\n truly supports changing the selection.\n- `diagram` for architecture, sequence, data-flow, dependency, or state\n relationships, only when it clarifies something real. Labels must not overlap\n nodes, connectors, or each other.\n- `tabs` for multiple states, directions, or comparisons. A tab that reveals\n only prose usually means the plan is under-specified \u2014 include a relevant\n visual unless the tab is intentionally document-only.\n- `table`, `checklist`, `callout` for scannable structure.\n\n**Open questions are callouts, not buried prose.** Surface anything unresolved in\na dedicated open-questions / needs-clarification block. Never put a\nquestions/decisions wall inside the plan narrative.\n\n**`custom-html` is a bounded escape hatch only** \u2014 a single complete fragment\ninside a block, never `html`/`head`/`body`/`script` tags, never a generic\nplaceholder, density demo, or proof that custom HTML works. Prefer the native\nblocks for normal plans. It may support supplemental demos or references, but it\nis never the primary home for a requested mockup, UI state, or visual\ncomparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the\nproduct fix is canvas support for that artifact type, not moving the mockup into\nthe document.\n\n**Before handoff, open the plan and check it.** Fix overlap, excessive\nwhitespace, clipped fragments, misleading inactive controls, poor contrast, and\nunreadable diagrams before asking for approval.\n\n<!-- SHARED-CORE:document-quality END -->\n\n<!-- SHARED-CORE:exemplar START -->\n\n## Good vs. Bad Exemplar\n\n**GOOD.** A `/ui-plan` for a todo app: a canvas with a `desktop` artboard whose\n`data.html` is a real flex layout \u2014 a sidebar of links (`Inbox 12`, `Today 4`,\n`Done`), a main column with an `<h1>Today</h1>`, accent `.wf-pill`s for the\nfilters, a muted section label `OVERDUE`, and `.wf-card` task rows carrying real\ntitles, due dates, and a primary `button.primary` \u2014 styled only through bare\nelements, helper classes, and `--wf-*` tokens, so the renderer applies the\ncorrect desktop footprint, theme, and one subtle whole-frame wobble. Plain-text\ndesigner notes sit spaced off the frame, pointing only at the controls that need\nexplanation. Below it, a Claude/Codex-grade document: objective and\ndone-criteria, an `implementation-map` naming the real components and actions\nwith short highlighted snippets, a `decision` card weighing two real approaches,\nand a validation step \u2014 none of it repeating the canvas. This is the bar.\n\n**BAD.** A `data.html` with hard-coded hex colors, a `font-family`, or fixed\npixel width/height; gray placeholder bars \"insinuating\" text on a non-skeleton\nframe; a forced desktop + mobile pair for a popover; floating bordered\nannotation cards hugging the frames; a fresh hand-authored kit-tree `screen`\ninstead of `html`; a mockup escaped into a document `custom-html` block; and a\nmarketing-style document with a hero heading and value props that just restates\nwhat the canvas already shows. Never produce this.\n\n<!-- SHARED-CORE:exemplar END -->\n\n## Tool Guidance\n\n- `create-ui-plan`: create the UI-first structured visual plan.\n- `create-visual-questions`: use only for the explicit `/visual-questions`\n command, not as `/ui-plan` preflight.\n- `update-visual-plan`: revise content, mockups, comments, or handoff notes;\n prefer targeted `contentPatches`.\n- `read-visual-plan-source`: read the normalized plan as `plan.mdx`,\n optional `canvas.mdx`, optional `.plan-state.json`, and JSON.\n- `patch-visual-plan-source`: apply granular MDX AST patches by stable block,\n artboard, annotation, component, or wireframe-node id.\n- `import-visual-plan-source`: create or replace a plan from an MDX folder.\n- `get-visual-plan`: inspect the current structured plan, exported HTML, and\n annotations; it also returns the MDX folder for source workflows.\n- `get-plan-feedback`: read unconsumed reviewer comments before coding.\n- `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX\n files for repo check-in.\n\nWhen the user critiques a plan's look or structure, fix the renderer or this\nskill \u2014 never hand-edit one stored plan. Turn feedback into better guidance.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/visual-questions`,\n`/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const VISUALIZE_PLAN_SKILL_MD = "---\nname: visualize-plan\ndescription: >-\n Convert an existing Codex, Claude Code, Markdown, or pasted plan into an\n Agent-Native Plans visual companion with diagrams, wireframes, annotations, and\n feedback.\nmetadata:\n visibility: exported\n---\n\n# Visualize Plan\n\nUse `/visualize-plan` when a plan already exists and the user wants it easier to\nreview. The native Codex or Claude Code plan can stay where it is; Agent-Native\nPlans creates a structured visual companion beside it \u2014 diagrams, wireframes,\nstate sketches, option cards, and comment prompts instead of a wall of text. It\nstill reads like a plan, not a marketing page.\n\n## Plan Discipline\n\n- **Gate hard.** A visual companion is worth it only when the source plan is\n long, risky, or hard to react to as text. If the source plan is for trivial,\n unambiguous work, skip the companion and just implement.\n- **Stay grounded and read-only.** Preserve the source plan's intent, do not\n invent codebase facts, and label anything inferred as inferred. Make no source\n edits while building or reviewing the companion.\n- **The companion is the approval gate.** Ask the user to review and approve the\n direction before you write code, and name which files/areas the work touches.\n Carry unresolved assumptions and open questions into a clear block instead of\n guessing silently.\n\n## Workflow\n\n1. Gather the existing plan text from the user's paste, a referenced file, or\n recent visible agent context. Do not invent the source plan. If no plan text\n exists and the work is UI-heavy, use `/ui-plan` instead.\n2. Call `visualize-plan` with `planText`, `title`, `brief`, `source`, and\n `repoPath` when available.\n3. Surface the returned Plans link or inline MCP App.\n4. Enrich the import with `update-visual-plan` (prefer targeted `contentPatches`):\n add a canvas with wireframes for user-visible UI, diagrams for architecture or\n data flow, option cards for real tradeoffs, and explicit open questions. Apply\n the two cores below \u2014 the companion must meet the same quality bar as a fresh\n plan, not be a thinner ruleset. Label inferred visuals as inferred. When the\n user wants source-control friendly edits, use `patch-visual-plan-source`\n against the MDX files instead of regenerating the plan.\n5. Ask the user to react, then call `get-plan-feedback` before implementing,\n after review, and before the final response.\n6. Treat imported text as source material. The structured visual plan and\n comments are the review surface; HTML is the export receipt. Do not replace a\n native plan unless the user asks.\n\n<!-- SHARED-CORE:wireframe-canvas START -->\n\n## Wireframe & Canvas Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for how wireframes and the\ncanvas work. Do not paraphrase it per command.\n\n**A wireframe is an HTML mockup. The renderer owns the look; you write the\ncontent.** Set `data.html` to a self-contained, semantic HTML fragment of the\nscreen and set `data.surface`. The renderer owns the surface footprint/aspect,\nthe dark/light theme, the hand-drawn font, and the rough.js sketch overlay \u2014 you\nnever write `<html>`/`<body>`/`<script>`/`<style>` tags, font-family, hex colors,\nor any width/height/coordinates. You write real HTML layout and real product\ncontent; the renderer styles and roughens it.\n\n**A wireframe block's data is an HTML screen plus a surface:**\n\n```json\n{\n \"surface\": \"browser\",\n \"html\": \"<div style=\\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\\"><h1>Sign in</h1><p class=\\\"wf-muted\\\">Use your work email to continue.</p><div class=\\\"wf-card\\\" style=\\\"display:flex;flex-direction:column;gap:10px\\\"><label>Email<input value=\\\"jane@acme.co\\\" /></label><label>Password<input value=\\\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\\\" /></label><label style=\\\"display:flex;align-items:center;gap:8px\\\"><input type=\\\"checkbox\\\" checked /> Remember me</label><button class=\\\"primary\\\">Sign in</button></div><a href=\\\"#\\\">Forgot password?</a></div>\"\n}\n```\n\n**Write PLAIN semantic HTML and let the renderer style it.** Bare elements\n(`h1`/`h2`/`h3`, `p`, `button`, `input`, `<input type=\"checkbox\">`, `a`, `hr`)\nare auto-themed \u2014 no classes needed. Helper classes carry the rest:\n\n- `.wf-card` / `.wf-box` \u2014 a bordered, padded container (a panel, a list item).\n- `.wf-pill` / `.wf-chip` \u2014 a rounded tag or filter; add `.accent`\n (`<span class=\"wf-pill accent\">`) for the accent-filled variant.\n- `.wf-muted` \u2014 secondary/muted text (or use `<small>`).\n- `button.primary` or any element with `[data-primary]` \u2014 the accent-filled\n primary button.\n\n**Use the `--wf-*` tokens for any custom color, never hex.** The renderer flips\nthese on light/dark, so reading them is what keeps a mockup correct in both\nthemes. For any inline border, background, or text color, reference a token:\n`style=\"border:1.4px solid var(--wf-line)\"`. The tokens are `--wf-ink` (text),\n`--wf-muted` (secondary text), `--wf-line` (borders/dividers), `--wf-paper`\n(page background), `--wf-card` (raised surface), `--wf-accent` /\n`--wf-accent-fg` / `--wf-accent-soft` (brand action), `--wf-warn`, `--wf-ok`,\nand `--wf-radius`. Never hard-code a hex color and never set `font-family` \u2014 the\nrenderer owns the sketch/clean font.\n\n**Lay out with inline `style` flex/grid.** You write the real layout \u2014\n`display:flex; flex-direction:column; gap:10px; padding:16px` and so on \u2014 and the\nrenderer never repositions anything. Compose the actual product: reproduce the\ncurrent screen, then show the modification. Real labels, real counts, real dates,\nreal button text grounded in the screen you read; not lorem or gray bars.\n\n**Surface presets \u2014 match the real footprint, never default to desktop+mobile.**\nPick the `surface` that matches what the user will actually see:\n\n- `browser`: a web page that needs a browser chrome frame around it.\n- `desktop`: a full desktop app page or app shell.\n- `mobile`: a phone screen, only when the work is genuinely mobile.\n- `popover`: a small floating menu, dropdown, or inline popover.\n- `panel`: a side panel, inspector, or sidebar widget.\n\nThe surface locks the footprint and aspect; never set width/height/coordinates.\nA sidebar popover renders as a small surface, not a desktop page and a phone\nframe. Do not emit `desktop` + `mobile` variants unless responsive behavior\nactually changes the layout. For a component or widget, show one broader\napp-context frame only when placement affects understanding, then the focused\ncomponent states.\n\n**Modify, don't redesign.** When the task changes an existing screen, reproduce\nthe current screen's real layout and footprint FIRST, then change only the delta\nand call it out with a single annotation. Do not restack the page into a new\nlayout. For net-new surfaces, compose from the real app shell.\n\n**Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a\npopover, menu, dialog, toast), show the full screen once, then add a small\nseparate artboard whose `html` contains ONLY that sub-surface \u2014 do not re-draw\nthe whole page around it, and do not scale a duplicate up. Pick the matching\n`surface` (e.g. `popover`) so the footprint is right; never widen a popover to\npage width.\n\n**Loading / skeleton states.** Set `data.skeleton: true` on the wireframe and\nfill the `html` with neutral, textless placeholder geometry \u2014 boxes and bars\nbuilt as `<div>`s with `background:var(--wf-line)` and explicit heights/widths,\nno labels or copy. The renderer drops borders, sketch, and color into the\nskeleton register automatically. Never escape to a `custom-html` document block\nto fake a loader, and never move a mockup out of the canvas \u2014 mockups always\nlive in canvas artboards.\n\n**Editing an existing mockup.** To change one element, text, or color in an\nexisting html mockup, do NOT regenerate the frame \u2014 call `update-visual-plan`\nwith `contentPatches: [{ op: \"patch-wireframe-html\", blockId, edits: [{ find,\nreplace }] }]`. Each `find` is a unique snippet of the current html (read it\nfirst with `get-visual-plan`); set `all: true` on an edit to replace every\noccurrence. The result is re-sanitized.\n\n**Canvas annotations are designer notes on the artboard.** When a top canvas is\npresent, sprinkle Figma-style notes near the frames they explain: a short\nheading, supporting text, and bullets \u2014 plain text layers, never bordered or\nshadowed cards, and never a box around a frame. The renderer spaces notes away\nfrom frames, so place each note by the frame it describes. Use an arrow only to\npoint at one specific control or transition; for a broad frame-level note, write\ntext beside the frame with no connector. Connectors are for real sequences only \u2014\nnever fake \"Step 1 \u2192 Step 2\" lines between independent states.\n\n**Do not create overlapping annotations.** Anchor each note to the frame it\nexplains with `targetId` + `placement` (top/right/bottom/left). The renderer\nparks notes in a gutter beside the frame and lays them out automatically \u2014 never\nsupply x/y or points for anchored notes; hand-placed coordinates fight the\nauto-layout and cause the overlap you're trying to avoid. Reserve arrows for a\nnote that must point at a specific control inside a frame; a note that simply\nsits beside its frame needs no arrow.\n\n**Patching.** Edit one wireframe, canvas annotation, or block with targeted `contentPatches`\n(for example `update-block`, `replace-blocks`, `update-canvas-annotation`) rather\nthan regenerating the whole plan. `contentPatches` are part of the public MCP\naction schema, so Claude Code, Codex, Cursor, and other hosts can make surgical\nedits. If an agent is working from exported source files, use\n`read-visual-plan-source` / `patch-visual-plan-source`: `plan.mdx` holds\nfrontmatter plus markdown/document blocks, `canvas.mdx` holds\n`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>`, and the\npatch action normalizes the MDX back into the same JSON runtime model. JSON is\nthe canonical runtime shape; MDX is the repo-friendly authoring/export surface.\nIn the browser, humans edit `rich-text` prose inline; agents should still use\n`update-rich-text` content patches or source patches for prose, and use\ncomments/structured patches for canvas, artboard, wireframe, and diagram edits.\n\n**Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an `html` wireframe (or reference a wireframe block via `blockId`) \u2014 a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.\n\n**Fill the frame; keep labels short.** Each artboard is a fixed-size surface \u2014 compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (`flex:1`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column \u2014 shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).\n\n**Good example \u2014 a contacts list, surface `browser`.** A small, real screen\ncomposed from the helper classes and tokens, layout in inline flex, no fonts or\nhex colors:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:12px;padding:16px;height:100%\">\n <div style=\"display:flex;align-items:center;justify-content:space-between\">\n <h1>Contacts</h1>\n <button class=\"primary\">New contact</button>\n </div>\n <div style=\"display:flex;gap:6px\">\n <span class=\"wf-pill accent\">All 128</span>\n <span class=\"wf-pill\">Favorites</span>\n <span class=\"wf-pill\">Archived</span>\n </div>\n <div class=\"wf-card\" style=\"display:flex;flex-direction:column;gap:0;padding:0\">\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>\n <span class=\"wf-pill\">Lead</span>\n </div>\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>\n <span class=\"wf-pill\">Customer</span>\n </div>\n </div>\n</div>\n```\n\n**Mockups belong on the canvas.** When the user asks for a mockup, UI state,\nloading state, prototype, layout, screen, or visual comparison, make the top\ncanvas the primary home for that visual. Document blocks can explain, compare,\nor map implementation, but they should not host the primary mockup just because\n`custom-html`, screenshots, or prose are easier to produce. If the canvas cannot\nrepresent the requested fidelity, still keep a canvas artboard and call out or\nextend the needed canvas renderer capability.\n\n**Legacy kit tree.** Older plans set a `screen` array of `{ el, ...props }` kit\nnodes instead of `html`; the renderer still accepts and displays it, but new\nplans emit `html`. Do not author fresh kit-tree screens \u2014 write the HTML mockup\ninstead. Likewise, old or imported plans may carry coordinate-based regions or\nfree-float x/y on notes or artboards; those are legacy escape hatches the\nrenderer still shows but you must never produce. The `surface` drives the aspect\nand footprint, the canvas auto-places artboards, and the gutter parks notes by\n`targetId` + `placement`; never supply width, height, or coordinates for a new\nplan.\n\n<!-- SHARED-CORE:wireframe-canvas END -->\n\n<!-- SHARED-CORE:document-quality START -->\n\n## Document Quality Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for the document below the\ncanvas. Do not paraphrase it per command.\n\n**The document is a serious technical plan, not marketing.** Write it the way a\nstrong Claude or Codex implementation plan reads: outcome-first, prose-first,\nself-contained, and specific. State the objective and what \"done\" means, the\nscope and non-goals, the proposed approach with the key decisions and their\nrationale, ordered steps that name real files, symbols, actions, and data\nshapes, the risks, and a closing verification step (tests, build, or a checkable\nbehavior). Replace vague prose with specifics; never ship a step like \"make it\nwork.\" No hero art, gradients, logos, nav bars, slogans, value props, giant\nlanding-page headings, or marketing cards unless the user explicitly asks.\n\n**Canvas and document never duplicate each other.** The UI story lives on the\ncanvas with on-canvas annotations; the document carries the technical depth the\ncanvas cannot show \u2014 concrete file/symbol maps, API and data contracts, code\nsnippets, migration or implementation phases, risks, and validation. Repeat a\nwireframe in the document only for a genuinely new detail view or comparison.\nSkip the canvas entirely for non-visual work and write a clean rich document.\n\n**Use the right block, and make it carry substance.** For the authoritative,\nmachine-checked list of block types and their data schemas, call `get-plan-blocks`\n\u2014 it returns the live registry vocabulary (type, MDX tag, placement, key fields)\nso you never emit a block the editor cannot render or round-trip:\n\n- `rich-text` for plan prose with real bold/italic/code/links and nested lists.\n- `implementation-map` / `code-tabs` for the file map: file path, the\n symbols/components to touch, the reason, risk/coordination notes, and a\n concise syntax-highlighted snippet of the code shape \u2014 never the whole file,\n never a prose-only file list.\n- `decision` for two or three option cards with consequences. These are static\n records; do not style them like clickable tabs or chips unless the renderer\n truly supports changing the selection.\n- `diagram` for architecture, sequence, data-flow, dependency, or state\n relationships, only when it clarifies something real. Labels must not overlap\n nodes, connectors, or each other.\n- `tabs` for multiple states, directions, or comparisons. A tab that reveals\n only prose usually means the plan is under-specified \u2014 include a relevant\n visual unless the tab is intentionally document-only.\n- `table`, `checklist`, `callout` for scannable structure.\n\n**Open questions are callouts, not buried prose.** Surface anything unresolved in\na dedicated open-questions / needs-clarification block. Never put a\nquestions/decisions wall inside the plan narrative.\n\n**`custom-html` is a bounded escape hatch only** \u2014 a single complete fragment\ninside a block, never `html`/`head`/`body`/`script` tags, never a generic\nplaceholder, density demo, or proof that custom HTML works. Prefer the native\nblocks for normal plans. It may support supplemental demos or references, but it\nis never the primary home for a requested mockup, UI state, or visual\ncomparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the\nproduct fix is canvas support for that artifact type, not moving the mockup into\nthe document.\n\n**Before handoff, open the plan and check it.** Fix overlap, excessive\nwhitespace, clipped fragments, misleading inactive controls, poor contrast, and\nunreadable diagrams before asking for approval.\n\n<!-- SHARED-CORE:document-quality END -->\n\n<!-- SHARED-CORE:exemplar START -->\n\n## Good vs. Bad Exemplar\n\n**GOOD.** A `/ui-plan` for a todo app: a canvas with a `desktop` artboard whose\n`data.html` is a real flex layout \u2014 a sidebar of links (`Inbox 12`, `Today 4`,\n`Done`), a main column with an `<h1>Today</h1>`, accent `.wf-pill`s for the\nfilters, a muted section label `OVERDUE`, and `.wf-card` task rows carrying real\ntitles, due dates, and a primary `button.primary` \u2014 styled only through bare\nelements, helper classes, and `--wf-*` tokens, so the renderer applies the\ncorrect desktop footprint, theme, and one subtle whole-frame wobble. Plain-text\ndesigner notes sit spaced off the frame, pointing only at the controls that need\nexplanation. Below it, a Claude/Codex-grade document: objective and\ndone-criteria, an `implementation-map` naming the real components and actions\nwith short highlighted snippets, a `decision` card weighing two real approaches,\nand a validation step \u2014 none of it repeating the canvas. This is the bar.\n\n**BAD.** A `data.html` with hard-coded hex colors, a `font-family`, or fixed\npixel width/height; gray placeholder bars \"insinuating\" text on a non-skeleton\nframe; a forced desktop + mobile pair for a popover; floating bordered\nannotation cards hugging the frames; a fresh hand-authored kit-tree `screen`\ninstead of `html`; a mockup escaped into a document `custom-html` block; and a\nmarketing-style document with a hero heading and value props that just restates\nwhat the canvas already shows. Never produce this.\n\n<!-- SHARED-CORE:exemplar END -->\n\n## Tool Guidance\n\n- `visualize-plan`: create the visual companion from the existing text plan.\n- `update-visual-plan`: enrich the import; prefer targeted `contentPatches` over\n replacing the whole content.\n- `read-visual-plan-source`: read the normalized plan as `plan.mdx`,\n optional `canvas.mdx`, optional `.plan-state.json`, and JSON.\n- `patch-visual-plan-source`: apply granular MDX AST patches by stable block,\n artboard, annotation, component, or wireframe-node id.\n- `import-visual-plan-source`: create or replace a plan from an MDX folder.\n- `get-visual-plan`: inspect the current structured plan, exported HTML, and\n annotations; it also returns the MDX folder for source workflows.\n- `get-plan-feedback`: read unconsumed reviewer comments before coding.\n- `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX\n files for repo check-in.\n\nWhen the user critiques a plan's look or structure, fix the renderer or this\nskill \u2014 never hand-edit one stored plan. Turn feedback into better guidance.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/visual-questions`,\n`/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
7
|
+
export declare const VISUAL_PLANS_SKILL_MD = "---\nname: visual-plan\ndescription: >-\n Use Agent-Native Plans when coding-agent work needs an interactive structured\n plan document with diagrams, wireframes, mockups, prototypes, annotations,\n and comments.\nmetadata:\n visibility: exported\n---\n\n# Agent-Native Plans\n\nAgent-Native Plans is structured visual planning mode for coding agents. Build\nthe plan you would normally write in Markdown, but as a scannable document with\neditable blocks mixed in: an optional top visual review area (wireframe canvas,\nlive prototype, or both in tabs) and a Notion-like technical document below. The\nuser reacts to visuals first and reads prose only where it helps.\n\n`/visual-plan` is the canonical command and the main entry point. Use `/ui-plan`\nwhen the work is primarily product UI and review should start with the screens.\nUse `/prototype-plan` when review should start with a functional live prototype.\nUse `/visual-questions` only when the user explicitly wants a visual intake form\nbefore planning. Use `/visualize-plan` to turn an existing Codex, Claude Code,\nMarkdown, or pasted plan into a visual companion.\n\n## When To Use\n\nCreate a visual plan when work is multi-file, ambiguous, long-running, risky, or\nUI-heavy, when architecture / data flow / UI direction / options / open\nquestions would be clearer visually, or when the user needs to react to a\ndirection before you implement.\n\n## Plan Discipline\n\n- **Gate hard.** A polished visual plan is the most expensive plan form; only\n invest when a wrong direction is costly. Skip it for trivial, unambiguous work\n \u2014 typos, one-line fixes, a single well-specified function, anything whose diff\n you could describe in one sentence \u2014 and just make the change. Never pad a plan\n with filler and never ship a single-step plan.\n- **Research before you draft.** Read the real files, actions, schema, and\n patterns first; name actual files, symbols, and data shapes instead of\n inventing them. Check existing `actions/` before proposing endpoints and prefer\n named client helpers over raw fetch. Delegate wide exploration to a sub-agent.\n- **Planning is read-only.** Make no source edits while building or reviewing the\n plan. Start editing only after the user approves the direction.\n- **Clarify vs. assume.** Do not ask how to build it \u2014 explore and present the\n approach and options in the plan. Ask a clarifying question only when an\n ambiguity would change the design and you cannot resolve it from the code; use\n the host agent's normal ask-user-question flow and batch 2-4 high-leverage\n questions before finalizing. Do not call `create-visual-questions` from\n `/visual-plan`; keep any answerable follow-up inside the plan itself as a\n bottom `question-form` Open Questions block. Otherwise state the assumption\n explicitly and proceed, and put anything unresolved in an open-questions block.\n- **The plan is the approval gate.** After surfacing it, ask the user to review\n and approve before you write code, and name which files/areas the work touches.\n Presenting the plan and requesting sign-off is the approval step \u2014 do not ask a\n separate \"does this look good?\" question.\n- **The document is the source of truth, not the chat.** When scope shifts,\n update the plan with `update-visual-plan` rather than only changing course in\n chat, and re-read the approved plan before major steps.\n\n## Core Workflow\n\n1. Follow the host agent's normal planning flow: inspect the codebase, delegate\n wide exploration when useful, gather the info needed, and ask native\n clarifying questions as needed before generating the plan.\n2. Decide the top visual surface with the rules below, then call\n `create-visual-plan` with the title, brief, source, repo path, and structured `content` blocks.\n3. Compose any top visual surface from the kit and write the document with\n native blocks (see the cores below). Keep the document close to the Markdown\n plan the agent would normally output; add diagrams, wireframes, prototypes,\n and visual callouts only where they clarify the plan. Skip the top visual\n surface for non-visual work.\n4. Surface the returned Plans link or inline MCP App and ask the user to review.\n Always include the actual URL in chat so the next step is a click in CLI or\n other text-only hosts. When the host exposes an embedded browser/preview panel\n and a tool can open arbitrary URLs there, open the returned plan URL\n automatically for convenient review; do not rely on this as the only handoff.\n5. Call `get-plan-feedback` before editing, after review, after any long pause,\n and before the final response. Treat `anchorDetails`, resolver intent, recent\n review events, and any focused screenshots from browser handoff as the source\n of truth for exactly what changed and exactly what each comment points at.\n6. Apply changes with `update-visual-plan`, preferring targeted `contentPatches`.\n When the user wants source-control friendly edits, use\n `patch-visual-plan-source` against the MDX files instead of regenerating the\n plan.\n7. Export with `export-visual-plan` only when the user wants a shareable receipt\n or repo-check-in artifacts.\n\n## Visual Surface Choice\n\nChoose the surface before creating the plan. Do not add visual chrome by\ndefault:\n\n- **No visual surface** for architecture-only, backend-only, data migration,\n copy-only, or otherwise non-visual plans. Use a strong document with diagrams\n only when relationships need a visual explanation.\n- **Canvas only** for one static screen, a before/after comparison, a component\n state, a small popover, or a visual direction that does not require clicking.\n Put those wireframes in `content.canvas` and omit `content.prototype`.\n- **Canvas + prototype** for multi-step UI flows, onboarding, wizards,\n review/approval flows, navigation changes, or anything where the reviewer\n needs to operate the behavior. Keep the static wireframes in\n `content.canvas`, add the aligned functional prototype in\n `content.prototype`, and rely on the top visual tabs to switch between them.\n- **Prototype-first** when the user explicitly asks for `/prototype-plan`, asks\n to operate the UI, or when interaction is the main question. Use\n `create-prototype-plan`, which still preserves static mocks where useful.\n\nFor mixed canvas + prototype plans, reuse the same real labels, app statuses,\nand screen ids across both surfaces. The canvas is the inspectable static reference;\nthe prototype is the interactive version of that same flow, not a separate\ndesign direction.\n\n<!-- SHARED-CORE:wireframe-canvas START -->\n\n## Wireframe & Canvas Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for how wireframes and the\ncanvas work. Do not paraphrase it per command.\n\n**A wireframe is an HTML mockup. The renderer owns the look; you write the\ncontent.** Set `data.html` to a self-contained, semantic HTML fragment of the\nscreen and set `data.surface`. The renderer owns the surface footprint/aspect,\nthe dark/light theme, the hand-drawn font, and the rough.js sketch overlay \u2014 you\nnever write `<html>`/`<body>`/`<script>`/`<style>` tags, font-family, hex colors,\nor any width/height/coordinates. You write real HTML layout and real product\ncontent; the renderer styles and roughens it.\n\n**A wireframe block's data is an HTML screen plus a surface:**\n\n```json\n{\n \"surface\": \"browser\",\n \"html\": \"<div style=\\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\\"><h1>Sign in</h1><p class=\\\"wf-muted\\\">Use your work email to continue.</p><div class=\\\"wf-card\\\" style=\\\"display:flex;flex-direction:column;gap:10px\\\"><label>Email<input value=\\\"jane@acme.co\\\" /></label><label>Password<input value=\\\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\\\" /></label><label style=\\\"display:flex;align-items:center;gap:8px\\\"><input type=\\\"checkbox\\\" checked /> Remember me</label><button class=\\\"primary\\\">Sign in</button></div><a href=\\\"#\\\">Forgot password?</a></div>\"\n}\n```\n\n**Write PLAIN semantic HTML and let the renderer style it.** Bare elements\n(`h1`/`h2`/`h3`, `p`, `button`, `input`, `<input type=\"checkbox\">`, `a`, `hr`)\nare auto-themed \u2014 no classes needed. Helper classes carry the rest:\n\n- `.wf-card` / `.wf-box` \u2014 a bordered, padded container (a panel, a list item).\n- `.wf-pill` / `.wf-chip` \u2014 a rounded tag or filter; add `.accent`\n (`<span class=\"wf-pill accent\">`) for the accent-filled variant.\n- `.wf-muted` \u2014 secondary/muted text (or use `<small>`).\n- `button.primary` or any element with `[data-primary]` \u2014 the accent-filled\n primary button.\n\n**Use the `--wf-*` tokens for any custom color, never hex.** The renderer flips\nthese on light/dark, so reading them is what keeps a mockup correct in both\nthemes. For any inline border, background, or text color, reference a token:\n`style=\"border:1.4px solid var(--wf-line)\"`. The tokens are `--wf-ink` (text),\n`--wf-muted` (secondary text), `--wf-line` (borders/dividers), `--wf-paper`\n(page background), `--wf-card` (raised surface), `--wf-accent` /\n`--wf-accent-fg` / `--wf-accent-soft` (brand action), `--wf-warn`, `--wf-ok`,\nand `--wf-radius`. Never hard-code a hex color and never set `font-family` \u2014 the\nrenderer owns the sketch/clean font.\n\n**Lay out with inline `style` flex/grid.** You write the real layout \u2014\n`display:flex; flex-direction:column; gap:10px; padding:16px` and so on \u2014 and the\nrenderer never repositions anything. Compose the actual product: reproduce the\ncurrent screen, then show the modification. Real labels, real counts, real dates,\nreal button text grounded in the screen you read; not lorem or gray bars.\n\n**Surface presets \u2014 match the real footprint, never default to desktop+mobile.**\nPick the `surface` that matches what the user will actually see:\n\n- `browser`: a web page that needs a browser chrome frame around it.\n- `desktop`: a full desktop app page or app shell.\n- `mobile`: a phone screen, only when the work is genuinely mobile.\n- `popover`: a small floating menu, dropdown, or inline popover.\n- `panel`: a side panel, inspector, or sidebar widget.\n\nThe surface locks the footprint and aspect; never set width/height/coordinates.\nA sidebar popover renders as a small surface, not a desktop page and a phone\nframe. Do not emit `desktop` + `mobile` variants unless responsive behavior\nactually changes the layout. For a component or widget, show one broader\napp-context frame only when placement affects understanding, then the focused\ncomponent states.\n\n**Modify, don't redesign.** When the task changes an existing screen, reproduce\nthe current screen's real layout and footprint FIRST, then change only the delta\nand call it out with a single annotation. Do not restack the page into a new\nlayout. For net-new surfaces, compose from the real app shell.\n\n**Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a\npopover, menu, dialog, toast), show the full screen once, then add a small\nseparate artboard whose `html` contains ONLY that sub-surface \u2014 do not re-draw\nthe whole page around it, and do not scale a duplicate up. Pick the matching\n`surface` (e.g. `popover`) so the footprint is right; never widen a popover to\npage width.\n\n**Loading / skeleton states.** Set `data.skeleton: true` on the wireframe and\nfill the `html` with neutral, textless placeholder geometry \u2014 boxes and bars\nbuilt as `<div>`s with `background:var(--wf-line)` and explicit heights/widths,\nno labels or copy. The renderer drops borders, sketch, and color into the\nskeleton register automatically. Never escape to a `custom-html` document block\nto fake a loader, and never move a mockup out of the canvas \u2014 mockups always\nlive in canvas artboards.\n\n**Editing an existing mockup.** To change one element, text, or color in an\nexisting html mockup, do NOT regenerate the frame \u2014 call `update-visual-plan`\nwith `contentPatches: [{ op: \"patch-wireframe-html\", blockId, edits: [{ find,\nreplace }] }]`. Each `find` is a unique snippet of the current html (read it\nfirst with `get-visual-plan`); set `all: true` on an edit to replace every\noccurrence. The result is re-sanitized.\n\n**Canvas annotations are designer notes on the artboard.** When a top canvas is\npresent, sprinkle Figma-style notes near the frames they explain: a short\nheading, supporting text, and bullets \u2014 plain text layers, never bordered or\nshadowed cards, and never a box around a frame. The renderer spaces notes away\nfrom frames, so place each note by the frame it describes. Use an arrow only to\npoint at one specific control or transition; for a broad frame-level note, write\ntext beside the frame with no connector. Connectors are for real sequences only \u2014\nnever fake \"Step 1 \u2192 Step 2\" lines between independent states.\n\n**Do not create overlapping annotations.** Anchor each note to the frame it\nexplains with `targetId` + `placement` (top/right/bottom/left). The renderer\nparks notes in a gutter beside the frame and lays them out automatically \u2014 never\nsupply x/y or points for anchored notes; hand-placed coordinates fight the\nauto-layout and cause the overlap you're trying to avoid. Reserve arrows for a\nnote that must point at a specific control inside a frame; a note that simply\nsits beside its frame needs no arrow.\n\n**Patching.** Edit one wireframe, canvas annotation, or block with targeted `contentPatches`\n(for example `update-block`, `replace-blocks`, `update-canvas-annotation`) rather\nthan regenerating the whole plan. `contentPatches` are part of the public MCP\naction schema, so Claude Code, Codex, Cursor, and other hosts can make surgical\nedits. If an agent is working from exported source files, use\n`read-visual-plan-source` / `patch-visual-plan-source`: `plan.mdx` holds\nfrontmatter plus markdown/document blocks, `canvas.mdx` holds\n`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>`, and the\npatch action normalizes the MDX back into the same JSON runtime model. JSON is\nthe canonical runtime shape; MDX is the repo-friendly authoring/export surface.\nIn the browser, humans edit `rich-text` prose inline; agents should still use\n`update-rich-text` content patches or source patches for prose, and use\ncomments/structured patches for canvas, artboard, wireframe, and diagram edits.\n\n**Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an `html` wireframe (or reference a wireframe block via `blockId`) \u2014 a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.\n\n**Fill the frame; keep labels short.** Each artboard is a fixed-size surface \u2014 compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (`flex:1`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column \u2014 shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).\n\n**Good example \u2014 a contacts list, surface `browser`.** A small, real screen\ncomposed from the helper classes and tokens, layout in inline flex, no fonts or\nhex colors:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:12px;padding:16px;height:100%\">\n <div style=\"display:flex;align-items:center;justify-content:space-between\">\n <h1>Contacts</h1>\n <button class=\"primary\">New contact</button>\n </div>\n <div style=\"display:flex;gap:6px\">\n <span class=\"wf-pill accent\">All 128</span>\n <span class=\"wf-pill\">Favorites</span>\n <span class=\"wf-pill\">Archived</span>\n </div>\n <div class=\"wf-card\" style=\"display:flex;flex-direction:column;gap:0;padding:0\">\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>\n <span class=\"wf-pill\">Lead</span>\n </div>\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>\n <span class=\"wf-pill\">Customer</span>\n </div>\n </div>\n</div>\n```\n\n**Mockups belong in the top visual review area.** Static visuals live on the\ncanvas; multi-step flows get both canvas wireframes and a prototype. When the\nuser asks for a mockup, UI state, loading state, layout, screen, or visual\ncomparison, make the canvas the primary home for that static visual. When the\nuser asks for a prototype or the plan contains a sequence the reviewer must\nfeel, keep the canvas artboards and add `content.prototype` so the top surface\nshows Wireframes / Prototype tabs. Document blocks can explain, compare, or map\nimplementation, but they should not host the primary mockup or prototype just\nbecause `custom-html`, screenshots, or prose are easier to produce. If the\ncanvas/prototype surface cannot represent the requested fidelity, still keep the\nclosest top-surface representation and call out or extend the needed renderer\ncapability.\n\n**Legacy kit tree.** Older plans set a `screen` array of `{ el, ...props }` kit\nnodes instead of `html`; the renderer still accepts and displays it, but new\nplans emit `html`. Do not author fresh kit-tree screens \u2014 write the HTML mockup\ninstead. Likewise, old or imported plans may carry coordinate-based regions or\nfree-float x/y on notes or artboards; those are legacy escape hatches the\nrenderer still shows but you must never produce. The `surface` drives the aspect\nand footprint, the canvas auto-places artboards, and the gutter parks notes by\n`targetId` + `placement`; never supply width, height, or coordinates for a new\nplan.\n\n<!-- SHARED-CORE:wireframe-canvas END -->\n\n<!-- SHARED-CORE:document-quality START -->\n\n## Document Quality Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for the document below the\ncanvas. Do not paraphrase it per command.\n\n**The document is a serious technical plan, not marketing.** Write it the way a\nstrong Claude or Codex implementation plan reads: outcome-first, prose-first,\nself-contained, and specific. State the objective and what \"done\" means, the\nscope and non-goals, the proposed approach with the key decisions and their\nrationale, ordered steps that name real files, symbols, actions, and data\nshapes, the risks, and a closing verification step (tests, build, or a checkable\nbehavior). Replace vague prose with specifics; never ship a step like \"make it\nwork.\" No hero art, gradients, logos, nav bars, slogans, value props, giant\nlanding-page headings, or marketing cards unless the user explicitly asks.\n\n**Top visuals and document never duplicate each other.** The UI story lives in\nthe top visual surface: canvas artboards for static inspection, plus prototype\ntabs when the flow should be functional. The document carries the technical depth\nthe visuals cannot show \u2014 concrete file/symbol maps, API and data contracts,\ncode snippets, migration or implementation phases, risks, and validation. Repeat\na wireframe in the document only for a genuinely new detail view or comparison.\nSkip the visual surface entirely for non-visual work and write a clean rich\ndocument.\n\n**Use the right block, and make it carry substance.** For the authoritative,\nmachine-checked list of block types and their data schemas, call `get-plan-blocks`\n\u2014 it returns the live registry vocabulary (type, MDX tag, placement, key fields)\nso you never emit a block the editor cannot render or round-trip:\n\n- `rich-text` for plan prose with real bold/italic/code/links and nested lists.\n- `implementation-map` / `code-tabs` for the file map: file path, the\n symbols/components to touch, the reason, risk/coordination notes, and a\n concise syntax-highlighted snippet of the code shape \u2014 never the whole file,\n never a prose-only file list.\n- `decision` for two or three option cards with consequences. These are static\n records; do not style them like clickable tabs or chips unless the renderer\n truly supports changing the selection.\n- `diagram` for architecture, sequence, data-flow, dependency, or state\n relationships, only when it clarifies something real. Labels must not overlap\n nodes, connectors, or each other.\n- `tabs` for multiple states, directions, or comparisons. A tab that reveals\n only prose usually means the plan is under-specified \u2014 include a relevant\n visual unless the tab is intentionally document-only.\n- `table`, `checklist`, `callout` for scannable structure.\n\n**Open questions live at the bottom as a form when answers would change the\nplan.** Surface answerable unresolved decisions in a final `question-form`\nblock titled \"Open Questions\". Use `single` or `multi` for clear choices,\n`freeform` for constraints, `recommended: true` for the default you would pick,\nand option `wireframe` / `diagram` previews for visual directions when useful.\nKeep non-answerable assumptions or risks as concise `callout` blocks in the\nrelevant section. Never bury a questions/decisions wall inside the plan\nnarrative.\n\n**`custom-html` is a bounded escape hatch only** \u2014 a single complete fragment\ninside a block, never `html`/`head`/`body`/`script` tags, never a generic\nplaceholder, density demo, or proof that custom HTML works. Prefer the native\nblocks for normal plans. It may support supplemental demos or references, but it\nis never the primary home for a requested mockup, UI state, or visual\ncomparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the\nproduct fix is canvas support for that artifact type, not moving the mockup into\nthe document.\n\n**Before handoff, open the plan and check it.** Fix overlap, excessive\nwhitespace, clipped fragments, misleading inactive controls, poor contrast, and\nunreadable diagrams before asking for approval.\n\n<!-- SHARED-CORE:document-quality END -->\n\n<!-- SHARED-CORE:exemplar START -->\n\n## Good vs. Bad Exemplar\n\n**GOOD.** A `/ui-plan` for a todo app: a canvas with a `desktop` artboard whose\n`data.html` is a real flex layout \u2014 a sidebar of links (`Inbox 12`, `Today 4`,\n`Done`), a main column with an `<h1>Today</h1>`, accent `.wf-pill`s for the\nfilters, a muted section label `OVERDUE`, and `.wf-card` task rows carrying real\ntitles, due dates, and a primary `button.primary` \u2014 styled only through bare\nelements, helper classes, and `--wf-*` tokens, so the renderer applies the\ncorrect desktop footprint, theme, and one subtle whole-frame wobble. Plain-text\ndesigner notes sit spaced off the frame, pointing only at the controls that need\nexplanation. Below it, a Claude/Codex-grade document: objective and\ndone-criteria, an `implementation-map` naming the real components and actions\nwith short highlighted snippets, a `decision` card weighing two real approaches,\nand a validation step \u2014 none of it repeating the canvas. If the task also\nchanges a multi-step completion flow, the same top area includes a Prototype tab\nwhose screens use the same labels and states as the canvas artboards, with\n`data-goto` controls for the sequence. This is the bar.\n\n**BAD.** A `data.html` with hard-coded hex colors, a `font-family`, or fixed\npixel width/height; gray placeholder bars \"insinuating\" text on a non-skeleton\nframe; a forced desktop + mobile pair for a popover; floating bordered\nannotation cards hugging the frames; a fresh hand-authored kit-tree `screen`\ninstead of `html`; a multi-step UI flow with only static frames and no prototype\ntab; a mockup escaped into a document `custom-html` block; and a marketing-style\ndocument with a hero heading and value props that just restates what the canvas\nalready shows. Never produce this.\n\n<!-- SHARED-CORE:exemplar END -->\n\n## Tool Guidance\n\n- `create-visual-plan`: start one structured visual plan per agent task/run;\n `content` may include no visual surface, canvas only, or canvas + prototype.\n- `create-ui-plan`: start a UI-first plan when the work is primarily product UI.\n- `create-prototype-plan`: start a prototype-first plan with a functional top\n review surface.\n- `convert-visual-plan-to-prototype`: convert an existing HTML wireframe canvas\n into a prototype plan.\n- `create-visual-questions`: use only for the explicit `/visual-questions`\n command, not as `/visual-plan` preflight.\n- `visualize-plan`: build a visual companion from an existing text plan.\n- `update-visual-plan`: revise content, status, or comments; prefer\n `contentPatches` over regenerating the whole plan.\n- `read-visual-plan-source`: read the normalized plan as `plan.mdx`,\n optional `canvas.mdx`, optional `.plan-state.json`, and JSON.\n- `patch-visual-plan-source`: apply granular MDX AST patches by stable block,\n artboard, annotation, component, or wireframe-node id.\n- `import-visual-plan-source`: create or replace a plan from an MDX folder.\n- `get-visual-plan`: read the current structured plan, exported HTML, and\n annotations; it also returns the MDX folder for source workflows.\n- `get-plan-feedback`: read unconsumed human feedback. Use it frequently; it\n returns grouped threads, exact anchor details, expected resolver, and recent\n review-event payloads so agents can act only on the comments meant for them.\n- `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX\n files for repo check-in.\n\nWhen the user critiques a plan's look or structure, fix the renderer or this\nskill \u2014 never hand-edit one stored plan. Turn feedback into better guidance.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/prototype-plan`,\n`/visual-questions`, `/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
8
|
+
export declare const UI_PLAN_SKILL_MD = "---\nname: ui-plan\ndescription: >-\n Use Agent-Native Plans for UI-first planning with an optional top pan/zoom\n wireframe canvas, a refined Notion-like document, rich tabs, diagrams,\n comments, drawing, and agent handoff.\nmetadata:\n visibility: exported\n---\n\n# UI Plan\n\nUse `/ui-plan` when the task is primarily about product UI, user flows,\ninteraction details, component layout, or visual direction. The reviewable UI\ncomes first; implementation detail comes after the user has something concrete to\nreact to.\n\n`/visual-plan` remains the general command for architecture, backend, refactors,\nand mixed work. Use `/prototype-plan` when the UI review needs a functional live\nprototype instead of static screens. Use `/visual-questions` only when the user\nexplicitly wants visual intake before planning, and `/visualize-plan` when a text\nplan already exists.\n\n## Plan Discipline\n\n- **Gate hard.** Use a UI plan when the surface is new, ambiguous, spans several\n screens or states, or the direction needs agreement before coding. Skip it for\n cosmetic one-liners \u2014 a color, a label, a spacing tweak \u2014 and just make the\n change. Never ship a single-step or filler plan.\n- **Research before you draft.** Read the real components, routes, and design\n tokens first; ground every mockup and the file map in actual files and symbols.\n Delegate wide exploration to a sub-agent when the surface is large.\n- **Planning is read-only.** Make no source edits while building or reviewing.\n Start editing only after the user approves the UI direction.\n- **Clarify vs. assume.** Do not ask how to build the UI \u2014 present the direction\n and options as mockups and tabs. Ask a clarifying question only when an\n ambiguity would change the design; use the host agent's normal\n ask-user-question flow and batch 2-4 before finalizing. Do not call\n `create-visual-questions` from `/ui-plan`; keep answerable follow-up inside\n the same plan as a bottom `question-form` Open Questions block. Otherwise\n state the assumption in the plan and proceed.\n- **The plan is the approval gate.** Ask the user to review and approve the UI\n direction before you write code, and name the files/areas the work touches.\n\n## UI-First Workflow\n\n1. Follow the host agent's normal planning flow: inspect the codebase, gather\n the UI/component context needed, and ask native clarifying questions as needed\n before generating the plan.\n2. Call `create-ui-plan` with a UI-specific title, brief, source, repo path, and\n structured `content`. The canvas comes first, the document second.\n3. Compose the top canvas from the kit (see the cores below): the key artboards\n with real product content, designer notes, and connectors only for real\n sequences. Skip the canvas when wireframes would not clarify the work.\n4. Continue below as a concise technical document that stays close to the\n Markdown plan the agent would normally output \u2014 not a second copy of the\n canvas \u2014 covering concrete files, contracts, phases, risks, and validation.\n5. Call `get-plan-feedback` before implementation, after review, after a long\n pause, and before the final response. Treat `anchorDetails`, resolver intent,\n recent review events, and any focused screenshots from browser handoff as the\n source of truth for exactly what changed and exactly what each UI comment\n points at. Apply changes with `update-visual-plan`, preferring\n `contentPatches` for one frame, annotation, node, tab, or block. When the\n user wants source-control friendly edits, use `patch-visual-plan-source`\n against the MDX files instead of regenerating the plan.\n\n## Agent Handoff\n\nAfter the canvas and document, add a short handoff that names the chosen UI\ndirection, unresolved visual questions, and feedback that must be read before\ncode changes. Never claim feedback has been applied until `get-plan-feedback` or\nthe user has supplied it.\n\n<!-- SHARED-CORE:wireframe-canvas START -->\n\n## Wireframe & Canvas Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for how wireframes and the\ncanvas work. Do not paraphrase it per command.\n\n**A wireframe is an HTML mockup. The renderer owns the look; you write the\ncontent.** Set `data.html` to a self-contained, semantic HTML fragment of the\nscreen and set `data.surface`. The renderer owns the surface footprint/aspect,\nthe dark/light theme, the hand-drawn font, and the rough.js sketch overlay \u2014 you\nnever write `<html>`/`<body>`/`<script>`/`<style>` tags, font-family, hex colors,\nor any width/height/coordinates. You write real HTML layout and real product\ncontent; the renderer styles and roughens it.\n\n**A wireframe block's data is an HTML screen plus a surface:**\n\n```json\n{\n \"surface\": \"browser\",\n \"html\": \"<div style=\\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\\"><h1>Sign in</h1><p class=\\\"wf-muted\\\">Use your work email to continue.</p><div class=\\\"wf-card\\\" style=\\\"display:flex;flex-direction:column;gap:10px\\\"><label>Email<input value=\\\"jane@acme.co\\\" /></label><label>Password<input value=\\\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\\\" /></label><label style=\\\"display:flex;align-items:center;gap:8px\\\"><input type=\\\"checkbox\\\" checked /> Remember me</label><button class=\\\"primary\\\">Sign in</button></div><a href=\\\"#\\\">Forgot password?</a></div>\"\n}\n```\n\n**Write PLAIN semantic HTML and let the renderer style it.** Bare elements\n(`h1`/`h2`/`h3`, `p`, `button`, `input`, `<input type=\"checkbox\">`, `a`, `hr`)\nare auto-themed \u2014 no classes needed. Helper classes carry the rest:\n\n- `.wf-card` / `.wf-box` \u2014 a bordered, padded container (a panel, a list item).\n- `.wf-pill` / `.wf-chip` \u2014 a rounded tag or filter; add `.accent`\n (`<span class=\"wf-pill accent\">`) for the accent-filled variant.\n- `.wf-muted` \u2014 secondary/muted text (or use `<small>`).\n- `button.primary` or any element with `[data-primary]` \u2014 the accent-filled\n primary button.\n\n**Use the `--wf-*` tokens for any custom color, never hex.** The renderer flips\nthese on light/dark, so reading them is what keeps a mockup correct in both\nthemes. For any inline border, background, or text color, reference a token:\n`style=\"border:1.4px solid var(--wf-line)\"`. The tokens are `--wf-ink` (text),\n`--wf-muted` (secondary text), `--wf-line` (borders/dividers), `--wf-paper`\n(page background), `--wf-card` (raised surface), `--wf-accent` /\n`--wf-accent-fg` / `--wf-accent-soft` (brand action), `--wf-warn`, `--wf-ok`,\nand `--wf-radius`. Never hard-code a hex color and never set `font-family` \u2014 the\nrenderer owns the sketch/clean font.\n\n**Lay out with inline `style` flex/grid.** You write the real layout \u2014\n`display:flex; flex-direction:column; gap:10px; padding:16px` and so on \u2014 and the\nrenderer never repositions anything. Compose the actual product: reproduce the\ncurrent screen, then show the modification. Real labels, real counts, real dates,\nreal button text grounded in the screen you read; not lorem or gray bars.\n\n**Surface presets \u2014 match the real footprint, never default to desktop+mobile.**\nPick the `surface` that matches what the user will actually see:\n\n- `browser`: a web page that needs a browser chrome frame around it.\n- `desktop`: a full desktop app page or app shell.\n- `mobile`: a phone screen, only when the work is genuinely mobile.\n- `popover`: a small floating menu, dropdown, or inline popover.\n- `panel`: a side panel, inspector, or sidebar widget.\n\nThe surface locks the footprint and aspect; never set width/height/coordinates.\nA sidebar popover renders as a small surface, not a desktop page and a phone\nframe. Do not emit `desktop` + `mobile` variants unless responsive behavior\nactually changes the layout. For a component or widget, show one broader\napp-context frame only when placement affects understanding, then the focused\ncomponent states.\n\n**Modify, don't redesign.** When the task changes an existing screen, reproduce\nthe current screen's real layout and footprint FIRST, then change only the delta\nand call it out with a single annotation. Do not restack the page into a new\nlayout. For net-new surfaces, compose from the real app shell.\n\n**Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a\npopover, menu, dialog, toast), show the full screen once, then add a small\nseparate artboard whose `html` contains ONLY that sub-surface \u2014 do not re-draw\nthe whole page around it, and do not scale a duplicate up. Pick the matching\n`surface` (e.g. `popover`) so the footprint is right; never widen a popover to\npage width.\n\n**Loading / skeleton states.** Set `data.skeleton: true` on the wireframe and\nfill the `html` with neutral, textless placeholder geometry \u2014 boxes and bars\nbuilt as `<div>`s with `background:var(--wf-line)` and explicit heights/widths,\nno labels or copy. The renderer drops borders, sketch, and color into the\nskeleton register automatically. Never escape to a `custom-html` document block\nto fake a loader, and never move a mockup out of the canvas \u2014 mockups always\nlive in canvas artboards.\n\n**Editing an existing mockup.** To change one element, text, or color in an\nexisting html mockup, do NOT regenerate the frame \u2014 call `update-visual-plan`\nwith `contentPatches: [{ op: \"patch-wireframe-html\", blockId, edits: [{ find,\nreplace }] }]`. Each `find` is a unique snippet of the current html (read it\nfirst with `get-visual-plan`); set `all: true` on an edit to replace every\noccurrence. The result is re-sanitized.\n\n**Canvas annotations are designer notes on the artboard.** When a top canvas is\npresent, sprinkle Figma-style notes near the frames they explain: a short\nheading, supporting text, and bullets \u2014 plain text layers, never bordered or\nshadowed cards, and never a box around a frame. The renderer spaces notes away\nfrom frames, so place each note by the frame it describes. Use an arrow only to\npoint at one specific control or transition; for a broad frame-level note, write\ntext beside the frame with no connector. Connectors are for real sequences only \u2014\nnever fake \"Step 1 \u2192 Step 2\" lines between independent states.\n\n**Do not create overlapping annotations.** Anchor each note to the frame it\nexplains with `targetId` + `placement` (top/right/bottom/left). The renderer\nparks notes in a gutter beside the frame and lays them out automatically \u2014 never\nsupply x/y or points for anchored notes; hand-placed coordinates fight the\nauto-layout and cause the overlap you're trying to avoid. Reserve arrows for a\nnote that must point at a specific control inside a frame; a note that simply\nsits beside its frame needs no arrow.\n\n**Patching.** Edit one wireframe, canvas annotation, or block with targeted `contentPatches`\n(for example `update-block`, `replace-blocks`, `update-canvas-annotation`) rather\nthan regenerating the whole plan. `contentPatches` are part of the public MCP\naction schema, so Claude Code, Codex, Cursor, and other hosts can make surgical\nedits. If an agent is working from exported source files, use\n`read-visual-plan-source` / `patch-visual-plan-source`: `plan.mdx` holds\nfrontmatter plus markdown/document blocks, `canvas.mdx` holds\n`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>`, and the\npatch action normalizes the MDX back into the same JSON runtime model. JSON is\nthe canonical runtime shape; MDX is the repo-friendly authoring/export surface.\nIn the browser, humans edit `rich-text` prose inline; agents should still use\n`update-rich-text` content patches or source patches for prose, and use\ncomments/structured patches for canvas, artboard, wireframe, and diagram edits.\n\n**Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an `html` wireframe (or reference a wireframe block via `blockId`) \u2014 a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.\n\n**Fill the frame; keep labels short.** Each artboard is a fixed-size surface \u2014 compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (`flex:1`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column \u2014 shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).\n\n**Good example \u2014 a contacts list, surface `browser`.** A small, real screen\ncomposed from the helper classes and tokens, layout in inline flex, no fonts or\nhex colors:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:12px;padding:16px;height:100%\">\n <div style=\"display:flex;align-items:center;justify-content:space-between\">\n <h1>Contacts</h1>\n <button class=\"primary\">New contact</button>\n </div>\n <div style=\"display:flex;gap:6px\">\n <span class=\"wf-pill accent\">All 128</span>\n <span class=\"wf-pill\">Favorites</span>\n <span class=\"wf-pill\">Archived</span>\n </div>\n <div class=\"wf-card\" style=\"display:flex;flex-direction:column;gap:0;padding:0\">\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>\n <span class=\"wf-pill\">Lead</span>\n </div>\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>\n <span class=\"wf-pill\">Customer</span>\n </div>\n </div>\n</div>\n```\n\n**Mockups belong in the top visual review area.** Static visuals live on the\ncanvas; multi-step flows get both canvas wireframes and a prototype. When the\nuser asks for a mockup, UI state, loading state, layout, screen, or visual\ncomparison, make the canvas the primary home for that static visual. When the\nuser asks for a prototype or the plan contains a sequence the reviewer must\nfeel, keep the canvas artboards and add `content.prototype` so the top surface\nshows Wireframes / Prototype tabs. Document blocks can explain, compare, or map\nimplementation, but they should not host the primary mockup or prototype just\nbecause `custom-html`, screenshots, or prose are easier to produce. If the\ncanvas/prototype surface cannot represent the requested fidelity, still keep the\nclosest top-surface representation and call out or extend the needed renderer\ncapability.\n\n**Legacy kit tree.** Older plans set a `screen` array of `{ el, ...props }` kit\nnodes instead of `html`; the renderer still accepts and displays it, but new\nplans emit `html`. Do not author fresh kit-tree screens \u2014 write the HTML mockup\ninstead. Likewise, old or imported plans may carry coordinate-based regions or\nfree-float x/y on notes or artboards; those are legacy escape hatches the\nrenderer still shows but you must never produce. The `surface` drives the aspect\nand footprint, the canvas auto-places artboards, and the gutter parks notes by\n`targetId` + `placement`; never supply width, height, or coordinates for a new\nplan.\n\n<!-- SHARED-CORE:wireframe-canvas END -->\n\n<!-- SHARED-CORE:document-quality START -->\n\n## Document Quality Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for the document below the\ncanvas. Do not paraphrase it per command.\n\n**The document is a serious technical plan, not marketing.** Write it the way a\nstrong Claude or Codex implementation plan reads: outcome-first, prose-first,\nself-contained, and specific. State the objective and what \"done\" means, the\nscope and non-goals, the proposed approach with the key decisions and their\nrationale, ordered steps that name real files, symbols, actions, and data\nshapes, the risks, and a closing verification step (tests, build, or a checkable\nbehavior). Replace vague prose with specifics; never ship a step like \"make it\nwork.\" No hero art, gradients, logos, nav bars, slogans, value props, giant\nlanding-page headings, or marketing cards unless the user explicitly asks.\n\n**Top visuals and document never duplicate each other.** The UI story lives in\nthe top visual surface: canvas artboards for static inspection, plus prototype\ntabs when the flow should be functional. The document carries the technical depth\nthe visuals cannot show \u2014 concrete file/symbol maps, API and data contracts,\ncode snippets, migration or implementation phases, risks, and validation. Repeat\na wireframe in the document only for a genuinely new detail view or comparison.\nSkip the visual surface entirely for non-visual work and write a clean rich\ndocument.\n\n**Use the right block, and make it carry substance.** For the authoritative,\nmachine-checked list of block types and their data schemas, call `get-plan-blocks`\n\u2014 it returns the live registry vocabulary (type, MDX tag, placement, key fields)\nso you never emit a block the editor cannot render or round-trip:\n\n- `rich-text` for plan prose with real bold/italic/code/links and nested lists.\n- `implementation-map` / `code-tabs` for the file map: file path, the\n symbols/components to touch, the reason, risk/coordination notes, and a\n concise syntax-highlighted snippet of the code shape \u2014 never the whole file,\n never a prose-only file list.\n- `decision` for two or three option cards with consequences. These are static\n records; do not style them like clickable tabs or chips unless the renderer\n truly supports changing the selection.\n- `diagram` for architecture, sequence, data-flow, dependency, or state\n relationships, only when it clarifies something real. Labels must not overlap\n nodes, connectors, or each other.\n- `tabs` for multiple states, directions, or comparisons. A tab that reveals\n only prose usually means the plan is under-specified \u2014 include a relevant\n visual unless the tab is intentionally document-only.\n- `table`, `checklist`, `callout` for scannable structure.\n\n**Open questions live at the bottom as a form when answers would change the\nplan.** Surface answerable unresolved decisions in a final `question-form`\nblock titled \"Open Questions\". Use `single` or `multi` for clear choices,\n`freeform` for constraints, `recommended: true` for the default you would pick,\nand option `wireframe` / `diagram` previews for visual directions when useful.\nKeep non-answerable assumptions or risks as concise `callout` blocks in the\nrelevant section. Never bury a questions/decisions wall inside the plan\nnarrative.\n\n**`custom-html` is a bounded escape hatch only** \u2014 a single complete fragment\ninside a block, never `html`/`head`/`body`/`script` tags, never a generic\nplaceholder, density demo, or proof that custom HTML works. Prefer the native\nblocks for normal plans. It may support supplemental demos or references, but it\nis never the primary home for a requested mockup, UI state, or visual\ncomparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the\nproduct fix is canvas support for that artifact type, not moving the mockup into\nthe document.\n\n**Before handoff, open the plan and check it.** Fix overlap, excessive\nwhitespace, clipped fragments, misleading inactive controls, poor contrast, and\nunreadable diagrams before asking for approval.\n\n<!-- SHARED-CORE:document-quality END -->\n\n<!-- SHARED-CORE:exemplar START -->\n\n## Good vs. Bad Exemplar\n\n**GOOD.** A `/ui-plan` for a todo app: a canvas with a `desktop` artboard whose\n`data.html` is a real flex layout \u2014 a sidebar of links (`Inbox 12`, `Today 4`,\n`Done`), a main column with an `<h1>Today</h1>`, accent `.wf-pill`s for the\nfilters, a muted section label `OVERDUE`, and `.wf-card` task rows carrying real\ntitles, due dates, and a primary `button.primary` \u2014 styled only through bare\nelements, helper classes, and `--wf-*` tokens, so the renderer applies the\ncorrect desktop footprint, theme, and one subtle whole-frame wobble. Plain-text\ndesigner notes sit spaced off the frame, pointing only at the controls that need\nexplanation. Below it, a Claude/Codex-grade document: objective and\ndone-criteria, an `implementation-map` naming the real components and actions\nwith short highlighted snippets, a `decision` card weighing two real approaches,\nand a validation step \u2014 none of it repeating the canvas. If the task also\nchanges a multi-step completion flow, the same top area includes a Prototype tab\nwhose screens use the same labels and states as the canvas artboards, with\n`data-goto` controls for the sequence. This is the bar.\n\n**BAD.** A `data.html` with hard-coded hex colors, a `font-family`, or fixed\npixel width/height; gray placeholder bars \"insinuating\" text on a non-skeleton\nframe; a forced desktop + mobile pair for a popover; floating bordered\nannotation cards hugging the frames; a fresh hand-authored kit-tree `screen`\ninstead of `html`; a multi-step UI flow with only static frames and no prototype\ntab; a mockup escaped into a document `custom-html` block; and a marketing-style\ndocument with a hero heading and value props that just restates what the canvas\nalready shows. Never produce this.\n\n<!-- SHARED-CORE:exemplar END -->\n\n## Tool Guidance\n\n- `create-ui-plan`: create the UI-first structured visual plan.\n- `create-prototype-plan`: create a prototype-first plan when UI review needs a\n functional live prototype.\n- `convert-visual-plan-to-prototype`: convert an existing HTML wireframe canvas\n into a prototype plan.\n- `create-visual-questions`: use only for the explicit `/visual-questions`\n command, not as `/ui-plan` preflight.\n- `update-visual-plan`: revise content, mockups, comments, or handoff notes;\n prefer targeted `contentPatches`.\n- `read-visual-plan-source`: read the normalized plan as `plan.mdx`,\n optional `canvas.mdx`, optional `.plan-state.json`, and JSON.\n- `patch-visual-plan-source`: apply granular MDX AST patches by stable block,\n artboard, annotation, component, or wireframe-node id.\n- `import-visual-plan-source`: create or replace a plan from an MDX folder.\n- `get-visual-plan`: inspect the current structured plan, exported HTML, and\n annotations; it also returns the MDX folder for source workflows.\n- `get-plan-feedback`: read unconsumed reviewer comments before coding; it\n returns grouped threads, exact anchor details, expected resolver, and recent\n review-event payloads so agents can act only on the comments meant for them.\n- `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX\n files for repo check-in.\n\nWhen the user critiques a plan's look or structure, fix the renderer or this\nskill \u2014 never hand-edit one stored plan. Turn feedback into better guidance.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/prototype-plan`,\n`/visual-questions`, `/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
9
|
+
export declare const PROTOTYPE_PLAN_SKILL_MD = "---\nname: prototype-plan\ndescription: >-\n Use Agent-Native Plans for /prototype-plan when work needs a functional\n prototype-first plan, static mocks, comments, review toggles, or conversion\n from a visual plan.\nmetadata:\n visibility: exported\n---\n\n# Prototype Plan\n\n`/prototype-plan` creates a plan whose primary review surface is a live,\nfunctional prototype above the document. Use it when the user needs to feel a\nflow, operate basic UI state, or comment on interaction before implementation\nhardens the decision.\n\n## Rule\n\nMake the prototype answer a concrete question. The plan should say what is being\ntested, show the functional prototype first, then keep static mocks and implementation\nnotes in the document below.\n\n## When To Use\n\nUse `/prototype-plan` when the user asks for a prototype, wants to click through\nand operate UI states, needs design review before code, wants comments pinned to\nlive screens, or asks to move a visual plan into a prototype.\n\nPrefer `/visual-plan` for architecture, data flow, or non-interactive planning.\nPrefer `/ui-plan` when static screen review is enough. Use `/visualize-plan`\nfirst only when the user hands you an existing Markdown/Codex/Claude plan that\nneeds a visual companion before becoming interactive.\n\n## Core Workflow\n\n1. Inspect the real codebase and decide the question the prototype should\n answer. Good examples: \"Does this onboarding flow feel short enough?\" or\n \"Which dashboard density should we implement?\"\n2. Call `create-prototype-plan` with a title, brief, and screen HTML. Default to\n one functional prototype screen when local UI behavior is enough; use 2-4\n screens only for true routes, steps, or materially different contexts. The\n returned plan opens with the prototype viewer on top and static mocks, flow\n diagram, implementation map, and verification below.\n3. Make controls actually work. Use the renderer's safe Alpine-like directives:\n `x-data`, `x-model`, `x-for`, `x-text`, `x-show`, `:class`, `@click`, and\n `@keydown.enter`. Use safe helper verbs such as `remove(list, item)`,\n `setAll(list, 'done', true)`, `removeWhere(list, 'done', true)`, and counters\n such as `count(list)`, `countWhere(list, 'done', true)`, and\n `remaining(list, 'done')` when they help. Use `data-goto=\"screen-id\"` only\n for true screen/route changes, not for every button press.\n4. Show important app feedback inside the prototype itself: selected filters,\n checked rows, typed drafts, validation messages, permissions, progress, or\n empty states.\n5. Surface the returned Plans link and ask the user to click through, comment on\n the prototype or static mocks, and approve the direction before code changes.\n6. Before implementing or revising, call `get-plan-feedback`. Treat prototype\n anchors, screenshots, and resolver intent as the source of truth.\n7. Update with `update-visual-plan` content patches. Use\n `patch-prototype-html`, `update-prototype-screen`, or `set-prototype` for\n targeted prototype edits instead of regenerating the whole plan.\n\n## Converting A Visual Plan\n\nWhen a visual plan already has HTML canvas wireframes, call\n`convert-visual-plan-to-prototype` with the plan id. This derives prototype\nscreens from the canvas frames, preserves the canvas/static mocks by default,\nand changes the top review surface to the prototype viewer.\n\nUse `removeCanvas: true` only when the user explicitly wants the old canvas\ngone. Otherwise keep static mocks available for source export and detailed\nreview.\n\n## Prototype Screen HTML\n\nWrite bounded semantic HTML fragments only:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:14px;padding:18px;height:100%\">\n <header style=\"display:flex;justify-content:space-between;gap:12px\">\n <div>\n <h1>Launch checklist</h1>\n <p class=\"wf-muted\">Reviewer can add, complete, filter, and remove tasks.</p>\n </div>\n <span class=\"wf-pill accent\">Live prototype</span>\n </header>\n <section\n class=\"wf-card\"\n x-data=\"{ draft: '', filter: 'all', todos: [{ text: 'Check copy', done: false }, { text: 'Confirm owner', done: true }] }\"\n style=\"display:flex;flex-direction:column;gap:10px\"\n >\n <div style=\"display:flex;gap:8px\">\n <input x-model=\"draft\" @keydown.enter=\"draft && todos.push({ text: draft, done: false }); draft = ''\" placeholder=\"Add task\" />\n <button class=\"primary\" @click=\"draft && todos.push({ text: draft, done: false }); draft = ''\">Add</button>\n </div>\n <div style=\"display:flex;gap:8px\">\n <button @click=\"filter = 'all'\" :class=\"{ primary: filter === 'all' }\">All</button>\n <button @click=\"filter = 'done'\" :class=\"{ primary: filter === 'done' }\">Done</button>\n <button @click=\"setAll(todos, 'done', true)\">Mark all done</button>\n </div>\n <p class=\"wf-muted\"><span x-text=\"remaining(todos, 'done')\"></span> open / <span x-text=\"count(todos)\"></span> total</p>\n <div\n class=\"wf-box\"\n x-for=\"todo in todos\"\n x-show=\"filter === 'all' || (filter === 'done' && todo.done)\"\n :class=\"{ 'is-done': todo.done }\"\n style=\"display:flex;justify-content:space-between;gap:10px\"\n >\n <label style=\"display:flex;gap:8px\"><input type=\"checkbox\" x-model=\"todo.done\" /><span x-text=\"todo.text\"></span></label>\n <button @click=\"remove(todos, todo)\">Remove</button>\n </div>\n <button @click=\"removeWhere(todos, 'done', true)\">Clear completed</button>\n </section>\n</div>\n```\n\nUse real labels, counts, dates, and controls grounded in the target app. Keep\nsurfaces honest: `browser` for web pages, `desktop` for app shells, `mobile`\nonly for real mobile work, `panel` for side panels, and `popover` for menus.\n\nDo not include `<html>`, `<body>`, `<script>`, `<style>`, browser `on*`\nhandler attributes such as `onclick`, fake APIs, raw secrets, or customer data.\nThe renderer owns sketchy/clean mode, theme, surface sizing, rough outlines, and\ncomment overlays.\n\n## Review Surface\n\nPrototype plans support:\n\n- real local controls through safe prototype directives\n- optional screen/route transitions from `data-goto`\n- rough vs clean mode through the shared wireframe toggle\n- dark vs light mode through the shared theme toggle\n- comment visibility from the prototype toolbar\n- Figma-style comments pinned directly on live prototype screens\n- a popout URL with `?prototype=1` for focused browser review\n- static wireframe mocks in the document body where they help implementation\n\n## Source Files\n\nRuntime JSON is canonical. Source export uses:\n\n- `plan.mdx` for document blocks\n- `prototype.mdx` for `<Prototype>`, `<PrototypeScreen>`, and\n `<PrototypeTransition>`\n- `canvas.mdx` for static mocks when a canvas is present\n- `.plan-state.json` for persisted viewport state\n\nPatch source with `patch-visual-plan-source` only when the user wants\nsource-control friendly edits. Patch runtime content when the user is simply\nreviewing and iterating.\n\n## Related Skills\n\n- `visual-plan`\n- `ui-plan`\n- `visualize-plan`\n- `visual-questions`\n";
|
|
10
|
+
export declare const VISUAL_QUESTIONS_SKILL_MD = "---\nname: visual-questions\ndescription: >-\n Use Agent-Native Plans to ask rich visual intake questions when\n /visual-questions is explicitly requested before creating a UI plan or visual\n plan.\nmetadata:\n visibility: both\n---\n\n# Visual Questions\n\nUse `/visual-questions` when the next best step is not a plan yet, but a\nreviewable visual intake: single-choice chips, multi-select chips, freeform\nnotes, mockup choices, sketch diagrams, and a generated answer summary that feeds\nthe next planning prompt. It composes with `/visual-plan`, `/ui-plan`,\n`/prototype-plan`, and `/visualize-plan`.\n\n## When To Use\n\n- The user asks to be shown options before the agent writes a plan.\n- UI direction, form factor, layout model, feature set, or visual style is fuzzy\n enough that 2-6 answers would materially change the plan.\n- The user would benefit from choosing between visual mockups or diagrams rather\n than answering text-only prompts.\n\nGate hard: skip this for tiny, unambiguous changes. If the agent can reasonably\ninfer the answer, prefer `/ui-plan`, `/prototype-plan`, or `/visual-plan` directly and put\nassumptions in the plan.\n\nVisual questions are an explicit intake command, not an automatic preflight for\n`/visual-plan`, `/ui-plan`, or `/prototype-plan`.\n\n## Workflow\n\n1. Call `create-visual-questions` with a clear title, brief, source, and repo\n path when known.\n2. Omit `questions` for the default UI intake. Provide a custom `questions` array\n only when the task has domain-specific choices.\n3. Surface the returned Plans link and ask the user to answer visually.\n4. The generated summary drives the next step: `create-ui-plan` for static UI\n review, `create-prototype-plan` for click-through UI flows,\n `create-visual-plan` for general plans, `visualize-plan` when a text plan\n already exists, or `update-visual-plan` with targeted `contentPatches` to\n fold answers into an active plan.\n5. If the user leaves comments, call `get-plan-feedback` before using the answers.\n\n## Question Types\n\nSupported `questions` entries:\n\n- `single`: chip group where one option wins.\n- `multi`: chip group where multiple options can be selected.\n- `freeform`: textarea for constraints, inspirations, or things to avoid.\n- `visual`: visual options with sketch previews \u2014 use for layout direction, flow\n depth, surface choice, or diagram choices.\n\nEach option can include `label`, `value`, `description`, `recommended`,\n`preview`, and `bullets`. Valid `preview` values match the wireframe surfaces:\n`desktop`, `mobile`, `popover`, `panel`, `component`, `split`, `flow`, and\n`diagram`. Pick the preview that matches the real footprint \u2014 do not offer a\ndesktop/mobile pair for a popover, panel, or component.\n\n## Quality Bar\n\n- Ask only decision-changing questions. A beautiful form with low-value questions\n is still friction.\n- Prefer visible, answerable options over abstract prose.\n- Use visual tabs when users need to compare layout or flow shapes.\n- Keep the output calm and document-like, not a landing page.\n- The generated answer summary is not the final plan; it is the intake prompt for\n the next agent step.\n\n## Tool Guidance\n\n- `create-visual-questions`: create the interactive intake plan.\n- `get-visual-plan`: inspect the current visual question plan.\n- `get-plan-feedback`: read comments before creating or updating the next plan.\n- `create-ui-plan`: create a UI-first plan from the answers.\n- `create-prototype-plan`: create a prototype-first plan from the answers when\n interaction feel matters.\n- `create-visual-plan`: create a general visual plan from the answers.\n- `visualize-plan`: enrich an existing text plan after answers are gathered.\n- `export-visual-plan`: export answer plans as HTML, Markdown fallback,\n structured JSON, and MDX files when the intake needs to be checked into a repo.\n- `read-visual-plan-source` / `patch-visual-plan-source`: inspect or patch the\n MDX source if another agent is operating from checked-in plan files.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/prototype-plan`,\n`/visual-questions`, `/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
11
|
+
export declare const VISUALIZE_PLAN_SKILL_MD = "---\nname: visualize-plan\ndescription: >-\n Convert an existing Codex, Claude Code, Markdown, or pasted plan into an\n Agent-Native Plans visual companion with diagrams, wireframes, prototypes,\n annotations, and feedback.\nmetadata:\n visibility: exported\n---\n\n# Visualize Plan\n\nUse `/visualize-plan` when a plan already exists and the user wants it easier to\nreview. The native Codex or Claude Code plan can stay where it is; Agent-Native\nPlans creates a structured visual companion beside it \u2014 diagrams, wireframes,\nstate sketches, functional prototypes, option cards, and comment prompts instead\nof a wall of text. It still reads like a plan, not a marketing page.\n\nUse `/prototype-plan` instead when the user wants a functional prototype as the first\nartifact and there is no text plan to preserve. When a text plan already exists,\n`/visualize-plan` should decide whether it needs no visual surface, canvas only,\nor canvas + prototype; call `convert-visual-plan-to-prototype` after\nvisualization when its HTML wireframes should drive a prototype review.\n\n## Plan Discipline\n\n- **Gate hard.** A visual companion is worth it only when the source plan is\n long, risky, or hard to react to as text. If the source plan is for trivial,\n unambiguous work, skip the companion and just implement.\n- **Stay grounded and read-only.** Preserve the source plan's intent, do not\n invent codebase facts, and label anything inferred as inferred. Make no source\n edits while building or reviewing the companion.\n- **The companion is the approval gate.** Ask the user to review and approve the\n direction before you write code, and name which files/areas the work touches.\n Carry answerable unresolved assumptions and open questions into a bottom\n `question-form` block instead of guessing silently.\n\n## Workflow\n\n1. Gather the existing plan text from the user's paste, a referenced file, or\n recent visible agent context. Do not invent the source plan. If no plan text\n exists and the work is UI-heavy, use `/ui-plan` or `/prototype-plan` instead.\n2. Call `visualize-plan` with `planText`, `title`, `brief`, `source`, and\n `repoPath` when available.\n3. Surface the returned Plans link or inline MCP App.\n4. Decide the top visual surface with the rules below, then enrich the import\n with `update-visual-plan` (prefer targeted `contentPatches`): add canvas\n wireframes for user-visible UI, add `content.prototype` for multi-step flows,\n add diagrams for architecture or data flow, add option cards for real\n tradeoffs, and add explicit open questions. Apply the two cores below \u2014 the\n companion must meet the same quality bar as a fresh plan, not be a thinner\n ruleset. Label inferred visuals as inferred. When the user wants\n source-control friendly edits, use `patch-visual-plan-source` against the MDX\n files instead of regenerating the plan. If the user asks to make the visual\n companion functional and the canvas contains HTML wireframes, call\n `convert-visual-plan-to-prototype`.\n5. Ask the user to react, then call `get-plan-feedback` before implementing,\n after review, and before the final response.\n6. Treat imported text as source material. The structured visual plan and\n comments are the review surface; HTML is the export receipt. Do not replace a\n native plan unless the user asks.\n\n## Visual Surface Choice\n\nChoose the surface after reading the source plan and before enriching it. Do not\nadd visual chrome by default:\n\n- **No visual surface** when the imported plan is architecture-only,\n backend-only, data migration, copy-only, or otherwise non-visual. Keep the\n companion as a strong document and add diagrams only when relationships need a\n visual explanation.\n- **Canvas only** when the source plan includes one static screen, a before/after\n comparison, a component state, a small popover, or a visual direction that does\n not require clicking. Put those wireframes in `content.canvas` and omit\n `content.prototype`.\n- **Canvas + prototype** when the source plan describes a multi-step UI flow,\n meaningful interactive app behavior, onboarding, wizard, review/approval flow,\n navigation change, or any sequence the reviewer needs to operate. Keep the\n static wireframes in\n `content.canvas`, add the aligned functional prototype in\n `content.prototype`, and rely on the top visual tabs to switch between them.\n- **Prototype-first conversion** when an already-visualized plan's HTML\n wireframes should become functional. Use `convert-visual-plan-to-prototype` for\n an existing canvas, or `update-visual-plan` with `set-prototype` when the\n imported plan needs a hand-authored prototype that does not map cleanly from\n the canvas. Keep static mocks unless the user explicitly asks to remove them.\n\nFor mixed canvas + prototype companions, reuse the same real labels, states, and\nscreen ids across both surfaces. The canvas is the inspectable static reference;\nthe prototype is the interactive version of that same flow, not a separate\ndesign direction. If the imported plan only has text, add HTML wireframes before\ncalling `convert-visual-plan-to-prototype`; never convert a diagram-only or\nempty canvas into a fake prototype.\n\n<!-- SHARED-CORE:wireframe-canvas START -->\n\n## Wireframe & Canvas Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for how wireframes and the\ncanvas work. Do not paraphrase it per command.\n\n**A wireframe is an HTML mockup. The renderer owns the look; you write the\ncontent.** Set `data.html` to a self-contained, semantic HTML fragment of the\nscreen and set `data.surface`. The renderer owns the surface footprint/aspect,\nthe dark/light theme, the hand-drawn font, and the rough.js sketch overlay \u2014 you\nnever write `<html>`/`<body>`/`<script>`/`<style>` tags, font-family, hex colors,\nor any width/height/coordinates. You write real HTML layout and real product\ncontent; the renderer styles and roughens it.\n\n**A wireframe block's data is an HTML screen plus a surface:**\n\n```json\n{\n \"surface\": \"browser\",\n \"html\": \"<div style=\\\"display:flex;flex-direction:column;gap:10px;padding:16px;height:100%\\\"><h1>Sign in</h1><p class=\\\"wf-muted\\\">Use your work email to continue.</p><div class=\\\"wf-card\\\" style=\\\"display:flex;flex-direction:column;gap:10px\\\"><label>Email<input value=\\\"jane@acme.co\\\" /></label><label>Password<input value=\\\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\\\" /></label><label style=\\\"display:flex;align-items:center;gap:8px\\\"><input type=\\\"checkbox\\\" checked /> Remember me</label><button class=\\\"primary\\\">Sign in</button></div><a href=\\\"#\\\">Forgot password?</a></div>\"\n}\n```\n\n**Write PLAIN semantic HTML and let the renderer style it.** Bare elements\n(`h1`/`h2`/`h3`, `p`, `button`, `input`, `<input type=\"checkbox\">`, `a`, `hr`)\nare auto-themed \u2014 no classes needed. Helper classes carry the rest:\n\n- `.wf-card` / `.wf-box` \u2014 a bordered, padded container (a panel, a list item).\n- `.wf-pill` / `.wf-chip` \u2014 a rounded tag or filter; add `.accent`\n (`<span class=\"wf-pill accent\">`) for the accent-filled variant.\n- `.wf-muted` \u2014 secondary/muted text (or use `<small>`).\n- `button.primary` or any element with `[data-primary]` \u2014 the accent-filled\n primary button.\n\n**Use the `--wf-*` tokens for any custom color, never hex.** The renderer flips\nthese on light/dark, so reading them is what keeps a mockup correct in both\nthemes. For any inline border, background, or text color, reference a token:\n`style=\"border:1.4px solid var(--wf-line)\"`. The tokens are `--wf-ink` (text),\n`--wf-muted` (secondary text), `--wf-line` (borders/dividers), `--wf-paper`\n(page background), `--wf-card` (raised surface), `--wf-accent` /\n`--wf-accent-fg` / `--wf-accent-soft` (brand action), `--wf-warn`, `--wf-ok`,\nand `--wf-radius`. Never hard-code a hex color and never set `font-family` \u2014 the\nrenderer owns the sketch/clean font.\n\n**Lay out with inline `style` flex/grid.** You write the real layout \u2014\n`display:flex; flex-direction:column; gap:10px; padding:16px` and so on \u2014 and the\nrenderer never repositions anything. Compose the actual product: reproduce the\ncurrent screen, then show the modification. Real labels, real counts, real dates,\nreal button text grounded in the screen you read; not lorem or gray bars.\n\n**Surface presets \u2014 match the real footprint, never default to desktop+mobile.**\nPick the `surface` that matches what the user will actually see:\n\n- `browser`: a web page that needs a browser chrome frame around it.\n- `desktop`: a full desktop app page or app shell.\n- `mobile`: a phone screen, only when the work is genuinely mobile.\n- `popover`: a small floating menu, dropdown, or inline popover.\n- `panel`: a side panel, inspector, or sidebar widget.\n\nThe surface locks the footprint and aspect; never set width/height/coordinates.\nA sidebar popover renders as a small surface, not a desktop page and a phone\nframe. Do not emit `desktop` + `mobile` variants unless responsive behavior\nactually changes the layout. For a component or widget, show one broader\napp-context frame only when placement affects understanding, then the focused\ncomponent states.\n\n**Modify, don't redesign.** When the task changes an existing screen, reproduce\nthe current screen's real layout and footprint FIRST, then change only the delta\nand call it out with a single annotation. Do not restack the page into a new\nlayout. For net-new surfaces, compose from the real app shell.\n\n**Zoom in on sub-surfaces, don't redraw the page.** For a small sub-surface (a\npopover, menu, dialog, toast), show the full screen once, then add a small\nseparate artboard whose `html` contains ONLY that sub-surface \u2014 do not re-draw\nthe whole page around it, and do not scale a duplicate up. Pick the matching\n`surface` (e.g. `popover`) so the footprint is right; never widen a popover to\npage width.\n\n**Loading / skeleton states.** Set `data.skeleton: true` on the wireframe and\nfill the `html` with neutral, textless placeholder geometry \u2014 boxes and bars\nbuilt as `<div>`s with `background:var(--wf-line)` and explicit heights/widths,\nno labels or copy. The renderer drops borders, sketch, and color into the\nskeleton register automatically. Never escape to a `custom-html` document block\nto fake a loader, and never move a mockup out of the canvas \u2014 mockups always\nlive in canvas artboards.\n\n**Editing an existing mockup.** To change one element, text, or color in an\nexisting html mockup, do NOT regenerate the frame \u2014 call `update-visual-plan`\nwith `contentPatches: [{ op: \"patch-wireframe-html\", blockId, edits: [{ find,\nreplace }] }]`. Each `find` is a unique snippet of the current html (read it\nfirst with `get-visual-plan`); set `all: true` on an edit to replace every\noccurrence. The result is re-sanitized.\n\n**Canvas annotations are designer notes on the artboard.** When a top canvas is\npresent, sprinkle Figma-style notes near the frames they explain: a short\nheading, supporting text, and bullets \u2014 plain text layers, never bordered or\nshadowed cards, and never a box around a frame. The renderer spaces notes away\nfrom frames, so place each note by the frame it describes. Use an arrow only to\npoint at one specific control or transition; for a broad frame-level note, write\ntext beside the frame with no connector. Connectors are for real sequences only \u2014\nnever fake \"Step 1 \u2192 Step 2\" lines between independent states.\n\n**Do not create overlapping annotations.** Anchor each note to the frame it\nexplains with `targetId` + `placement` (top/right/bottom/left). The renderer\nparks notes in a gutter beside the frame and lays them out automatically \u2014 never\nsupply x/y or points for anchored notes; hand-placed coordinates fight the\nauto-layout and cause the overlap you're trying to avoid. Reserve arrows for a\nnote that must point at a specific control inside a frame; a note that simply\nsits beside its frame needs no arrow.\n\n**Patching.** Edit one wireframe, canvas annotation, or block with targeted `contentPatches`\n(for example `update-block`, `replace-blocks`, `update-canvas-annotation`) rather\nthan regenerating the whole plan. `contentPatches` are part of the public MCP\naction schema, so Claude Code, Codex, Cursor, and other hosts can make surgical\nedits. If an agent is working from exported source files, use\n`read-visual-plan-source` / `patch-visual-plan-source`: `plan.mdx` holds\nfrontmatter plus markdown/document blocks, `canvas.mdx` holds\n`<DesignBoard>/<Section>/<Artboard>/<Screen>/<Annotation>/<Connector>`, and the\npatch action normalizes the MDX back into the same JSON runtime model. JSON is\nthe canonical runtime shape; MDX is the repo-friendly authoring/export surface.\nIn the browser, humans edit `rich-text` prose inline; agents should still use\n`update-rich-text` content patches or source patches for prose, and use\ncomments/structured patches for canvas, artboard, wireframe, and diagram edits.\n\n**Never emit a titled artboard with no interior wireframe content.** Every artboard you place on the canvas must carry an `html` wireframe (or reference a wireframe block via `blockId`) \u2014 a label-only frame renders as an empty dashed box and is rejected at parse time. If you only have a title, write it as a section header or annotation, not an empty artboard.\n\n**Fill the frame; keep labels short.** Each artboard is a fixed-size surface \u2014 compose enough realistic HTML to fill it top to bottom with even vertical rhythm; never leave a large empty band. On desktop/app-shell sidebars, let the nav stack flex to fill (`flex:1`) and add any persistent bottom action/status after it so the rail reads complete in taller frames. On mobile especially, flow real rows down the whole screen (status bar, header, then list/detail content) rather than a header floating above a gap. Keep every label short enough to sit on one line within its column \u2014 shorten the copy rather than relying on the frame to absorb it (long labels wrap or clip).\n\n**Good example \u2014 a contacts list, surface `browser`.** A small, real screen\ncomposed from the helper classes and tokens, layout in inline flex, no fonts or\nhex colors:\n\n```html\n<div style=\"display:flex;flex-direction:column;gap:12px;padding:16px;height:100%\">\n <div style=\"display:flex;align-items:center;justify-content:space-between\">\n <h1>Contacts</h1>\n <button class=\"primary\">New contact</button>\n </div>\n <div style=\"display:flex;gap:6px\">\n <span class=\"wf-pill accent\">All 128</span>\n <span class=\"wf-pill\">Favorites</span>\n <span class=\"wf-pill\">Archived</span>\n </div>\n <div class=\"wf-card\" style=\"display:flex;flex-direction:column;gap:0;padding:0\">\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1.4px solid var(--wf-line)\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Jane Cooper</strong><br /><small>jane@acme.co</small></div>\n <span class=\"wf-pill\">Lead</span>\n </div>\n <div style=\"display:flex;align-items:center;gap:10px;padding:10px 12px\">\n <div style=\"width:32px;height:32px;border-radius:999px;background:var(--wf-accent-soft)\"></div>\n <div style=\"flex:1\"><strong>Marcus Lee</strong><br /><small>marcus@globex.io</small></div>\n <span class=\"wf-pill\">Customer</span>\n </div>\n </div>\n</div>\n```\n\n**Mockups belong in the top visual review area.** Static visuals live on the\ncanvas; multi-step flows get both canvas wireframes and a prototype. When the\nuser asks for a mockup, UI state, loading state, layout, screen, or visual\ncomparison, make the canvas the primary home for that static visual. When the\nuser asks for a prototype or the plan contains a sequence the reviewer must\nfeel, keep the canvas artboards and add `content.prototype` so the top surface\nshows Wireframes / Prototype tabs. Document blocks can explain, compare, or map\nimplementation, but they should not host the primary mockup or prototype just\nbecause `custom-html`, screenshots, or prose are easier to produce. If the\ncanvas/prototype surface cannot represent the requested fidelity, still keep the\nclosest top-surface representation and call out or extend the needed renderer\ncapability.\n\n**Legacy kit tree.** Older plans set a `screen` array of `{ el, ...props }` kit\nnodes instead of `html`; the renderer still accepts and displays it, but new\nplans emit `html`. Do not author fresh kit-tree screens \u2014 write the HTML mockup\ninstead. Likewise, old or imported plans may carry coordinate-based regions or\nfree-float x/y on notes or artboards; those are legacy escape hatches the\nrenderer still shows but you must never produce. The `surface` drives the aspect\nand footprint, the canvas auto-places artboards, and the gutter parks notes by\n`targetId` + `placement`; never supply width, height, or coordinates for a new\nplan.\n\n<!-- SHARED-CORE:wireframe-canvas END -->\n\n<!-- SHARED-CORE:document-quality START -->\n\n## Document Quality Core\n\nThis section is shared, word for word, by `/visual-plan`, `/ui-plan`, and\n`/visualize-plan`. It is the single source of truth for the document below the\ncanvas. Do not paraphrase it per command.\n\n**The document is a serious technical plan, not marketing.** Write it the way a\nstrong Claude or Codex implementation plan reads: outcome-first, prose-first,\nself-contained, and specific. State the objective and what \"done\" means, the\nscope and non-goals, the proposed approach with the key decisions and their\nrationale, ordered steps that name real files, symbols, actions, and data\nshapes, the risks, and a closing verification step (tests, build, or a checkable\nbehavior). Replace vague prose with specifics; never ship a step like \"make it\nwork.\" No hero art, gradients, logos, nav bars, slogans, value props, giant\nlanding-page headings, or marketing cards unless the user explicitly asks.\n\n**Top visuals and document never duplicate each other.** The UI story lives in\nthe top visual surface: canvas artboards for static inspection, plus prototype\ntabs when the flow should be functional. The document carries the technical depth\nthe visuals cannot show \u2014 concrete file/symbol maps, API and data contracts,\ncode snippets, migration or implementation phases, risks, and validation. Repeat\na wireframe in the document only for a genuinely new detail view or comparison.\nSkip the visual surface entirely for non-visual work and write a clean rich\ndocument.\n\n**Use the right block, and make it carry substance.** For the authoritative,\nmachine-checked list of block types and their data schemas, call `get-plan-blocks`\n\u2014 it returns the live registry vocabulary (type, MDX tag, placement, key fields)\nso you never emit a block the editor cannot render or round-trip:\n\n- `rich-text` for plan prose with real bold/italic/code/links and nested lists.\n- `implementation-map` / `code-tabs` for the file map: file path, the\n symbols/components to touch, the reason, risk/coordination notes, and a\n concise syntax-highlighted snippet of the code shape \u2014 never the whole file,\n never a prose-only file list.\n- `decision` for two or three option cards with consequences. These are static\n records; do not style them like clickable tabs or chips unless the renderer\n truly supports changing the selection.\n- `diagram` for architecture, sequence, data-flow, dependency, or state\n relationships, only when it clarifies something real. Labels must not overlap\n nodes, connectors, or each other.\n- `tabs` for multiple states, directions, or comparisons. A tab that reveals\n only prose usually means the plan is under-specified \u2014 include a relevant\n visual unless the tab is intentionally document-only.\n- `table`, `checklist`, `callout` for scannable structure.\n\n**Open questions live at the bottom as a form when answers would change the\nplan.** Surface answerable unresolved decisions in a final `question-form`\nblock titled \"Open Questions\". Use `single` or `multi` for clear choices,\n`freeform` for constraints, `recommended: true` for the default you would pick,\nand option `wireframe` / `diagram` previews for visual directions when useful.\nKeep non-answerable assumptions or risks as concise `callout` blocks in the\nrelevant section. Never bury a questions/decisions wall inside the plan\nnarrative.\n\n**`custom-html` is a bounded escape hatch only** \u2014 a single complete fragment\ninside a block, never `html`/`head`/`body`/`script` tags, never a generic\nplaceholder, density demo, or proof that custom HTML works. Prefer the native\nblocks for normal plans. It may support supplemental demos or references, but it\nis never the primary home for a requested mockup, UI state, or visual\ncomparison. If fidelity requires HTML/CSS, image capture, or real React/CSS, the\nproduct fix is canvas support for that artifact type, not moving the mockup into\nthe document.\n\n**Before handoff, open the plan and check it.** Fix overlap, excessive\nwhitespace, clipped fragments, misleading inactive controls, poor contrast, and\nunreadable diagrams before asking for approval.\n\n<!-- SHARED-CORE:document-quality END -->\n\n<!-- SHARED-CORE:exemplar START -->\n\n## Good vs. Bad Exemplar\n\n**GOOD.** A `/ui-plan` for a todo app: a canvas with a `desktop` artboard whose\n`data.html` is a real flex layout \u2014 a sidebar of links (`Inbox 12`, `Today 4`,\n`Done`), a main column with an `<h1>Today</h1>`, accent `.wf-pill`s for the\nfilters, a muted section label `OVERDUE`, and `.wf-card` task rows carrying real\ntitles, due dates, and a primary `button.primary` \u2014 styled only through bare\nelements, helper classes, and `--wf-*` tokens, so the renderer applies the\ncorrect desktop footprint, theme, and one subtle whole-frame wobble. Plain-text\ndesigner notes sit spaced off the frame, pointing only at the controls that need\nexplanation. Below it, a Claude/Codex-grade document: objective and\ndone-criteria, an `implementation-map` naming the real components and actions\nwith short highlighted snippets, a `decision` card weighing two real approaches,\nand a validation step \u2014 none of it repeating the canvas. If the task also\nchanges a multi-step completion flow, the same top area includes a Prototype tab\nwhose screens use the same labels and states as the canvas artboards, with\n`data-goto` controls for the sequence. This is the bar.\n\n**BAD.** A `data.html` with hard-coded hex colors, a `font-family`, or fixed\npixel width/height; gray placeholder bars \"insinuating\" text on a non-skeleton\nframe; a forced desktop + mobile pair for a popover; floating bordered\nannotation cards hugging the frames; a fresh hand-authored kit-tree `screen`\ninstead of `html`; a multi-step UI flow with only static frames and no prototype\ntab; a mockup escaped into a document `custom-html` block; and a marketing-style\ndocument with a hero heading and value props that just restates what the canvas\nalready shows. Never produce this.\n\n<!-- SHARED-CORE:exemplar END -->\n\n## Tool Guidance\n\n- `visualize-plan`: create the visual companion from the existing text plan.\n- `update-visual-plan`: enrich the import; prefer targeted `contentPatches` over\n replacing the whole content. Use `set-prototype`, `patch-prototype-html`,\n `update-prototype-screen`, and `patch-wireframe-html` when revising\n functional prototype flows or their static frame counterparts.\n- `convert-visual-plan-to-prototype`: convert an existing HTML wireframe canvas\n into a functional prototype while preserving static mocks by default.\n- `create-prototype-plan`: use only when the user wants a prototype-first plan\n and there is no existing plan text that `/visualize-plan` should preserve.\n- `read-visual-plan-source`: read the normalized plan as `plan.mdx`,\n optional `canvas.mdx`, optional `prototype.mdx`, optional `.plan-state.json`,\n and JSON.\n- `patch-visual-plan-source`: apply granular MDX AST patches by stable block,\n artboard, annotation, component, prototype screen, or wireframe-node id.\n- `import-visual-plan-source`: create or replace a plan from an MDX folder.\n- `get-visual-plan`: inspect the current structured plan, exported HTML, and\n annotations; it also returns the MDX folder for source workflows.\n- `get-plan-feedback`: read unconsumed reviewer comments before coding; it\n returns grouped threads, exact anchor details, expected resolver, and recent\n review-event payloads so agents can act only on the comments meant for them.\n- `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX\n files for repo check-in.\n\nWhen the user critiques a plan's look or structure, fix the renderer or this\nskill \u2014 never hand-edit one stored plan. Turn feedback into better guidance.\n\n## Setup & Authentication\n\nThere are two ways into Plans.\n\n**Coding agent (CLI).** Install once with the Agent-Native CLI. The command\ninstalls the Plans skills, registers the hosted Plans MCP connector, and\nauthenticates it in the same step (a one-time browser sign-in at setup \u2014 this is\nintended), so the first tool call does not hit an OAuth wall:\n\n```bash\nagent-native skills add visual-plan\n```\n\nAfter that, `/visual-plan` (and `/ui-plan`, `/prototype-plan`,\n`/visual-questions`, `/visualize-plan`) generate a plan and open the editor. Pass `--no-connect` to\nregister the connector without authenticating, then run\n`agent-native connect https://plan.agent-native.com` whenever you are ready.\n\n**Browser (people you share with).** Open the Plans editor and create & edit\nwith no sign-up \u2014 you work as a guest. Sign in only when you want to save or\nshare; signing in claims the plans you made as a guest into your account.\n\nSharing and commenting require an account: public/shared plans are viewable by\nanyone with the link, but commenting on them needs an agent-native account.\n\nFor fully offline, no-account use, run the Plans app locally and sync plans to\nyour repo as MDX. This local mode is a separate advanced path, not the default\nhosted flow.\n\nIf a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`,\ndo not keep retrying the tool. Authenticate the connector with\n`agent-native connect https://plan.agent-native.com` (OAuth-capable hosts can\ninstead re-run /mcp and choose Authenticate), then continue once the connector\nis available.\n\nHosted default: connect `https://plan.agent-native.com/_agent-native/mcp`. Do\nnot put shared secrets in skill files.\n";
|
|
11
12
|
type SkillsCommand = "list" | "add" | "help";
|
|
12
13
|
export interface ParsedSkillsArgs {
|
|
13
14
|
command: SkillsCommand;
|
package/dist/cli/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAyOjE,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAyOjE,eAAO,MAAM,qBAAqB,0x3BAqdjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,s6xBAya5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,gkOA8JnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,urLA6HrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,u50BA+bnC,CAAC;AAmTF,KAAK,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC;IACb;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAWD,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACzC;AAED,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,aAAa,CAAC,EAAE,CACd,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,CACb,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,CACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,UAAU,yBAAyB;IACjC,cAAc,EAAE,QAAQ,EAAE,CAAC;IAC3B,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClE;AAED,UAAU,yBAAyB;IACjC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAwJD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAmEhE;AA2SD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAqK1B;AAgBD,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAuHf"}
|