export declare const VISUAL_PLANS_SKILL_MD = "---\nname: visual-plan\ndescription: >-\n Turn ordinary text plans into rich interactive visual plans with diagrams,\n file maps, annotated code, open questions, and UI/prototype review when\n useful.\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: inline diagrams, code snippets,\nopen questions, and an optional top visual review area (wireframe canvas, live\nprototype, or both in tabs). Architecture and backend plans stay document-only;\nUI and product plans start with the top canvas/prototype (the Visual Surface\nChoice section owns that rule).\n\n`/visual-plan` is the packaged command and main entry point. Choose the review\nmode from the task: UI-first when the work is primarily product UI and review\nshould start with screens, prototype-first when review should start with a\nfunctional live prototype, design-first when review needs full-fidelity branded\nscreens, or visual-intake when the user explicitly wants a questionnaire before\nplanning. When a Codex, Claude Code, Markdown, or pasted plan already exists,\n`/visual-plan` uses that source plan as the starting point and builds the review\nsurface from it instead of starting over.\n\n## When To Use\n\nCreate or adapt a visual plan whenever the plan would be better as a reviewable\nartifact than a chat paragraph. This includes modest work such as a single UI\nsurface with states, a small workflow, a before/after product change, or a\ncomponent/API/data-shape decision that needs alignment, plus larger multi-file,\nambiguous, long-running, risky, or UI-heavy work. Use it when architecture /\ndata flow / UI direction / options / open questions would benefit from inline\ndiagrams or structured blocks, when the user needs to react to a direction\nbefore you implement, or when an existing text plan needs a richer review\nsurface.\n\n## Plan Discipline\n\n- **Gate thoughtfully.** A visual plan is a richer review surface, not only a\n tool for giant projects. Use it when the user needs to see, compare, comment\n on, or approve a direction before code, even for a modest UI/state/workflow\n change. Skip it for truly trivial, unambiguous work \u2014 typos, one-line fixes, a\n single well-specified function, anything whose diff you could describe in one\n sentence \u2014 and just make the change. Never pad a plan with filler and never\n 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 Lead with reuse: for each step, name what it reuses \u2014 existing actions, schema,\n components, helpers \u2014 before what it adds, so the plan explains the genuinely new\n delta instead of redescribing what already exists.\n- **Decide the hard-to-reverse bets first.** For non-trivial backend, data, or API\n work, sketch where the feature is headed, then call out the decisions that are\n expensive to undo once data or callers depend on them \u2014 wire format, public ids,\n data-model shape, auth and ownership boundaries \u2014 and get those right in the plan\n even if most of the feature ships later. Then scope to the smallest first cut that\n proves the approach without foreclosing it, stating both what is in and what is\n explicitly deferred.\n- **Keep examples at the right altitude.** When the user's idea is a broad\n framework, product, or operating-model change, do not collapse it into the\n first concrete example, provider, or sync path they mention. Separate the core\n abstraction from motivating examples and app/provider adapters. Use examples\n to make the plan legible, but label them as examples unless they are the whole\n requested scope.\n- **Publish standalone plans.** If the user pasted, referenced, or already has a\n Codex / Claude Code / Markdown plan, treat it as source material, but rewrite\n the published plan as a clean standalone proposal. Preserve the source plan's\n useful intent and codebase facts, label inferred visuals as inferred, and avoid\n revision language such as \"preserve the prior plan\", \"do not drop the old\n idea\", \"unlike the previous version\", or \"this revision changes...\". A reader\n who never saw the chat or earlier drafts should understand the plan.\n- **Make the first read concrete.** If the plan is meant to be shared with\n someone outside the chat, or if the concept is abstract, lead near the top with\n one concrete product example before mode tables, architecture, or roadmaps. For\n UI-capable concepts, that usually means a top-canvas app state that shows the\n real user workflow in product terms. Do not rely on phrases that only make\n sense in conversation, and do not frame the plan as \"not the old idea\"; state\n the positive model directly.\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` for\n ordinary clarification or preflight; reserve it for the visual-intake mode when\n the user explicitly asks for a visual intake questionnaire. Otherwise state the\n assumption explicitly and proceed, and keep anything unresolved in the plan's\n single bottom `question-form` Open Questions block. For complex plans, do a\n final open-question pass before handoff: if a decision would affect\n architecture, scope, UX, data shape, or rollout, either decide it in the plan\n with rationale or put it in that bottom form with a recommended default.\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 make the updated document stand alone. Do not describe the update as\n a correction to an earlier draft inside the plan itself. Re-read the approved\n plan before major steps.\n\n## Create A Structured Agent-Native Plan \u2014 Never Inline\n\nThe deliverable is ALWAYS a structured Agent-Native Plan, not a chat-only plan.\nThe hosted Plan MCP connector (`plan` server, or legacy `agent-native-plans`) is\nthe default collaboration and commenting surface; it is not a reason to reject\nthe planning pattern as an external dependency or rented layer. Plans are\nportable source artifacts (`plan.mdx`, optional `canvas.mdx` /\n`prototype.mdx`, JSON, and HTML export), and ownership-sensitive workflows can\nuse local-files mode or a self-hosted/custom Plan app URL without abandoning the\nskill's review discipline. Do not advise the user to skip `/visual-plan` because\nthe default surface is hosted; choose the right Plan mode for the user's\nownership, privacy, sharing, and branding needs.\n\nBy default, create the plan via the Plan MCP connector and NEVER hand it over as\ninline chat content \u2014 no Markdown prose, ASCII sketch, table, or fenced\nwireframe. If the `plan` (or legacy `agent-native-plans`) tools are not visible,\ndiscover them through the host's `tool_search` first; if they are still missing,\nSTOP and give the user the client-specific reconnect step rather than improvising\nan inline plan. Before publishing, or whenever a connector or auth error appears,\nREAD `references/connection.md` in this skill directory \u2014 it is the single source\nof truth for the never-inline rule, connector discovery, and the per-client\nreconnect steps. Local-files privacy mode (after Tool Guidance) is the exception.\n\n## Core Workflow\n\nThis section describes the default hosted Plan MCP workflow. If\n`AGENT_NATIVE_PLANS_MODE=local-files` is set, or the user asks for fully local\nfiles/no hosted Plan writes, use **Local-Files Privacy Mode** instead; carry\nforward only the code-research and plan-composition guidance here.\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. If a source plan\n already exists, gather its exact text from the user's paste, a referenced\n file, or recent visible agent context; do not invent source text.\n2. Call `get-plan-blocks` for the authoritative block catalog \u2014 do not author\n from memorized tags. Then call the mode-matched create tool:\n `create-visual-plan` for document-first plans (architecture, backend, data,\n refactor, API), `create-ui-plan` for UI-first plans, `create-prototype-plan`\n for prototype-first plans, `create-plan-design` for design-first plans,\n `create-visual-questions` only when the user explicitly asks for a visual\n intake questionnaire. When a source plan already exists,\n pass it as `planText` and preserve the original plan's useful intent while\n producing a standalone plan document, not a revision memo.\n3. For UI/product plans, compose the top canvas first with the primary\n wireframes and annotated states, then write the document with native blocks\n (see `references/canvas.md` and `references/document-quality.md`). For\n broad product architecture plans with a user-facing implication, add a\n concrete \"what this looks like in the app\" visual before the abstract\n architecture or mode tables. Keep the document close to the standalone\n Markdown plan the agent would normally output. If an existing plan was\n provided, carry forward the right facts and decisions without referring to\n the previous draft or explaining how this version differs. For non-visual\n plans, skip the top visual surface (Visual Surface Choice below owns the rule)\n and put `diagram`, `data-model`,\n `api-endpoint`, `diff`, `file-tree`, `code`, and `annotated-code` blocks\n directly next to the relevant prose.\n Wide document layout is renderer-owned and intentionally allowlisted: only\n literal code-review surfaces (`diff`, `annotated-code`) and `tabs` blocks\n with vertical orientation or diff-like children break out wider than prose.\n Keep `api-endpoint`, `openapi-spec`, `data-model`, `json-explorer`,\n `wireframe`, question, and `custom-html` blocks in normal document flow unless\n their own renderer says otherwise.\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 \u2014 a convenience and smoke test, never the\n only handoff or the access\n model. Plans should load out of the box for the local agent and local browser\n session; if a signed-in embedded browser cannot read a local plan that an\n anonymous/tool check can read, fix the app/action ownership or access path\n rather than patching one plan by hand. For high-stakes plans (architecture,\n backend, data, multi-file, or risky), also kick off the self-review pass in\n **Self-Review Before Handoff** while the user reads, instead of blocking the\n handoff on it.\n5. For hosted plans, call `get-plan-feedback` before editing, after review,\n 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. For hosted plans, apply changes with `update-visual-plan`, preferring\n targeted `contentPatches`.\n Treat the top-level `content` payload as a full replacement, not a merge; do\n not send a partial `content` object to add a canvas or one block. If a full\n replacement or `replace-blocks` is unavoidable, call `get-visual-plan`\n immediately before the write, pass its `plan.updatedAt` as\n `expectedUpdatedAt`, and carry forward every existing block and visual\n surface. Never reuse a revision from an earlier read or feedback payload.\n For source-control friendly edits, use granular `patch-visual-plan-source`\n operations against the MDX files instead of regenerating the plan;\n `replace-file` is also destructive and requires the same fresh\n `expectedUpdatedAt` fence.\n7. After every hosted-plan write, call `get-visual-plan` again and compare the\n persisted text, block IDs/counts, canvas frames, and prototype with the\n intended result. A successful mutation response is not proof that unrelated\n content survived. If the edit addressed agent-targeted feedback, only after\n this verification call `resolve-plan-comment` for the thread and\n `consume-plan-feedback` for its comments; do both so addressed feedback is\n neither visibly open nor returned as pending work.\n8. For hosted plans, export with `export-visual-plan` only when the user wants a\n shareable receipt or repo-check-in artifacts.\n\n## Self-Review Before Handoff\n\nThis adversarial self-review pass is opt-in, not default: run it only for\nhigh-stakes plans \u2014 irreversible migrations, security-sensitive work, or when\nthe user explicitly asks for extra rigor \u2014 and skip it otherwise. It roughly\ndoubles the cost of plan generation, so the default for small, UI-only,\nsingle-decision, or ordinary plans is to skip it, not to run it. Keep the pass\ncheap and non-blocking when it does run:\n\n- **Surface the plan first, review concurrently.** Post the link and let the user\n start reading, then run the review in parallel \u2014 never make the user wait on it.\n- **Review the written plan; do not re-research.** Critique the plan text and its\n own blocks. The grounding was already done while drafting, so the review checks\n the output instead of re-exploring the repo.\n- **Spawn one skeptical reviewer** whose only job is to find what is weak, missing,\n or wrong \u2014 not to praise. Point it at: hard-to-reverse decisions made implicitly\n or not at all (wire format, public ids, data-model shape, auth, ownership); steps\n not anchored in real files or symbols; a menu of options where the plan should\n commit to one; obvious missing decisions (\"what happens when X?\", \"why not Y?\");\n and padding or single-step filler.\n- **Fix vs. ask.** Apply clear-cut fixes yourself with `update-visual-plan`\n `contentPatches` \u2014 vague non-goals, unanchored claims, an obvious missing\n decision. Route genuine judgment calls back to the user instead: add them to the\n bottom `question-form` Open Questions block or batch them into the normal\n ask-user-question flow. Do not silently decide them.\n- **Do not surprise the user mid-read.** On a large plan, apply the patches before\n the editor loads; otherwise note briefly that a self-review is running so the\n plan changing under them is expected. When you next respond, summarize what the\n review changed and what it surfaced for the user to decide.\n\n## Visual Surface Choice\n\nChoose the surface before creating the plan or after reading the source plan. Do\nnot add visual chrome by default:\n\nFor UI/product plans, the top canvas is usually the primary review surface. Put\nthe first meaningful wireframes there, not buried as document-body blocks. Use\nmultiple canvas artboards when states matter, such as the default view, an\noverflow menu or popover, a side panel, loading, or error. Put short annotations\nbeside frames with `targetId` plus `placement`; keep implementation details,\ntradeoffs, file maps, data contracts, risks, and verification in the document\nbody below the canvas.\n\nWhen the user asks for a flow, storyboard, journey, wireframe, canvas, or \"what\nthis looks like\", treat that as a canvas-first request. Make one artboard per\nuser-visible state, connect only adjacent transitions, and use short canvas\nannotations for the product notes. Do not substitute a document-body `diagram`\nblock for the requested storyboard just because HTML diagrams are faster to\nwrite; diagrams belong below the canvas for backend mechanics, architecture, or\ndata-flow explanation.\n\nKeep product wireframes and explanatory/meta diagrams separate. Start with pure\nscreens that look like the app state under discussion, without callout prose or\narchitecture notes embedded inside the UI. Put arrows, labels, contracts, data\nflow, and mode explanations in separate annotations, separate canvas diagrams,\nor the document body.\n\nWhen the plan touches an existing app, inspect the current shell/components\nbefore drawing. The first artboard should look like the real app at the same\ndensity: existing sidebars, toolbar placement, overflow menus, app chrome, and\nframework agent chrome stay in their real places. Model secondary surfaces as\nseparate states, such as a top-right overflow popover, sheet, panel, loading\nstate, or separate AgentSidebar, rather than inventing a permanent inspector or\nfolding framework chrome into the product UI.\n\n- **No visual surface** for architecture-only, backend-only, data migration,\n copy-only, or otherwise non-visual plans. Do not use the top canvas for\n architecture diagrams, dependency maps, file plans, API contracts, or\n data-flow-only reviews. Use a strong document with local inline diagrams\n only when relationships need a visual explanation, usually one spatial diagram\n per recommendation or decision. Prefer grouped regions, layers, quadrants,\n matrices, or before/after panels over a single-axis chain unless the\n relationship is truly sequential.\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 When both surfaces are present, open the Wireframes tab by default; the\n prototype remains available as the interactive follow-up view.\n- **Prototype-first** when the user asks to operate the UI or when interaction is\n the main question. Use `create-prototype-plan`, which still preserves static\n 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\nTreat \u201Chigher fidelity,\u201D \u201Cpixel-accurate,\u201D \u201Cpolished mockup,\u201D \u201Cproduction-like,\u201D\n\u201Creal design,\u201D and \u201Cnot a sketch/wireframe\u201D as design-first language even when\nthe request also says \u201Cmockup.\u201D For a new plan, use `create-plan-design`. For\nan existing plan, keep the same plan id and call `update-visual-plan` with a\n`set-visual-render-mode` patch using `renderMode: \"design\"` plus the upgraded\nscreen HTML/CSS in the same update. Ground the result in the real app shell,\ntokens, typography, spacing, and states, and add stable `data-design-id`\ntargets. Put scoped styles in each screen's `css` field, never in a `