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.
- answer-me-with-html treats AI explanation as a compilation problem, not a writing problem.
- The local CLI absorbs layout, diagrams, linting, and packaging so the model can stay compact.
- ASD-STE100 and the hidden source envelope make the output clearer, more auditable, and easier to patch.
- The repo fits a broader pattern where models express intent and local tools turn that intent into a durable artifact.
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.
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
| Approach | What the model writes | What the local tool does | Why it matters |
|---|---|---|---|
| Direct HTML generation | Long HTML, CSS, SVG, and copy | Very little | High token cost and more room for formatting drift |
| answer-me-with-html | Short draft plus component directives | Layout, diagrams, linting, theming, and assembly | Less output, faster responses, easier auditing |
| Classic deck tool | Slides and presenter framing | Mostly rendering and export | Good for presentations, not optimized for compact technical explainers |
The Pipeline: Draft, Lint, Render, Assemble
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.”
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
| Capability | What it adds | Why it matters |
|---|---|---|
| Flow, sequence, tree, timeline | Specialized visual forms | The model can choose the right diagram instead of hand-coding SVG |
| Themes | Different presentation skins | The same draft can fit different editorial moods |
| Runtime interactivity | Zoom, toggles, playback, and step-through behavior | The 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
| Tool | Best at | How it differs |
|---|---|---|
| Claude Artifacts | Fast visual output inside Claude | Proprietary and tied to the web app |
| visual-explainer | Terminal-friendly visual summaries | More focused on reviews and audits |
| html-ppt-skill | Slide decks and presenter mode | Optimized for presentation breadth, not compact explainers |
| drawio-skill | Editable diagrams | Centered on diagram editing, not finished reading experiences |
| answer-me-with-html | Single-file technical explainers | Built 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.





