--- name: visual-plan description: >- This skill should be used whenever a plan for non-trivial work is being produced, presented, or proposed (a feature, design, refactor, migration, or any multi-step task), including in plan mode and together with whatever planning skill produced the plan. It is the default way to deliver a plan: instead of a wall of text, it renders the plan as MDX to a scannable, self-contained HTML page (diagrams, phases, file-change maps, comparisons) via the `vplan` CLI. It applies when the user says "plan this", "what's the approach", "how should we approach X", "show me the plan", "make a visual plan", "render this plan", or asks for a plan with diagrams/charts, and when they want to review, approve, sign off on, or give feedback on a plan. Skip only for a trivial one-step change or when the user explicitly asks for plain prose. --- ## Purpose Render a plan as a visual MDX page instead of a wall of text, using the `vplan` CLI. The component vocabulary is general: although the examples below are code-flavored, it fits any structured plan (a product launch, a research agenda, an incident response), not just software changes. Use the components that fit the plan and skip the ones that do not. Above all, **show, don't tell**: a reader should grasp the plan by scanning its diagrams, phases, and tables, with prose only connecting the visuals, not carrying the plan itself. The **Show, don't tell** section below is the heart of this skill. > **If the `vplan` command is not found**, install it globally first: `npm i -g vplan@latest` > (published on npm). Re-run the failed command afterward. ## Workflow 1. Write the plan to a `.mdx` file, starting with a single `# Title` heading (it becomes the plan title; no frontmatter). Then use the components below; you never write `import` statements, they are always in scope. 2. Validate before showing the user: `vplan check .mdx`. Fix every reported `file:line:col` issue (it names valid enum values and flags unknown components). `check` also runs a **quality lint** that flags weak renders (the enforced Gotchas below); its warnings fail `check`, so fix them too. 3. **Present the plan with `vplan .mdx`. An interactive review is the default way to deliver a plan, not a special mode reserved for sign-off.** It opens the plan with a feedback layer where the user comments on whole sections or on selected text, **answers any `` directly** (each question becomes an inline answer field; a question with nested option bullets becomes clickable choices, and the picked option's text (or the typed "Other" text) is the answer, printed back as `Answer to "":`), then clicks Approve / Deny / Iterate. It **blocks** until they submit, prints the decision, comments, and answers to stdout, and exits: approve 0, deny 1, iterate 2, timeout 3 (`--timeout`, default 15m; closing the tab counts as deny). It is a long-running foreground server, so run it in the background. (The explicit `--review` flag still works but is redundant now that review is the default.) A comment may carry a severity tag: treat a `[must-fix]` comment as blocking (it must be addressed before the plan can be approved) and a `[suggestion]` or untagged comment as non-blocking input. Then act on the printed feedback: - **Approve** -> proceed with the plan as written. - **Iterate** -> revise the plan addressing each comment, then simply re-run `vplan .mdx`; the review tab updates the same plan in place and the round number increments automatically (pass `-i N` only to override it). Repeat until Approve or Deny. **Edit the same `.mdx` file in place** and re-render: `vplan` snapshots each plan it presents (keyed by the file path), so the next render automatically marks what changed since the last view with a subtle git-gutter accent and a "N changed" summary, letting the user re-review only the delta. Pass `--diff ` to diff against an explicit file instead of the snapshot, or `--no-diff` to suppress diffing (e.g. a clean first look). - **Deny** -> stop and reconsider; do not proceed. **Review is the right default for every non-trivial plan.** Targeted comments and in-place `` answers drive sharper revisions than back-and-forth chat, and the loop ends in an explicit Approve so you know it is settled. Reach for a static render (step 4) only when the user just wants to look, not shape or decide. 4. **A static page, a live-reloading preview, or a PDF/JPG export** are the non-review outputs, for when the user only wants to look or wants a shareable file rather than review one. When you need one, **load `references/static-exports.md`**; it holds the commands and flags for these (kept out of here so review stays the default path). Authoring the plan (everything below) is identical whichever output you choose. Run `vplan components` anytime for the exact prop signatures. ## Components The data components (`FileTree`, `Chart`, `Stat`, `Compare`, `Matrix`, `Questions`, `Checklist`) take their data as **markdown children**, not props: write a normal markdown list (or, for `Matrix` and a multi-series `Chart`, a markdown table) between the tags. Only the scalar settings (`title`, `type`, `status`) are attributes. This is fewer tokens and avoids the `{[{ ... }]}` brace errors that break a render. - ``: one step in a numbered vertical timeline; wraps markdown (ordered lists, prose, nested components). The steps auto-number in order. One per major step of the plan. - ` ```mermaid ` fenced block, for diagrams: architecture (`flowchart`), `sequenceDiagram`, dependency graphs, `stateDiagram-v2`, `classDiagram`, `erDiagram`, and `xychart-beta`. Reach for this first for anything structural. (gantt and pie are not supported; use `` for quantitative data. `check` now validates each diagram, so an unsupported type fails check with a `file:line:col` instead of rendering an error box.) - ` ```math ` fenced block, a display formula written in LaTeX, typeset as math (complexity bounds, probabilities, linear algebra). Example: ` ```math ` then `T(n) = O(n \log n)`. - ``: highlight a risk, decision, tip, or note; wraps markdown. (`note` is blue, `tip` is green, `decision` is purple, `risk` is red, `warn` is yellow.) - ``: file-change map. One bullet per file, `- `, where `change` is `add|modify|delete|move`. A move needs both ends, `- move -> ` (the file renders at its destination with the origin shown). A path ending in `/` marks a whole directory (e.g. `- delete src/legacy/`). A colored file-type icon is added automatically from the path's extension. Append ` -- ` to any line for a short inline comment on that change (what it does or why); keep it to a phrase, since it shares the row with the file name. ```mdx - add src/gateway/rate-limiter.ts -- sliding-window check against Redis - modify src/gateway/middleware.ts -- mount the limiter behind the flag - delete src/gateway/legacy/ ``` - ``: estimates/metrics. Single series: one bullet per point, `-