web-artifacts-builder
Install this skill
npx skills add anthropics/skillsWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
The web-artifacts-builder skill automates the creation of self-contained React applications meant for Claude’s artifact interface. It provides a structured environment using React 18, Vite, and Tailwind CSS, bundled through Parcel into a single HTML file. By abstracting the complex setup of inline bundling, this skill allows developers to focus on component logic rather than build configuration. It includes pre-configured path aliases and a suite of over 40 shadcn/ui components, ensuring consistency and speed. The workflow emphasizes producing clean, production-ready code while strictly avoiding common aesthetic patterns associated with synthetic AI outputs, such as excessive purple gradients or uniform rounded corners. It maintains a lightweight footprint by focusing on essential bundling processes, ensuring the resulting code is shareable and immediately viewable within the Claude environment.
When to Use This Skill
- •Creating interactive dashboards for data visualization
- •Prototyping standalone UI components for frontend testing
- •Building functional educational widgets for users
- •Developing self-contained game prototypes
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- “build me a React artifact for this dashboard
- “initialize a new artifact project using the web-artifacts-builder
- “generate a single HTML file for this React component
- “create a shadcn-based artifact project named my-app
- “bundle my current React directory into an artifact
Pro Tips
- 💡Always adhere to the design guidelines to prevent 'AI slop' and maintain a professional aesthetic for your artifacts.
- 💡Utilize shadcn/ui components extensively to ensure consistency, accessibility, and accelerate development of polished UIs.
- 💡For simpler, single-file HTML/JSX needs without complex state or routing, consider alternative, lighter skills to optimize performance and generation time.
What this skill does
- •Initializes React projects with Vite and TypeScript
- •Integrates shadcn/ui and Tailwind CSS pre-configured
- •Bundles entire React codebases into a single, portable HTML file
- •Handles complex asset inlining for artifact compatibility
- •Enforces path alias configurations for cleaner import statements
When not to use it
- ✕Building full-stack applications requiring server-side database connections
- ✕Projects needing persistent state across page reloads on different hosts
- ✕High-performance scenarios where multi-file asset loading is strictly required
Example workflow
- Execute the initialization script to setup the Vite environment
- Modify the React source files to build the UI component
- Verify component styles adhere to the design guidelines
- Run the bundling script to generate the final HTML artifact
- Provide the bundle.html file in the chat output
Prerequisites
- –Node.js version 18 or higher
- –Bash shell environment for running scripts
Pitfalls & limitations
- !The bundle process inlines all code, which can result in very large HTML files if assets are not managed
- !Testing inside the build environment is optional and may increase latency if performed incorrectly
- !Manual edits to the parcel configuration may break the bundling process
FAQ
How it compares
Unlike manual bundling where you must configure complex loaders, this skill automates the Parcel build pipeline to ensure code renders correctly as a Claude artifact without manual configuration overhead.
📄 Full skill instructions — original source: anthropics/skills
To build powerful frontend claude.ai artifacts, follow these steps:
1. Initialize the frontend repo using
scripts/init-artifact.sh2. Develop your artifact by editing the generated code
3. Bundle all code into a single HTML file using
scripts/bundle-artifact.sh4. Display artifact to user
5. (Optional) Test the artifact
**Stack**: React 18 + TypeScript + Vite + Parcel (bundling) + Tailwind CSS + shadcn/ui
## Design & Style Guidelines
VERY IMPORTANT: To avoid what is often referred to as "AI slop", avoid using excessive centered layouts, purple gradients, uniform rounded corners, and Inter font.
## Quick Start
### Step 1: Initialize Project
Run the initialization script to create a new React project:
bash scripts/init-artifact.sh <project-name>
cd <project-name>This creates a fully configured project with:
- ✅ React + TypeScript (via Vite)
- ✅ Tailwind CSS 3.4.1 with shadcn/ui theming system
- ✅ Path aliases (
@/) configured- ✅ 40+ shadcn/ui components pre-installed
- ✅ All Radix UI dependencies included
- ✅ Parcel configured for bundling (via .parcelrc)
- ✅ Node 18+ compatibility (auto-detects and pins Vite version)
### Step 2: Develop Your Artifact
To build the artifact, edit the generated files. See **Common Development Tasks** below for guidance.
### Step 3: Bundle to Single HTML File
To bundle the React app into a single HTML artifact:
bash scripts/bundle-artifact.shThis creates
bundle.html - a self-contained artifact with all JavaScript, CSS, and dependencies inlined. This file can be directly shared in Claude conversations as an artifact.**Requirements**: Your project must have an
index.html in the root directory.**What the script does**:
- Installs bundling dependencies (parcel, @parcel/config-default, parcel-resolver-tspaths, html-inline)
- Creates
.parcelrc config with path alias support- Builds with Parcel (no source maps)
- Inlines all assets into single HTML using html-inline
### Step 4: Share Artifact with User
Finally, share the bundled HTML file in conversation with the user so they can view it as an artifact.
### Step 5: Testing/Visualizing the Artifact (Optional)
Note: This is a completely optional step. Only perform if necessary or requested.
To test/visualize the artifact, use available tools (including other Skills or built-in tools like Playwright or Puppeteer). In general, avoid testing the artifact upfront as it adds latency between the request and when the finished artifact can be seen. Test later, after presenting the artifact, if requested or if issues arise.
## Reference
- **shadcn/ui components**: https://ui.shadcn.com/docs/components
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/web-artifacts-builder/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/anthropics/skills/web-artifacts-builder/SKILL.md - Cursor:
~/.cursor/skills/anthropics/skills/web-artifacts-builder/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/anthropics/skills/web-artifacts-builder/SKILL.md
🚀 Install with CLI:npx skills add anthropics/skills