visual-doc
Skill8 starsChanged 4 months agoMITView on GitHub
Use when the user asks to turn a spec, plan, or design markdown into a self-contained, visually readable HTML document grounded in the real codebase — with diagrams, a file tree, annotated code, and open questions. The general-purpose illustrated-doc renderer (for an approval-focused design spec use visual-spec; for a code change use visual-recap).
- Installs packages
In this repository5 other files it gives its agents.
- atlas-reviewSkill
- quizSkill
- visual-atlasSkill
- visual-recapSkill
- visual-specSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Required language guide: Before writing user-facing text, read $VISUAL_SKILLS_DIR/skills/shared/plain-language.md.
- Distinctive: line 25
Ground it in the real repo: use real file paths and real identifiers from the target codebase (e.g.
- Very specific: line 125
Keep d2 valid: quote keys/values with dots (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Visual Doc
Turn a spec/plan into a single self-contained, hand-drawn-styled HTML document by authoring a typed block array and rendering it. Unlike the recap (which is automatic), you compose the blocks — so ground every reference in the real repo.
Tool location (resolved through the installer's ~/.claude/visual-skills symlink — re-run npm run skills:install if the repo moves):
VISUAL_SKILLS_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/visual-skills"Required language guide. Before writing user-facing text, read
$VISUAL_SKILLS_DIR/skills/shared/plain-language.md. Apply it to every authored field and live
reply.
Steps
- Read the source spec/plan (the file the user names, or the plan already in context).
- Read the authoritative schema:
$VISUAL_SKILLS_DIR/src/blocks.ts. It defines theBlockunion — treat it as the source of truth for field names and shapes. - Ground it in the real repo: use real file paths and real identifiers from the target codebase (e.g. model names, route/procedure names, exported symbols). Do not invent identifiers.
- Author a
Block[]JSON array using the mapping below. Render it from the tool directory:
cd "$VISUAL_SKILLS_DIR" npx tsx bin/doc.ts --blocks <ABSOLUTE_BLOCKS_JSON> --title "<Title>" \ --source "<source path or label>" --out <ABSOLUTE_OUT_DIR>--outis a directory (e.g.<repo>/.visual/docs/<label>, absolute path); the HTML (doc.html) and any.excalidrawsidecars are written together inside it. Diagrams render as static D2 by default and stay that way unless you opt in: pass--excalidrawto promote editable-eligible diagrams to.excalidrawscenes (requires thenpm run setup:excalidrawtoolchain). Without the flag — or with--no-excalidraw— you get the static D2 floor.- Open it:
open <ABSOLUTE_OUT_DIR>/doc.html(macOS), else report the path.
Content -> block mapping
For diagram selection (which structural / boundary / data-flow / behavioral diagram to use) and
compile-tested recipes, consult the shared catalog: $VISUAL_SKILLS_DIR/skills/shared/diagrams.md.
Color diagrams with the catalog's semantic palette (the "Color vocabulary" section) — mark the
changed/subject node and tag actors / external systems / datastores by role.
Primary blocks you author for a doc:
narrative / sections ->
prose(Markdown; GitHub-flavored). A fencedmermaidflowchart inside prose is auto-promoted to a diagram (and becomes editable if the Excalidraw upgrade is installed).{ "type": "prose", "id": "overview", "markdown": "## Overview\n\nWhat & why..." }architecture / flow ->
diagram—d2is required (the rendering floor); addmermaidfor the editable upgrade onflowchart/architecturekinds. Quote any d2 key/value containing a dot or space.{ "type": "diagram", "id": "flow", "title": "Request flow", "kind": "flowchart", "d2": "direction: down\n\"client\" -> \"api\" -> \"db\"", "mermaid": "graph TD\nclient-->api-->db" }affected / new files ->
file-tree—statusis one ofA/M/D/R.{ "type": "file-tree", "id": "files", "title": "Files", "files": [ { "path": "src/server/routers/league.ts", "status": "M", "added": 20, "deleted": 4 } ] }key code to explain ->
annotated-code— per-line notes; use for the 2-3 most important snippets, not everything.lineis 1-based.{ "type": "annotated-code", "id": "capture", "title": "captureOrder", "lang": "ts", "code": "const order = await paypal.capture(id);\nreturn order;", "annotations": [ { "line": 1, "note": "server-side capture" } ] }open decisions ->
questions{ "type": "questions", "id": "open", "title": "Open questions", "questions": [ { "question": "Refund window?", "recommendedDefault": "30 days" } ] }- grouping ->
group— a titled, collapsible set of related blocks; add an optionaldescription(markdown) summarizing what the group covers. Shape:{ "type":"group", "id":"…", "title":"…", "blocks":[ … ] }(one level deep). Used mainly by recaps to order diffs into a narrative; available for any doc too. multiple views of one thing ->
tabs— a CSS-only tab switcher (no JS) presenting complementary diagrams as switchable panels. Each tab holds ONE block, one level deep (a tab may not contain agroupor anothertabs).{ "type": "tabs", "id": "views", "title": "Two views", "tabs": [ { "label": "Flow", "block": { "type": "diagram", "id": "v-flow", "title": "Flow", "kind": "flowchart", "d2": "a -> b" } }, { "label": "Seq", "block": { "type": "diagram", "id": "v-seq", "title": "Seq", "kind": "sequence", "d2": "shape: sequence_diagram\na -> b: hi" } } ] }lead summary ->
overview— a scannable callout placed first: a one-lineheadline, shortpoints(eachhreflinking to a section by#id), and an optional leaddiagram(DiagramBlockortabs) rendered before the points. Author it for larger docs.{ "type": "overview", "id": "overview", "headline": "Add PayPal capture", "points": [ { "text": "new `capture` [route](#flow)" } ], "diagram": { "type": "diagram", "id": "ov-flow", "title": "Flow", "kind": "flowchart", "d2": "a -> b" } }worked instance ->
example— a real input walked through stages to its output (source+lessonrequired; static rail by default,"reveal"/"step"for volume,variant:"contrast"for old-vs-new). Seeskills/shared/spec-components.mdfor the full recipe.{ "type": "example", "id": "ex-capture", "title": "Capturing an authorized order", "source": "test/fixtures/orders/authorized.json", "stages": [ { "label": "Input", "kind": "input", "body": "…" }, { "label": "Output", "kind": "output", "body": "…" } ], "lesson": "Capture is idempotent — replaying it twice charges once." }
When to add an example: any transformation or algorithm the doc explains gets one worked instance — don't just describe the mechanism in prose, show one real case going through it.
Other block types in the Block union — schema, api, diff — are normally produced
automatically by the visual-recap flow from a real git diff, not hand-authored. Reach
for visual-recap when the subject is a code change rather than a plan.
Notes
- Block
ids must be unique across the document. - Keep d2 valid: quote keys/values with dots (e.g.
"league.captureOrder"). If d2 fails to compile, that block renders a visible placeholder rather than breaking the document. - Diagrams need
d2on PATH (brew install d2); without it they show placeholders.
Example
cd "$VISUAL_SKILLS_DIR"
npx tsx bin/doc.ts --blocks /tmp/doc-blocks.json --title "Payments migration" \
--source docs/specs/payments.md --out /Users/me/Projects/app/.visual/docs/payments
open /Users/me/Projects/app/.visual/docs/payments/doc.htmlDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

