1仕組みと動作原理
仕組みは「スキャフォールディング+バンドル」の2段階構成:init-artifact.sh が pnpm create vite をオンデマンド実行して React-TS プロジェクトを生成し、Tailwind/shadcn 依存関係をインストールして同梱の shadcn/ui コンポーネント 43 点を展開;bundle-artifact.sh が Parcel でビルドし、html-inline で単一の bundle.html にインライン化。
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`
コンポーネントはオンデマンド取得ではなくパッケージ同梱配布:shadcn-components.tar.gz に 40 以上の components/ui/*.tsx が内包されており、オフライン解凍ですぐに使用可能で、CLI による個別取得を回避。
✅ 40+ shadcn/ui components pre-installed
成果物の思想=単一の自己完結型 HTML:bundle.html がすべての JS/CSS/依存関係をインライン化し、claude.ai アーティファクトとしてそのまま共有またはブラウザ表示が可能。
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.
スコープの規律:「複数コンポーネント/状態管理/ルーティング/複雑なインタラクション」を伴う成果物のみを対象とし、シンプルな単一ファイル HTML/JSX は明確に対象外(トリガー前に複雑度を判定)。
Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
テスト/可視化は意図的に任意の事後ステップへ格下げ:「ユーザーが完成品を確認する前」のレイテンシ増加を防ぎ、問題発生時にのみテストを実施。
Note: This is a completely optional step. Only perform if necessary or requested.
「AI slop(AI特有の安っぽさ)」を防ぐスタイリングルールを内蔵:過度な中央揃えレイアウト、紫のグラデーション、画一的な角丸、Inter フォントを明示的に禁止。
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.
2コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| network | npm registry(registry.npmjs.org) |
| package | create-vite / vite / [email protected] / postcss / autoprefixer / tailwindcss-animate / class-variance-authority / clsx / tailwind-merge / lucide-react / next-themes / @radix-ui/react-*(20+)/ sonner / cmdk / vaul / embla-carousel-react / react-day-picker / react-resizable-panels / date-fns / react-hook-form / zod |
| package | parcel / @parcel/config-default / parcel-resolver-tspaths / html-inline(打包期,bundle 脚本安装) |
| cli | node ≥18 / pnpm(宿主环境) |
4推奨統制措置と判定根拠
- scripts/: ローカルスクリプトまたはコマンドの実行: init-artifact.sh / bundle-artifact.sh(bash)→ 内部で pnpm(create/install/add/e を実行
- 网络端点: 外部ネットワークアクセスの宣言: 各初期化時: registry.npmjs.org(pnpm create vite、複数回の pnpm install による依存取得、pnpm add parcel
- 本地工作目录: ファイルの読み書きと成果物出力: プロジェクトディレクトリ全体(package.json/tsconfig/vite.config/src コンポーネント等)
5二重目の独立検証
- [ok] 40+ 组件声称 vs tarball — tar -tzf 实测 43 个 components/ui/*.tsx(含 sonner/drawer/resizable),声称成立。
- [ok] init 脚本步骤与 SKILL 流程一致 — create vite(react-ts)→ 清理模板 → 装 tailwind/依赖 → 写 postcss/tailwind/vite/tsconfig → tar 解包,SKILL 描述可逐句对应。
- [ok] bundle 单文件化 — parcel build --no-source-maps + html-inline 输出 bundle.html;.parcelrc tspaths 配置存在。
- [ok] 网络外发对象 — 无自有端点/回调;全部为 pnpm→registry.npmjs.org(create-vite/tailwind/radix/parcel)。版本 pin:[email protected] 固定,create-vite 与多数依赖取 latest——版本漂移与供应链留意点已在 reason 说明。
- [ok] 凭证读取 — skill 脚本零凭证读取;pnpm 读 ~/.npmrc 属包管理器宿主行为(已在 credential_reads 注明,非脚本显式读取)。
- [ok] PROJECT_NAME 注入点 — pnpm create vite "$PROJECT_NAME" 引号安全;sed 标题替换串未转义(& / \ 字符可破坏表达式)——本地低危输入面,已在 injection_surface 记录。
- [ok] Node 版本门禁 — 脚本有 NODE_VERSION < 18 拒绝与 Vite 版本 pin 逻辑,与 SKILL 'Node 18+ compatibility' 声称一致。
- [ok] 元数据 — 本地 HEAD==pin 41bbe19;Apache-2.0 LICENSE.txt。
6結論
c56ef465edf880ee…