HTML Anything
Markdown is the draft. HTML is what humans read. Your local agent writes it. The agentic HTML editor — in the agentic era, you don't hand-edit docs anymore, so the output format should be what the reader actually wants: HTML. Local-first, zero API key, reuses the CLI session you already have logged in — 9 coding-agent CLIs auto-detected on your PATH (Claude Code · Cursor Agent · Codex · Gemini CLI · GitHub Copilot CLI · OpenCode · Qwen Coder · Aider · IBM Bob), driven by 75 composable skill templates across 9 deliverable surfaces (magazine articles · keynote decks · résumés · posters · Xiaohongshu cards · tweet cards · web prototypes · data reports · Hyperframes videos). One-click export to WeChat / X / Zhihu, or download .html / .png.
Showcase
The eight skills that surface at the top of the picker's Featured / 推荐 group — sorted by their recommended: rank in SKILL.md frontmatter (lower = higher). Each ships a real example.html you can open straight from the repo, no auth, no setup.
The full skill catalog (organized by mode) is in Skills below.
Why this exists
Anthropic's Claude Code team announced they stopped writing internal docs in Markdown — they ship HTML now. The argument is simple:
| Markdown | HTML |
|---|
| Good for the writer | Good for the reader |
| Layout limited to the renderer | Layout is yours |
| Looks ugly screenshotted into a tweet | Already looks like a designed image |
| Has to be re-flowed for WeChat / Zhihu / newsletter | One-click format conversion |
HTML is the final form for humans. Markdown is just an intermediate state during writing.
But "writing HTML" used to mean writing CSS, picking type scales, snapping to a grid, doing responsive — most users won't, designers won't bother, writers don't have the patience. So what we built: after you press ⌘+Enter, your local AI agent turns any input (Markdown / CSV / Excel / JSON / SQL / raw notes) into a ship-ready single-file HTML in seconds, then one-click sends it to WeChat / X / Zhihu / anywhere. "Ship-ready" is the bar — when generation finishes, the artifact is what your audience actually sees. No "I'll touch it up later" pass.
We stand on four open-source shoulders:
nexu-io/open-design — the agent-detection layer, the design-system model, and the SKILL.md protocol. next/src/lib/agents/ and next/src/lib/templates/skills/* mirror this architecture directly.
mdnice/markdown-nice — proof that juice-inlined CSS pastes cleanly into WeChat and Zhihu without per-platform manual fix-up.
gcui-art/markdown-to-image — the iframe → high-DPI PNG export path.
alchaincyf/huashu-md-html — the anti-AI-slop discipline that maps into the hard constraints inside every SKILL.md (CJK-first font stack, 8 px baseline grid, contrast ≥ 4.5, must-use-real-data rule).
At a glance
| What you get |
|---|
| Coding-agent CLIs (8) | Claude Code · Cursor Agent · OpenAI Codex · Gemini CLI · GitHub Copilot CLI · OpenCode · Qwen Coder · Aider — scanned on startup across PATH (including ~/.local/bin, ~/.bun/bin, /opt/homebrew/bin, ~/.npm-global/bin — directories a GUI-launched Node process normally misses), swap from the top-bar picker. |
| Zero API key | We reuse the session you already have logged in via claude login · cursor login · gemini auth. Your existing subscription does the work; marginal cost is $0. |
| 75 skill templates | prototype (web / SaaS landing / dashboard / data report) · deck (20 keynote skills incl. Swiss International, Guizang Editorial, XHS Pastel, Hermes Cyber, Replit, Magazine Web…) · frame (10 Hyperframes video frames — liquid hero, NYT data chart, sticky-note flowchart, glitch title, cinema light-leak, macOS notification, logo outro…) · social (X / Xiaohongshu / Spotify / Reddit cards) · office (PM spec · eng runbook · finance report · HR onboarding · invoice · OKRs · weekly update · meeting notes · kanban) · doc (Kami warm-parchment editorial) · mockup (3D device frame) · vfx (text-cursor effect). |
| 9 surface modes | 📖 magazine article · 🎬 keynote deck · 📄 résumé · 🖼️ poster · 📱 Xiaohongshu card · 🐦 tweet card · 🛠️ web prototype · 📊 data report · 🎞️ Hyperframes video. Each has multiple skills you can pick from. |
| One-click export | juice inlines CSS → WeChat paste with zero re-formatting · modern-screenshot renders the iframe to a 2× PNG → ClipboardItem → drop straight into the tweet composer · <mjx-container> → data-eeimg placeholder → Zhihu equations render automatically · standalone .html download · high-DPI .png download. |
| Streaming render | POST /api/convert over SSE. The agent's stdout JSON-line stream is parsed for text deltas → server-sent events → client appends → iframe srcdoc updates live. Waiting for an AI generation looks like watching it type in real time. |
|
Demo
Quickstart
git clone https://github.com/nexu-io/html-anything
cd html-anything
pnpm install
pnpm -F @html-anything/next dev
# → http://localhost:3000
Open the browser → the top bar auto-detects whichever coding-agent CLI you already have signed in → pick a template → paste content → ⌘+Enter.
No API key required. We reuse the session you already have logged in (Claude / Cursor / Codex / Gemini / Copilot subscriptions all work).
Workspace
This repo is a small pnpm workspace:
next/ is the complete Next app (@html-anything/next).
e2e/ is the browser-test package (@html-anything/e2e) and the only source of truth for Playwright cases.
- root owns CI, docs, and
scripts/guard.ts; root package.json intentionally does not proxy app or e2e commands.
Run package commands from the repo root:
pnpm exec tsx scripts/guard.ts
pnpm -F @html-anything/next dev
pnpm -F @html-anything/next typecheck
pnpm -F @html-anything/next test
pnpm -F @html-anything/next build
pnpm -F @html-anything/e2e typecheck
pnpm -F @html-anything/e2e test
Supported coding agents
On startup we scan PATH (including ~/.local/bin, ~/.bun/bin, /opt/homebrew/bin, ~/.npm-global/bin — directories normally missed by GUI-launched Node) and surface every CLI we recognize:
| Agent | Detection binary | Invocation |
|---|
| Claude Code | claude | claude -p --output-format stream-json |
| OpenAI Codex | codex | codex exec --json --sandbox workspace-write |
| Cursor Agent | cursor-agent | cursor-agent --print --output-format stream-json --force --trust |
| Gemini CLI | gemini | gemini --output-format stream-json --yolo |
| GitHub Copilot CLI | copilot | copilot --allow-all-tools --output-format json |
| OpenCode | opencode-cli / opencode | opencode run --format json --dangerously-skip-permissions - |
| Qwen Coder | qwen | qwen --yolo - |
| Aider | aider | aider --no-pretty --no-stream --yes-always --message-file - |
| IBM Bob | bob | bob --output-format stream-json --hide-intermediary-output |
The detection strategy and per-CLI adapter shape are borrowed directly from nexu-io/open-design and multica-ai/multica: one privileged process spawns CLIs, JSON-line is the wire protocol, every CLI gets a thin adapter in next/src/lib/agents/argv.ts.
If you've already done claude login / cursor login / gemini auth in your terminal, HTML Anything reuses that session. No second copy of the API key required.
Skills
75 skills under next/src/lib/templates/skills/, each a folder following the Claude Code SKILL.md convention plus an extended frontmatter (mode · scenario · surface · preview · design_system).
The two axes the picker uses:
- mode —
prototype (web / SaaS landing / dashboard / data report / résumé / doc) · deck (20 horizontal-swipe presentations) · frame (10 Hyperframes motion frames) · social (4 social-card formats) · office (PM / engineering / finance / HR / operations document surfaces).
- scenario —
design · marketing · engineering · product · finance · hr · sale · personal. Used to group skills in the picker.
Web prototypes & marketing pages (prototype mode)
| Skill | Best for | Output |
|---|
prototype-web | Generic web prototype (default) | Single-page HTML, 1440×900 desktop |
saas-landing | SaaS landing page | Hero / features / pricing / CTA |
waitlist-page | Waitlist / early-access page | Minimal form + social proof |
pricing-page | Pricing page | Multi-tier comparison tables |
dashboard | Admin / analytics console | Sidebar + dense data layout |
docs-page | Technical documentation | 3-column docs layout |
blog-post | Long-form blog post | Editorial layout |
mobile-app | iOS / Android prototype | iPhone 15 Pro chrome |
mobile-onboarding | App onboarding flow | Splash · value · sign-in trio |
gamified-app | Gamified app | Quest · XP · level trio |
Decks (deck mode, 20 skills)
Hyperframes video frames & VFX & device mockups (frame / vfx / mockup, 12 skills)
Frame scripts conform to the heygen-com/hyperframes spec and hand off straight to remotion-dev/remotion to render .mp4.
Social share cards (social mode)
For source-backed X / Twitter cards, capture the tweet text, author, reply
counts, likes, views, media URLs, and thread context with
TweetClaw, then paste that packet
into social-x-post-card
or card-twitter. Keep HTML
Anything responsible for visual rendering and export; keep scraping, approval,
and publishing in your own workflow.
Office & operations (office / doc mode)
Adding a skill takes one folder. Copy a similar skill, edit its SKILL.md frontmatter, restart pnpm -F @html-anything/next dev, the picker shows it. See CONTRIBUTING.md for the bar a skill PR has to clear before we merge.
Six load-bearing ideas
1 · We don't ship an agent. Yours is good enough.
On boot the browser calls /api/agents. The server scans PATH — including the dirs a GUI-launched Node usually misses (~/.local/bin, ~/.bun/bin, /opt/homebrew/bin, ~/.npm-global/bin) — and surfaces whichever CLIs it finds. Each CLI has one adapter (argv + stdin protocol + stream parser) in next/src/lib/agents/argv.ts. The whole detection model is borrowed directly from nexu-io/open-design and multica-ai/multica: one privileged process spawns CLIs, JSON-line is the wire protocol.
2 · Skills are folders, not plugins.
Following Claude Code's SKILL.md convention — SKILL.md + assets/ + references/ + example.html. Drop a folder into next/src/lib/templates/skills/, restart pnpm -F @html-anything/next dev, the picker shows it. deck-guizang-editorial is vendored directly from op7418/guizang-ppt-skill with original LICENSE and authorship preserved.
3 · Hard constraints stop the model from freestyling.
Every template hardcodes:
- CJK-first font stack —
Noto Sans/Serif SC / source-han for Chinese, Inter / Manrope for Latin.
- 8 px baseline grid — every spacing, line-height, font-size is a multiple of 8.
- Rounded corners · soft shadow · no pure black / pure white — visual de-slop-ification.
- Color contrast ≥ 4.5, every interactive element has a real
:focus state.
- Must use the user's real data, no lorem ipsum.
The discipline is lifted from alchaincyf/huashu-design's Junior-Designer mode + anti-AI-slop checklist. Constraints belong in the prompt — every SKILL.md writes them in.
4 · Streaming render = watch the AI draw.
POST /api/convert is SSE. The agent's stdout is line-delimited JSON; the server pulls out the text deltas and re-emits them as SSE events; the client appends to the iframe's srcdoc. The whole experience is the same as watching the agent type in a terminal, except the artifact is HTML, not Markdown. Interrupt at any time — you're not paying for a whole generation you don't want.
5 · One-click export = zero second-pass formatting.
- WeChat MP —
juice inlines CSS + data-tool markers → paste into the editor, styles survive end to end.
- X / Weibo / Xiaohongshu —
modern-screenshot renders the iframe to a 2× PNG → ClipboardItem → drop straight into the composer.
- Zhihu — same as above, plus
<mjx-container> is replaced with data-eeimg LaTeX-image placeholders (Zhihu won't render KaTeX live — math has to be an image).
- Download
.html / download .png — self-contained single file, shareable anywhere.
Mechanically inspired by mdnice/markdown-nice and gcui-art/markdown-to-image.
6 · Sandboxed iframe = secure + isolated.
User-emitted HTML always renders inside <iframe sandbox="allow-scripts allow-same-origin">. Third-party scripts (Tailwind CDN, Google Fonts, custom animations) still execute, but cookies and localStorage stay in the iframe's own origin — the host page is never poisoned. Opening devtools only shows the iframe's DOM, so the debugging experience matches a standalone HTML file.
Architecture
┌─────────────────────── Browser (Next.js 16) ──────────────────────┐
│ Editor / upload · top-bar agent picker · template picker · iframe │
└─────────────┬──────────────────────────────────┬──────────────────┘
│ ⌘+Enter │
▼ ▼
┌─────────────────────┐ ┌──────────────────────┐
│ GET /api/agents │ │ POST /api/convert │
│ scan PATH, list │ │ SSE — spawn CLI │
│ installed CLIs │ │ pipe stdin / stdout │
└─────────────────────┘ └──────────┬───────────┘
│ spawn + stdin pipe
▼
┌────────────────────────────────────┐
│ Your local coding-agent CLI │
│ claude / codex / cursor-agent / │
│ gemini / copilot / opencode / │
│ qwen / aider │
│ → reuses your existing session │
└────────────────────────────────────┘
│
▼
stdout JSON-line ──► SSE event
│
▼
iframe srcdoc append (live)
│
⌘+C copy → ClipboardItem
⌘+S download → .html / .png
| Layer | Stack |
|---|
| Frontend | Next.js 16 App Router + Turbopack · React 19 · Tailwind v4 · zustand state |
| Server routes | GET /api/agents (detection) · POST /api/convert (SSE streaming spawn) |
| Agent transport | child_process.spawn · one stdin/stdout adapter per CLI (next/src/lib/agents/argv.ts) |
| Browser-side processing | juice (CSS inlining) · modern-screenshot (PNG export) · xlsx / papaparse (spreadsheet parsing) · marked + highlight.js (Markdown-compatible input) · dompurify (XSS defense) |
| Preview sandbox | iframe[sandbox="allow-scripts allow-same-origin"] + srcdoc |
| Export targets | .html standalone · .png high-DPI · ClipboardItem (text/html + image/png) · WeChat-compatible inlined CSS |
| Deploy | Local pnpm -F @html-anything/next dev · Vercel one-click for the web layer (agent stays local) |
Export targets
| Platform | Implementation | Paste behavior |
|---|
| WeChat MP | juice inlines CSS + data-tool markers | Paste into editor, zero re-formatting |
| Zhihu | Same as WeChat + <mjx-container> → data-eeimg LaTeX image placeholder | Equations render after upload |
| X / Weibo / Xiaohongshu | modern-screenshot → 2× PNG → ClipboardItem | Drop straight into the composer |
Download .html | Single-file, inlined assets | Open anywhere with a browser |
Download .png | High-DPI screenshot | Share anywhere |
Roadmap
Status
Early but real. The closed loop — detect agent → pick skill → SSE stream → sandboxed iframe preview → one-click export — runs end-to-end against all 8 CLIs listed above. The skill library and the SKILL.md hard-constraints are where most of the leverage lives, and both are stable. The picker UX, design-system metadata, and the multi-template compare flow ship daily. If something looks broken on your machine, open an issue with the agent CLI you were using and the input — those are the bug reports that move things forward fastest.
| Surface | State |
|---|
| Agent detection (8 CLIs) | ✅ stable |
| Skill registry + picker (75 skills) | ✅ stable |
| SSE streaming render | ✅ stable |
| Sandboxed iframe preview | ✅ stable |
One-click WeChat / X / Zhihu / .html / .png export | ✅ stable |
| CSV / Excel / JSON / SQL format auto-detect | ✅ stable |
| Multi-template compare (generate 4, pick 1) | 🛠 in progress |
Hyperframes → .mp4 one-click handoff to Remotion | 🛠 in progress |
| Browser extension (select on any page → convert) | ⏳ planned |
| History / version diff / IndexedDB archive | ⏳ planned |
Skill marketplace (install <github-repo>) | ⏳ planned |
Security
The Next API surface is the local-only side of the app — /api/convert spawns the user's coding-agent CLI with maximally permissive flags, /api/deploy writes credentialed config to disk. Both are intended for a single operator on a single machine. To prevent a malicious page from DNS-rebinding attacker.example to 127.0.0.1 and POSTing into those routes through the user's browser, every /api/* request is gated on a Host-header allowlist in next/src/middleware.ts.
| Setting | When to use |
|---|
| Default (no env vars set) | The common case — next dev / next start on your own machine. 127.0.0.1, localhost, and ::1 Host headers (any port) are accepted. Everything else gets a 403 { "error": "Host not allowed" }. |
HTML_ANYTHING_ALLOWED_HOSTS=daemon.mirage.local,html-anything.lan | LAN / mDNS setup — you're reaching the app from another device on the same network and the browser dials a non-loopback hostname. Comma-separated; port-insensitive; case-insensitive. The default loopback set is still accepted on top of this. |
HTML_ANYTHING_ALLOW_ANY_HOST=1 | Reverse-proxy mode — Caddy / nginx / Cloudflare Tunnel is terminating the public hostname and forwarding to the app. The proxy is now responsible for Host policy. Loudly insecure if you set this without a trusted proxy in front, so it is not the default. |
Set the env var in whatever environment file your launcher reads (e.g. next/.env.local). The middleware is pinned to the Node runtime (export const runtime = "nodejs" in next/src/middleware.ts) so process.env is read per-request — Edge middleware can inline process.env.* at build time, which would silently break operator overrides set after next build. The validation is unit-tested in next/src/lib/security/host-validation.test.ts and the loopback-still-works dev path is exercised in the Playwright spec at e2e/ui/host-validation.spec.ts.
Contributing
Issues, PRs, new skills, new agent adapters, new export targets, and translations are all welcome. The highest-leverage contributions are usually one folder, one Markdown file, or one PR-sized adapter — small surface area, big leverage. Pick the slot that matches what you want to add:
- Add a skill — drop a folder into
next/src/lib/templates/skills/ with SKILL.md + example.html (+ optional assets/ and references/). The picker auto-discovers it after pnpm -F @html-anything/next dev restart. The SKILL.md frontmatter has to set mode · scenario · surface · preview · design_system — copy a neighbour and edit.
- Wire up a new coding-agent CLI — one entry in
next/src/lib/agents/argv.ts covering: detection binary, argv builder, stdin/stdout protocol, stream parser. Detection is exercised by next/src/app/api/agents/ and the spawn loop by next/src/app/api/convert/.
- Add an export target — drop a module under
next/src/lib/export/ (next to wechat.ts / image.ts / clipboard.ts) and add the button to the export menu. WeChat Channels · Douyin captions · Notion · Linear · Telegraph · RSS are all open.
- Sharpen a
SKILL.md — strengthen the hard-constraints (CJK font stack, 8 px baseline, contrast ≥ 4.5, must-use-real-data), add a 5-dimensional self-critique, swap in a better palette. Anti-AI-slop discipline is the most underrated PR shape we accept.
- Translations & docs —
README.zh-CN.md and CONTRIBUTING.zh-CN.md are kept in parallel with the English files; please update both.
Full walkthrough, bar-for-merging, code style, and what we don't accept → CONTRIBUTING.md (简体中文).
References & lineage
Every external project this repo borrows from — what we take from each, and where it lands in the tree.
Each bundled upstream skill retains its original LICENSE and authorship inside its own next/src/lib/templates/skills/<skill>/ folder.
Stay in the loop
Follow @nexudotio on X for release notes, new skills, and the occasional behind-the-scenes thread on what's shipping next. The HTML Anything Discord channel is where demos, template requests, export/debugging questions, and bigger community conversations happen — run by the upstream open-design team.
Contributors
Thanks to everyone who has filed an issue, opened a PR, or added a skill / agent adapter / export target. Every real contribution counts, and the wall below is the easiest way to say so out loud.
If you've shipped your first PR — welcome. The good-first-issue / help-wanted labels are the entry point.
Star History
If the curve bends up, that's the signal we look for. ★ this repo to push it.
License
Apache-2.0 © 2026 HTML Anything contributors. See LICENSE.
Bundled work retains its original license and authorship attribution — see the per-skill LICENSE / README.md inside each next/src/lib/templates/skills/<skill>/ folder for what it inherits from upstream.