Generate visual explanations, diagrams, and architecture visualizations.
Generate ASCII diagrams, Mermaid charts, and visual explanations for code and architecture.
/sl:preview --explain <topic> # ASCII + Mermaid + prose
/sl:preview --diagram <topic> # Architecture/data flow (Mermaid)
/sl:preview --ascii <topic> # Terminal-friendly ASCII only
No args or no mode: use AskUserQuestion with mode options.
| Mode | Output | Browser Required |
|---|---|---|
--explain | ASCII art + Mermaid diagram + prose explanation | Optional |
--diagram | Mermaid diagram (architecture, data flow, sequence) | Yes (for render) |
--ascii| Terminal-friendly ASCII art only |
| No |
Extract:
If topic references codebase concepts, run quick Grep / Glob to understand actual structure.
If topic references code patterns or architecture:
sl ast search for structural patternssl lsp references for dependency mappingASCII mode:
┌──────────┐ ┌──────────┐
│ Client │────▶│ Server │
└──────────┘ └─────┬────┘
│
┌─────▼────┐
│ Database │
└──────────┘
Diagram mode (Mermaid v11):
graph TD
A[Client] --> B[Server]
B --> C[Database]
Explain mode: Combine ASCII + Mermaid + prose walkthrough.
Save to:
{plan-dir}/visuals/{slug}.mdplans/visuals/{slug}.mdSlug: lowercase topic, replace spaces with hyphens, max 80 chars.
Output inline for terminal display. For Mermaid diagrams, also save the .md file for browser rendering.
sl ast search and sl lsp references for accurate code structure visualization