网络工件构建器
- 作者仓库星标 0
- 许可证 Complete terms in LICENSE.txt
- 作者更新于 2026年8月21日 17:10
- 作者仓库 skills
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @anthropics · Complete terms in LICENSE.txt
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:初始化项目
运行初始化脚本来创建一个新的 React 项目:这将创建一个完全配置的项目,其中包含: ✅ React + TypeScript(通过 Vite) ✅ 带 shadcn/ui 主题系统的 Tailwind CSS 3.4.1 ✅ 配置了路径别名 (`@/`)
第 2 步:开发您的工件
要构建工件,请编辑生成的文件。请参阅下面的常见开发任务以获取指导。
第 3 步:捆绑到单个 HTML 文件
将 React 应用程序捆绑到单个 HTML 工件中:这将创建 `bundle.html` - 一个内联所有 JavaScript、CSS 和依赖项的独立工件。该文件可以作为工件直接在 Claude 对话中共享。要求:您的项目根目录中必须有一个`index.html`。脚本的作用:安装捆绑依赖项(parcel、@parcel/config-default、parcel-resolver-tspaths、html-inline)
第 4 步:与用户共享工件
最后,在与用户的对话中共享捆绑的 HTML 文件,以便他们可以将其视为工件。
第 5 步:测试/可视化工件(可选)
注意:这是一个完全可选的步骤。仅在必要或要求时执行。要测试/可视化工件,请使用可用的工具(包括其他技能或内置工具,例如 Playwright 或 Puppeteer)。一般来说,避免预先测试工件,因为它会增加请求和可以看到完成的工件之间的延迟。如果有要求或出现问题,请在展示工件后稍后进行测试。
# 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
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
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
- **shadcn/ui components**: https://ui.shadcn.com/docs/components 章节与文件索引
按说明文件中的顺序排列。
设计和风格指南
第 1 步:初始化项目
第 2 步:开发您的工件
第 3 步:捆绑到单个 HTML 文件
第 4 步:与用户共享工件
文件/命令 -> scripts/init-artifact.sh · scripts/bundle-artifact.sh · bundle.html · index.html · .parcelrc
内容校验值 -> 89f8b412c2cd
web-artifacts-builder 是给 claude.ai artifact 造单文件 HTML React app 的脚手架:React 18 + TypeScript + Vite + Parcel 打包 + Tailwind CSS + shadcn/ui,最终通过
bundle-artifact.sh把所有 JS / CSS / 依赖内联到一个bundle.html里,可以直接当 artifact 分享。设计思路
作者的目标:让你「写 React 代码 + 一键导出单 HTML」,省去 Claude artifact 单文件、不能引外部 CDN 的纠结。脚手架默认装好 40+ shadcn/ui 组件、Radix UI 全套依赖、
@/path alias、Vite + Parcel + html-inline 全链路,Node 18+ 自动检测并 pin Vite 版本。设计与样式守则(重要)
作者特别点出反「AI slop」:少用过度居中布局、紫色渐变、统一圆角、Inter 字体——这些是一眼能认出 AI 模板的视觉特征,要刻意避开。
工作流
Step 1 Initialize:
bash scripts/init-artifact.sh <project-name>建仓 →cd <project-name>;自动装好 React + TS(via Vite)/ Tailwind 3.4.1 + shadcn/ui theme /@/alias / 40+ shadcn 组件 / 全套 Radix UI / Parcel + .parcelrc / Node 18+ pin。Step 2 Develop:编辑生成的代码,对照 "Common Development Tasks"。Step 3 Bundle:bash scripts/bundle-artifact.sh跑出bundle.html——单文件 self-contained。要求项目根有index.html。脚本内做的事:装parcel/@parcel/config-default/parcel-resolver-tspaths/html-inline;写 .parcelrc 含 alias;Parcel 构建无 source map;用 html-inline 把 asset 全内联。Step 4 Share 把bundle.html当 artifact 给用户。Step 5 Test/Visualize(可选):用 Playwright / Puppeteer / 其他 skill 跑一下。适合的场景
不适合
配套
theme-factory(统一视觉主题)、prototype(更通用的 prototype 脚手架)、webapp-testing(Playwright 跑通 artifact 验证)、pdf/make-pdf(同样面向「成品 artifact」的另一类)。