Skip to main content

Open source · MIT · @bestagentkits/render

Your agent writes YAML. The compiler ships HTML.

Describe a page in a short YAML or JSON Page Spec. AK Render compiles it into one deterministic, offline, self-contained HTML file, so your agent stops spending tokens on raw HTML, CSS and JavaScript.

The explain gallery page compiled by AK Render in the editorial theme, showing its serif title and the compile pipeline tabs
  • One self-contained file
  • Opens from file://
  • Zero network requests by default
  • Same spec, same bytes
  • Nonce-locked styles and script
  • Embedded OFL fonts
  • Light and dark
  • Reduced-motion aware
  • Keyboard first

Why a compiler instead of hand-written HTML

An agent that writes markup pays for layout, CSS and script on every page, and gets a slightly different page every run. With AK Render the agent writes only what the page says. Presentation, accessibility and security are the compiler's job.

The agent hand-writes HTML

  • Every page re-spends output tokens on layout, CSS and script
  • Two runs of the same prompt produce two different files
  • CDN fonts, chart libraries and remote images break offline
  • Dark mode, focus order and reduced motion depend on the prompt

The agent writes a Page Spec

  • The explain gallery page is a 2.6 kB spec; the compiler emits the other 124.4 kB
  • The same spec and compiler version produce identical bytes and hash
  • One file that opens from disk, with fonts embedded and the network denied
  • Keyboard, reduced motion, print and the dark scheme come from the compiler

The agent loop

  1. Find

    ak-render catalog lists all 83 block types and every action in 7,228 bytes. search-catalog ranks block types by intent words, and catalog --category lists one group.

  2. Describe

    ak-render describe <type...> --compact returns one line per prop for several blocks at once. The full hero contract with --json is 2,612 bytes.

  3. Validate

    ak-render validate <spec> --json returns diagnostics with a stable code and the JSON path to fix. Exit code 1 means fix and retry.

  4. Compile

    ak-render <spec> --out page.html writes the file and prints bytes, hash and runtime features. A spec path of - reads from stdin.

~/plans
# discover once
ak-render catalog | head -1
Page Spec v1 — 83 blocks
ak-render describe hero --json | wc -c
2612
# a typo in the spec comes back with the path to fix
ak-render validate plan.yaml
error: $.blocks[0].title: required value is missing
error: $.blocks[0].titl: unknown property "titl" for this block
ak-render validate plan.yaml
ok: plan.yaml
  blocks: 8 (nodes: 9)
ak-render plan.yaml --out plan.html
wrote 111479 bytes to plan.html (3 runtime features, hash 12524sw1xvd176)
# same spec from stdin, same bytes
cat plan.yaml | ak-render - --out again.html
wrote 111479 bytes to again.html (3 runtime features, hash 12524sw1xvd176)
cmp plan.html again.html && echo identical
identical

What it saves your agent

A hand-written page costs an agent three times. It reads presentation guidance, writes markup, CSS and script, and then carries the finished file in its context. With AK Render it reads a small catalog, writes a short spec, and gets back a one-line summary.

  • Presentation context

    −64%

    Benchmarked: 64–68%. 23.7k–26.6k tokens of legacy guidance against 7.9k–8.5k for contract, skill, catalog and blocks

  • Typical task, estimated

    −54%

    38.9k → 17.9k tokens with full contracts, 13.1k (−66%) with compact ones; 4 characters per token

  • Output on real pages

    −52%

    Median projected saving over 12 HTML pages agents wrote in real projects

  • Compiled page in context

    0 bytes

    The HTML goes to disk; the agent reads a summary of under 800 characters

Estimated tokens per page task, in thousands
Estimated tokens per page task, in thousands010203040Guidance readWrittenReturnedGuidance read: Hand-written HTML 33.7Written: Hand-written HTML 13.9Returned: Hand-written HTML 0Guidance read: AK Render, full contracts 9.1Written: AK Render, full contracts 7.2Returned: AK Render, full contracts 0.1Guidance read: AK Render, compact contracts 4.5Written: AK Render, compact contracts 7.2Returned: AK Render, compact contracts 0.1

