/flow-extras:better-planfrom flow-extras
Present a plan, design, proposal, or architecture as a polished, interactive, REVIEWABLE page instead of flat markdown — using the locally-installed `better-plan` CLI. Use WHENEVER you are about to show a human a plan they will read and approve: a build/implementation plan, a design doc, an architecture proposal, an API design, a migration plan, an RFC, or a "here's what I'm going to do" before starting work. Renders MDX with diagrams, interactive API specs, annotated code, wireframes, decision records, comparison matrices, timelines, and more, and gives the reviewer an in-page Approve / Request-changes control you can poll. Triggers on - better-plan, /better-plan, "write a plan", "show me the plan", "render the plan", "make a visual plan", "plan this out", "design doc", "proposal", "before you build", "present the plan", "let me review the plan", "plan I can approve", "make the plan readable". Do NOT use for - a one-line answer, a quick code diff, or work you are executing rather than proposing.
Ships in flow-extras. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
better-plan turns a plan you write as MDX into a polished page the reviewer opens in a browser, navigates, and approves in the UI. Reach for it instead of dumping a wall of markdown whenever a human will review and sign off on what you propose.
The command is globally installed — just run better-plan <plan.mdx>; you never need the tool's repo path.
Use a visual plan when you are proposing something a human will review: a build/implementation plan, design doc, architecture, API design, migration, or "here's my approach before I start." Especially when the plan has structure prose hides badly — a flow, an API surface, code to annotate, a UI to sketch, options to compare.
Don't for: a one-line answer, a quick diff, FAQ-style replies, or work you're executing rather than proposing. A plan page is for review, not for narration.
The payoff is the approval gate: present the plan, then gate your next step on the reviewer's decision (below). That turns "I think this is what you want" into "you approved exactly this."
.mdx file (default plan.mdx). Lead with <PlanHeader>, then top-level ## headings — each ## becomes a nav entry, so they are the plan's spine.better-plan ./plan.mdx → it opens the plan in the browser automatically and prints the localhost URL (pass --no-open to suppress the auto-open).better-plan ./plan.mdx # render one plan → prints a localhost URL
better-plan ./plans/ # a directory renders all .mdx files as one page (filename order)
better-plan ./plan.mdx --port 5000 # prefer a port (next free is used if taken)
better-plan ./plan.mdx --theme dark # initial theme
better-plan ./plan.mdx --wait-approval # block until the reviewer decides, then exit
Every rendered plan has a sticky review bar: the reviewer clicks Approve plan, or Request changes which opens a dialog asking what to change. Learn the decision two ways:
# A) Blocking — the command exits when the reviewer decides:
better-plan ./plan.mdx --wait-approval # exit 0 = approved, exit 2 = changes requested (note printed)
# B) Polling — run the server, then poll the status endpoint until it leaves "pending":
curl -s http://localhost:4711/__bp/status
# {"status":"pending"} → keep waiting
# {"status":"approved","at":"…"} → proceed
# {"status":"changes-requested","note":"…","at":"…"} → revise per the note, re-render
Poll loop you can drop into a shell:
while curl -s http://localhost:4711/__bp/status | grep -q '"status":"pending"'; do sleep 3; done
curl -s http://localhost:4711/__bp/status # → the decision (+ note)
Do not start building until status is approved. If it's changes-requested, read the note, revise the MDX (it live-reloads), and wait again.
A served plan also has a floating Ask Claude dock — the reviewer can ask free-text questions about the plan at any time. Watch for them and answer in one of two ways:
Read questions and post answers over the same local channel (use the port from the URL printed at launch):
# the running thread — or read the sibling <plan>.qa.json (same data, no server needed)
curl -s http://localhost:4711/__bp/qa
# {"entries":[{"id":"q1","question":"…","askedAt":"…"}]} → an entry with no "answer" is waiting on you
# answer in text…
curl -s -X POST http://localhost:4711/__bp/answer -H 'content-type: application/json' \
-d '{"id":"q1","kind":"text","text":"…"}'
# …or note that you revised the plan (after editing the MDX)
curl -s -X POST http://localhost:4711/__bp/answer -H 'content-type: application/json' \
-d '{"id":"q1","kind":"plan-update"}'
Poll GET /__bp/qa (or the <plan>.qa.json sidecar) while the plan is open so you catch questions as they arrive — the open page shows each reply the instant you post it.
<PlanHeader> first — the masthead (title, summary, status, effort, author).## headings are the spine — they generate the nav. Keep them scannable (Context, Architecture, API, Data, Risks…).<Diagram>. An endpoint → <APISpec>. A tradeoff → <Comparison> or <ADR>. Don't narrate what a diagram already shows.{...}, multi-line code/DSL in a template literal {`…`}.<Diagram> (graph LR, -->, [Label]). The engine only understands A -> B arrows + [accent] — Mermaid renders a parse error. This is the #1 mistake.<PlanHeader> title, <APISpec> method+path, <AnnotatedCode> code, <Wireframe>/<FileTree> children, <Collapsible> summary, <Stat> value, <Comparison> columns+rows, <ADR>/<Step> title, <Entity> name, <Checklist>/<Timeline> items). A missing one renders a visible warning slot, not the component.### for a main section — only top-level ## headings generate the nav. Sub-headings vanish from the spine._index to <Step> — <Steps> injects it; passing it manually breaks numbering.<PlanHeader> or bury it mid-document — it's the masthead; it goes first, once.{`…`}, not a bare string, or it won't compile.The test for every component: does the reviewer learn faster from this than from the paragraph it replaces? If not, write the sentence.
| You have… | Use | Not |
|---|---|---|
| A sequence/flow/architecture | <Diagram> | a paragraph describing arrows |
| An HTTP endpoint contract | <APISpec> | a fenced JSON blob |
| Code worth pointing at specific lines | <AnnotatedCode> | code + "note that line 2…" prose |
| A UI you're proposing | <Wireframe> | "it'll have a sidebar and…" |
| ≥3 options weighed on ≥2 axes | <Comparison> | bullet lists of pros/cons |
| A consequential decision | <ADR> | a buried paragraph |
| A multi-step procedure | <Steps> | a numbered markdown list (fine for ≤2 trivial steps) |
| One fact, one option, one step | a sentence | a single-row <Comparison> / single <Step> |
The MUST-know four plus the masthead — full catalog (every prop, every gotcha) in the reference file:
| Component | One-liner | Required |
|---|---|---|
<PlanHeader> | Masthead: title, summary, status, effort, author | title |
<Diagram> | Flow/sequence/state/ER via arrow DSL (A -> B), auto-laid-out, zoom/pan | — |
<APISpec> | Interactive endpoint: method, path, params, example | method, path |
<AnnotatedCode> | Syntax-highlighted code with amber margin notes on line ranges | code |
<Wireframe> | Low-fi UI sketch in a browser/phone frame | children |
<Callout> | note / tip / warning / danger / success admonition | — |
<Steps>/<Tabs>/<Collapsible> | Procedure, tabbed views, disclosure | (Step needs title) |
<Comparison>/<ADR> | Option matrix, decision record | (columns,rows) / title |
<Stat>/<Checklist>/<DataModel>/<Timeline>/<Badge> | Metrics, tasks, schema, roadmap, status pills | (Stat value; others vary) |
Get the live catalog from the CLI — the fastest source of truth, generated from the installed tool:
better-plan components # every component, its props (required marked *), and an example
better-plan components Diagram # one component's full shape
better-plan components --json # machine-readable (name, props[{name,type,required,note}], example)
Read references/components.md in full before authoring components. It has every component's exact props, required props, MDX example, and gotchas (the Diagram arrow-DSL A -> B : label / [accent]; AnnotatedCode lines ranges like "2-4"; FileTree's indented-text parsing with # comment and <-- chip; the sub-components <Step>/<Tab>/<Entity>).
Diagrams use a custom engine — Mermaid syntax does not work. Declare edges with arrows:
<Diagram type="flow" caption="Render pipeline">
{`MDX file -> compile -> render [accent] -> localhost`}
</Diagram>
A -> B makes an edge; A -> B : label labels it; a node ending [accent] is tinted amber. Or pass nodes/edges props for richer graphs. Big diagrams zoom (wheel) and pan (drag) in the page.
| Symptom | Fix |
|---|---|
| CLI exits "path not found" | Check the path; no server started. |
| Page shows a located compile error (file + line) | Usually a missing required prop or an unclosed tag at that line. |
| One component shows an inline error/warning slot | That component's props/syntax are wrong; the rest of the page is fine. |
A <Diagram> shows a parse error | You used Mermaid syntax — switch to A -> B arrows. |
| Port busy | The tool already chose the next free port — use the URL it printed. |
A single fact → a sentence. Executing the plan, not proposing it → this skill renders, it doesn't build. The reviewer only wants a diff → show the code.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub tomaspalsson/flow --plugin flow-extras20 skills in this plugin
/auditStage-gated parallel code audit for a whole codebase or module: recon → 6 parallel detection agents (correctness, security, performance, design, tests, style) → dedup + triage → user approval gate → fix planning → second approval gate → serialized apply with revert-on-failure → verification. Use for whole-codebase/module debt inventory, health checks, modernization, production-readiness sweeps, or quality audits. Triggers on: /audit, audit this codebase, audit repo, find tech debt, pay down debt, code health check, make production-ready, refactor everything, apply clean code, quality sweep. Do NOT use for: single-PR or branch review ≤10 files (use /pr-reviewer), one-file cleanup (use /simplify), bug fix (use /fix), feature work (use /flow:next), style-only formatting (run the formatter), or uncommitted-change review (use /review). Scope threshold: whole-codebase or whole-module only — not for incremental branch work./babysitDrive one open pull request, or several independent ones, toward merge-ready after flow ships a draft: fix failing CI and resolve merge conflicts. Use when asked to babysit a PR, get it green, fix the CI, resolve the conflicts, or check on one or more PRs. Modes: check (one read-only report) or drive (loop until CI is green and the PR merges clean, or a hard stop). Open review threads are reported and left to the user. Never merges and never marks a draft ready. Not for opening the PR (use /flow:next), not for reviewing someone else's PR (use /pr-reviewer), not for diagnosing a bug from scratch (use /flow:fix).