---
title: "AK Render: Stop making AI write hundreds of lines of HTML just to present a report"
url: "https://zuey.me/articles/ak-render-dung-bat-ai-viet-html-de-lam-bao-cao?lang=en"
locale: en
access: free
full_text: true
published_at: "2026-10-08T15:27:35.695Z"
tags: ["AI Agents", "MCP", "Developer Tools", "Agent Skills"]
translations:
  vi: "https://zuey.me/articles/ak-render-dung-bat-ai-viet-html-de-lam-bao-cao.md?lang=vi"
  zh: "https://zuey.me/articles/ak-render-dung-bat-ai-viet-html-de-lam-bao-cao.md?lang=zh"
  ko: "https://zuey.me/articles/ak-render-dung-bat-ai-viet-html-de-lam-bao-cao.md?lang=ko"
  ja: "https://zuey.me/articles/ak-render-dung-bat-ai-viet-html-de-lam-bao-cao.md?lang=ja"
---
# AK Render: Stop making AI write hundreds of lines of HTML just to present a report

> Why we built AK Render, a deterministic Page Spec-to-HTML compiler with local and hosted MCP. Context from Thariq's Claude Code HTML plans, transparent token estimates, architecture, and limits.

There is something rather absurd about how we use AI for programming.

Ask an AI to produce a report, dashboard, implementation plan, or simply a polished HTML page. Instead of focusing on the message, it starts grinding through HTML, CSS, JavaScript, responsive layouts, dark mode, charts, and animations.

You may end up with hundreds of kilobytes of HTML. The next time you ask for a similar report, the model writes nearly all that presentation code again.

> We are paying an expensive language model to do work that a compiler can handle more reliably.

