There is a particular kind of prompt that an engineer eventually asks an agent and then stops recognizing the actual response. “Explain the TCP three-way handshake.” “How are the files in this repo organized?” “Redis or Memcached for the cache?” You ask a real question, the model thinks for ten seconds, and what lands in your terminal is a wall of paragraphs that explains everything and changes nothing you can act on. You scroll past it, you ask the agent to “show me this as a diagram,” and you get a Mermaid block whose arrows point at the wrong boxes. The hard part was never the answer — the answer is in the training data — the hard part was rendering it so a human could read it three seconds after the agent did.
QingYunA/answer-me-with-html is a small Node 20 CLI plus a Claude Code / Codex / Cursor / OpenCode / Pi / DeepSeek Harness skill that takes the rendering work out of the model and into the CLI. The model writes a short Markdown draft. The CLI picks the template, lays out the panels, applies the theme, computes SVG coordinates, draws the flow charts with dagre, and emits a single .html page — one you can open offline, copy the Markdown source back from, and send to someone else. The published benchmark corpus puts the model’s share of the bytes at 612 tokens on average, against 4,893 for a hand-written HTML page that does the same job. The CLI writes the other 4,281. Eight times fewer tokens, two-and-a-half times faster, and fifteen percent cheaper when the prompt cache is warm. The corpus is fixed, the numbers are reproducible from node bench/corpus.mjs, and every page that ships with the skill is in the release download.
The interesting thing is not the speedup — the interesting thing is the contract. The skill tells the agent exactly what to write (a Markdown draft with frontmatter, ## Panel title {span=2}, fenced component blocks for flow, sequence, er, tree, timeline, and so on) and refuses to let the agent write what it should not (raw HTML, raw SVG, raw CSS, full-page boilerplate). Every component has a kind=good fit check; shape that the renderer knows how to lay out, and the renderer complains with the line number and a correct example when the draft has an error. The agent fixes the error in one turn. The page that comes back is one the model would not have produced on its own, not because the model is not capable, but because the cost of producing it inline was bad.
The bet, in one sentence
An agent that has to render a page should not also be doing the rendering. The skill separates content from layout: the model writes what to say, the CLI decides how it looks, the page is what comes out.
What’s actually hard about HTML pages
Three problems make HTML rendering expensive, and the tool that fixes them has to fix them structurally — not by adding more tokens, but by moving tokens out of the model entirely.
- Boilerplate share. A hand-written HTML page is mostly not content. The corpus run measured 4,893 output tokens per page on average for nine questions (TCP three-way handshake, Redis vs Memcached, git merge vs rebase, each run three times on Claude Sonnet 5.5, dated 2026-10-07). Of those 4,893 tokens: SVG coordinates and paths were 47% (20,716 tokens across the nine HTML pages, averaged into 2,302 per page), CSS was 15% (6,498 across, 722 per page), HTML tags were 17%, and the prose the user actually wanted was 21% (9,467 across, 1,052 per page). The model is writing five times more boilerplate than content, in a kind of artifact where boilerplate is the part that should be the same every time.
- Diagram coordinates. SVG flow charts have to lay out nodes, route edges, and avoid overlap. The model can do this by hand for a five-node graph, and the arrows usually point at the right boxes. For a thirty-node architecture map, the model has to compute viewBox coordinates, label widths, edge crossings, and arrowhead positions for every node and every edge. The output is almost always wrong somewhere, and “wrong” here is silent: the arrow lands on the wrong box and the user accepts the diagram because redrawing it would take another thirty seconds. dagre (the same layout library that powers Mermaid’s
flowchartengine) does this in milliseconds, and gives the same answer every time for the same input. The model does not get to use dagre — the model just writes SVG. - Theme drift. A page that the model writes inline has whatever theme the model happens to write for that prompt. A page that the CLI renders has the same theme for every page, because the renderer’s templates are version-controlled. The skill ships three themes (
blueprint,shadcn,paper); the CLI pickspaperfor long text andblueprintfor diagrams by default. Every page in the corpus uses the same theme because the renderer decided it.
The skill’s answer is the Markdown draft format. The agent writes a YAML frontmatter block, a sequence of ## Panel title sections, fenced code blocks whose language is a component name (flow LR, sequence num, er, tree, timeline, flow LR, limits), and optional raw html or svg blocks for things the components cannot express. The CLI parses it, validates it (sentence length, plain words, passive voice, common Chinese typos and vague words — adapted from ASD-STE100 aircraft-maintenance-manual English; warns by default, fails in strict mode), and renders it. The agent never gets near the toolbar.
The mechanism, in one CLI invocation
The end-to-end path is:
am render < draft.md > page.html
or, from inside a Claude Code / Codex / Cursor / OpenCode / Pi / DeepSeek Harness agent:
> Explain the TCP three-way handshake
The agent writes a short Markdown draft like:
---
title: TCP three-way handshake
---
## A Three-way handshake {span=2}
```sequence num
Client -> Server: SYN, seq=x
Server -> Client: SYN+ACK, seq=y, ack=x+1
Client -> Server: ACK, ack=y+1
note Client, Server: ESTABLISHED
```
## C State changes {span=2}
```flow LR
(CLOSED) -> LISTEN: passive open
LISTEN -> SYN_RCVD: get SYN / send SYN+ACK
SYN_RCVD -> *ESTABLISHED: get ACK
```
and hands it to the bundled CLI. About 50 ms later the page is at ~/.answer-me-with-html/pages/ and the browser opens it (or it does not, with --no-open). The same flow with the agent’s standard Write tool and a am video invocation produces a 3Blue1Brown-style narrated explainer video with scene morphs, camera focus, and a chapter strip, all from the same draft format.
What the benchmark actually shows
The published corpus is fixed, the methodology is in bench/README.md, and the numbers come from claude -p --output-format json: modelUsage.outputTokens, duration_ms, and total_cost_usd. Each row is the median of three paired runs.
The plain-setup run (Claude Code with project settings only, no MCP servers, skill installed in the work folder, ~25,000 tokens of context per turn):
| Topic | Output tokens | Time | Cost per answer |
|---|---|---|---|
| TCP handshake & teardown | 5,399 → 1,120 (4.8×) | 32 s → 13 s (2.4×) | $0.098 → $0.079 |
| Redis vs Memcached | 4,536 → 979 (4.6×) | 29 s → 12 s (2.5×) | $0.086 → $0.077 |
| git merge vs rebase | 4,861 → 922 (5.3×) | 31 s → 11 s (2.8×) | $0.090 → $0.076 |
| Average | 4,932 → 1,007 (4.9×) | 31 s → 12 s (2.6×) | $0.091 → $0.077 (15% less) |
The loaded-setup run (the author’s own Claude Code with many plugins, rules, and skills, ~86,000 tokens of context per turn):
| Topic | Output tokens | Time | Cost per answer |
|---|---|---|---|
| TCP handshake & teardown | 8,194 → 1,149 (7.1×) | 52 s → 14 s (3.6×) | $0.165 → $0.119 |
| Redis vs Memcached | 8,146 → 1,031 (7.9×) | 54 s → 14 s (3.8×) | $0.194 → $0.147 |
| git merge vs rebase | 6,627 → 1,031 (6.4×) | 45 s → 14 s (3.1×) | $0.301 → $0.147 |
| Average | 7,656 → 1,070 (7.2×) | 50 s → 14 s (3.5×) | $0.220 → $0.138 (37% less) |
The plain-setup pages use 4.9× fewer output tokens and the loaded-setup pages use 7.2× fewer. The loaded-setup cost drops further (37% versus 15%) because in the loaded setup the cache read dominates the bill, and the skill’s output never invalidates the cached context. The video benchmark (one topic, five runs, no voice) measured 27,839 → 1,566 output tokens (17.8×) and 202 s → 17 s (11.8×). The skill was cheaper in 8 of 9 paired runs in the loaded setup, and in all 9 paired runs in the plain setup. Raw rows are in bench/results/lean/results.json and bench/results/results.json.
Why the cost drop lags the token drop
A first reaction is “8× fewer tokens should be 8× cheaper.” It is not, because output is only part of the bill. Split by Claude Sonnet 5.5 pricing (output $10/M, cache read $0.20/M, cache write $4/M plain / $2.50/M loaded), the average plain-setup answer costs:
| Ask for HTML directly | Answer me with HTML | Difference | |
|---|---|---|---|
| Output | 5,097 tokens · $0.051 (55%) | 1,123 tokens · $0.011 | −$0.040 |
| Cache write | 7,919 tokens · $0.032 | 12,361 tokens · $0.049 | +$0.018 |
| Cache read | 49,627 tokens · $0.010 | 95,456 tokens · $0.019 | +$0.009 |
| Other input | 960 tokens · $0.001 | 954 tokens · $0.001 | 0 |
| Total | $0.093 | $0.081 | −14% |
Output is 55% of the plain bill. If the skill wrote zero output tokens, the theoretical ceiling on the saving is 55%. The skill’s actual saving is 14% in the plain setup and 37% in the loaded setup, because the loaded setup’s bill is mostly cache reads, and the cache reads grow less than the output shrinks (the skill reads the same context four times instead of two — two extra cache reads at $0.20/M is about a cent). In one run the cache missed entirely (7 of 18 runs), and the whole context was rewritten: those runs cost $0.28 to $0.54. With a warm cache the skill is consistently cheaper.
The README is honest about this. “Output is 55% of the plain answer. If the skill wrote zero output tokens, it could still save at most 55%.” This is the kind of caveat that the project’s own benchmark README leads with — the bill is the hard part of the trade, and the cache write went up because the SKILL.md is about 4,000 tokens and has to live in the cache. A shorter SKILL.md cut the skill’s cost from $0.083 to $0.077 in the plain setup; the pages stayed the same kind.
The 25 releases in 11 days, and what shipped
The project shipped 25 releases between Oct 2 (v0.4.0) and Oct 12 (v0.5.2). The cadence is unusual: v0.4.0 on Oct 2, v0.4.3 on Oct 3, v0.4.4 on Oct 4, six releases on Oct 5–6, four more on Oct 7–8, then v0.5.0 on Oct 9 (the major bump), four releases on Oct 10–11, and v0.5.1 and v0.5.2 on Oct 12. Reading the changelogs gives a clearer picture than reading the README about what the project actually moves on. Three changes stand out:
- The compact MCP input schema (
REA_MCP_INPUT_SCHEMA_PROFILE=compact, shipped in v0.4.x). Size-capped MCP clients (Kimi / Moonshot, anything that truncates tool definitions to fit a small budget) now get a compressed schema while the canonical schema is retained for runtime validation. This matters because the skill’s MCP manifest is large — twelve components, multiple themes, multiple export modes — and the same manifest had to fit in clients with a 1,000-token tool-definition budget. The compact mode is for the wire, the canonical mode is for the validator. The two stay in sync because the wire format is generated from the canonical format at build time. - Pi, Hermes, and Qwen Code setups (v0.4.x → v0.5.0). The skill used to install via
/plugin marketplace addfor Claude Code andnpx skills addfor Codex / Cursor / OpenCode / DeepSeek Harness. Pi, Hermes, and Qwen Code are added in 0.5.0, and Hermes active-profile support is recognized (Hermes runs different skills under different profiles; the install now follows the active profile, not the default). The cross-agent surface is the reason the skill is built on top of vercel-labs/skills, which supports more than 70 agents — the agent list is the install’s responsibility, not the skill’s. - Always-on mode (recommended, off by default). A single line in the agent’s rules file turns every conclusion into a page. When the agent gives a summary, a plan, a comparison, a review, or an explanation — even a short one — it also makes a 2-to-4-panel page, puts the link at the end of the reply, and skips casual chat. The pages never pop open by default, so they do not interrupt. The configuration is one rule in
~/.claude/CLAUDE.mdorAGENTS.md, and the recommendation is to leave it on: “you stop asking for pages, and short answers read as well as long ones.” Pages pile up in~/.answer-me-with-html/; clear witham clean.
The cadence (25 releases in 11 days) reads as maintainer-driven early commits, which is consistent with the cordis.patch.yml file in the repo root (the project is also a DeepSeek Harness plugin via dsh plugin --profile web add github:QingYunA/answer-me-with-html).
Trade-offs and what it does not fix
Three honest limits, in order of operational impact.
1. The token savings depend on what kind of page you ask for. Pages that are mostly prose with one small diagram do not save as much as pages that are mostly diagrams with one paragraph. The corpus is nine pages, three topics, all of which are diagram-heavy by design. A summary, a planning a code change, a comparison of two libraries without diagrams — the savings are smaller because there is less SVG coordinate work for the CLI to take over. The CLI still does the layout and the theme work, but the SVG savings are smaller.
2. The skill is one renderer. It does one thing (Markdown draft → single .html page with text, tables, components, real code from your files). Archify does one diagram of one system, to render it to PNG/SVG/WebM and explore the focus / route-tracing controls. dsh-genui does 30+ components inside the DeepSeek Harness chat reply, with buttons and forms and quizzes. The skill’s docs/compare.md is candid about this: “Archify when you want one diagram of a system. dsh-genui when you work in the DeepSeek Harness web UI and want a live tool in the chat. Answer me with HTML when you work in a terminal agent and want the whole answer as one page.” The three tools do different jobs; the skill’s job is the page, not the diagram.
3. The skill does not control its own prompt cache. The bench/README.md is honest about this — the loaded-setup cost depends on the prompt cache, and the cache sometimes misses. In 7 of 18 loaded-setup runs (4 plain, 3 skill) the cache missed, the whole context was rewritten, and the run cost $0.28 to $0.54. The skill does not know when this will happen, and the cache state is invisible to the skill. A warm cache cuts the cost; a cold cache wipes out the saving. The author notes that an earlier 2026-10-02 run measured the skill about 20% more expensive in the loaded setup; it did not record cache tokens, so it could not tell how many runs missed the cache. The benchmark that ships today records cache tokens, which is the only way to know what is going on.
The reference digest this post would be saved as, if any future cron touched this lane: the bench/results/ JSON files, the bench/corpus/tokens.json file, and the docs/reference.md file (24 KB of component syntax and edge cases). The corpus and the token counts do not change. The setup cost drops and rises with the model and the cache; the ratios stay roughly the same across model swaps, because the model writes the same kind of content either way.
Comments
Powered by GitHub Discussions via Giscus. Sign in with GitHub to leave a comment.