Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Use `/sidenote <the thought>` to park one, or `/sidenote` to see what's parked.

Ask an agent to explain how something works and you get paragraphs. Ask it to *draw* the thing and you get comprehension — a call tree, a component tree, a sequence diagram. But a diagram is also the easiest place in the world to launder a guess: prose hedges out loud (*"it probably calls…"*), while boxes and arrows just assert. An architecture diagram drawn from priors reads as **verified**, and people build on it for weeks.

[`skills/visualize/SKILL.md`](./skills/visualize/SKILL.md) is the §7 rule applied to pictures. It gives the agent a menu of visual forms — pseudocode, call tree, component tree, file tree, text sequence diagrams, shaped `diff`s, or one focused HTML file — and tells it to pick the *smallest* one that makes the point, **matched to the surface it lands on**: a terminal has no diagram renderer, so a `mermaid` fence there just prints its own source; the text forms are the picture already. Mermaid is reserved for surfaces that actually render it. Then the Greybeard part: **read the code before drawing it** (the actual files, this session — if the diagram has five nodes, you opened five things), **anchor every node** to a real `file:line`, **trace the current shape with the real input** (an anchor proves the node exists, not that the arrow fires — if the concrete key dead-ends in the registry, the dead end is the picture), and **tag anything unread as ASSUMED** with the check that would settle it. A diagram that's 90% verified and 10% quietly invented is 100% untrustworthy.
[`skills/visualize/SKILL.md`](./skills/visualize/SKILL.md) is the §7 rule applied to pictures. It gives the agent a menu of visual forms — pseudocode, call tree, component tree, file tree, text sequence diagrams, shaped `diff`s, or one focused HTML file — and tells it to pick the *smallest* one that makes the point, **matched to the surface it lands on**: a terminal has no diagram renderer, so a `mermaid` fence there just prints its own source; the text forms are the picture already. Mermaid is reserved for surfaces that actually render it. Those forms are the floor: before settling on one, the agent checks what the current harness can render with, such as an artifact or page tool, and what drawing guidance it offers, such as a diagramming or charting skill. When the question needs more than text, it draws there and follows that guidance. The anchors and ASSUMED tags go on the rendered nodes, and a renderer that uploads counts as publishing. Then the Greybeard part: **read the code before drawing it** (the actual files, this session — if the diagram has five nodes, you opened five things), **anchor every node** to a real `file:line`, **trace the current shape with the real input** (an anchor proves the node exists, not that the arrow fires — if the concrete key dead-ends in the registry, the dead end is the picture), and **tag anything unread as ASSUMED** with the check that would settle it. A diagram that's 90% verified and 10% quietly invented is 100% untrustworthy.

Use `/visualize <what to draw>`, or a bare `/visualize` to draw whatever's currently on the table.

Expand Down
15 changes: 13 additions & 2 deletions skills/visualize/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Use one, sometimes a few, rarely all. Match the form to the question being asked

**Check the surface before you pick.** A terminal has no diagram renderer: a `mermaid` fence there prints its own source code, which is strictly worse than the plain-text form it replaced. So in a terminal (Claude Code, a shell, a plain log) every form below must be *text that is already the picture* — trees, indentation, box-drawing characters. Reach for Mermaid only when the output lands somewhere that actually renders it: a published artifact, a `.md` file read on GitHub, the desktop or web app. When in doubt, assume it won't render and draw it as text.

**Then check what this session can render with.** The forms below are the floor, not the ceiling. The harness you're running in may already have a better way to show a picture than anything this skill can hand-roll. Look at the tools and skills it actually gave you this session, including tools listed only by name until you load them, not the ones harnesses usually ship. You're looking for two things. First, anything that renders: a page or artifact publisher (an `Artifact` tool, a board's `show_page`), a document tool with diagram blocks, or a whiteboard or design connector. Second, any guidance on drawing well there: a diagramming or charting skill (`artifact-diagramming`, `dataviz`), or the rendering notes in a tool's own description. What you find feeds the pick below; it doesn't make it. When the question needs more than text can carry (a dense flow, a state comparison, a chart, a UI), a renderer the harness provides beats a hand-rolled file, because it shows the picture where this harness shows things to the user.

- **The question picks the form; the renderer only draws it.** A call tree that answers the question is still a call tree, even when an artifact tool is one call away. Use a renderer only when the form you chose needs one.
- **If several renderers qualify, use the one that reaches the user where they're looking**, and prefer one the harness's own instructions name for showing things.
- **Load the drawing guidance for that renderer, if there is any, and follow its mechanics**: format, theming, size limits. Guidance written for one page tool may still cover another HTML page, so check what it says it applies to. This skill decides *what* goes in the picture; that guidance decides *how* it renders there.
- **The grounding rules travel with the picture.** The `file:line` anchors and `ASSUMED` tags go on the rendered nodes, not only in the chat reply. A polished render looks even more verified than a text tree, so it needs the tags more.
- **Uploading is publishing.** A renderer that hosts the page or sends it to a service takes the code you drew off the machine. Follow that tool's own rules on when it may be used and when it may publish. If they say nothing and the repo is private, ask first.
- **Running as a subagent, hand the picture back.** Your reply goes to the agent that spawned you, and a user-facing renderer may replace what that agent is showing. Return the text form or a file path, unless that agent asked you to render it.

If nothing in the session renders, or you can't tell, the forms below are complete on their own.

- **Logic or an algorithm** — pseudocode:

```text
Expand Down Expand Up @@ -102,7 +113,7 @@ Use one, sometimes a few, rarely all. Match the form to the question being asked
}
```

- **One focused HTML file** — for a visual UI, a layout, a state comparison, or a concept too dense for Mermaid: a diagram, an infographic, or a short slide deck, whichever fits. Match the product's real colors, type, spacing, and components; use real labels and real data. Then open it:
- **One focused HTML file** — for a visual UI, a layout, a state comparison, or a concept too dense for Mermaid: a diagram, an infographic, or a short slide deck, whichever fits. Match the product's real colors, type, spacing, and components; use real labels and real data. Show it through the renderer picked above, if there is one. Otherwise, write the file and open it locally:

```
Bash(open path/to/visualize-{description}.html)
Expand All @@ -112,4 +123,4 @@ Use one, sometimes a few, rarely all. Match the form to the question being asked

Place each visual next to the short text it supports. Keep only the calls, files, props, states, and boundaries needed to answer the question actually being asked — an exhaustive diagram is a refusal to decide what matters. Prune every node that doesn't earn its place, then say what you left out.

Close with the anchors: the `file:line` list behind the drawing, and any `ASSUMED` node with the one check that would settle it.
Close with the anchors: the `file:line` list behind the drawing, and any `ASSUMED` node with the one check that would settle it. If the picture went to a renderer, the reply still says where it landed (a link, a path, or the panel it's on), along with the short text and the anchors, so a reader who never opens it still gets the answer.
Loading