answer-me-with-html: The Compiler That Turns Agent Output Into a Page

Instead of asking an LLM to write a giant blob of HTML, this project has it write a tight draft and lets a local CLI assemble the diagrams, styling, linting, and interactivity.

8 min read • View on GitHub • More from QingYunA

A small handwritten draft sits on a desk and feeds into a mechanical print shop. On the other side, a finished single-page explainer emerges with clean panels, diagrams, and a tidy page structure. The image explains the repo’s core idea: the model writes intent, while local tooling does the expensive visual work.
The model supplies the draft. The CLI supplies the page.
Key Takeaways

The best way to understand answer-me-with-html is as a visual compiler for agent output. The LLM does not need to become a frontend engineer. It only needs to emit a compact draft, and the local toolchain turns that draft into a readable single-file page.

The model writes a short Markdown draft; a bundled CLI handles layout, auto-laid-out diagrams and a controlled-English writing check. Measured: 7.4× fewer output tokens and 3.6× faster than asking for HTML directly.

Cyan, Author / Maintainer · QingYunA (Cyan) GitHub Profile

The Agent Writes Less, the Page Does More

That shift matters because the expensive part of an explainer is not the text itself. It is the structure around the text: layout, diagrams, theme, captions, and the small bits of runtime behavior that make the page usable offline. This repo moves that burden out of the prompt and into code.

The result is a more deterministic workflow. Instead of hoping a model emits clean HTML and consistent SVG, the agent produces a small directive set. The CLI then renders the page with rules the model does not have to invent from scratch.

Why Token Efficiency Changes the Game

ApproachWhat the model writesWhat the local tool doesWhy it matters
Direct HTML generationLong HTML, CSS, SVG, and copyVery littleHigh token cost and more room for formatting drift
answer-me-with-htmlShort draft plus component directivesLayout, diagrams, linting, theming, and assemblyLess output, faster responses, easier auditing
Classic deck toolSlides and presenter framingMostly rendering and exportGood for presentations, not optimized for compact technical explainers
A close-up split scene shows a thick stack of verbose output on one side and a slim drafted note on the other. The slim note passes through a set of gears and becomes a finished page. The image explains that the project saves tokens by moving presentation work into local tooling.
The shortcut is not a prettier prompt. It is a smaller contract.

The Pipeline: Draft, Lint, Render, Assemble

The novelty is not any one component. It is the handoff between them.

export function renderDoc(source) {
  const parsed = parseDoc(source);
  lintDoc(parsed);
  const body = parsed.blocks.map(block => renderBlock(block)).join('\n');
  return wrapPage(body, parsed.meta);
}

This is the repo’s cleanest insight. The model does not render. The CLI does. Once you accept that division of labor, the rest of the design falls into place: component renderers for flowcharts and trees, a shell that inlines runtime code, and a page format that can survive without a backend.

Why Simplified Technical English Is a Clever Constraint

answer-me-with-html does a particularly clean job along the lines of “let the model write the content, let the program handle the typesetting.”

Unattributed (Substack), Technical Reviewer · Open-source Agent Skill turns long LLM text into visual HTML pages

The ASD-STE100 linter is more than a novelty. It makes the system less tolerant of vague filler, decorative language, and fuzzy instructions. That is useful when the goal is not literary flourish but technical clarity.

For explainers, constraints are a feature. A controlled vocabulary reduces ambiguity for the model and reduces noise for the reader. The page becomes easier to trust because the prose is forced to stay closer to the actual structure of the argument.

The Hidden Source Envelope

The generated HTML keeps a hidden source envelope, which means the artifact is not a dead end. The page can carry its own draft inside it, so patching and re-rendering can happen without hunting for a separate source file.

<textarea id="am-source" hidden>
# draft

```flow
A -> B
```
</textarea>

That is a smart versioning move. It preserves the self-contained nature of the page while still letting the artifact remain editable in place. In practice, that makes the output feel more like a living document and less like a one-way export.

Components, Themes, and the Browser Runtime

CapabilityWhat it addsWhy it matters
Flow, sequence, tree, timelineSpecialized visual formsThe model can choose the right diagram instead of hand-coding SVG
ThemesDifferent presentation skinsThe same draft can fit different editorial moods
Runtime interactivityZoom, toggles, playback, and step-through behaviorThe page stays useful offline without a server

This is where the repo starts to look less like a template and more like an internal platform. The point is not to create a single fixed output. The point is to make a narrow language that the model can use reliably, then map that language to several presentation forms.

Where It Fits in the Agent Tooling Landscape

ToolBest atHow it differs
Claude ArtifactsFast visual output inside ClaudeProprietary and tied to the web app
visual-explainerTerminal-friendly visual summariesMore focused on reviews and audits
html-ppt-skillSlide decks and presenter modeOptimized for presentation breadth, not compact explainers
drawio-skillEditable diagramsCentered on diagram editing, not finished reading experiences
answer-me-with-htmlSingle-file technical explainersBuilt for terminal agents, token efficiency, and offline pages

That position is narrow in a good way. It is not trying to replace slide decks, diagram editors, or chat-native artifacts. It is trying to make terminal agents better at the specific job of turning technical intent into something a human can read quickly.

Why This Pattern Matters Beyond This Repo

The bigger lesson is architectural. LLMs are good at intent, structure, and rough content. Local tools are better at stable rendering, layout, and packaging. Once you separate those jobs, the agent loop gets cheaper, faster, and easier to inspect.

That is why this repo feels important. It does not ask the model to do more. It asks the system to do more around the model. That is a better bet for explainers, and probably for a lot of other agent workflows too.