Artifacts Builder

作者: Anthropic

用於創建精緻、多組件 claude.ai HTML 工件的一套工具,採用現代前端網頁技術(React、Tailwind CSS、shadcn/ui)。適用於需要狀態管理、路由或 shadcn/ui 元件的複雜工件,不適用於簡單的單一檔案 HTML/JSX 工件。 授權條款:完整條款請見 LICENSE.txt

npx skills add https://github.com/anthropics/skills --skill web-artifacts-builder

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

來自 Anthropic 的更多技能

Algorithmic Art
Anthropic
使用p5.js建立演算法藝術,包含種子隨機性與互動式參數探索。當使用者要求以程式碼創作藝術、生成式藝術、演算法藝術、流場或粒子系統時使用此功能。創作原創演算法藝術,避免抄襲現有藝術家作品以規避版權問題。 授權:完整條款請見LICENSE.txt
creative
Internal Comms
Anthropic
一套資源,幫助我撰寫各種內部溝通內容,使用公司偏好的格式。每當需要撰寫內部溝通文件(如狀態報告、領導層更新、第三方更新、公司通訊、常見問題、事件報告、專案更新等)時,Claude 應使用此技能。 授權:完整條款請見 LICENSE.txt
Webapp Testing
Anthropic
使用 Playwright 與本地網頁應用程式互動及測試的工具包。支援驗證前端功能、除錯 UI 行為、擷取瀏覽器螢幕截圖,以及檢視瀏覽器日誌。 授權條款:完整條款請見 LICENSE.txt
development
XLSX
Anthropic
全面的試算表建立、編輯與分析,支援公式、格式設定、資料分析與視覺化。當 Claude 需要處理試算表(.xlsx、.xlsm、.csv、.tsv 等)以進行:(1) 建立含公式與格式的新試算表,(2) 讀取或分析資料,(3) 修改現有試算表並保留公式,(4) 試算表中的資料分析與視覺化,或 (5) 重新計算公式。 授權:專有。LICENSE.txt 包含完整條款。
document
Skill Creator
Anthropic
建立有效技能的指南。當使用者想要建立新技能(或更新現有技能)以擴展 Claude 的專業知識、工作流程或工具整合能力時,應使用此技能。 授權:完整條款請見 LICENSE.txt
Slack Gif Creator
Anthropic
用於建立針對 Slack 最佳化的動畫 GIF 工具包,包含尺寸限制驗證器與可組合的動畫基本元件。當使用者要求為 Slack 製作動畫 GIF 或表情動畫(例如「幫我做一個 X 做 Y 的 Slack GIF」)時,此技能便會啟用。 授權條款:完整條款請見 LICENSE.txt
creative
Theme Factory
Anthropic
用於為成品套用主題風格的工具包。這些成品可以是投影片、文件、報告、HTML登陸頁面等。內建10組預設主題(含配色與字型),可套用於任何已建立的成品,或即時生成全新主題。 授權條款:完整條款請見LICENSE.txt
creative
Brand Guidelines
Anthropic
將Anthropic官方品牌色彩與字體應用於任何可能需要呈現Anthropic風格與視覺感受的成品。當涉及品牌色彩、風格指南、視覺格式或公司設計標準時使用此規範。 授權:完整條款請見LICENSE.txt
creative