Builds self-contained HTML artifacts from a React + Tailwind + shadcn/ui template with page kit, theme design system, diagram renderer, and one-call build+verify. For interactive multi-section artifacts needing state, charts, or components.
Ships in web-artifacts-builder. 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; scripts run unread.
React + TS + Tailwind + shadcn/ui (41 components) + rich libs → one self-contained bundle.html (all JS/CSS inlined; CSP-safe, no CDN/eval) via Vite in ~0.6s.
Render <Theme/> once near the root of every App.tsx: import { Theme } from '@/theme' then <Theme/> as the first element. It's what actually switches light/dark (via prefers-color-scheme + [data-theme]) and is what shadcn's bg-primary/text-muted-foreground/etc. classes now resolve through. index.css only ships static light-mode fallback hex so the page isn't broken for the instant before mount — it is not a substitute and never switches themes on its own.
The bottleneck is agent round-trips, not the build. Minimize turns:
Write App.tsx + Bash build.sh; on edits Edit + build.sh + Artifact publish together.cat, not one Read each. Don't re-read a file you just wrote.build.sh resolves its own deps).bash scripts/build.sh <name> App.tsx [--specs specs.json] [--repo <checkout>] # render diagrams, bundle, verify → <name>.html
bash scripts/build.sh <name> # rebuild after editing <name>/src/App.tsx
Publish <name>.html with the Artifact tool (the published file's basename is the gallery title, so never bundle.html). Re-publish the same path on edits to keep the URL. scripts/make-artifact.sh <name> [App.tsx | -] is the bare bundle step, without diagrams or verify.
Node missing (bare shell): export PATH="$(dirname "$(mise which node)"):$PATH". First run on a machine: eval "$(bash scripts/ensure-deps.sh)" installs the template packages and finds diagram-design.
Document title (browser tab + Artifact gallery name). Put a @title comment on its own line in App.tsx — the build stamps it into index.html on every run:
// @title: Billing Data Model — Review
export default function App() { … }
Without it the title falls back to <name>, so pick a human-readable <name> (billing-review, not demo). Never leave the placeholder __ARTIFACT_TITLE__ in template/index.html hardcoded to a real name — every future artifact inherits it.
@/kit, shipped in the template): Page (hero, theme, scroll container, grouped TOC rail), Section, text (P, Term, Id, Ref, Src, Mark, Chip, Gone, Added) and blocks (Tldr, BeforeAfter, Changes, Deprecations, TimeChart, Table, Card, Grid, Callout, Code, Steps, Figure, Playground). Read references/kit.md before writing App.tsx; prefer the kit over hand-written JSX.references/design.md (rules for any custom JSX) and references/theme-tokens.md (raw values; the palette lives in template/src/theme.tsx).references/diagram-types.md is the catalog (which type answers which question). ⚙ types render from a JSON spec: python3 scripts/diagrams/render.py --example <type>, then pass the specs to build.sh --specs. ✎ types are drawn by hand following references/diagram-brief.md and converted with scripts/diagram-to-jsx.sh <name> <files>, which maps every color to the theme vars.build.sh ends with scripts/verify.sh <name> [repo] (✗ fails, ⚠ readability warnings: long takeaways and paragraphs, lists over 5, hedges and idioms): theme-only colors, no shadows, responsive grids, title, <Src> links resolve, <Term> order, overflow and tiny text at 390/768/1280px, one light+dark contact sheet. Fix every ✗ in one pass.Reach for one only when it beats plain JSX; unused imports tree-shake out. Before using any lib, read its row in references/libraries.md — per-lib best practices (theme-aware colors, the common gotcha, when not to use it).
| Need | Import |
|---|---|
| Highlight/circle/underline a phrase | react-rough-notation → RoughNotation |
Hover tooltip (wrap a <span>) | @tippyjs/react → Tippy + import 'tippy.js/dist/tippy.css' |
| Syntax-highlighted code | prism-react-renderer → Highlight, themes |
| Charts | recharts (wrap in ResponsiveContainer); values over time → kit <TimeChart> |
| Flow/sequence/state diagram | scripts/diagrams/render.py spec (themed SVG); mermaid only as a last resort (+3MB, ignores the theme) |
| Before/after wipe | react-compare-slider (img src = data-URI) |
| Staggered animation | animejs → animate, stagger |
| Hand-drawn shapes | roughjs → rough |
| Arrows between elements | leader-line → LeaderLine (imperative, init in useEffect) |
Icons: lucide-react. Brand logos: inline Simple-Icons <svg fill="currentColor">.
Bundle baseline ~450KB; +recharts ~+500KB; import mermaid ~+3MB.
Mermaid (last resort): import mermaid, render in a useEffect (native <pre className="mermaid"> no-ops — host only scans initial static HTML). Component → references/recipes.md. Authoring clear, color-coded diagrams (4–7 nodes, classDef color-by-role, shapes, syntax) → references/mermaid.md.
The host auto-sizes the iframe to content; the parent scrolls — there's no inner scroll viewport. So these silently fail: position: sticky, 100vh/h-screen pinning, <a href="#id"> hash-jumps, window scroll listeners (scrollY stays 0), and scroll-root-autodetecting libs (react-scrollama was removed for this).
Fix: make your own scroll container — wrap the page in a ref'd h-screen overflow-y-auto div; everything inside then behaves normally. (Radix portal-based components — Dialog, Sheet, Popover, DropdownMenu, etc., which mount into document.body — are unaffected by this and position correctly; verified against this iframe's auto-sizing model.)
Scrollspy (@/components/ui/scrollspy) with targetRef={scrollRef}, history={false}. It's already hardened (rAF-throttled, no-op on unchanged id, settle-lock so clicks don't flash/trail). Style active jitter-free: never change font-weight (reflows the rail) — reserve bold metrics + signal with color and a transform-scaled dot.position: fixed (not sticky), inline fallback on narrow screens; drive steps with IntersectionObserver.Scaffolds + jitter-free CSS: references/recipes.md.
Avoid "AI slop": no excessive centering, purple gradients, uniform rounded corners, or Inter. Deliberate palette/type/layout. Both themes through the theme vars (references/design.md). Wide content gets overflow-x.
references/recipes.md.verify.sh is the pre-publish test; Playwright only for interaction bugs it can't see.new-artifact.sh / build-artifact-fast.sh = clone / build separately. Template deps missing → (cd template && pnpm install).make-artifact.sh <name> skips the clone if <name>/ exists (rebuild only). Added a file to template/src since? An old clone won't have it → UNLOADABLE_DEPENDENCY. Fix: rm -rf <name> and re-run.LICENSE.txt (opens in a new tab)assets/diagram-design-profile.md (opens in a new tab)references/design.md (opens in a new tab)references/diagram-brief.md (opens in a new tab)references/diagram-types.md (opens in a new tab)references/kit.md (opens in a new tab)references/libraries.md (opens in a new tab)references/mermaid.md (opens in a new tab)references/recipes.md (opens in a new tab)references/theme-tokens.md (opens in a new tab)scripts/build-artifact-fast.sh (opens in a new tab)scripts/build.sh (opens in a new tab)scripts/diagram-to-jsx.sh (opens in a new tab)scripts/diagrams/__init__.py (opens in a new tab)scripts/diagrams/charts.py (opens in a new tab)scripts/diagrams/core.py (opens in a new tab)scripts/diagrams/graph.py (opens in a new tab)scripts/diagrams/matrix.py (opens in a new tab)scripts/diagrams/preview.sh (opens in a new tab)scripts/diagrams/render.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/web-artifacts-builder:web-artifacts-builderfrom web-artifacts-builder
npx claudepluginhub iamshobe/dotfiles --plugin web-artifacts-builder