Hand-written HTML: Guidance read 33.7, Written 13.9, Returned 0. AK Render, full contracts: Guidance read 9.1, Written 7.2, Returned 0.1. AK Render, compact contracts: Guidance read 4.5, Written 7.2, Returned 0.1

Chart data table
Estimated tokens per page task, in thousands
SeriesGuidance readWrittenReturned
Hand-written HTML33.713.90
AK Render, full contracts9.17.20.1
AK Render, compact contracts4.57.20.1

Where the HTML goes

  1. Agent

    Reads the catalog once and the contracts of the blocks it uses.

  2. Page Spec

    Writes only what the page says, as YAML or JSON.

  3. Compiler

    Writes the HTML to disk. The page never passes through the model's context.

Where the savings come from

  • Context

    The 7.2 kB catalog and per-block contracts replace pages of HTML style guidance.

  • Generation

    The agent stops writing CSS, script and markup. The median legacy page was 26% visible text.

  • Validation

    A failed check returns a stable code and the JSON path to fix, not a broken page to inspect.

  • Context shielding

    A compiled page is 111–246 kB. The summary the agent reads back is under 800 characters.

  • Determinism

    The same spec compiles to the same bytes, so a rerun gives the agent nothing new to review.

  • Edits

    A change is a line in the spec. The agent does not regenerate or re-read the page to fix a label.

Everything a page needs, as data

  • A bar chart from the dashboard gallery page, cropped at twice the pixel density

    Chart

    Charts that read at a glance

    Sixteen kinds, from bar and line to scatter, heatmap, waterfall and treemap, bound to shared datasets, each with a data table behind it.

  • 83

    Block types in the catalog

    From hero and bento to data tables, kanban boards and pricing, including the page root.

  • 11

    Built-in theme presets

    Each with a light and a dark token set, an embedded display face and its own component recipes.

  • The comparison block from the diff gallery page in dark mode

    Diff

    Diffs with intent

    Before and after, side by side, with the risk spelled out.

  • The timeline block from the plan gallery page

    Plan

    Plans that track themselves

    Milestones, owners and status on one timeline.

  • The diagram block from the plan gallery page, a three-node flow

    Diagram

    Diagrams without an engine

    Structured flows render as accessible markup.

  • A donut chart from the dashboard gallery page in dark mode

    Theme

    Charts follow the scheme

    Every chart stop recolors from theme tokens in dark mode.

  • Interaction

    12

    Declarative actions

    Copy, toggle, tabs, filter, theme and download are bound in the spec. No page-authored script, no inline handler.

The YAML behind each visual

Each picture below is an element crop of a compiled gallery page. Next to it is the Page Spec block that produced it, copied from the fixture in this repository. The agent writes the right-hand side; the compiler draws the left.

The kpi block from the showcase gallery page: four metric cards with deltas and sparklines
KPI cards with a verdict and a sparkline
fixtures/pages/showcase.yaml, first two of four itemsyaml
- type: kpi
  items:
    - label: Test cases
      value: '363'
      delta: '+21 this round'
      trend: up
      good: up
      series: [15, 198, 278, 305, 308, 313, 342, 363]
      caption: Declared it() and test() cases across the git history
    - label: Fixture pages
      value: '11'
      delta: '+1'
      trend: up
      good: up
      series: [7, 8, 9, 9, 10, 10, 11]
      caption: Pages in fixtures/pages at each milestone
