Community程式設計與開發github.com

artifacts-builder

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

artifacts-builder 是什麼?

Artifacts Builder 是一套專為 Claude.ai 設計的專業技能,旨在幫助開發者建立功能豐富、多元件的前端 HTML 構件。它基於 React 18、TypeScript、Vite、Parcel、Tailwind CSS 和 shadcn/ui 等現代技術棧,並提供初始化和打包腳本,讓開發者能快速建立並將複雜的 React 應用打包為單一 HTML 檔案,直接嵌入 Claude 對話中。此技能特別適合需要狀態管理、路由或多種 UI 元件的專案,能有效避免常見的「AI 風格」設計問題。支援的平台包括 Claude Code 和 Cursor,透過腳本自動化流程,將開發與部署門檻降至最低。開發者只需執行 init-artifact.sh 初始化專案,編寫程式碼後再執行 bundle-artifact.sh 打包成自包含的 bundle.html 檔案,即可輕鬆分享給使用者。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-claude-skills/tree/master/artifacts-builder

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

在你喜歡的 AI 中提問

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

說明文件

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 <project-name>
cd <project-name>

這將建立一個完全配置好的專案,包含:

  • ✅ 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 建置(不產生 source map)
  • 使用 html-inline 將所有資產內嵌到單一 HTML 中

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

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

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

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

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

參考資料

Individual skills in this repo

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

ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

agent-mail-automation

Automate Agent Mail tasks via Rube MCP (Composio). Always search tools first for current schemas.

agentql-automation

Automate Agentql tasks via Rube MCP (Composio). Always search tools first for current schemas.

agenty-automation

Automate Agenty tasks via Rube MCP (Composio). Always search tools first for current schemas.

相關技能