How we went from 1,000-line AI-generated HTML to a 250-line YAML spec — and why that matters.
Asking AI to generate a slide deck in raw HTML is like asking it to hand-write assembly.
type: card, type: timelineOutput tokens are the expensive ones (5× cost of input). Anything the AI doesn't have to write saves both money and quality degradation from cognitive load.
A three-layer pipeline — the AI only touches the top layer.
Claude receives a topic + tight system prompt listing the component catalog. Outputs only valid YAML.
Declarative slide data — types, text, colors. No HTML, no CSS, no JS. Diffs cleanly in git.
Handlebars engine reads spec, dispatches to component templates, inlines theme CSS, emits one self-contained HTML file.
Fully styled, interactive, keyboard-navigable presentation. Zero runtime dependencies.
CSS variables, reset styles, nav JS, keyboard handlers, progress bar, Handlebars templates, grid layout, font imports, canvas chart JS, range-slider wiring.
Based on measured output from both presentations built so far.
| Metric | Raw HTML | YAML spec | Saving |
|---|---|---|---|
| Output lines | ~1,000 | ~250 | 75% |
| Output tokens (est.) | ~14,000 | ~2,800 | 80% |
| Cost at Sonnet rates | $0.21 | $0.04 | $0.17 |
| Thinking scope | Style + content | Content only | qualitative |
| Build time (AI step) | ~45s | ~12s | ~73% |
At 100 decks/month that's ~$17 saved in output tokens alone — but the bigger win is quality. A model thinking only about content writes better content.
The ~4,300 lines of framework code (builder, templates, CSS) are written once and reused across every deck at zero AI cost.
Every cell below is an actual rendered instance of that component type.
Accents, badges, symbols, analogy boxes, and meter bars in one component.
Highlights key information inline with a green left border.
Red variant signals caution.
Bridges technical concepts to familiar mental models from other engineering domains.
Vertical dot-connected steps for flows or histories.
Supports any number of items.
Dots auto-connect via CSS.
| Metric | Value |
|---|---|
| p99 latency | 3ms |
| uptime | 99.9% |
| error rate | 0.01% |
inline code in itemsBig numbers for metrics and KPIs:
fn_body JS is a sharp edgedark-minimal only in v0.1Prioritized by impact-to-effort ratio.
light-clean themequote component — large pull quote with attributionicon-row component — emoji/symbol + label gridsteps component — horizontal step flowimg component, base64 inlined)<aside>, toggled with n)pretty-slides export)neon-dark and corporate-light themespretty-slides add-theme / add-componentThe key design decision
The framework owns the visual layer permanently. The AI owns the content layer per deck. Neither intrudes on the other.
YAML in → HTML out. 80% fewer tokens, consistent design, two working decks.
PDF export, parallel generation, 3 themes, schema validation.
Web UI, plugin system, presenter mode, GitHub Actions CI.