All skills
anthropics avatar

/web-artifacts-builder

@ef74077 official
by Anthropicanthropics/skills179k stars
21,193

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.

Use this Skill: https://skilld.dev/gh/anthropics/skills/web-artifacts-builder

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ78 tokens always: the name and description. β‰ˆ678 when used: this file.

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

Source: SKILL.md on GitHub

2 warnings16d5 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides a comprehensive suite for building React-based web artifacts using modern frontend tools. It includes several security considerations, such as the execution of development-oriented shell commands, the installation of numerous external dependencies from public registries, and the dynamic modification of configuration files. While these behaviors are characteristic of a standard development workflow, they represent operational risks that should be reviewed. See the detailed analysis for context.

  • Socket16d

    1 alert: gptAnomaly

  • Snyk16d

    Risk: LOW Β· No issues

  • Runlayer7mo

    3/4 files flagged

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at ef74077. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 10 months ago

README badge

README badge for anthropics/skills/web-artifacts-builder

Bundles React, TypeScript, Tailwind CSS, and shadcn/ui components into single-file HTML artifacts for claude.ai conversations. Use when building stateful, routed, or component-heavy frontends that require more than simple HTML/JSX.

Generated from the current SKILL.md.

What frontend frameworks and libraries does this skill use?
React 18 with TypeScript, Vite for dev tooling, Parcel for bundling, Tailwind CSS 3.4.1, and shadcn/ui components with Radix UI.
Can I use this skill for simple single-file HTML or JSX artifacts?
No. This skill is designed for complex artifacts requiring state management, routing, or shadcn/ui components. Simple single-file artifacts do not need this workflow.
What does the bundling script produce?
A single self-contained `bundle.html` file with all JavaScript, CSS, and dependencies inlined, ready to share as a Claude artifact.
Do I need to test the artifact before sharing it?
No, testing is optional and discouraged upfront because it adds latency. Share the artifact first, then test later if requested or if issues arise.
What Node version does this skill require?
Node 18 or higher. The initialization script auto-detects your Node version and pins the appropriate Vite version.

Generated from the current SKILL.md. These answers refresh after source changes.