That is the problem my team and I built **AK Render** to address within the AgentKit ecosystem: move repetitive presentation work out of the model and into a rule-based compiler. [Website](https://render.agentkit.best) · [GitHub source](https://github.com/bestagentkits/ak-render)

![AK Render overview](https://render.agentkit.best/og-card.png)

*AK Render's official social preview.*

### The HTML plans discussion with Thariq

On **October 5, 2026**, **Thariq (@trq212)** shared work on a Claude Code skill for producing clearer **HTML plans**. He described using plain language, code snippets, surfaced questions, and mockups, with **linting** to reduce common failure modes. His post was a preview asking for feedback, not a benchmark and not an endorsement of AK Render. [Read Thariq's original post](https://x.com/trq212/status/2107192901537329354).

Thariq's October 5, 2026 post about an HTML-planning skill for Claude Code.

[X: https://x.com/trq212/status/2107192901537329354](https://x.com/trq212/status/2107192901537329354)

I quoted that post on **October 8, 2026** to introduce **AK Render**, the open-source project my team and I are building. My post said “I made HTML plans saving ~60% of tokens.” To be precise, this refers to our **estimated 54–66% token reduction for a representative page task**. It is **not** a measured 60% reduction in real API bills or a live model A/B result. [Read my post](https://x.com/goon_nguyen/status/2108197445469712460).

My October 8, 2026 response introducing AK Render.

[X: https://x.com/goon_nguyen/status/2108197445469712460](https://x.com/goon_nguyen/status/2108197445469712460)

The overlap is the underlying need: **AI-generated plans should be more than difficult-to-scan Markdown; HTML can provide readable structure, questions, diagrams, and interaction.** But Thariq's work focuses on the planning workflow in Claude Code, while AK Render provides a **deterministic Page Spec-to-HTML compiler** for plans, dashboards, reports, and other outputs. **I am not claiming that Thariq uses, validates, or endorses AK Render.** These are related approaches to a similar problem, not the same product.

### 1. What is AK Render?

AK Render is a **declarative page compiler** designed for AI coding agents. The underlying principle is simple.

Rather than ask AI to produce HTML, CSS, and JavaScript, we ask it to describe **what the page should contain** in a YAML or JSON **Page Spec**. AK Render handles the rest.

**Conventional approach:** User → AI → HTML + CSS + JavaScript → Web page.

**With AK Render:** User → AI → Page Spec → AK Render → Complete HTML page.

```mermaid
flowchart LR
 U[User] --> A[AI agent]
 A --> S[Page Spec YAML/JSON]
 S --> C[AK Render compiler]
 C --> H[Self-contained interactive offline HTML]
```

*AI structures the content; the compiler handles presentation.*

The responsibility is deliberately split: **AI decides what to communicate. The compiler decides how it should be presented.**

For example, an agent only needs to declare a `chart` block with a dataset and chart type. AK Render produces the SVG, axis formatting, colors, labels, small-screen behavior, and dark mode. The agent no longer rewrites charting code for every report.

### 2. A short Page Spec can produce a complete HTML page

Here is a Vietnamese Page Spec I used to exercise AK Render itself:

```yaml
version: 1
meta:
  title: "AI transformation progress report"
  description: "Summary of an internal rollout."
theme:
  preset: editorial
blocks:
  - type: hero
    eyebrow: "Report"
    title: "AI transformation in the workplace"
    description: "A summary page that opens offline."
  - type: section
    title: "Implementation steps"
    blocks:
      - type: steps
        items:
          - title: "Discovery"
            text: "Collect the problems to solve."
          - title: "Pilot"
            text: "Evaluate one real workflow."
  - type: callout
    tone: info
    title: "Note"
    text: "All examples are illustrative."
```

No CSS, no JavaScript, and no instructions about font sizes, button colors, or pixel-by-pixel positioning.

I tested it through AK Render's MCP tools: **validation returned no errors** and compilation produced **125,119 bytes of HTML**, using the `editorial` theme on compiler version `0.3.0`. This is one illustrative compilation, not a performance benchmark.

The generated HTML includes the presentation system, typography, responsive layout, and light/dark handling. Crucially, **there is no second AI model designing the interface**. The compiler generates the result.

### 3. What can AK Render do?

As of **October 8, 2026**, the catalog contains **83 block types** across eight functional categories, ranging from basic text and images to complex data and engineering components:

- **Dashboards:** KPI cards, charts, searchable data tables, filters, and progress.
- **Project management:** timelines, roadmaps, kanban, checklists, risk matrices.
- **Engineering reports:** code reviews, file trees, terminals, log viewers, tests, and API docs.
- **Product pages:** pricing, feature matrices, testimonials, showcases, and before/after comparisons.
- **Interactions:** tabs, accordions, carousels, dialogs, theme controls, and downloads.

![AK Render dashboard chart example](https://render.agentkit.best/assets/crop-chart.webp)

*A chart compiled from a Page Spec without model-authored chart code.*

AK Render supports **16 chart types**, including bar, line, scatter, heatmap, waterfall, and treemap. Charts are SVG and can read from shared datasets, so an agent does not need to duplicate the same numbers in a chart and a table.

There are also **11 built-in themes**, each supporting light and dark modes. A change in theme can turn the same content into an editorial report, an operations console, or an executive presentation. [Compare the themes](https://render.agentkit.best/gallery/themes/).

![AK Render before/after comparison](https://render.agentkit.best/assets/crop-compare.webp)

*Before/after comparison block from the demo gallery.*

Interactions are declared from a closed action vocabulary. Agents cannot inject arbitrary JavaScript into Page Specs. For reports authored by AI, that constraint is a deliberate security and consistency decision.

### 4. The real opportunity is not prettier HTML, but fewer tokens

We did not build AK Render merely to add another attractive HTML generator. Our goal was to eliminate **repetitive presentation work that AI performs** just to communicate a result.

To quantify that hypothesis, we analyzed 12 HTML pages produced by agents in real projects and constructed an **estimated** token-cost model. For a representative task:

| Approach | Estimated tokens |
| --- | --- |
| Agent-authored HTML | 38,900 |
| AK Render, full contracts | 17,900 |
| AK Render, compact contracts | 13,100 |

**Estimated tokens per HTML-page task** (bar chart)

| Label | Estimated tokens |
| --- | --- |
| Hand-written HTML | 38900 |
| AK Render full | 17900 |
| AK Render compact | 13100 |

In this model, estimated savings are **54% to 66%**. A separate measurement of presentation-instruction context showed reductions of **64% to 68%**.

The reason is straightforward. When an agent writes HTML itself, it reads design guidance, emits repeated interface code, and keeps that generated code in its context. With AK Render it reads a compact block catalog, selects the contracts it needs, writes a Page Spec, and receives a short compilation summary.

The full HTML is written to disk rather than echoed back as hundreds of kilobytes of context. **Instead of paying AI to repeatedly align elements, choose colors, and draw charts, we can spend its capacity on the information that actually requires intelligence.**

> **WARN:** **An important qualification about our own benchmarks:** We have **not proven** that AK Render cuts real API costs by 66%. Token counts are **estimated at four characters per token**, without a live tokenizer or controlled model A/B tests. Repair iterations, wall-clock time, and output quality have not yet been evaluated end to end.

One of the 12 pages would actually require a Page Spec **35% larger** than the conventional approach. If a page is primarily prose, there may be little or no output-token saving.

[Read the benchmark method and underlying measurements](https://github.com/bestagentkits/ak-render/blob/main/docs/artifacts/agent-token-cost.md).

### 5. Another benefit: the same input produces the same output

Beyond token use, we deliberately designed AK Render around **deterministic rendering**: results that can be reproduced and checked.

Given the same Page Spec, compiler version, and configuration, AK Render outputs exactly the same HTML bytes. Ask an AI to write HTML twice from the same prompt and you will often get two different codebases.

Determinism matters for CI/CD, recurring reports, change reviews, and versioned documentation. We can compare output hashes rather than make the model inspect thousands of lines of generated HTML.

Edits become simpler too. To change a title, the agent updates one field instead of digging through markup.

### 6. A single HTML file that works offline

Another design principle is **offline by default**. The emitted HTML opens directly via `file://`; its fonts and interaction runtime are bundled, without fetching a UI framework or chart library from a CDN.

By default, the page makes no network requests. External images and media must be explicitly allowed by the Page Spec. AK Render also derives a Content Security Policy (CSP) to constrain content sources and behavior.

This makes the output useful for client reports, internal documentation, delivery plans, and artifacts emailed by agents. Recipients can open the file without deploying a server.

This is not a substitute for end-to-end data protection. An HTML file may still contain sensitive information; access control, storage, and sharing remain the responsibility of the surrounding system.

### 7. Getting started with AK Render

AK Render is available as a CLI, a JavaScript/TypeScript library, and an MCP server. The local version requires **Node.js 20.11 or newer**.

Install the Agent Skill in your coding agent:

```bash
npx skills add bestagentkits/ak-render
```

Or inspect the block catalog directly:

```bash
npx -y @bestagentkits/render catalog
```

Write a Page Spec in `report.yaml`, then validate and compile it:

```bash
npx -y @bestagentkits/render validate report.yaml
npx -y @bestagentkits/render report.yaml --out report.html
```

For agents, the recommended loop is to discover blocks, inspect their contracts, create a spec, validate diagnostics, and compile. We also provide **10 starter recipes**, including dashboards, benchmarks, incident reports, implementation plans, and decision memos.

Claude Code, Codex, ChatGPT, and other compatible clients can call AK Render through MCP, provided their environment supports the relevant MCP transport.

Next I will explain the two MCP modes, OAuth/API-key access, and why a local HTML file differs from a hosted artifact link.

[Detailed agent guide](https://github.com/bestagentkits/ak-render/blob/main/docs/agent-guide.md).

### 8. MCP server: making AK Render a tool that agents can call

We built the **MCP server** so agents can invoke AK Render directly in their workflows instead of asking humans to run a CLI command. Model Context Protocol (MCP) exposes structured tools for discovering capabilities, inspecting input contracts, validating a Page Spec, and compiling it.

**AK Render provides eight MCP tools**, sharing the compiler's contracts. We do not maintain a separate rendering engine in the cloud and hope it matches local output: equivalent inputs, options, and compiler versions produce byte-identical artifacts.

| MCP tool | Purpose |
| --- | --- |
| `catalog` | List 83 blocks and actions by category |
| `search-catalog` | Find blocks by intent, e.g. sortable table |
| `describe` | Read full or compact input contracts |
| `recipes` | List 10 starter Page Specs |
| `recipe` | Get one editable YAML recipe |
| `themes` | List available themes |
| `validate` | Check spec, returning error codes and JSON paths |
| `render` | Compile HTML and return a summary, not the entire file |

There are two MCP modes. **Local MCP (stdio)** runs with Node.js 20.11+ and writes HTML to the agent's filesystem. **Remote MCP (Streamable HTTP)** is served at `https://render.agentkit.best/mcp` and is suitable for clients that cannot install Node or need shareable URLs.

### 8.1. Configure the local MCP server

Add this configuration to an MCP client that supports `stdio`. Local rendering needs no AgentKit account and does not send the Page Spec to our hosted service. It requires no network at compile time, apart from the initial package download if the package is not installed:

```json
{
  "mcpServers": {
    "ak-render": {
      "command": "npx",
      "args": ["-y", "@bestagentkits/render", "mcp"]
    }
  }
}
```

The agent can now follow `catalog` → `describe` → `validate` → `render`. Local `render` takes an `out` path, such as `report.html`, writes the file, and returns a compact summary with bytes, hash, theme, features, and warnings. **Do not feed the entire generated HTML back into the model context**; that defeats the point.

### 8.2. Configure hosted MCP for ChatGPT, Claude, and compatible clients

For an MCP client supporting **Streamable HTTP and OAuth**, register the URL below. An eligible client follows the AgentKit sign-in flow when connecting:

```json
{
  "mcpServers": {
    "ak-render": {
      "type": "http",
      "url": "https://render.agentkit.best/mcp"
    }
  }
}
```

For automation or CI, or clients without OAuth support, use a personal **AgentKit API key** as a Bearer token. Never commit a real key or include one in a published article:

```json
{
  "mcpServers": {
    "ak-render": {
      "type": "http",
      "url": "https://render.agentkit.best/mcp",
      "headers": {
        "Authorization": "Bearer ${AGENTKIT_TOKEN}"
      }
    }
  }
}
```

One distinction matters: **a public MCP endpoint does not mean anonymous, free cloud rendering**. Hosted requests require OAuth or an API key and the appropriate AgentKit entitlement. If you cannot use the hosted service, the open-source local renderer is still available. Clients must actually support the corresponding MCP configuration; not every ChatGPT or Claude interface accepts the JSON exactly as shown.

### 8.3. Where does the generated HTML go?

Local MCP writes HTML to the `out` path. **Remote MCP** cannot write to a user's disk, so it stores the artifact privately and returns an `artifactUrl` along with its hash, size, warnings, and expiration time.

- **Regular artifact URL:** expires in about **one hour**.
- **`render` with `share: true`:** creates a share link with a **30-day default expiration**, not permanent hosting.
- **Default output:** self-contained HTML with no network requests unless explicitly allowed.
- **PNG/PDF export:** available through cloud **REST endpoints**, not as separate tools among the eight MCP tools.

The hosted renderer runs on Cloudflare Workers, uses private R2 storage for artifacts and shares, enforces rate limits, and serves stored pages under a sandbox CSP. The current code specifies **60 renders/minute**, **20 shares/minute**, and **120 validations/minute** per subject, plus limits on artifact sizes and node counts. These are current configuration values, not permanent guarantees.

The design boundary is important to us: **local compilation is canonical; the cloud is optional convenience** for agents that need HTTP access, shared links, or exports. The local compiler does not depend on our hosted service.

[MCP server and cloud architecture documentation](https://github.com/bestagentkits/ak-render/blob/main/apps/cloud/README.md) · [Agent guide](https://github.com/bestagentkits/ak-render/blob/main/docs/agent-guide.md).

### 9. Can AK Render replace frontend development?

**No.** This distinction matters if we want realistic expectations.

AK Render is built for **structured information pages**, including charts, filters, and browser interactions. It is not intended to replace React, Next.js, or custom application frameworks.

You cannot insert arbitrary HTML, CSS, or JavaScript into a Page Spec. If you need complex business logic, backend integration, real-time synchronization, or pixel-perfect customization, this approach may not fit.

That trade-off is intentional. We restrict arbitrary customization in return for more predictable, consistent, and safer agent-generated results.

> The fewer unnecessary presentation decisions an agent makes, the easier the overall system becomes to control.

### 10. Why I built AK Render this way

I began with a first-principles question: **Why spend language-model inference on tasks we already know how to solve with deterministic algorithms?**

Layout, chart formatting, tables, themes, and responsive behavior can be encoded as rules. Understanding user intent, selecting the important information, organizing an argument, and explaining data are better uses of AI.

Our goal was never to make agents write more code. Quite the opposite: **make them write as little code as necessary to complete the job.**

AK Render is our practical experiment with that principle, especially for agents producing reports, analyses, and deliverables. We publish the source so others can inspect, use, and challenge the approach.

I do not want to oversell our own product. At publication time, our latest release is **v0.3.0 (October 6, 2026)**. Our benchmarks are in-house and have not undergone comprehensive independent A/B testing. They are early evidence, not a final verdict on real-world savings.

More than introducing another tool, I want to share the engineering principle behind it.

> **AI should produce meaning. The compiler should produce the interface.**

Sometimes improving AI efficiency is less about choosing a smarter model and more about stopping it from doing work that never required intelligence.

---

### References and live demos

- [Website and architecture](https://render.agentkit.best)
- [MIT-licensed source](https://github.com/bestagentkits/ak-render)
- [Demo gallery](https://render.agentkit.best/gallery/)
- [11 theme previews](https://render.agentkit.best/gallery/themes/)
- [Benchmark methodology and data](https://github.com/bestagentkits/ak-render/blob/main/docs/artifacts/agent-token-cost.md)
- [Agent guide](https://github.com/bestagentkits/ak-render/blob/main/docs/agent-guide.md)
- [MCP server and cloud docs](https://github.com/bestagentkits/ak-render/blob/main/apps/cloud/README.md)
- [Thariq on HTML plans in Claude Code](https://x.com/trq212/status/2107192901537329354)
- [My post introducing AK Render](https://x.com/goon_nguyen/status/2108197445469712460)
