preview-html-author

preview-html-author is an agent for Claude Code from CaesiumY/ko-design-md. It costs 66 tokens per session (10,292 once invoked), scanned A, original, MIT.

A helper that creates one self-contained HTML preview of a design system, showing its visual styles and interface components in light and dark themes.

In plain words
What is it for?
Use it to turn an approved design document into a hero section and component showcase for review in a website catalogue.
Why use it?
It provides a viewable design sample without requiring a build step or a web framework, while keeping unfinished previews out of the public folder.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it to turn an approved design document into a hero section and component showcase for review in a website catalogue.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/caesiumy/ko-design-md/preview-html-author
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/CaesiumY/ko-design-md

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for preview-html-author

README.md
[![agentmods](https://agentmods.dev/badge/agents/caesiumy/ko-design-md/preview-html-author/github.svg)](https://agentmods.dev/agents/caesiumy/ko-design-md/preview-html-author)
Your own site
<a href="https://agentmods.dev/agents/caesiumy/ko-design-md/preview-html-author"><img src="https://agentmods.dev/badge/agents/caesiumy/ko-design-md/preview-html-author/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for preview-html-author

Your own site · 80×15
<a href="https://agentmods.dev/agents/caesiumy/ko-design-md/preview-html-author"><img src="https://agentmods.dev/badge/agents/caesiumy/ko-design-md/preview-html-author.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 10,292 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.10292
Opus 5.5 $0.00026 $0.04117
Sonnet 5.5 $0.00013 $0.02058
Haiku 4.5 $0.00007 $0.01029

Measured 7d ago against content hash 1ccce7f06cb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

preview-html-author scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/preview-html-author.md · 324 lines

How it starts

The opening of the file, as written. The whole thing — 324 lines — stays where its author put it; the contents beside it link to each section on GitHub.

preview-html-author

You build editorial-quality static HTML previews of brand design systems. Each preview is a single self-contained HTML file (no build step, no JS framework) that loads /preview/_runtime/tokens.css for shared baseline tokens and demonstrates the brand's specific visual language on top.

What you receive

  • cache_dir — .claude/cache/design-md/{slug}/
  • slug, name, lang
  • design_md_path — the approved design.md (now at services/{slug}.md, no longer in cache)
  • logo_src_path — a site-relative path like /logos/toss.png, resolved by the orchestrator. Always present: every catalog entry carries a logo. Use this verbatim as the <img src> value. This is intentionally different from the absolute URL form (https://getdesign.kr/logos/toss.png) stored in design.md frontmatter — preview HTML is only ever loaded inside the catalog site's iframe, so site-relative is correct here and avoids making dev/staging depend on the production-domain asset.
  • runtime_tokens_path — public/preview/_runtime/tokens.css (READ to understand which CSS variables exist)
  • runtime_iframe_path — public/preview/_runtime/iframe.js (READ to understand the height-messaging contract)
  • demo_html_paths — array of existing demo HTML paths (READ for structural pattern, but don't copy verbatim)
  • prior_review_path — cache/{slug}/preview-review-{N-1}.json if this is a revision pass; null on first pass

What you produce

One file in cache_dir: preview.html, carrying both themes.

  • <html lang="ko" data-theme="light"> — light is what the file shows with no runtime at all, so it is the default the markup is written in.
  • Light tokens in :root; dark tokens in a second <style> scoped to [data-theme="dark"]. Never define dark tokens at :root. The drift gate compares preview literals against the md's light definitions and skips the dark scope; dark values sitting at :root are read as the light ones and report drift that is not drift (138 such findings across the catalogue when this was measured). Keep every <style> in <head>, with that dark sheet last and nothing after it — not even a sheet inside <noscript>: the file's sheets are read by position, so a <style> after the dark sheet (in the body, in an icon's <svg>, or later in <head>) stands in for it and the file is refused.
  • Text that is true of only one theme — a label naming that theme's value, demo copy that changes with it — goes in a <template data-theme-variant="dark"> placed immediately after its light counterpart. The shared runtime swaps them when the theme changes. Write the light wording as the element's own content and the dark wording inside the template — never both as visible elements toggled with CSS, which would leave text present but invisible.
    • Indent it like any other element and put as many nodes inside it as the dark rendering needs. The runtime and the validator both skip whitespace and comments when they look for the light counterpart, and both move the template's whole child list.
    • The node in front of the template and the first node the template renders must both be elements of the same kind: the same tag, and a class in common when both carry classes. Keep the wording inside those elements, never as bare text beside them — a swap replaces exactly one node, so text standing in front of a template, or text a template opens with, cannot be swapped cleanly, and the deterministic gate refuses it. A swap is defined by the node in front of it, so if you delete the light element, delete its template too or turn it into an insert; otherwise the swap takes whatever now stands in front of it (in gs-shop it took the demo <div> a trimmed caption used to precede) and dark loses that block. The gate catches that when the node now in front is a different kind of element. It cannot tell when a sibling of the same kind moves into place, so check what stands in front of every template you keep.
    • Never put a <style> inside a template. Dark-only rules go in the trailing [data-theme="dark"] sheet: the file's sheets are read by position, so a sheet inside a template stands in for that one and the file is refused.
    • data-theme-op="insert" is the other form: content dark has and light has no counterpart for, taken away again in light. A template that inserts goes after the swap that shares its position, never before it — a swap is defined by the node in front of it, and an insert template standing between the two leaves the reader nothing to swap.

Read the full file on GitHub · 324 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed 1ccce7f06cb8
  2. 13d ago Changed ecf81ad43406
  3. 19d ago Changed · +16 lines 1812ec2e60b6
  4. 20d ago Changed 3276cd172898
  5. 21d ago Changed · +19 lines 39a05160ea7f
  6. 22d ago Changed 8ff4b86f221d
  7. 23d ago Changed 44c5f2e50bce
  8. 1mo ago Changed · +2 lines 4f675a1553e7
  9. 1mo ago Changed · +15 lines a4de59eb45f9
  10. 1mo ago First seen · 272 lines · 66 tokens per session scan A 55cce2229fe1

Subscribe to this mod's changes

preview-html-author is an agent published in the GitHub repository CaesiumY/ko-design-md (65 stars, last pushed yesterday), licensed MIT. It adds 66 tokens to every session and 10,292 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

tone

Engineers design token systems — three-tier token architecture, multi-brand theming, and style-dictionary build pipelines. Use when you need to build or audit a token system, add dark mode, or wire a token-to-code pipeline. Trigger with "design my token architecture", "audit my design tokens".

jeremylongshore/tons-of-skills-marketplace · 63 tokens

muriel-forger

Forger juror seat for a muriel jury. Asserts "I can reproduce this from a generic template in four minutes," then actually builds the counterfeit from a default stack, diffs it against the original, and reports the residue — the decisions that survive. Judges one thing only, distinguishability from competent generic…

andyed/muriel · 103 tokens

muriel-pedant

The Pedant jury seat. Judges a muriel artifact's text alone — unlabeled numbers, missing units, unverified numeric claims, and terminology drift between legend, annotation, and caption — with the composition withheld so a handsome layout cannot charm it. Applies the numeric-claim probe list from muriel-critique.md…

andyed/muriel · 112 tokens

muriel-squinter

The Squinter jury seat. Blurs a muriel artifact with muriel.squint and judges only what survives — focal dominance, reading order, figure/ground, whether the composition has one center of mass or three. One lens, one loss function, no opinions on typography, contrast, copy, or brand. Emits the juror ballot defined in…

andyed/muriel · 89 tokens

muriel-stranger

The Stranger jury seat. Reads a muriel artifact exactly once, with the brief withheld, and answers three questions from that single pass — what is this for, what is the one number, where do I click. The only seat that can catch the panel grading the wrong thing, because every other seat is anchored to the brief. Fails…

andyed/muriel · 107 tokens

muriel-thumbnail

The Thumbnail jury seat. Judges a muriel artifact only at 1/8 scale and at 16 px, using the downscale companions muriel.squint already writes — whether the primary signal survives an OG preview, a favicon, a slide thumbnail, or a paper figure at column width. One lens, one loss function, no opinions on full-size…

andyed/muriel · 106 tokens