/howtoai-design:web-artifactsfrom How to AI — Design
Builds single-file interactive web artifacts — tools, calculators, quizzes, games, mini-apps — engineered for sandboxes that block network and storage. Use for "build an artifact" or a one-file app.
Ships in How to AI — Design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
An artifact is one HTML file that must do everything itself, inside a sandbox you don't control. The engineering skill is not writing the app — it's writing the app so nothing it depends on can be taken away. Build for the strictest sandbox; anything looser is a bonus you discover, never a plan.
Assume all five, always. Verifying a host allows more comes after a working build, not before.
| Constraint | Working assumption | Build consequence |
|---|---|---|
| Network | Every external request is blocked — CDN scripts, stylesheets, fonts, images, fetch/XHR/WebSockets | Inline every byte. Libraries as inline JS, styles in <style>, icons as inline SVG, data baked in at build time |
| Storage | localStorage, sessionStorage, IndexedDB, cookies throw or vanish | State lives in JS memory. Persistence = export/import (download JSON, paste-to-restore) |
| Files | Exactly one file, no routes, no backend | Views are state, not pages. "Navigation" swaps a view variable and re-renders |
| Size | Single-digit-MB budgets; embedded data counts | Prefer generated/SVG assets over base64 blobs; trim data to what the UI shows |
| Viewport | Rendered in an iframe of unknown size, either color theme | Relative units, no hardcoded heights, both prefers-color-scheme modes styled |
Some hosts document exceptions — a whitelisted CDN, a runtime API for model calls or shared state. Treat each as an upgrade to layer on with a fallback, not a foundation. An artifact that dies when the exception disappears was built wrong.
Deny-list details, inlining strategies per asset type, and graceful-degradation
shims (safe storage wrapper, capability probes): read
references/sandbox-constraints.md.
One hand-written HTML file: vanilla JS, a single state object, a render()
function, styles scoped in one <style> block. This covers calculators,
quizzes, timers, converters, dashboards over baked-in data, and most games —
and it stays debuggable because the file is the source.
Escape hatch — only when the app genuinely needs component architecture
(many interdependent views, complex shared state): scaffold a real React
project, then compile it down to one self-contained HTML file. Structure
templates for both, the state/render pattern, and the exact scaffold-and-bundle
commands: read references/single-file-patterns.md.
Aesthetics are a separate discipline — the frontend-taste skill governs how the artifact looks; this skill governs whether it survives.
An artifact is untested until it has been rendered and used, not code-read. Before calling it done:
localStorage read (throws in stricter sandboxes),100vh/fixed heights (measure the iframe, not the screen),undefined because its CDN tag was blocked.http in src=/href=/url( — any hit is a
dependency that will be blocked.Say so early, before building: real persistence across sessions or devices, multiple users sharing state, authentication, secrets, or datasets too big to inline all mean the honest answer is a real app with a backend — an artifact version will demo well and then lose everyone's data.
window.localStorage throws a SecurityError — if (window.localStorage) is itself the crash. Wrap the access, not just the
usage, in try/catch.Chart is not defined. The
fix is inlining, not guards.<link> or @import that
gets blocked just falls back — the artifact runs but looks wrong everywhere.
Design on a system font stack; embed woff2 as base64 only if a specific face
is essential (and budget its size).alert(), confirm(), prompt(), and window.open() are typically dead
in sandboxed iframes (no allow-modals/popup flags). Build in-page modals;
never gate a flow on a native dialog.<form> submit navigates the iframe (or gets blocked). Always
preventDefault() and handle in JS — an un-prevented Enter keypress can
blank the whole artifact.<link rel="modulepreload">,
crossorigin attributes, or lazy-loaded chunks referencing files that no
longer exist after single-file inlining. Grep the bundle output for external
references (checklist step 5) — it catches all of these.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub rubenhassid1/howtoai-skills --plugin howtoai-design12 skills in this plugin
/bannersDesigns banner and cover graphics — LinkedIn banners, X headers, YouTube channel art, event covers, OG images — as pixel-exact HTML at each surface's real dimensions and safe zones./brand-kitBuilds a brand identity system — color roles, type pairing, logo direction, reusable brand tokens other skills consume. Use for "brand kit", "brand identity", "my brand colors", "brand guidelines", or "make my stuff look consistent"./design-critiqueReviews a design — screenshot, URL, Figma export, or built UI — with a severity-ordered verdict on visual quality, usability, and accessibility in one pass. Use for "critique my design", "design review", "is this accessible", "roast my landing page"./design-stylesPicks a named visual style and executes it faithfully — brutalist, neobrutalist, minimalist, soft, glassmorphic, luxury, playful, and more. Use when asked to "make it brutalist", "make it feel soft/premium", or "what style should this be"./design-systemBuilds or extracts a reusable design system: token architecture (primitive, semantic, component) plus a documented component set. Use for "design system", "design tokens", or "component library"./frontend-tasteAesthetic judgment for any web UI being built, replacing AI-default habits with deliberate design decisions. Use while building frontend interfaces, or when asked to make it look good, look less generic, or not look AI-generated.Other plugins' skills for the same job