website-cloner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWebsite Cloner Skill
网站克隆Skill
Clone any website with pixel-perfect fidelity using an orchestrated multi-agent workflow.
借助编排好的多Agent工作流,以像素级精度克隆任意网站。
Overview
概述
This skill provides a complete system for cloning websites:
- Slash command: orchestrates the entire workflow
/clone-website <url> - 4 specialized sub-agents: Each handles a specific phase
- Output: Single React component using Tailwind CSS + motion
该Skill为网站克隆提供了一套完整的系统:
- 斜杠命令:编排整个工作流
/clone-website <url> - 4个专用子Agent:每个Agent负责特定阶段的任务
- 输出结果:单个使用Tailwind CSS + motion的React组件
Architecture
架构
┌─────────────────────────────────────────┐
│ ORCHESTRATOR (/clone-website) │
│ Delegates, doesn't code │
└─────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ screen- │ │ extrac- │ │ (can │
│ shotter │ │ tor │ │ parallel│
└─────────┘ └─────────┘ └─────────┘
│
▼
┌─────────────┐
│ cloner │◄────────┐
└─────────────┘ │
│ │
▼ │
┌─────────────┐ │
│ qa-reviewer │─────────┘
└─────────────┘ (loop until done)┌─────────────────────────────────────────┐
│ ORCHESTRATOR (/clone-website) │
│ Delegates, doesn't code │
└─────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ screen- │ │ extrac- │ │ (can │
│ shotter │ │ tor │ │ parallel│
└─────────┘ └─────────┘ └─────────┘
│
▼
┌─────────────┐
│ cloner │◄────────┐
└─────────────┘ │
│ │
▼ │
┌─────────────┐ │
│ qa-reviewer │─────────┘
└─────────────┘ (loop until done)Quick Setup
快速设置
1. Create Sub-Agents
1. 创建子Agent
Run in Claude Code and create these 4 agents. For each, select "Generate with Claude" and provide the description.
/agents| Agent Name | Description Summary |
|---|---|
| Captures comprehensive screenshots (full-page, sections, components, hover states) |
| Downloads assets to |
| Implements React component with Tailwind + motion, auto-detects project type |
| Pixel-by-pixel comparison, classifies issues as Critical/Major/Minor |
Detailed prompts for each agent: See
references/subagents.md在Claude Code中运行命令,创建这4个Agent。对于每个Agent,选择“Generate with Claude”并提供描述信息。
/agents| Agent 名称 | 描述摘要 |
|---|---|
| 捕获全面的截图(全页、区块、组件、悬停状态) |
| 将资源下载到 |
| 实现基于Tailwind + motion的React组件,自动检测项目类型 |
| 逐像素对比,将问题分为严重/主要/次要等级 |
各Agent的详细提示词:请查看
references/subagents.md2. Install Slash Command
2. 安装斜杠命令
Copy to your commands folder:
assets/clone-website.mdbash
undefined将复制到你的命令文件夹:
assets/clone-website.mdbash
undefinedProject-level (shared via git)
项目级(通过Git共享)
cp assets/clone-website.md .claude/commands/
cp assets/clone-website.md .claude/commands/
Or user-level (personal)
或用户级(个人使用)
cp assets/clone-website.md ~/.claude/commands/
undefinedcp assets/clone-website.md ~/.claude/commands/
undefined3. Configure Playwright MCP
3. 配置Playwright MCP
Ensure Playwright MCP is configured in or :
~/.claude.json.claude/settings.jsonjson
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-playwright"]
}
}
}确保在或中配置了Playwright MCP:
~/.claude.json.claude/settings.jsonjson
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-playwright"]
}
}
}Usage
使用方法
bash
/clone-website https://example.comThe orchestrator will:
- Create task folder
.tasks/clone-{domain}/ - Invoke screenshotter → captures all visual references
- Invoke extractor → downloads assets, extracts styles
- Invoke cloner → implements React component
- Invoke qa-reviewer → finds discrepancies
- Loop steps 4-5 until PERFECT or max 5 iterations
bash
/clone-website https://example.com编排器将执行以下操作:
- 创建任务文件夹
.tasks/clone-{domain}/ - 调用截图Agent → 捕获所有视觉参考素材
- 调用提取Agent → 下载资源,提取样式信息
- 调用克隆Agent → 实现React组件
- 调用QA审核Agent → 找出差异
- 循环步骤4-5,直到达到完美状态或完成最多5次迭代
Output Structure
输出结构
your-project/
├── public/
│ ├── images/ # Downloaded images
│ ├── videos/ # Downloaded videos
│ └── icons/ # Downloaded SVGs/icons
├── app/clone/page.tsx # React component (location varies by framework)
└── .tasks/clone-{domain}/
├── context.md # Extracted styles
├── screenshots/ # Visual references
└── review-notes.md # QA findingsyour-project/
├── public/
│ ├── images/ # 下载的图片
│ ├── videos/ # 下载的视频
│ └── icons/ # 下载的SVG/图标
├── app/clone/page.tsx # React组件(位置因框架而异)
└── .tasks/clone-{domain}/
├── context.md # 提取的样式信息
├── screenshots/ # 视觉参考素材
└── review-notes.md # QA审核结果Tech Stack Decisions
技术栈选择
| Technology | Reason |
|---|---|
| Tailwind CSS | Arbitrary values ( |
| motion | Modern, lighter alternative to framer-motion (import from "motion/react") |
| Single component | Focus on cloning, not architecture; sections divided by comments |
| Auto-detect framework | Supports Next.js, TanStack Start, Vite, etc. |
Detailed rationale: See
references/tech-decisions.md| 技术 | 选择理由 |
|---|---|
| Tailwind CSS | 任意值(如 |
| motion | 现代、轻量的framer-motion替代方案(从"motion/react"导入) |
| 单组件输出 | 专注于克隆功能,不涉及架构;通过注释划分区块 |
| 自动检测框架 | 支持Next.js、TanStack Start、Vite等多种框架 |
详细选型理由:请查看
references/tech-decisions.mdWorkflow Details
工作流详情
Phase-by-phase breakdown: See
references/workflow.md分阶段详解:请查看
references/workflow.mdCustomization
自定义配置
Change output location
修改输出位置
Edit the cloner agent's system prompt to specify a different output path.
编辑克隆Agent的系统提示词以指定不同的输出路径。
Add frameworks
添加框架支持
Update project detection logic in cloner agent for additional frameworks.
更新克隆Agent中的项目检测逻辑,以支持更多框架。
Adjust iteration limit
调整迭代次数上限
Modify the slash command's Phase 5 to change max iterations (default: 5).
修改斜杠命令的第5阶段配置,调整最大迭代次数(默认值:5)。
Troubleshooting
故障排除
| Issue | Solution |
|---|---|
| Sub-agents not found | Verify names exactly match: |
| Playwright errors | Run |
| Assets not loading | Check |
| Infinite loop | QA reviewer should set status; check |
| 问题 | 解决方案 |
|---|---|
| 找不到子Agent | 确认Agent名称完全匹配: |
| Playwright 报错 | 运行 |
| 资源无法加载 | 检查 |
| 无限循环 | QA审核Agent应设置状态;查看 |
undefined