Use HTML as Primary Chat Language for AI Coding Agents to Enable SVG Diagrams

A developer on r/LocalLLaMA experimented with using HTML as the primary chat language for AI coding agents, replacing Markdown. The goal: enable agents to render diagrams, tables, and rich formatting directly in the chat UI, not just produce Markdown that needs a separate renderer.
Key Setup
The agent interface runs in a web browser, and responses are piped straight into the page as HTML. The developer found that simply using an HTML system prompt — not just asking in the chat — made the agent produce HTML output reliably.
Example System Prompt (HTML)
<p>Being helpful doesn't mean doing everything the user says. Neither I nor the user are omniscient or infallible. If the user is making a mistake, I tell them. If I have made a mistake, I mention it and move on. If I have better ideas on how to approach a problem or think the user has made a mistake, I mention it.</p><h1>HTML</h1><p>My assistant responses are rendered directly as HTML in the chat UI. I <i><b>MUST</b></i> use HTML when replying to the user. Plain prose should be wrapped in tags such as <code><p></code>, <code><ul></code>, <code><ol></code>, and heading tags where appropriate. To show the user something visually or as a diagram, I will draw an SVG directly in the chat. Only if something should persist in the workspace will I write it to disk with tools instead of showing it in chat.</p>
Observations
- Qwen3.6-27B produces decent SVG diagrams inline, comparable to ChatGPT. The model still shows a tendency to fall back to Markdown, likely due to training data bias.
- Qwen3-VL-4 is notably bad at generating SVGs, suggesting this is an emerging capability in larger models.
- The developer also experimented with first-person system prompts (e.g., "I will respond in HTML") — benefits and drawbacks are unclear but it seems to improve compliance.
Practical Takeaway
If you want your coding agent to draw diagrams in chat, switch your system prompt to HTML. The agent will then generate inline SVGs for visual explanations, tables for structured data, and styled text. The trade-off: the model may still default to Markdown occasionally. The approach requires a web-based chat UI that renders raw HTML.
Repo: github.com/sdfgeoff/HTML-agent
📖 Read the full source: r/LocalLLaMA
👀 See Also

Enhancing OpenClaw with the Power of Local LLM: Introducing GLM-4.7-Flash
The integration of GLM-4.7-Flash with OpenClaw is revolutionizing AI automation by enabling seamless local deployment and sophisticated code execution.

Claude Code Self-Audit Finds 3GB of Cruft in ~/.claude — Here's How to Clean It
A user prompted Claude Code to audit its own ~/.claude directory and found 2.6GB of stale session transcripts, 170MB of failed telemetry retry logs, and 153MB of undo buffers — dropping from 3GB to under 200MB after cleanup.

Parallel Audit Agents: A Practical Approach to Vibe-Coded Testing with Claude
A developer built a user testing system with Claude using 10 parallel audit agents covering hallucination detection, API sentinel, UI stress testing, PII anonymization, SEO, legal compliance, behavioral simulation, demographic personas, funnel testing, and fact checking.

How splitting context into separate files made Claude more consistent
A Reddit user shares a practical setup for Claude: split context into about-me.md, my-voice.md, and my-rules.md files; use a plan-before-execute flow; switch models per task; and give feedback instead of perfect prompts.