Community编程与开发github.com

Artifacts Builder(构件构建器)

一套用于创建复杂、多组件 Claude.ai HTML 构件的工具集,基于现代前端 Web 技术(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 等现代工具链。该技能的核心价值在于提供自动化的初始化与构建流程,通过简单的脚本命令即可生成一个完整的前端项目,并最终将所有资源(包括 JavaScript、CSS 和依赖)内联到单个 HTML 文件中,便于在 Claude 对话中作为构件直接分享。它特别适用于需要状态管理、路由或使用 shadcn/ui 组件的复杂场景,并提供了设计风格指南以避免生成“AI 味”过重的界面。该技能支持 Claude.ai 平台,并兼容 Node 18+ 环境。

兼容平台✓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 味”的设计,应避免过度使用居中布局、紫色渐变、统一圆角以及 Inter 字体。

快速开始

第一步:初始化项目

运行初始化脚本以创建一个新的 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 版本)

第二步:开发构件

要构建构件,请编辑生成的文件。具体指导请参见下方的常见开发任务。

第三步:打包为单个 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 maps)
  • 通过 html-inline 将所有资源内联到单个 HTML 中

第四步:与用户分享构件

最后,在对话中与用户分享打包后的 HTML 文件,以便他们将其视为构件查看。

第五步:测试/可视化构件(可选)

注意:这是一个完全可选的步骤。仅在必要时或被要求时才执行。

要测试/可视化构件,请使用可用工具(包括其他技能或内置工具,如 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.

相关技能