网络工件构建器
- 作者仓库星标 0
- 许可证 Complete terms in LICENSE.txt
- 作者仓库 nano-core
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @0-CYBERDYNE-SYSTEMS-0 · 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
## When to use this skill
- Use when the user request matches this skill's domain and capabilities.
- Use when this workflow or toolchain is explicitly requested.
## When not to use this skill
- Do not use when another skill is a better direct match for the task.
- Do not use when the request is outside this skill's scope.
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 步:开发您的工件
文件/命令 -> scripts/init-artifact.sh · scripts/bundle-artifact.sh · bundle.html · index.html · .parcelrc
内容校验值 -> 44dcd53980c8
当前原文的自动摘译,尚未人工审校。
何时使用该技能
当用户请求与该技能的领域和功能匹配时使用。当明确请求此工作流程或工具链时使用。
什么时候不应该使用这个技能
当其他技能更适合该任务时,请勿使用。当请求超出该技能的范围时请勿使用。要构建强大的前端 claude.ai 工件,请按照以下步骤操作: 使用
scripts/init-artifact.sh初始化前端存储库 通过编辑生成的代码来开发您的工件设计和风格指南
非常重要:为了避免通常所说的“AI slop”,请避免使用过多的居中布局、紫色渐变、统一圆角和 Inter 字体。