Skip to content

Commit 52221d6

Browse files
committed
docs: rewrite README for clarity and conciseness
1 parent 707f573 commit 52221d6

File tree

2 files changed

+40
-122
lines changed

2 files changed

+40
-122
lines changed

README.md

Lines changed: 40 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -4,194 +4,112 @@
44

55
# visual-explainer
66

7-
**An agent skill + prompt templates that replace ASCII diagrams with beautiful, self-contained HTML pages — architecture overviews, flowcharts, diff reviews, data tables, and more.**
7+
**An agent skill that turns complex terminal output into styled HTML pages you actually want to read.**
88

99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](LICENSE)
1010

11+
Ask your agent to explain a system architecture, review a diff, or compare requirements against a plan. Instead of ASCII art and box-drawing tables, it generates a self-contained HTML page and opens it in your browser:
12+
1113
```
1214
> draw a diagram of our authentication flow
13-
14-
> visualize the database schema
15-
16-
> /diff-review main
15+
> /diff-review
16+
> /plan-review ~/docs/refactor-plan.md
1717
```
1818

19-
The agent builds a styled HTML page — CSS Grid layouts, Mermaid flowcharts, Google Fonts, dark/light themes, staggered animations — and opens it in your browser. One file, no build step, no dependencies.
19+
Each one produces a single `.html` file with real typography, dark/light theme support, and interactive Mermaid diagrams with zoom and pan. No build step, no dependencies beyond a browser.
20+
21+
https://github.com/user-attachments/assets/55ebc81b-8732-40f6-a4b1-7c3781aa96ec
2022

2123
## Why
2224

2325
Every coding agent defaults to ASCII art when you ask for a diagram. Box-drawing characters, monospace alignment hacks, text arrows. It works for trivial cases, but anything beyond a 3-box flowchart turns into an unreadable mess that nobody would put in a presentation or share with a team.
2426

25-
It gets worse with tables. Ask the agent to compare 15 requirements against a plan and you get a wall of pipes and dashes that wraps and breaks in the terminal. The data is there but it's painful to read.
26-
27-
This skill replaces all of that with real HTML pages that look like someone designed them — because the agent follows a design-aware workflow with reference templates, CSS patterns, and font pairings before generating each diagram.
27+
Tables are worse. Ask the agent to compare 15 requirements against a plan and you get a wall of pipes and dashes that wraps and breaks in the terminal. The data is there but it's painful to read.
2828

2929
## Install
3030

