Back to React & React Native

web-artifacts-builder

ReactTailwind CSSshadcn/uiHTML artifactsFrontend developmentAI agentsUI generationTypeScript
151.5k🕒 2026-06-09Source ↗

Install this skill

npx skills add anthropics/skills

Works 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

  1. Execute the initialization script to setup the Vite environment
  2. Modify the React source files to build the UI component
  3. Verify component styles adhere to the design guidelines
  4. Run the bundling script to generate the final HTML artifact
  5. 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

What makes this different from a standard React setup?
It includes specific bundling scripts that transform a multi-file project into a single, inlineable HTML file compatible with Claude artifacts.
Can I use custom npm packages?
Yes, standard npm packages are supported, though keep in mind they must be compatible with the Parcel bundler during the inline process.
How do I avoid the 'AI slop' look?
Avoid using default purple gradients, overly centered layouts, and standard Inter font stacks. Customize your Tailwind configuration to define a unique aesthetic.

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.

Source & trust

152k stars🕒 Updated 2026-06-09
📄 Full skill instructions — original source: anthropics/skills
# Web Artifacts Builder

To build powerful frontend claude.ai artifacts, follow these steps:
1. Initialize the frontend repo using scripts/init-artifact.sh
2. Develop your artifact by editing the generated code
3. Bundle all code into a single HTML file using scripts/bundle-artifact.sh
4. 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.sh


This 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)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/web-artifacts-builder/
  3. Save the file as SKILL.md
  4. 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

Read the Master Guide: Mastering Agent Skills

Recommended Rules

View more rules

Recommended Workflows

View more workflows

Recommended MCP Servers

View more MCP servers

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid react & react native issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under React & React Native and is published by Anthropic, maintained in anthropics/skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.