The terminal block from the showcase gallery page in dark mode, a typed validate and compile session
A typed terminal session with a copy control
fixtures/pages/showcase.yamlyaml
- type: terminal
  title: ~/project
  lines:
    - kind: comment
      text: '# validate the spec, then compile it'
    - kind: command
      text: ak-render validate explain.yaml
    - kind: success
      text: 'ok: explain.yaml'
    - kind: output
      text: '  blocks: 8 (nodes: 9)'
    - kind: command
      text: ak-render explain.yaml --out explain.html
    - kind: output
      text: wrote 124500 bytes to explain.html (4 runtime features, hash 0w5t9z60ka9un7)
    - kind: command
      text: ak-render themes
    - kind: output
      text: blueprint  editorial  paper-ink  swiss-clean  terminal-mono  warm-signal
The checklist block from the showcase gallery page: four of five release gates done, with a progress meter
A checklist that counts itself
fixtures/pages/showcase.yamlyaml
- type: checklist
  title: Release gates for this page
  items:
    - text: Unit tests, lint, typecheck, and build pass
      done: true
    - text: Theme snapshots and the gallery regenerate byte-identical
      done: true
    - text: Browser tests pass, including the before/after slider
      done: true
    - text: No horizontal overflow at 375 and 1440 pixels
      done: true
    - text: Visual regression baselines for the showcase blocks
      done: false
The file-tree block from the showcase gallery page in dark mode, with added and modified files
A file tree built from flat paths
fixtures/pages/showcase.yaml, first four of eight itemsyaml
- type: file-tree
  title: What this round touched
  items:
    - path: src/render/font-faces.ts
      status: added
      note: inlines the bundled faces
    - path: src/render/embedded-fonts.generated.ts
      status: added
    - path: src/render/surface-styles.ts
      status: added
      note: the night band
    - path: assets/fonts/geist/OFL.txt
      status: added
The timeline block from the plan gallery page with three weekly milestones
A timeline from three list items
fixtures/pages/plan.yamlyaml
- type: timeline
  title: Schedule
  items:
    - when: Week 1
      title: Schema freeze
      text: Page Spec v1 accepted with migration policy.
    - when: Week 2
      title: Compiler and themes
      text: Deterministic output under every built-in preset.
    - when: Week 3
      title: Runtime
      text: Browser-tested interactions across input methods.
The comparison block from the diff gallery page in dark mode, before and after side by side
A before and after comparison
fixtures/pages/diff.yamlyaml
- type: comparison
  title: Escaping strategy
  left:
    label: Before
    items:
      - Escape applied while parsing
      - Context assumed safe after validation
      - Attribute values escaped once
  right:
    label: After
    items:
      - Escape applied at emission per context
      - URL schemes allowlisted per action
      - Embedded JSON serialized for script context

Eleven presets, light and dark

A theme is typed data, never CSS. Pick a preset, or extend one with validated tokens and component recipes; every preset ships both schemes and its fonts inside the file.

  • blueprint

    Technical drawing with cool slate surfaces and monospace labels. Set in Geist.

  • editorial

    Serif headlines, generous whitespace, deep navy with gold. Set in Fraunces.

  • paper-ink

    Warm cream paper with terracotta and sage. Set in Bricolage Grotesque.

  • terminal-mono

    Near-black terminal with green and amber, monospace throughout. Set in JetBrains Mono.

  • swiss-clean

    Neutral high-contrast grid with one red accent. Set in Inter Tight.

  • warm-signal

    Warm neutral surfaces signalling with amber and emerald. Set in Plus Jakarta Sans.

  • data-console

    Dense operations console with a cyan accent, ledger tables and quiet charts. Set in Geist and JetBrains Mono.

  • executive-report

    White and ink with a navy accent, headline metrics and outlined cards. Set in Inter Tight.

  • product-studio

    Soft neutral surfaces, a violet accent, framed media and raised cards. Set in Plus Jakarta Sans.

  • research-notebook

    Paper with an oxblood accent, serif reading type, ledger tables and outlined notes. Set in Fraunces.

  • crimson-press

    Cream paper, black ink and a crimson accent, with square ledger rules. Set in Fraunces, Inter Tight and JetBrains Mono.

One spec, two color schemes

