|
8 | 8 |
|
9 | 9 | [](LICENSE) |
10 | 10 |
|
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: |
| 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 | 12 |
|
13 | 13 | ``` |
14 | 14 | > draw a diagram of our authentication flow |
15 | 15 | > /diff-review |
16 | 16 | > /plan-review ~/docs/refactor-plan.md |
17 | 17 | ``` |
18 | 18 |
|
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 | 19 | https://github.com/user-attachments/assets/55ebc81b-8732-40f6-a4b1-7c3781aa96ec |
22 | 20 |
|
23 | 21 | ## Why |
24 | 22 |
|
25 | | -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. |
| 23 | +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. |
26 | 24 |
|
27 | 25 | 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. |
28 | 26 |
|
29 | | -## Install |
| 27 | +This skill fixes that. Real typography, dark/light themes, interactive Mermaid diagrams with zoom and pan. No build step, no dependencies beyond a browser. |
30 | 28 |
|
31 | | -### Pi |
| 29 | +## Install |
32 | 30 |
|
| 31 | +**Pi:** |
33 | 32 | ```bash |
34 | | -# Installs the skill and all slash commands in one step |
35 | 33 | pi install https://github.com/nicobailon/visual-explainer |
36 | 34 | ``` |
37 | 35 |
|
38 | | -If you prefer a manual install, clone the repo and copy the prompts: |
39 | | - |
40 | | -```bash |
41 | | -git clone https://github.com/nicobailon/visual-explainer.git ~/.pi/agent/skills/visual-explainer |
42 | | -mkdir -p ~/.pi/agent/prompts |
43 | | -cp ~/.pi/agent/skills/visual-explainer/prompts/*.md ~/.pi/agent/prompts/ |
44 | | -``` |
45 | | - |
46 | | -### Claude Code |
47 | | - |
48 | | -Clone the skill, then copy the prompt templates so they register as slash commands: |
49 | | - |
| 36 | +**Claude Code:** |
50 | 37 | ```bash |
51 | 38 | git clone https://github.com/nicobailon/visual-explainer.git ~/.claude/skills/visual-explainer |
52 | 39 | mkdir -p ~/.claude/commands |
53 | 40 | cp ~/.claude/skills/visual-explainer/prompts/*.md ~/.claude/commands/ |
54 | 41 | ``` |
55 | 42 |
|
56 | | -If you have [surf-cli](https://github.com/nicobailon/surf-cli) installed, the skill can also generate illustrations via Gemini and embed them in pages. The agent detects surf automatically and skips image generation if it's not there. |
57 | | - |
58 | | -## Usage |
59 | | - |
60 | | -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/`. |
61 | | - |
62 | | -The skill ships with seven prompt templates: |
| 43 | +## Commands |
63 | 44 |
|
64 | 45 | | Command | What it does | |
65 | 46 | |---------|-------------| |
66 | 47 | | `/generate-web-diagram` | Generate an HTML diagram for any topic | |
67 | 48 | | `/generate-visual-plan` | Generate a visual implementation plan for a feature or extension | |
68 | | -| `/generate-slides` | Generate a magazine-quality slide deck for any topic | |
69 | | -| `/diff-review` | Visual diff review with architecture comparison, code review, decision log | |
| 49 | +| `/generate-slides` | Generate a magazine-quality slide deck | |
| 50 | +| `/diff-review` | Visual diff review with architecture comparison and code review | |
70 | 51 | | `/plan-review` | Compare a plan against the codebase with risk assessment | |
71 | 52 | | `/project-recap` | Mental model snapshot for context-switching back to a project | |
72 | | -| `/fact-check` | Verify accuracy of a review page or plan doc against actual code | |
| 53 | +| `/fact-check` | Verify accuracy of a document against actual code | |
73 | 54 |
|
74 | | -https://github.com/user-attachments/assets/342d3558-5fcf-4fb2-bc03-f0dd5b9e35dc |
75 | | - |
76 | | -Any prompt that produces a scrollable page also supports a `--slides` flag to generate a slide deck instead: |
| 55 | +The agent 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. |
77 | 56 |
|
78 | | -``` |
79 | | -/diff-review --slides # slide deck version of a diff review |
80 | | -/project-recap --slides 2w # slide deck recap of last 2 weeks |
81 | | -``` |
| 57 | +## Slide Deck Mode |
82 | 58 |
|
83 | | -`/diff-review` is probably the most useful. Run it with no arguments to diff against `main`, or pass any git ref: |
| 59 | +Any command that produces a scrollable page supports `--slides` to generate a slide deck instead: |
84 | 60 |
|
85 | 61 | ``` |
86 | | -/diff-review # feature branch vs main (default) |
87 | | -/diff-review abc123 # single commit |
88 | | -/diff-review main..HEAD # committed changes only |
89 | | -/diff-review #42 # pull request |
| 62 | +/diff-review --slides |
| 63 | +/project-recap --slides 2w |
90 | 64 | ``` |
91 | 65 |
|
92 | | -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. |
93 | | - |
94 | | -`/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: |
95 | | - |
96 | | -``` |
97 | | -/plan-review ~/docs/refactor-plan.md |
98 | | -``` |
99 | | - |
100 | | -`/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. |
| 66 | +https://github.com/user-attachments/assets/342d3558-5fcf-4fb2-bc03-f0dd5b9e35dc |
101 | 67 |
|
102 | 68 | ## How It Works |
103 | 69 |
|
104 | 70 | ``` |
105 | 71 | SKILL.md (workflow + design principles) |
106 | 72 | ↓ |
107 | | -references/ ← agent reads before each generation |
108 | | -├── css-patterns.md (layouts, animations, theming, depth tiers) |
109 | | -├── libraries.md (Mermaid theming, Chart.js, anime.js, font pairings) |
110 | | -├── responsive-nav.md (sticky sidebar TOC for multi-section pages) |
111 | | -└── slide-patterns.md (slide engine, 10 slide types, transitions, presets) |
| 73 | +references/ ← agent reads before generating |
| 74 | +├── css-patterns.md (layouts, animations, theming) |
| 75 | +├── libraries.md (Mermaid, Chart.js, fonts) |
| 76 | +├── responsive-nav.md (sticky TOC for multi-section pages) |
| 77 | +└── slide-patterns.md (slide engine, transitions, presets) |
112 | 78 | ↓ |
113 | | -templates/ ← agent reads the matching reference template |
114 | | -├── architecture.html (CSS Grid cards — terracotta/sage palette) |
115 | | -├── mermaid-flowchart.html (Mermaid + ELK — teal/cyan palette) |
116 | | -├── data-table.html (tables with KPIs and badges — rose/cranberry palette) |
117 | | -└── slide-deck.html (viewport-fit slides — midnight editorial palette) |
| 79 | +templates/ ← reference templates with different palettes |
| 80 | +├── architecture.html |
| 81 | +├── mermaid-flowchart.html |
| 82 | +├── data-table.html |
| 83 | +└── slide-deck.html |
118 | 84 | ↓ |
119 | 85 | ~/.agent/diagrams/filename.html → opens in browser |
120 | 86 | ``` |
121 | 87 |
|
122 | | -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 four 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. |
123 | | - |
124 | | -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. |
| 88 | +The skill routes to the right approach automatically: Mermaid for flowcharts and diagrams, CSS Grid for architecture overviews, HTML tables for data, Chart.js for dashboards. |
125 | 89 |
|
126 | 90 | ## Limitations |
127 | 91 |
|
128 | | -- Requires a browser to view — no inline terminal rendering |
129 | | -- Switching OS theme requires a page refresh for Mermaid SVGs (CSS-styled elements respond instantly) |
130 | | -- Results vary by model capability — the skill provides design guidance, not pixel-perfect specs |
| 92 | +- Requires a browser to view |
| 93 | +- Switching OS theme requires a page refresh for Mermaid SVGs |
| 94 | +- Results vary by model capability |
131 | 95 |
|
132 | 96 | ## Credits |
133 | 97 |
|
134 | | -Borrows ideas from [Anthropic's frontend-design skill](https://github.com/anthropics/skills) and [interface-design](https://github.com/Dammyjay93/interface-design), adapted for one-shot diagram generation. |
| 98 | +Borrows ideas from [Anthropic's frontend-design skill](https://github.com/anthropics/skills) and [interface-design](https://github.com/Dammyjay93/interface-design). |
135 | 99 |
|
136 | 100 | ## License |
137 | 101 |
|
|
0 commit comments