3131
The skill follows the [Agent Skills specification](https://agentskills.io/specification). Clone it into your agent's skills directory:
3232

33-
### Pi
34-
3533
```bash
34+
# Pi
3635
git clone https://github.com/nicobailon/visual-explainer.git ~/.pi/agent/skills/visual-explainer
37-
```
3836

39-
Restart Pi. The skill auto-discovers from the skills directory.
40-
41-
To get the slash commands (`/diff-review`, `/plan-review`, etc.), copy the prompt templates and install the [pi-prompt-template-model](https://github.com/nicobailon/pi-prompt-template-model) extension for skill auto-injection:
42-
43-
```bash
44-
cp ~/.pi/agent/skills/visual-explainer/prompts/*.md ~/.pi/agent/prompts/
45-
pi install npm:pi-prompt-template-model
46-
```
47-
48-
Without the extension the prompts still work as normal templates, but the agent won't get the skill auto-injected — it would need to discover and load it on its own.
49-
50-
### Claude Code
51-
52-
```bash
37+
# Claude Code
5338
git clone https://github.com/nicobailon/visual-explainer.git ~/.claude/skills/visual-explainer
54-
```
55-
56-
### Other agents
5739

58-
Any agent that supports the Agent Skills spec can load the skill by pointing at the directory containing `SKILL.md`. If your agent doesn't support auto-discovery, paste the contents of `SKILL.md` into your system prompt directly.
40+
# Other agents — point at the directory containing SKILL.md,
41+
# or paste its contents into your system prompt
42+
```
5943

60-
### Manual (no git)
44+
For Pi, restart after cloning. To get the slash commands (`/diff-review`, `/plan-review`, etc.), copy the prompt templates and install the [pi-prompt-template-model](https://github.com/nicobailon/pi-prompt-template-model) extension:
6145

6246
```bash
63-
mkdir -p ~/.agent/skills/visual-explainer
64-
curl -L https://github.com/nicobailon/visual-explainer/archive/refs/heads/main.tar.gz | \
65-
tar -xz --strip-components=1 -C ~/.agent/skills/visual-explainer
47+
cp ~/.pi/agent/skills/visual-explainer/prompts/*.md ~/.pi/agent/prompts/
48+
pi install npm:pi-prompt-template-model
6649
```
6750

68-
### Optional: AI-generated images
69-
70-
If you have [surf-cli](https://github.com/nicobailon/surf-cli) installed with its Chrome extension, the skill can generate illustrations via Gemini Nano Banana Pro and embed them in diagrams — hero banners, conceptual illustrations, educational diagrams. The agent checks for surf availability automatically and skips image generation gracefully if it's not installed. Everything else works without it.
51+
If you have [surf-cli](https://github.com/nicobailon/surf-cli) installed, the skill can also generate illustrations via Gemini Nano Banana Pro and embed them in pages. The agent detects surf automatically and skips image generation if it's not there.
7152

7253
## Usage
7354

74-
**Ask naturally.** The agent sees the skill description and loads it when you mention diagrams, architecture, flowcharts, schemas, or visualizations:
55+
The agent loads the skill when you mention diagrams, architecture, flowcharts, schemas, or visualizations. It also kicks in automatically when it's about to dump a complex table in the terminal (4+ rows or 3+ columns) — it renders HTML instead and opens it in the browser. Output goes to `~/.agent/diagrams/`.
7556

76-
```
77-
> draw a diagram of our authentication flow
78-
> visualize the database schema
79-
> create an architecture overview of the notification system
80-
```
81-
82-
**Proactive table rendering.** When the agent is about to render a complex ASCII table (4+ rows or 3+ columns), it generates a styled HTML table instead and opens it in the browser. Comparisons, audits, feature matrices, status reports — anything tabular gets the HTML treatment automatically.
83-
84-
**Force-load** if the agent doesn't pick it up on its own:
85-
86-
```
87-
> /skill:visual-explainer draw the microservices architecture
88-
```
89-
90-
Output goes to `~/.agent/diagrams/` and the result opens in your browser.
91-
92-
## Prompt Templates
93-
94-
The skill ships with five prompt templates that become slash commands in Pi:
57+
The skill ships with five prompt templates:
9558

9659
| Command | What it does |
9760
|---------|-------------|
9861
| `/generate-web-diagram` | Generate an HTML diagram for any topic |
99-
| `/diff-review` | Visual diff review — before/after architecture, KPI dashboard, code review, decision log |
100-
| `/plan-review` | Compare a plan against the codebase — current vs. planned architecture, risk assessment |
101-
| `/project-recap` | Visual snapshot for context-switching back to a project after days away |
102-
| `/fact-check` | Verify factual accuracy of a review page, plan doc, or spec against the actual code |
62+
| `/diff-review` | Visual diff review with architecture comparison, code review, decision log |
63+
| `/plan-review` | Compare a plan against the codebase with risk assessment |
64+
| `/project-recap` | Mental model snapshot for context-switching back to a project |
65+
| `/fact-check` | Verify accuracy of a review page or plan doc against actual code |
10366

104-
### `/diff-review`
105-
106-
Accepts any git ref. Generates architecture comparison, file map, structured Good/Bad/Ugly code review, decision log with confidence indicators, and re-entry context.
67+
`/diff-review` is probably the most useful. Run it with no arguments to diff against `main`, or pass any git ref:
10768

10869
```
109-
/diff-review main # feature branch vs main (default)
70+
/diff-review # feature branch vs main (default)
11071
/diff-review abc123 # single commit
11172
/diff-review main..HEAD # committed changes only
11273
/diff-review #42 # pull request
113-
/diff-review HEAD # uncommitted changes only
114-
```
115-
116-
### `/plan-review`
117-
118-
Compares a codebase against an implementation plan. Current vs. planned architecture diagrams, change-by-change breakdown, dependency analysis, risk assessment, and Good/Bad/Ugly review of the plan itself.
119-
120-
```
121-
/plan-review ~/docs/refactor-plan.md # plan + working directory
122-
/plan-review ~/docs/refactor-plan.md ./src # plan + explicit path
123-
```
124-
125-
### `/project-recap`
126-
127-
Mental model snapshot — architecture diagram, recent activity, decision log, working/broken/blocked dashboard, cognitive debt hotspots. Takes an optional time window:
128-
129-
```
130-
/project-recap # last 2 weeks (default)
131-
/project-recap 30d # last 30 days
13274
```
13375

134-
### `/fact-check`
76+
It generates a full page with before/after architecture diagrams, KPI dashboard, structured Good/Bad/Ugly code review, decision log with confidence indicators, and re-entry context for your future self.
13577

136-
Extracts every verifiable claim from a document (file references, function names, line counts, behavior descriptions), re-checks each against the actual code, corrects inaccuracies, and adds a verification summary:
78+
`/plan-review` does something similar but for implementation plans — pass it a plan file and it cross-references every claim against the actual codebase, produces current vs. planned architecture diagrams, and flags risks and gaps:
13779

13880
```
139-
/fact-check # most recent review page
140-
/fact-check ~/.agent/diagrams/diff-review.html # specific file
141-
/fact-check ~/Documents/docs/refactor-plan.md # plan doc
81+
/plan-review ~/docs/refactor-plan.md
14282
```
14383

144-
## Diagram Types
145-
146-
| Type | Rendering | When to use |
147-
|------|-----------|-------------|
148-
| Architecture (text-heavy) | CSS Grid cards + flow arrows | System overviews with rich descriptions |
149-
| Architecture (topology) | Mermaid | Service maps, connection diagrams |
150-
| Flowchart / Pipeline | Mermaid | CI/CD, data pipelines, processes |
151-
| Sequence | Mermaid | Service-to-service calls, request flows |
152-
| Data flow | Mermaid with edge labels | ETL, event streaming, message flows |
153-
| Schema / ER | Mermaid | Database schemas, entity relationships |
154-
| State machine | Mermaid | State transitions, decision trees |
155-
| Mind map | Mermaid | Hierarchical breakdowns, project structure |
156-
| Data table | HTML `<table>` | Comparisons, audits, feature matrices |
157-
| Timeline | CSS | Roadmaps, release history, project phases |
158-
| Dashboard | CSS Grid + Chart.js | Metrics overviews, KPI displays |
159-
160-
The agent picks the right rendering approach automatically. Mermaid handles anything with connections and automatic edge routing. CSS Grid handles text-heavy content where card descriptions matter more than topology. HTML tables handle structured data.
84+
`/project-recap` is designed for context-switching back to a project after days away. It scans recent git activity and produces an architecture snapshot, decision log, and cognitive debt hotspots. `/fact-check` takes any document that makes claims about code and verifies every one of them.
16185

16286
## How It Works
16387

16488
```
16589
SKILL.md (workflow + design principles)
16690
167-
references/ ← agent reads on-demand before each generation
91+
references/ ← agent reads before each generation
16892
├── css-patterns.md (layouts, animations, theming, depth tiers)
169-
├── libraries.md (Mermaid deep theming, Chart.js, anime.js, font pairings)
93+
├── libraries.md (Mermaid theming, Chart.js, anime.js, font pairings)
17094
└── responsive-nav.md (sticky sidebar TOC for multi-section pages)
17195
17296
templates/ ← agent reads the matching reference template
173-
├── architecture.html (CSS Grid cards with flow arrows — terracotta/sage palette)
174-
├── mermaid-flowchart.html (Mermaid + ELK + handDrawn mode — teal/cyan palette)
175-
└── data-table.html (tables with KPIs and status badges — rose/cranberry palette)
97+
├── architecture.html (CSS Grid cards — terracotta/sage palette)
98+
├── mermaid-flowchart.html (Mermaid + ELK + handDrawn — teal/cyan palette)
99+
└── data-table.html (tables with KPIs and badges — rose/cranberry palette)
176100
177101
~/.agent/diagrams/filename.html → opens in browser
178102
```
179103

180-
The agent follows a four-step workflow: pick an aesthetic direction (9 options — monochrome terminal, editorial, blueprint, neon, paper/ink, sketch, IDE-inspired, data-dense, gradient mesh), read the right reference template, generate a self-contained HTML file with both light and dark theme support, and open it. Each template uses a deliberately different color palette so the agent absorbs variety rather than a single look.
181-
182-
Every diagram is a single `.html` file with all styles inlined. The only external requests are Google Fonts and optional CDN libraries (Mermaid, Chart.js, anime.js). No build step, no npm, no bundler. Open it in any browser, send it to a colleague, drop it in a PR.
183-
184-
## Customization
104+
The agent picks an aesthetic direction, reads the right reference template, generates a self-contained HTML file with both light and dark themes, and opens it. The three templates use deliberately different palettes so the agent learns variety rather than defaulting to one look. The skill handles 11 diagram types — Mermaid for anything with connections (flowcharts, sequences, ER, state machines, mind maps), CSS Grid for text-heavy architecture overviews, HTML tables for data, Chart.js for dashboards — and routes to the right approach automatically.
185105

186-
Output directory and browser command are in `SKILL.md` under the "Deliver" section — edit to match your setup. To add diagram types, aesthetic directions, or CSS patterns, edit the respective files. The agent reads them fresh each time, so changes take effect immediately (unless you modify the frontmatter `description`, which needs a Pi restart for re-indexing).
106+
To customize the output directory, browser command, or add your own diagram types and CSS patterns, edit the files directly. The agent reads them fresh each time.
187107

188108
## Limitations
189109

190-
- Diagrams require a browser to view — no inline terminal rendering
191-
- Mermaid diagrams initialize once at page load; switching OS theme requires a refresh for the Mermaid SVG (CSS-styled elements respond instantly)
192-
- Google Fonts need an internet connection on first load (system font fallbacks are included)
193-
- Very complex Mermaid diagrams (50+ nodes) may need the ELK layout engine for clean edge routing, which adds CDN weight
194-
- The agent picks aesthetics based on skill guidance, not pixel-perfect design specs — results vary by model capability
110+
- Requires a browser to view — no inline terminal rendering
111+
- Switching OS theme requires a page refresh for Mermaid SVGs (CSS-styled elements respond instantly)
112+
- Results vary by model capability — the skill provides design guidance, not pixel-perfect specs
195113

196114
## Credits
197115

banner.png

-140 KB
Loading

0 commit comments

Comments
 (0)