The explain gallery page in light modeLight
The explain gallery page in dark modeDark
Drag the divider, or focus it and use the arrow keys. Both images are screenshots of the same compiled file.

Use it in three steps

  1. Write a spec

    Describe the page in YAML or JSON. Blocks carry meaning, such as hero, steps, timeline, chart or comparison; there is no field for HTML, CSS or script.

  2. Validate

    Diagnostics name the JSON path to fix, so an agent repairs a spec in one more turn instead of rereading a page.

  3. Compile and open

    One HTML file that opens from disk, offline, in light and dark, and reads the same in print and in a screenshot.

plan.yamlyaml
version: 1
meta:
  title: Migration plan
theme:
  preset: editorial
blocks:
  - type: hero
    eyebrow: Plan
    title: Migration plan
    description: Move the public API to the new gateway without downtime.
  - type: section
    title: Steps
    blocks:
      - type: steps
        items:
          - title: Mirror traffic
            text: Send a copy of production requests to the new gateway.
          - title: Switch reads
            text: Route read endpoints once error rates match.
  - type: callout
    tone: info
    title: Rollback
    text: Point DNS back to the old gateway; no data migrates.
Validate, compile, openbash
npx -y @bestagentkits/render validate plan.yaml
npx -y @bestagentkits/render plan.yaml --out plan.html
open plan.html

Give your agent the skill

The ak-render skill teaches an agent the whole loop, from catalog to compiled file. Install it with the skills CLI for any agent, or as a plugin that also registers the MCP server.

Any agent, with the skills CLIbash
npx skills add bestagentkits/ak-render
Claude Code pluginbash
claude plugin marketplace add bestagentkits/ak-render
claude plugin install ak-render@ak-render
Codex and ChatGPT pluginbash
codex plugin marketplace add bestagentkits/ak-render
codex plugin add ak-render@ak-render

ak-render mcp serves the same loop over stdio as MCP tools: catalog, search-catalog, describe, recipes, recipe, validate, render and themes. The render tool writes the file and returns only a summary, so the page never enters the context.

MCP client configurationjson
{
  "mcpServers": {
    "ak-render": {
      "command": "npx",
      "args": ["-y", "@bestagentkits/render", "mcp"]
    }
  }
}

Connect the hosted MCP server

https://render.agentkit.best/mcp serves the same tools over Streamable HTTP, so an agent that cannot run Node still compiles pages. render stores the page and returns a link instead of writing a file. Add only the URL and the client signs you in to agentkit.best with OAuth; the sign-in lasts up to a year while the client keeps using it.

Pick your AI tool

Claude

claude.ai and Claude Desktop: open Settings → Connectors → Add custom connector. Name it AK Render, paste the URL, then choose Connect and sign in at agentkit.best.

Remote MCP server URLtext
https://render.agentkit.best/mcp

ChatGPT

Open Settings → Apps & Connectors, turn on Developer mode under Advanced settings, then choose Create. Name it AK Render, paste the URL, pick OAuth as the authentication and sign in at agentkit.best.

MCP server URLtext
https://render.agentkit.best/mcp

Claude Code

Add the serverbash
claude mcp add --transport http ak-render https://render.agentkit.best/mcp

Then run /mcp inside Claude Code, select ak-render and choose Authenticate.

Cursor

~/.cursor/mcp.jsonjson
{
  "mcpServers": {
    "ak-render": { "url": "https://render.agentkit.best/mcp" }
  }
}

Cursor lists the server under Settings → MCP; choose its login prompt to sign in at agentkit.best.

VS Code

.vscode/mcp.jsonjson
{
  "servers": {
    "ak-render": { "type": "http", "url": "https://render.agentkit.best/mcp" }
  }
}

Start the server from mcp.json or the MCP view, and allow the sign-in when VS Code asks.

Codex

Add the server and sign inbash
codex mcp add ak-render --url https://render.agentkit.best/mcp
codex mcp login ak-render

API key

