clone-page
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/clone-page
/clone-page
What This Does
功能介绍
Analyzes a webpage and generates equivalent code in your chosen format. Creates
production-ready, accessible code that matches the visual design.
分析网页并生成所选格式的等效代码。创建符合视觉设计的生产就绪、可访问性代码。
Usage
使用方法
/clone-page https://example.com # Auto-detect from project stack
/clone-page https://example.com --format html # Plain HTML + CSS
/clone-page https://example.com --format react # React components
/clone-page https://example.com --format nextjs # Next.js App Router
/clone-page https://example.com --format native # React Native
/clone-page https://example.com --format vue # Vue.js SFCs
/clone-page https://example.com --format svelte # Svelte components/clone-page https://example.com # 根据项目栈自动检测
/clone-page https://example.com --format html # 纯HTML + CSS
/clone-page https://example.com --format react # React组件
/clone-page https://example.com --format nextjs # Next.js App Router
/clone-page https://example.com --format native # React Native
/clone-page https://example.com --format vue # Vue.js单文件组件
/clone-page https://example.com --format svelte # Svelte组件Output Formats
输出格式
| Format | Output | Use Case |
|---|---|---|
| HTML + CSS files | Static sites, email templates, prototypes |
| JSX + CSS Modules/styled-components | React SPAs, Vite apps |
| Next.js App Router components | Next.js projects |
| React Native + StyleSheet | Mobile apps with Expo |
| Vue 3 SFCs with | Vue.js projects |
| Svelte components | SvelteKit projects |
| Detect from project | Default behavior |
| 格式 | 输出内容 | 适用场景 |
|---|---|---|
| HTML + CSS文件 | 静态站点、邮件模板、原型 |
| JSX + CSS Modules/styled-components | React单页应用、Vite应用 |
| Next.js App Router组件 | Next.js项目 |
| React Native + StyleSheet | 使用Expo的移动应用 |
| 带 | Vue.js项目 |
| Svelte组件 | SvelteKit项目 |
| 根据项目自动检测 | 默认行为 |
Requirements
要求
MCP Browser (recommended):
For best results, configure the Puppeteer or Playwright MCP server in your
settings.json. This enables screenshots and full DOM access.
Without MCP Browser:
Falls back to WebFetch which provides HTML content but no screenshots
or JavaScript-rendered content.
MCP Browser(推荐):
为获得最佳效果,请在settings.json中配置Puppeteer或Playwright MCP服务器。这将支持截图和完整DOM访问。
无MCP Browser时:
将降级为WebFetch,仅提供HTML内容,但无法截图或获取JavaScript渲染的内容。
How It Works
工作原理
-
Analyze the page. Delegate to the site-analyzer agent to:
- Fetch the page content (via MCP browser or WebFetch)
- Take source reference screenshots (desktop + mobile) — saved to and
.agent-pipeline/screenshots/source-desktop.pngsource-mobile.png - Extract structure, components, and design tokens
- Write analysis to
.agent-pipeline/site-analysis.md
-
Generate theme. Extract design tokens and create/update theme:
- Colors (primary, secondary, accent, etc.)
- Typography (fonts, sizes, weights)
- Spacing scale
- Border radii and shadows
-
Generate components. Delegate to the ui-cloner agent to:
- Create components in the specified format
- Use appropriate styling approach for the format
- Follow conventions for each framework/library
-
Compose the page. Create the full page component that:
- Imports and arranges all sections
- Applies the theme
- Handles responsive behavior
-
Verify with visual comparison. Delegate to the frontend-verifier agent to:
- Open the cloned page in the browser
- Take screenshots of the clone at matching viewports
- Compare clone screenshots against source screenshots (visual diff)
- Score the visual match (0–100) across layout, colors, typography, spacing, content, responsive
- If score < 70: fix and re-verify (up to 3 iterations)
- Write verification report with final score to
.agent-pipeline/frontend-verification-report.md
-
Report results. Write summary toincluding:
.agent-pipeline/clone-report.md- Files created
- Visual match score
- Any remaining differences
-
分析页面:委托给site-analyzer代理完成以下操作:
- 获取页面内容(通过MCP浏览器或WebFetch)
- 拍摄源参考截图(桌面端 + 移动端)——保存至和
.agent-pipeline/screenshots/source-desktop.pngsource-mobile.png - 提取结构、组件和设计令牌
- 将分析结果写入
.agent-pipeline/site-analysis.md
-
生成主题:提取设计令牌并创建/更新主题:
- 颜色(主色、辅助色、强调色等)
- 排版(字体、字号、字重)
- 间距比例
- 边框圆角和阴影
-
生成组件:委托给ui-cloner代理完成以下操作:
- 创建指定格式的组件
- 使用对应格式的合适样式方案
- 遵循各框架/库的约定
-
组合页面:创建完整页面组件:
- 导入并排列所有区块
- 应用主题
- 处理响应式行为
-
视觉对比验证:委托给frontend-verifier代理完成以下操作:
- 在浏览器中打开克隆后的页面
- 在匹配视口下拍摄克隆页面的截图
- 对比克隆截图与源截图(视觉差异)
- 对布局、颜色、排版、间距、内容、响应式等维度的视觉匹配度打分(0–100)
- 若分数<70:修复并重新验证(最多3次迭代)
- 将含最终分数的验证报告写入
.agent-pipeline/frontend-verification-report.md
-
结果报告:将摘要写入,包括:
.agent-pipeline/clone-report.md- 创建的文件
- 视觉匹配度分数
- 剩余差异
Format-Specific Output
格式专属输出
HTML (--format html
)
--format htmlHTML(--format html
)
--format htmloutput/
├── index.html # Semantic HTML structure
├── styles/
│ ├── reset.css # CSS reset
│ ├── variables.css # CSS custom properties (theme)
│ └── main.css # Component styles
└── assets/
└── (placeholder images)output/
├── index.html # 语义化HTML结构
├── styles/
│ ├── reset.css # CSS重置样式
│ ├── variables.css # CSS自定义属性(主题)
│ └── main.css # 组件样式
└── assets/
└── (占位图片)React (--format react
)
--format reactReact(--format react
)
--format reactsrc/
├── components/
│ ├── ui/ # Atomic components
│ ├── sections/ # Page sections
│ └── layout/ # Layout components
├── styles/
│ ├── theme.ts # Design tokens
│ └── global.css # Global styles
└── App.tsx # Composed pagesrc/
├── components/
│ ├── ui/ # 原子组件
│ ├── sections/ # 页面区块
│ └── layout/ # 布局组件
├── styles/
│ ├── theme.ts # 设计令牌
│ └── global.css # 全局样式
└── App.tsx # 组合后的页面Next.js (--format nextjs
)
--format nextjsNext.js(--format nextjs
)
--format nextjssrc/
├── components/
│ ├── ui/
│ ├── sections/
│ └── layout/
├── styles/
│ └── theme.ts
└── app/
└── page.tsx # App Router pagesrc/
├── components/
│ ├── ui/
│ ├── sections/
│ └── layout/
├── styles/
│ └── theme.ts
└── app/
└── page.tsx # App Router页面React Native (--format native
)
--format nativeReact Native(--format native
)
--format nativesrc/
├── components/
│ ├── ui/
│ ├── sections/
│ └── layout/
├── theme/
│ └── index.ts # Design tokens
└── screens/
└── ClonedScreen.tsxsrc/
├── components/
│ ├── ui/
│ ├── sections/
│ └── layout/
├── theme/
│ └── index.ts # 设计令牌
└── screens/
└── ClonedScreen.tsxVue (--format vue
)
--format vueVue(--format vue
)
--format vuesrc/
├── components/
│ ├── ui/ # Base components
│ └── sections/ # Section components
├── styles/
│ └── variables.css # CSS custom properties
└── views/
└── ClonedPage.vue # Page componentsrc/
├── components/
│ ├── ui/ # 基础组件
│ └── sections/ # 区块组件
├── styles/
│ └── variables.css # CSS自定义属性
└── views/
└── ClonedPage.vue # 页面组件Svelte (--format svelte
)
--format svelteSvelte(--format svelte
)
--format sveltesrc/
├── lib/
│ ├── components/
│ │ ├── ui/
│ │ └── sections/
│ └── styles/
│ └── theme.ts
└── routes/
└── +page.svelte # SvelteKit pagesrc/
├── lib/
│ ├── components/
│ │ ├── ui/
│ │ └── sections/
│ └── styles/
│ └── theme.ts
└── routes/
└── +page.svelte # SvelteKit页面UI Library Support
UI库支持
When using or , you can specify a UI library:
--format react--format nextjs/clone-page https://example.com --format nextjs --ui mantine
/clone-page https://example.com --format nextjs --ui tailwind
/clone-page https://example.com --format nextjs --ui shadcn
/clone-page https://example.com --format react --ui chakra
/clone-page https://example.com --format react --ui mui| UI Library | Description |
|---|---|
| Plain CSS/CSS Modules (default for react) |
| Tailwind CSS utility classes |
| Mantine UI components (default for nextjs) |
| shadcn/ui components |
| Chakra UI components |
| Material UI components |
使用或时,可指定UI库:
--format react--format nextjs/clone-page https://example.com --format nextjs --ui mantine
/clone-page https://example.com --format nextjs --ui tailwind
/clone-page https://example.com --format nextjs --ui shadcn
/clone-page https://example.com --format react --ui chakra
/clone-page https://example.com --format react --ui mui| UI库 | 说明 |
|---|---|
| 纯CSS/CSS Modules(React默认选项) |
| Tailwind CSS工具类 |
| Mantine UI组件(Next.js默认选项) |
| shadcn/ui组件 |
| Chakra UI组件 |
| Material UI组件 |
Options
选项
| Option | Description |
|---|---|
| Output format: html, react, nextjs, native, vue, svelte, auto |
| UI library for React/Next.js (see above) |
| Clone only a specific section (hero, features, footer) |
| Extract reusable components without composing page |
| Extract only the design tokens/theme |
| Use existing theme, don't extract new one |
| Custom output directory for components |
| 选项 | 说明 |
|---|---|
| 输出格式:html、react、nextjs、native、vue、svelte、auto |
| React/Next.js的UI库(见上表) |
| 仅克隆指定区块(hero、features、footer等) |
| 仅提取可复用组件,不组合页面 |
| 仅提取设计令牌/主题 |
| 使用现有主题,不提取新主题 |
| 组件的自定义输出目录 |
Example Workflows
示例工作流
Clone as plain HTML
克隆为纯HTML
User: /clone-page https://stripe.com/payments --format html
Agent: I'll clone the Stripe Payments page as static HTML.
[Analysis]
- Structure: Hero, Features Grid, Pricing Table, FAQ, Footer
- Colors: #635BFF (primary), #0A2540 (dark), #F6F9FC (light)
- Font: Inter, system-ui
[Generation]
Created:
- index.html (semantic HTML5)
- styles/variables.css (CSS custom properties)
- styles/main.css (component styles)
Open index.html in your browser to preview.用户: /clone-page https://stripe.com/payments --format html
代理: 我将把Stripe Payments页面克隆为静态HTML。
[分析]
- 结构:Hero、功能网格、定价表、FAQ、页脚
- 颜色:#635BFF(主色)、#0A2540(深色)、#F6F9FC(浅色)
- 字体:Inter、system-ui
[生成]
已创建:
- index.html(语义化HTML5)
- styles/variables.css(CSS自定义属性)
- styles/main.css(组件样式)
在浏览器中打开index.html预览效果。Clone for React SPA
克隆为React单页应用
User: /clone-page https://linear.app --format react --ui tailwind
Agent: I'll clone Linear's homepage as React + Tailwind components.
[Generation]
- src/components/ui/Button.tsx
- src/components/sections/HeroSection.tsx
- src/components/sections/FeaturesSection.tsx
- src/styles/theme.ts
- src/App.tsx用户: /clone-page https://linear.app --format react --ui tailwind
代理: 我将把Linear主页克隆为React + Tailwind组件。
[生成]
- src/components/ui/Button.tsx
- src/components/sections/HeroSection.tsx
- src/components/sections/FeaturesSection.tsx
- src/styles/theme.ts
- src/App.tsxClone for mobile
克隆为移动端应用
User: /clone-page https://example.com --format native
Agent: I'll convert this design to React Native components.
[Generation]
- src/components/ui/Button.tsx
- src/components/sections/HeroSection.tsx
- src/theme/index.ts
- src/screens/ClonedScreen.tsx用户: /clone-page https://example.com --format native
代理: 我将把该设计转换为React Native组件。
[生成]
- src/components/ui/Button.tsx
- src/components/sections/HeroSection.tsx
- src/theme/index.ts
- src/screens/ClonedScreen.tsxTips
提示
- Start with simpler pages - Landing pages work best
- Review the analysis first - Run before cloning
/analyze-site - Iterate - Clone, review, adjust, repeat
- Match your stack - Use format when in a project
auto - Customize after - Clone gets you 80%, you refine the rest
- 从简单页面开始 - 落地页效果最佳
- 先查看分析结果 - 克隆前先运行
/analyze-site - 迭代优化 - 克隆、审查、调整、重复
- 匹配技术栈 - 在项目中使用格式
auto - 后续自定义 - 克隆完成80%的工作量,剩余部分由你细化
Limitations
局限性
- Cannot clone authentication-gated pages
- JavaScript-heavy SPAs need MCP browser for full analysis
- Some animations/interactions need manual recreation
- Assets (images, fonts) need separate handling
- 无法克隆需要认证的页面
- 重度JavaScript单页应用需要MCP浏览器才能完成完整分析
- 部分动画/交互需要手动重建
- 资源(图片、字体)需要单独处理
Ethical Use
伦理使用规范
This tool is for learning and inspiration. Do not:
- Directly copy proprietary designs without permission
- Clone sites to deceive users (phishing)
- Violate terms of service or copyright
Use cloned code as a starting point and customize to make it your own.
本工具用于学习和灵感启发。请勿:
- 未经许可直接复制专有设计
- 克隆站点用于欺骗用户(钓鱼)
- 违反服务条款或版权法
将克隆代码作为起点,并进行自定义使其成为专属内容。