web-artifacts-builder
/web-artifacts-builder
Build claude.ai HTML artifacts from a React + Tailwind + shadcn template with a page kit, a theme design system, a themed diagram renderer and a one-call build+verify. Use for interactive or multi-section artifacts needing state, charts, diagrams or components — not a trivial single-file snippet.
- Author
- iamshobe ↗
- Repository
- dotfiles ↗
- Licence
- Apache-2.0
- Last repository change
- 11.11.2026
Assessment and security
- Files in this package
- 97
- Scripts
- 68
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
- 68 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/build-artifact-fast.sh, scripts/build.sh, scripts/diagram-to-jsx.sh, scripts/diagrams/__init__.py, scripts/diagrams/charts.py, scripts/diagrams/core.py, scripts/diagrams/graph.py, scripts/diagrams/matrix.py
What it does and when to use it
Build claude.ai HTML artifacts from a React + Tailwind + shadcn template with a page kit, a theme design system, a themed diagram renderer and a one-call build+verify. Use for interactive or multi-section artifacts needing state, charts, diagrams or components — not a trivial single-file snippet.
Original author description
Build claude.ai HTML artifacts from a React + Tailwind + shadcn template with a page kit, a theme design system, a themed diagram renderer and a one-call build+verify. Use for interactive or multi-section artifacts needing state, charts, diagrams or components — not a trivial single-file snippet.
How it works
- Build — one call
- Building blocks
- Rich libraries (pre-installed; import directly, Vite inlines them)
- The iframe scrolls differently (critical)
- Design
- Notes
SKILL.md preview
---
name: web-artifacts-builder
description: Build claude.ai HTML artifacts from a React + Tailwind + shadcn template with a page kit, a theme design system, a themed diagram renderer and a one-call build+verify. Use for interactive or multi-section artifacts needing state, charts, diagrams or components — not a trivial single-file snippet.
license: Complete terms in LICENSE.txt
---
# Web Artifacts Builder
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.
## Build — one call
The bottleneck is agent round-trips, not the build. Minimize turns:
- Send independent calls in one response: `Write App.tsx` + `Bash build.sh`; on edits `Edit` + `build.sh` + `Artifact` publish together.
- Read the references you need in one `cat`, not one `Read` each. Don't re-read a file you just wrote.
- Each Bash call is a fresh shell: call scripts by absolute path (`build.sh` resolves its own deps).
- Fix every ✗ from verify in one edit pass, then one rebuild.
```bash
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:
```tsx
// @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.
## Building blocks
- **Page kit** (`@/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.
- **Design system**: theme vars, colors, contrast, narrow-width rules → `references/design.md` (rules for any custom JSX) and `references/theme-tokens.md` (raw values; the palette lives in `template/src/theme.tsx`).
- **Diagrams**: `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.
- **Verify**: `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.
## Rich libraries (pre-installed; import directly, Vite inlines them)
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 iframe scrolls differently (critical)
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.)
- **TOC/scrollspy:** vendored `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.
- **Pinned/scrollytelling:** `position: fixed` (not sticky), inline fallback on narrow screens; drive steps with `IntersectionObserver`.
Scaffolds + jitter-free CSS: `references/recipes.md`.
## Design
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`.
## Notes
- shadcn docs: https://ui.shadcn.com/docs/components · adding a component (vendor it, no build-time network): `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)`.
- **Stale-clone gotcha:** `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.
Files in this package (97)
- .gitignore 1 KB
- LICENSE.txt 11 KB
- SKILL.md 8 KB
- assets/diagram-design-profile.md 11 KB
- references/design.md 4 KB
- references/diagram-brief.md 6 KB
- references/diagram-types.md 5 KB
- references/kit.md 5 KB
- references/libraries.md 8 KB
- references/mermaid.md 3 KB
- references/recipes.md 4 KB
- references/theme-tokens.md 2 KB
- scripts/build-artifact-fast.sh 1 KB
- scripts/build.sh 2 KB
- scripts/diagram-to-jsx.sh 7 KB
- scripts/ensure-deps.sh 4 KB
- scripts/make-artifact.sh 3 KB
- scripts/new-artifact.sh 1 KB
- scripts/verify.sh 16 KB
- scripts/diagrams/__init__.py 1 KB
- scripts/diagrams/charts.py 38 KB
- scripts/diagrams/core.py 18 KB
- scripts/diagrams/graph.py 75 KB
- scripts/diagrams/matrix.py 16 KB
- scripts/diagrams/preview.sh 2 KB
- scripts/diagrams/render.py 4 KB
- scripts/diagrams/sequence.py 25 KB
- scripts/diagrams/stack.py 19 KB
- scripts/diagrams/timeline.py 22 KB
- template/.gitignore 1 KB
- template/.oxlintrc.json 1 KB
- template/README.md 1 KB
- template/components.json 1 KB
- template/index.html 1 KB
- template/package.json 2 KB
- template/pnpm-lock.yaml 153 KB
- template/postcss.config.js 1 KB
- template/tailwind.config.js 2 KB
- template/tsconfig.app.json 1 KB
- template/tsconfig.json 1 KB
- template/tsconfig.node.json 1 KB
- template/vite.config.ts 1 KB
- template/public/favicon.svg 9 KB
- template/public/icons.svg 5 KB
- template/src/App.css 1 KB
- template/src/App.tsx 1 KB
- template/src/index.css 1 KB
- template/src/main.tsx 1 KB
- template/src/theme.tsx 2 KB
- template/src/assets/hero.png 13 KB
- template/src/assets/react.svg 4 KB
- template/src/assets/vite.svg 9 KB
- template/src/components/ui/accordion.tsx 2 KB
- template/src/components/ui/alert.tsx 2 KB
- template/src/components/ui/aspect-ratio.tsx 1 KB
- template/src/components/ui/avatar.tsx 1 KB
- template/src/components/ui/badge.tsx 1 KB
- template/src/components/ui/breadcrumb.tsx 3 KB
- template/src/components/ui/button.tsx 2 KB
- template/src/components/ui/card.tsx 2 KB
- template/src/components/ui/carousel.tsx 6 KB
- template/src/components/ui/checkbox.tsx 1 KB
- template/src/components/ui/collapsible.tsx 1 KB
- template/src/components/ui/command.tsx 5 KB
- template/src/components/ui/context-menu.tsx 7 KB
- template/src/components/ui/dialog.tsx 4 KB
- template/src/components/ui/drawer.tsx 3 KB
- template/src/components/ui/dropdown-menu.tsx 7 KB
- template/src/components/ui/hover-card.tsx 1 KB
- template/src/components/ui/input.tsx 1 KB
- template/src/components/ui/label.tsx 1 KB
- template/src/components/ui/menubar.tsx 8 KB
- template/src/components/ui/navigation-menu.tsx 5 KB
- template/src/components/ui/popover.tsx 1 KB
- template/src/components/ui/progress.tsx 1 KB
- template/src/components/ui/radio-group.tsx 1 KB
- template/src/components/ui/resizable.tsx 2 KB
- template/src/components/ui/scroll-area.tsx 2 KB
- template/src/components/ui/scrollspy.tsx 9 KB
- template/src/components/ui/select.tsx 6 KB
- template/src/components/ui/separator.tsx 1 KB
- template/src/components/ui/sheet.tsx 4 KB
- template/src/components/ui/skeleton.tsx 1 KB
- template/src/components/ui/slider.tsx 1 KB
- template/src/components/ui/sonner.tsx 1 KB
- template/src/components/ui/switch.tsx 1 KB
- template/src/components/ui/table.tsx 3 KB
- template/src/components/ui/tabs.tsx 2 KB
- template/src/components/ui/textarea.tsx 1 KB
- template/src/components/ui/toast.tsx 5 KB
- template/src/components/ui/toaster.tsx 1 KB
- template/src/components/ui/toggle-group.tsx 2 KB
- template/src/components/ui/toggle.tsx 1 KB
- template/src/components/ui/tooltip.tsx 1 KB
- template/src/hooks/use-toast.ts 4 KB
- template/src/kit/index.tsx 58 KB
- template/src/lib/utils.ts 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · iamshobe/dotfiles | 100 | Apache-2.0 |
| Navinspire-ia/navin | 100 | AGPL-3.0 |
| rootcastleco/rei-skills | 100 | MIT |
| opencue/cuecards | 100 | MIT |
| majiayu000/spellbook | 100 | MIT |
| anthropics/skills | 100 | Apache-2.0 |
| traylinx/switchAILocal | 100 | Apache-2.0 |
| wide-moat/open-computer-use | 100 | Apache-2.0 |
| ar4mirez/samuel | 100 | MIT |
Database snapshot: 13.11.2026 · package version 5ee70c7845ea (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100od-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use when the user asks for artifacts builder work, or mentions od, artifacts, builder. - 95artifacts-builder
当用户需要创建复杂的多组件 HTML Artifacts(包含 React、Tailwind CSS、shadcn/ui)时使用。此 Skill 用于需要状态管理、路由或 shadcn/ui 组件的复杂 Artifacts,不适用于简单的单文件 HTML/JSX。 - 100artifacts-builder
Suite of tools for creating elaborate, multi-component AI artifacts viewer HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts. - 100artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts. - 100building-web-artifacts
Use when building elaborate, multi-component HTML artifacts using modern frontend technologies (React, Tailwind CSS, shadcn/ui). Triggers include requests for complex web artifacts requiring state management, routing, or shadcn/ui components. Not for simple single-file HTML/JSX… - 100web-artifacts-builder-v2
Suite of tools for creating elaborate, multi-component claude.ai HTML artefacts using modern frontend web technologies (React 19, Tailwind CSS v4, shadcn/ui). Use for complex artefacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artefacts.