For CI, scripts and clients without OAuth, create a personal key at agentkit.best/account/api-keys, export it as AGENTKIT_TOKEN and send it as a bearer. A key lasts until you revoke it or until the expiry you choose.

Any client that takes headersjson
{
  "mcpServers": {
    "ak-render": {
      "type": "http",
      "url": "https://render.agentkit.best/mcp",
      "headers": { "Authorization": "Bearer ${AGENTKIT_TOKEN}" }
    }
  }
}

Disconnect a client at any time under Account → Connected apps on agentkit.best. Revoke an API key on the same account's API Keys page.

Made by AgentKit, open to everyone

AK Render is built and hosted by AgentKit, a foundation of agents, skills and workflows for Claude Code, Codex, Cursor and other coding agents. The compiler, the CLI and the local MCP server are MIT-licensed and need no account; the hosted endpoint is the part reserved for customers.

  • AgentKit customers

    Owners of AgentKit Engineer, AgentKit Marketing or the Bundle connect to render.agentkit.best/mcp with OAuth or an API key, with stored pages, share links and PNG or PDF export included.

  • Run it locally

    npx @bestagentkits/render mcp serves every tool over stdio from your machine. It writes the page to disk, makes no network request and needs no account.

  • Deploy your own

    apps/cloud in the GitHub repo is the same Cloudflare Worker that runs here. Its README covers the R2 bucket, rate limits, routes and deploy commands; point ENTITLEMENTS_URL at your own service that answers its token-check contract, and turn on OAuth only if you run an authorization server.

Demo pages, compiled from fixtures

Every page in the gallery is a fixture spec in fixtures/pages compiled by the current build. Open one, then view its source to see a single HTML file with no requests.

Screenshot of the all-components.html gallery page compiled by AK Render
Every block type on one page

1 / 11Previous imageNext imageClose image viewer

Screenshot of the explain.html gallery page compiled by AK Render
Explain: a concept walk-through

2 / 11Previous imageNext imageClose image viewer

Screenshot of the dashboard.html gallery page compiled by AK Render
Dashboard: charts and metrics

3 / 11Previous imageNext imageClose image viewer

Screenshot of the plan.html gallery page compiled by AK Render
Plan: timeline, diagram, risks

4 / 11Previous imageNext imageClose image viewer

Screenshot of the diff.html gallery page compiled by AK Render
Diff: changes with intent

5 / 11Previous imageNext imageClose image viewer

Screenshot of the showcase.html gallery page compiled by AK Render
Showcase: the presentation blocks

6 / 11Previous imageNext imageClose image viewer

Screenshot of the brainstorm.html gallery page compiled by AK Render
Brainstorm: options and trade-offs

7 / 11Previous imageNext imageClose image viewer

Screenshot of the recap.html gallery page compiled by AK Render
Recap, in dark mode

8 / 11Previous imageNext imageClose image viewer

Screenshot of the interactive.html gallery page compiled by AK Render
Interactive: tabs, filters, state

9 / 11Previous imageNext imageClose image viewer

Screenshot of the media.html gallery page compiled by AK Render
Media: video, images, before and after

10 / 11Previous imageNext imageClose image viewer

Screenshot of the theme-showcase.html gallery page compiled by AK Render
Theme showcase: one spec under every preset

11 / 11Previous imageNext imageClose image viewer

Measured in this repository

  • Catalog the agent reads once

    7.2 kB

    ak-render catalog prints 7,228 bytes

  • Spec the agent writes

    2.6 kB

    explain.yaml; the compiled page is 127.0 kB

  • Network requests on open

    0

    explain.html from file:// in Chromium

  • Runtime dependencies

    1

    yaml, for reading specs

A screen recording of compiled gallery pages: tabs, the theme toggle and chart hovers. Nothing in it is a mockup.

Open source · MIT

Write the spec. Ship the page.

This page is a Page Spec compiled by AK Render, and so is every page in the gallery.