Official程式設計與開發github.com

Web Artifacts Builder

用於在 claude.ai 上建立複雜、多元件的 HTML 構件(artifact)工具套件,採用現代前端技術(React、Tailwind CSS、shadcn/ui)。適用於需要狀態管理、路由或 shadcn/ui 元件的複雜構件,而非簡單的單一檔案 HTML/JSX 構件。

Web Artifacts Builder 是什麼?

Web Artifacts Builder 是一套專為 claude.ai 環境設計的工具,讓開發者能夠使用 React 18、TypeScript、Vite、Tailwind CSS 和 shadcn/ui 等現代前端技術,建立複雜的 HTML 構件。它通過 `init-artifact.sh` 腳本快速初始化專案,並內建路徑別名、40+ 預安裝的 shadcn/ui 元件,以及 Parcel 打包器設定。開發完成後,`bundle-artifact.sh` 腳本能將所有 JavaScript、CSS 和依賴項內聯至單一 `bundle.html` 檔案,方便直接在 Claude 對話中展示。此工具特別適合需要狀態管理、路由或多元件協作的複雜構件,並透過避免過度置中佈局、紫色漸層等設計建議,幫助減少常見的「AI 風格樣式」問題。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Web Artifacts Builder 是做什麼的?

若要建立強大的前端 claude.ai 構件,請遵循以下步驟:

  1. 使用 scripts/init-artifact.sh 初始化前端儲存庫
  2. 透過編輯生成的程式碼來開發您的構件
  3. 使用 scripts/bundle-artifact.sh 將所有程式碼打包成單一 HTML 檔案
  4. 將構件顯示給使用者
  5. (可選)測試構件

技術棧:React 18 + TypeScript + Vite + Parcel(打包)+ Tailwind CSS + shadcn/ui

設計與樣式指南

非常重要:為避免所謂的「AI 風格樣式」(AI slop),請避免使用過度的置中佈局、紫色漸層、統一的圓角以及 Inter 字型。

快速開始

步驟 1:初始化專案

執行初始化腳本以建立新的 React 專案:

bash scripts/init-artifact.sh <專案名稱>
cd <專案名稱>

這將建立一個完整設定的專案,包含:

  • ✅ React + TypeScript(透過 Vite)
  • ✅ Tailwind CSS 3.4.1 搭配 shadcn/ui 主題系統
  • ✅ 路徑別名(@/)已設定
  • ✅ 預先安裝 40 個以上的 shadcn/ui 元件
  • ✅ 包含所有 Radix UI 依賴項
  • ✅ Parcel 已設定用於打包(透過 .parcelrc)
  • ✅ Node 18+ 相容性(自動偵測並固定 Vite 版本)

步驟 2:開發您的構件

若要建構構件,請編輯產生的檔案。請參閱下方的 常見開發任務 以取得指導。

步驟 3:打包成單一 HTML 檔案

若要將 React 應用程式打包成單一 HTML 構件:

bash scripts/bundle-artifact.sh

這將建立 bundle.html - 一個自包含的構件,其中所有 JavaScript、CSS 和依賴項都已內聯。此檔案可以直接在 Claude 對話中作為構件分享。

需求:您的專案必須在根目錄中擁有 index.html。

腳本功能:

  • 安裝打包依賴項(parcel、@parcel/config-default、parcel-resolver-tspaths、html-inline)
  • 建立包含路徑別名支援的 .parcelrc 設定
  • 使用 Parcel 建置(無原始碼映射)
  • 使用 html-inline 將所有資產內聯至單一 HTML

步驟 4:與使用者分享構件

最後,在對話中與使用者分享打包後的 HTML 檔案,以便他們將其視為構件檢視。

步驟 5:測試/視覺化構件(可選)

注意:這是完全可選的步驟。僅在必要或要求時執行。

若要測試/視覺化構件,請使用可用的工具(包括其他技能或內建工具,如 Playwright 或 Puppeteer)。一般來說,請避免事先測試構件,因為這會增加請求到成品構件之間的延遲。請在呈現構件後,應要求或出現問題時,再進行測試。

參考資料

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists

anthropics/template-skill

Replace with description of the skill and when Claude should use it.

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists

claude-api

|-

discernment-nudge

After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

pptx

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions \

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill

slack-gif-creator

Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like

theme-factory

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \

相關技能