AGENT SKILL

React 网页应用构建

web-artifacts-builder

用于创建精细的、多组件的 claude.ai HTML 作品(artifact)的工具套件,采用现代前端 Web 技术(React、Tailwind CSS、shadcn/ui)。适用于需要状态管理、路由或 shadcn/ui 组件的复杂作品,而不适用于简单的单文件 HTML/JSX 作品。

使用场景开发参考
License 许可
Apache-2.0
所属仓库
anthropics/skills
最近更新
2026-11-15
Stars
★ 19w
Forks
2.3w

01 前言 Front Matter

name
web-artifacts-builder
license
Complete terms in LICENSE.txt
description
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.

02 资源文件 4

03 SKILL.md 正文

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

04 同仓库更多 Skills

anthropics
anthropics/skills

电子表格文件处理

xlsx

当电子表格文件是主要输入或输出时,使用此技能。这意味着用户想要执行以下任何任务:打开、读取、编辑或修复现有的 .xlsx、.xlsm、.xltx、.csv 或 .tsv 文件(例如添加列、计算公式、格式化、绘制图表、清理杂乱数据);从头开始或从其他数据源创建新的电子表格;或在表格文件格式之间进行转换。当用户按名称或路径引用电子表格文件时应特别触发——即使是随意提及(如“我下载文件夹里的那个 xlsx”)——并希望对其进行处理或从中生成内容。也适用于将杂乱的表格数据文件(格式错误的行、错位的表头、垃圾数据)清理或重组为规范的电子表格。交付成果必须是电子表格文件。即使涉及表格数据,当主要交付成果是 Word 文档、HTML 报告、独立的 Python 脚本、数据库管道或 Google Sheets API 集成时,也不要触发。

知识工作者文档处理
★ 19w
anthropics
anthropics/skills

Playwright 网页应用测试

webapp-testing

使用 Playwright 与本地 Web 应用程序交互并进行测试的工具包。支持验证前端功能、调试 UI 行为、捕获浏览器截图以及查看浏览器日志。

软件开发工程师开发参考
★ 19w
anthropics
anthropics/skills

作品主题样式设计

theme-factory

用于为作品(artifact)应用主题样式的工具包。这些作品可以是幻灯片、文档、报告、HTML 落地页等。提供 10 个带颜色/字体的预设主题,可应用于任何已创建的作品,也可即时生成新主题。

视觉设计师视觉设计
★ 19w
anthropics
anthropics/skills

Slack 动态 GIF 制作

slack-gif-creator

用于创建针对 Slack 优化的动态 GIF 的知识和实用工具。提供约束条件、验证工具和动画概念。适用于用户请求为 Slack 制作动态 GIF,例如“帮我做一个 X 做 Y 的 Slack GIF”。

视觉设计师视觉设计
★ 19w
anthropics
anthropics/skills

技能创建与优化

skill-creator

创建新技能、修改和改进现有技能,并衡量技能性能。适用于用户想要从零开始创建技能、编辑或优化现有技能、运行评估(eval)以测试技能、通过方差分析对技能性能进行基准测试,或优化技能描述以提高触发准确度。

软件开发工程师开发参考
★ 19w
anthropics
anthropics/skills

PPT 演示文稿处理

pptx

只要涉及 .pptx 或 .potx 文件(无论是作为输入、输出,还是两者兼有),都应使用此技能。这包括:创建幻灯片组、推介演示文稿或演示文稿;读取、解析或从任何 .pptx 或 .potx 文件中提取文本(即使提取的内容将用于其他地方,例如电子邮件或摘要);编辑、修改或更新现有演示文稿;合并或拆分幻灯片文件;处理模板(.potx)、版式、演讲者备注或批注。每当用户提到“幻灯片组(deck)”“幻灯片(slides)”“演示文稿(presentation)”,或引用 .pptx 或 .potx 文件名时都应触发,无论他们之后打算如何处理这些内容。如果需要打开、创建或处理 .pptx 或 .potx 文件,请使用此技能。

知识工作者文档处理
★ 19w