[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75GEFXKQEC1R4MA45FQZJZH":3,"skill-same:01M75GEFXKQEC1R4MA45FQZJZH":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M75GEFXKQEC1R4MA45FQZJZH","web-clone",null,"URL-driven website cloning with visual + functional verification","agisota\u002Fold-one","agisota","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121413592?v=4","01M75B4BRNT67EC1NDRT8QZEP2","01M75B4BS7QR9VP580MSCPTS3X",3,"MIT","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Foh-my-codex\u002Fskills\u002Fweb-clone\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: web-clone\ndescription: URL-driven website cloning with visual + functional verification\n---\n\n\u003CPurpose>\nClone a target website from its URL, replicating both visual appearance and core interactive functionality. Uses Playwright MCP for live page extraction, LLM-driven code generation, and iterative verification with `$visual-verdict` for visual scoring.\n\u003C\u002FPurpose>\n\n\u003CUse_When>\n- User provides a target URL and wants the site replicated as working code\n- User says \"clone site\", \"clone website\", \"copy webpage\", or \"web-clone\"\n- Task requires both visual fidelity AND functional parity with the original\n- Reference is a live URL (not a static screenshot — use `$visual-verdict` for screenshot-only tasks)\n\u003C\u002FUse_When>\n\n\u003CDo_Not_Use_When>\n- User only has screenshot references without a live URL — use `$visual-verdict` directly\n- User wants to modify, redesign, or \"improve\" the site — use standard implementation flow\n- Target requires authentication, payment flows, or backend API parity — out of scope for v1\n- Multi-page \u002F multi-route deep cloning — v1 handles single-page scope only\n\u003C\u002FDo_Not_Use_When>\n\n\u003CScope_Limits>\n**v1 scope**: Single page clone of the provided URL.\n\nIncluded:\n- Layout structure (header, nav, content areas, sidebar, footer)\n- Typography (font families, sizes, weights, line heights)\n- Colors, spacing, borders, border-radius\n- Core interactions: navigation links, buttons, form elements, dropdowns, modals, toggles\n- Responsive hints from the extracted layout (flexbox\u002Fgrid patterns)\n\nExcluded:\n- Backend API integration or data fetching\n- Authentication flows or protected content\n- Dynamic\u002Fpersonalized content (user-specific data)\n- Multi-page crawling or route graph cloning\n- Third-party widget functionality (maps, embeds, chat widgets)\n- Image\u002Fasset replication (use placeholders for external images)\n\n**Legal notice**: Only clone sites you own or have explicit permission to replicate. Respect copyright and trademarks.\n\u003C\u002FScope_Limits>\n\n\u003CPrerequisites>\nPlaywright MCP server must be available for browser automation.\n\n1. Before first tool use, call `ToolSearch(\"browser\")` or `ToolSearch(\"playwright\")` to discover available browser tools.\n2. If no browser tools are found, instruct the user:\n   ```\n   Playwright MCP is required. Configure it:\n   codex mcp add playwright npx \"@playwright\u002Fmcp@latest\"\n   ```\n3. Required tools: `browser_navigate`, `browser_snapshot`, `browser_take_screenshot`, `browser_evaluate`, `browser_wait_for`. Optional: `browser_click`, `browser_network_requests`.\n\u003C\u002FPrerequisites>\n\n\u003CInputs>\n- `target_url` (required): The URL to clone\n- `output_dir` (optional, default: current working directory): Where to generate the clone project\n- `tech_stack` (optional, inferred from project context): HTML\u002FCSS\u002FJS, React, Vue, Svelte, etc.\n\u003C\u002FInputs>\n\n\u003CTool_Usage>\n- Before first MCP tool use, call `ToolSearch(\"browser\")` or `ToolSearch(\"playwright\")` to discover deferred Playwright MCP tools.\n- If no browser tools are found, stop immediately and instruct the user to configure Playwright MCP.\n- Use `browser_snapshot` (accessibility tree) for structural understanding — it is far more token-efficient than screenshots.\n- Use `browser_take_screenshot` only when visual verification is needed (Pass 1 baseline, Pass 4 comparison).\n- Use `browser_evaluate` for DOM\u002Fstyle extraction — pass the scripts from this skill EXACTLY as written (do not modify them).\n- If running within ralph, use `state_write` \u002F `state_read` for web-clone state persistence between iterations.\n- Skip Codex consultation for straightforward extraction; use it only if verification repeatedly fails on the same issue.\n\u003C\u002FTool_Usage>\n\n\u003CState_Management>\nPersist extraction and progress data so the pipeline can resume if interrupted.\n\n- **After Pass 1 completes**: Write extraction summary to `.omx\u002Fstate\u002F{scope}\u002Fweb-clone-extraction.json` containing:\n  - `target_url`, `extracted_at` timestamp\n  - `screenshot_path` (path to `target-full.png`)\n  - `landmark_count` (number of nav, main, footer, form elements)\n  - `interactive_count` (number of detected interactive elements)\n  - `extraction_size_kb` (approximate size of DOM extraction data)\n- **After each Pass 4 verification**: Append the composite verdict to `.omx\u002Fstate\u002F{scope}\u002Fweb-clone-verdicts.json`.\n- **When running within ralph**: Also persist the `visual` portion of the composite verdict to `.omx\u002Fstate\u002F{scope}\u002Fralph-progress.json` for ralph compatibility, mapping `visual.score` → top-level `score` and `visual.verdict` → top-level `verdict`.\n- **On completion or failure**: Write final status with `completed_at` or `failed_at` timestamp.\n\u003C\u002FState_Management>\n\n\u003CContext_Budget>\nPass 1 extraction can produce very large data. Apply these limits proactively:\n\n- **DOM tree**: If the serialized JSON exceeds ~30KB, reduce `depth` parameter from 8 to 4 and re-extract. Focus on top-level structure.\n- **Accessibility snapshot**: If it exceeds ~20KB, this is normal for complex pages. Summarize key landmarks rather than keeping the full tree.\n- **Interactive elements**: Cap at 50 elements. If more exist, keep only visible ones (`isVisible: true`).\n- **Total extraction context**: Aim for under 60KB combined. If exceeded, prioritize: screenshot > accessibility snapshot > interactive elements > DOM styles.\n- **Image tokens**: Full-page screenshots are expensive. Take one baseline in Pass 1 and one comparison in Pass 4. Do not take screenshots between iterations unless debugging a specific region.\n\u003C\u002FContext_Budget>\n\n\u003CSteps>\n\n## Pass 1 — Extract\n\nCapture the target page's structure, styles, interactions, and visual baseline.\n\n1. **Navigate**: `browser_navigate` to `target_url`.\n2. **Wait for render**: `browser_wait_for` with appropriate condition (network idle or timeout of 5s) to ensure full render including lazy-loaded content.\n3. **Accessibility snapshot**: `browser_snapshot` — captures the semantic tree (roles, names, values, interactive states). This is your primary structural reference.\n4. **Full-page screenshot**: `browser_take_screenshot` with `fullPage: true` — save as reference baseline `target-full.png`.\n5. **DOM + computed styles**: `browser_evaluate` with the following script. **COPY THIS SCRIPT EXACTLY — do not modify it**:\n   ```javascript\n   (() => {\n     const walk = (el, depth = 0) => {\n       if (depth > 8 || !el.tagName) return null;\n       const cs = window.getComputedStyle(el);\n       return {\n         tag: el.tagName.toLowerCase(),\n         id: el.id || undefined,\n         classes: [...el.classList].slice(0, 5),\n         styles: {\n           display: cs.display, position: cs.position,\n           width: cs.width, height: cs.height,\n           padding: cs.padding, margin: cs.margin,\n           fontSize: cs.fontSize, fontFamily: cs.fontFamily,\n           fontWeight: cs.fontWeight, lineHeight: cs.lineHeight,\n           color: cs.color, backgroundColor: cs.backgroundColor,\n           border: cs.border, borderRadius: cs.borderRadius,\n           flexDirection: cs.flexDirection, justifyContent: cs.justifyContent,\n           alignItems: cs.alignItems, gap: cs.gap,\n           gridTemplateColumns: cs.gridTemplateColumns,\n         },\n         text: el.childNodes.length === 1 && el.childNodes[0].nodeType === 3\n           ? el.textContent?.trim().slice(0, 100) : undefined,\n         children: [...el.children].map(c => walk(c, depth + 1)).filter(Boolean),\n       };\n     };\n     return walk(document.body);\n   })()\n   ```\n6. **Interactive elements**: `browser_evaluate` to catalog all interactable elements. **COPY THIS SCRIPT EXACTLY — do not modify it**:\n   ```javascript\n   (() => {\n     const results = [];\n     document.querySelectorAll(\n       'button, a[href], input, select, textarea, [role=\"button\"], ' +\n       '[onclick], [aria-haspopup], [aria-expanded], details, dialog'\n     ).forEach(el => {\n       results.push({\n         tag: el.tagName.toLowerCase(),\n         type: el.type || el.getAttribute('role') || 'interactive',\n         text: (el.textContent || '').trim().slice(0, 80),\n         href: el.href || undefined,\n         ariaLabel: el.getAttribute('aria-label') || undefined,\n         isVisible: el.offsetParent !== null,\n       });\n     });\n     return results;\n   })()\n   ```\n7. **Network patterns** (optional): `browser_network_requests` — note XHR\u002Ffetch calls for reference. Do not attempt to replicate backends.\n\nKeep all extraction results in working memory for Pass 2.\n\n## Pass 2 — Build Plan\n\nAnalyze extraction results and decompose into a component plan.\n\n1. **Identify page regions**: From DOM tree + accessibility snapshot, identify major sections:\n   - Navigation bar \u002F header\n   - Hero \u002F banner section\n   - Main content area(s)\n   - Sidebar (if present)\n   - Footer\n   - Overlay elements (modals, drawers)\n\n2. **Map components**: For each region, define:\n   - Component name and responsibility\n   - Key style properties (from computed styles)\n   - Content summary (headings, text, images)\n   - Child components if nested\n\n3. **Create interaction map**: From interactive elements list:\n   - Navigation links → anchor tags with `href`\n   - Form elements → proper `\u003Cform>` with inputs, labels, validation\n   - Buttons → click handlers (toggle, submit, navigate)\n   - Dropdowns\u002Fmodals → show\u002Fhide toggle with transitions\n   - Accordions\u002Ftabs → state-based visibility\n\n4. **Extract design tokens**: Identify recurring values:\n   - Color palette (primary, secondary, background, text colors)\n   - Font stack (families, size scale, weight scale)\n   - Spacing scale (padding\u002Fmargin patterns)\n   - Border radius values\n\n5. **Define file structure**:\n   ```\n   {output_dir}\u002F\n   ├── index.html          (or App.tsx \u002F App.vue)\n   ├── styles\u002F\n   │   ├── globals.css      (reset + tokens)\n   │   └── components.css   (or scoped styles)\n   ├── scripts\u002F\n   │   └── interactions.js  (toggle, modal, dropdown logic)\n   └── assets\u002F              (placeholder images)\n   ```\n   Adapt to `tech_stack` if specified (React components, Vue SFCs, etc.).\n\n## Pass 3 — Generate Clone\n\nImplement the clone from the plan. Work component-by-component.\n\n1. **Scaffold**: Create the directory structure and base files.\n2. **Design tokens first**: Implement CSS custom properties or Tailwind config from extracted tokens.\n3. **Layout shell**: Build the page-level layout matching the original's flexbox\u002Fgrid structure.\n4. **Components**: Implement each region top-down:\n   - Match DOM structure from extraction (semantic tags, landmark roles)\n   - Apply computed styles — prioritize layout properties, then typography, then decorative\n   - Use actual extracted text content; use placeholder `\u003Cimg>` for external images\n5. **Interactions**: Wire up detected behaviors:\n   - Navigation: working `\u003Ca>` tags (to `#` anchors or stubs for v1)\n   - Forms: proper structure with `\u003Clabel>`, input types, placeholder text\n   - Toggles: JavaScript for dropdowns, modals, accordions\n   - Hover\u002Ffocus states: CSS transitions matching original behavior\n6. **Responsive**: If the original uses responsive breakpoints (detectable from media queries in computed styles or from viewport behavior), add basic responsive rules.\n\n## Pass 4 — Verify\n\nCompare the clone against the original across three dimensions.\n\n1. **Serve the clone**: Start a local server for the generated project:\n   ```bash\n   npx serve {output_dir} -l 3456 --no-clipboard\n   ```\n   If `npx serve` is unavailable, fall back to: `python3 -m http.server 3456 -d {output_dir}`.\n   The clone will be accessible at `http:\u002F\u002Flocalhost:3456`.\n2. **Visual verification**:\n   - Navigate to the clone with Playwright: `browser_navigate` to clone URL.\n   - Take full-page screenshot of clone.\n   - Run `$visual-verdict` with: `reference_images=[\"target-full.png\"]`, `generated_screenshot=\"clone-full.png\"`, `category_hint=\"web-clone\"`.\n   - The visual portion of the verdict feeds directly into the composite verdict below.\n   - Visual pass threshold: **score >= 85**.\n\n3. **Structural verification**: Compare landmark counts:\n   - Count `\u003Cnav>`, `\u003Cmain>`, `\u003Cfooter>`, `\u003Cform>`, `\u003Cbutton>`, `\u003Ca>` in both original and clone.\n   - Structure passes when all major landmarks exist (missing landmarks = fail).\n\n4. **Functional spot-check**: Test 2–3 detected interactions via Playwright:\n   - Click a navigation link → verify URL change or scroll behavior\n   - Toggle a dropdown\u002Fmodal → verify visibility change\n   - Interact with a form field → verify it accepts input\n   - Use `browser_click` and `browser_snapshot` to verify state changes.\n\n5. **Emit composite verdict**:\n\n```json\n{\n  \"visual\": {\n    \"score\": 82,\n    \"verdict\": \"revise\",\n    \"category_match\": true,\n    \"differences\": [\"Header spacing tighter than original\"],\n    \"suggestions\": [\"Increase nav gap to 24px\"]\n  },\n  \"functional\": {\n    \"tested\": 3,\n    \"passed\": 2,\n    \"failures\": [\"Dropdown does not open on click\"]\n  },\n  \"structure\": {\n    \"landmark_match\": true,\n    \"missing\": [],\n    \"extra\": []\n  },\n  \"overall_verdict\": \"revise\",\n  \"priority_fixes\": [\n    \"Fix dropdown toggle interaction\",\n    \"Increase header nav spacing\"\n  ]\n}\n```\n\n## Pass 5 — Iterate\n\nFix highest-impact issues and re-verify.\n\n1. **Prioritize fixes** by impact: layout > interactions > spacing > typography > colors.\n2. **Apply targeted edits**: Fix only the issues listed in `priority_fixes`. Do not refactor working code.\n3. **Re-verify**: Repeat Pass 4.\n4. **Loop**: Continue until `overall_verdict` is `pass` OR max **5 iterations** reached.\n5. **Final report**: Summarize what was successfully cloned, any remaining differences, and elements that could not be replicated.\n\n\u003C\u002FSteps>\n\n\u003COutput_Contract>\nAfter each verification pass, emit a **composite web-clone verdict** JSON:\n\n```json\n{\n  \"visual\": {\n    \"score\": 0,\n    \"verdict\": \"revise\",\n    \"category_match\": false,\n    \"differences\": [\"...\"],\n    \"suggestions\": [\"...\"],\n    \"reasoning\": \"short explanation\"\n  },\n  \"functional\": {\n    \"tested\": 0,\n    \"passed\": 0,\n    \"failures\": [\"...\"]\n  },\n  \"structure\": {\n    \"landmark_match\": false,\n    \"missing\": [\"...\"],\n    \"extra\": [\"...\"]\n  },\n  \"overall_verdict\": \"revise\",\n  \"priority_fixes\": [\"...\"]\n}\n```\n\nRules:\n- `visual` follows the `VisualVerdict` shape from `$visual-verdict`\n- `functional.tested\u002Fpassed` are counts; `failures` list specific interaction failures\n- `structure.landmark_match` is `true` when all major HTML landmarks (nav, main, footer, forms) are present\n- `overall_verdict`: `pass` when visual.score >= 85 AND functional.failures is empty AND structure.landmark_match is true\n- `priority_fixes`: ordered by impact, drives the next iteration\n\u003C\u002FOutput_Contract>\n\n\u003CIteration_Thresholds>\n- **Visual pass**: score >= 85\n- **Functional pass**: zero failures on tested interactions\n- **Structure pass**: all major landmarks present\n- **Overall pass**: all three dimensions pass\n- **Max iterations**: 5 (report best achieved result if threshold not met)\n\u003C\u002FIteration_Thresholds>\n\n\u003CError_Handling>\n- **Playwright MCP unavailable**: Stop. Instruct user to configure it. Do not attempt to clone without browser tools.\n- **Page fails to load**: Report the URL and HTTP status. Suggest the user verify the URL is accessible.\n- **browser_evaluate returns empty**: The page may use heavy client-side rendering. Wait longer (`browser_wait_for` with extended timeout) and retry once.\n- **Visual score stuck below threshold after 3 iterations**: Report the current state as best-effort. List the unresolved differences for the user.\n- **Extraction data too large for context**: Truncate deep DOM branches (depth > 6). Focus on top-level structure and defer nested details to iteration fixes.\n\u003C\u002FError_Handling>\n\n\u003CExample>\n**User**: \"Clone https:\u002F\u002Fnews.ycombinator.com\"\n\n**Pass 1**: Navigate to HN. Extract: table-based layout, orange (#ff6600) nav bar, story list with links + points + comments, footer. Screenshot saved.\n\n**Pass 2**: Regions: nav bar (logo + links), story table (30 rows × title + meta), footer. Tokens: orange #ff6600, gray #828282, Verdana font, 10pt base. Interaction map: story links (external), comment links, \"more\" pagination.\n\n**Pass 3**: Generate index.html with HN-style table layout, CSS matching extracted colors\u002Ffonts, working `\u003Ca>` tags for stories.\n\n**Pass 4**: Visual score=78 (font size off, spacing between stories too tight). Functional 2\u002F2 (links work). Structure match=true.\n\n**Pass 5 iteration 1**: Fix font to Verdana 10pt, increase row padding → score=88. Functional 2\u002F2. Structure match. → `overall_verdict: pass`. Done.\n\u003C\u002FExample>\n\n\u003CFinal_Checklist>\n- [ ] Pass 1 extraction completed and summarized (screenshot + accessibility tree + DOM styles + interactions)\n- [ ] Pass 2 component plan created with file structure\n- [ ] Pass 3 clone generated and files written to `output_dir`\n- [ ] Clone serves locally without errors\n- [ ] Pass 4 composite verdict emitted with all three dimensions\n- [ ] `overall_verdict` is `pass`, or max 5 iterations reached with best-effort report\n- [ ] When in ralph: visual verdict persisted to `ralph-progress.json`\n- [ ] Extraction summary persisted to `web-clone-extraction.json`\n\u003C\u002FFinal_Checklist>\n","\u003CPurpose>\nClone a target website from its URL, replicating both visual appearance and core interactive functionality. Uses Playwright MCP for live page extraction, LLM-driven code generation, and iterative verification with `$visual-verdict` for visual scoring.\n\u003C\u002FPurpose>\n\n\u003CUse_When>\n- User provides a target URL and wants the site replicated as working code\n- User says \"clone site\", \"clone website\", \"copy webpage\", or \"web-clone\"\n- Task requires both visual fidelity AND functional parity with the original\n- Reference is a live URL (not a static screenshot — use `$visual-verdict` for screenshot-only tasks)\n\u003C\u002FUse_When>\n\n\u003CDo_Not_Use_When>\n- User only has screenshot references without a live URL — use `$visual-verdict` directly\n- User wants to modify, redesign, or \"improve\" the site — use standard implementation flow\n- Target requires authentication, payment flows, or backend API parity — out of scope for v1\n- Multi-page \u002F multi-route deep cloning — v1 handles single-page scope only\n\u003C\u002FDo_Not_Use_When>\n\n\u003CScope_Limits>\n**v1 scope**: Single page clone of the provided URL.\n\nIncluded:\n- Layout structure (header, nav, content areas, sidebar, footer)\n- Typography (font families, sizes, weights, line heights)\n- Colors, spacing, borders, border-radius\n- Core interactions: navigation links, buttons, form elements, dropdowns, modals, toggles\n- Responsive hints from the extracted layout (flexbox\u002Fgrid patterns)\n\nExcluded:\n- Backend API integration or data fetching\n- Authentication flows or protected content\n- Dynamic\u002Fpersonalized content (user-specific data)\n- Multi-page crawling or route graph cloning\n- Third-party widget functionality (maps, embeds, chat widgets)\n- Image\u002Fasset replication (use placeholders for external images)\n\n**Legal notice**: Only clone sites you own or have explicit permission to replicate. Respect copyright and trademarks.\n\u003C\u002FScope_Limits>\n\n\u003CPrerequisites>\nPlaywright MCP server must be available for browser automation.\n\n1. Before first tool use, call `ToolSearch(\"browser\")` or `ToolSearch(\"playwright\")` to discover available browser tools.\n2. If no browser tools are found, instruct the user:\n   ```\n   Playwright MCP is required. Configure it:\n   codex mcp add playwright npx \"@playwright\u002Fmcp@latest\"\n   ```\n3. Required tools: `browser_navigate`, `browser_snapshot`, `browser_take_screenshot`, `browser_evaluate`, `browser_wait_for`. Optional: `browser_click`, `browser_network_requests`.\n\u003C\u002FPrerequisites>\n\n\u003CInputs>\n- `target_url` (required): The URL to clone\n- `output_dir` (optional, default: current working directory): Where to generate the clone project\n- `tech_stack` (optional, inferred from project context): HTML\u002FCSS\u002FJS, React, Vue, Svelte, etc.\n\u003C\u002FInputs>\n\n\u003CTool_Usage>\n- Before first MCP tool use, call `ToolSearch(\"browser\")` or `ToolSearch(\"playwright\")` to discover deferred Playwright MCP tools.\n- If no browser tools are found, stop immediately and instruct the user to configure Playwright MCP.\n- Use `browser_snapshot` (accessibility tree) for structural understanding — it is far more token-efficient than screenshots.\n- Use `browser_take_screenshot` only when visual verification is needed (Pass 1 baseline, Pass 4 comparison).\n- Use `browser_evaluate` for DOM\u002Fstyle extraction — pass the scripts from this skill EXACTLY as written (do not modify them).\n- If running within ralph, use `state_write` \u002F `state_read` for web-clone state persistence between iterations.\n- Skip Codex consultation for straightforward extraction; use it only if verification repeatedly fails on the same issue.\n\u003C\u002FTool_Usage>\n\n\u003CState_Management>\nPersist extraction and progress data so the pipeline can resume if interrupted.\n\n- **After Pass 1 completes**: Write extraction summary to `.omx\u002Fstate\u002F{scope}\u002Fweb-clone-extraction.json` containing:\n  - `target_url`, `extracted_at` timestamp\n  - `screenshot_path` (path to `target-full.png`)\n  - `landmark_count` (number of nav, main, footer, form elements)\n  - `interactive_count` (number of detected interactive elements)\n  - `extraction_size_kb` (approximate size of DOM extraction data)\n- **After each Pass 4 verification**: Append the composite verdict to `.omx\u002Fstate\u002F{scope}\u002Fweb-clone-verdicts.json`.\n- **When running within ralph**: Also persist the `visual` portion of the composite verdict to `.omx\u002Fstate\u002F{scope}\u002Fralph-progress.json` for ralph compatibility, mapping `visual.score` → top-level `score` and `visual.verdict` → top-level `verdict`.\n- **On completion or failure**: Write final status with `completed_at` or `failed_at` timestamp.\n\u003C\u002FState_Management>\n\n\u003CContext_Budget>\nPass 1 extraction can produce very large data. Apply these limits proactively:\n\n- **DOM tree**: If the serialized JSON exceeds ~30KB, reduce `depth` parameter from 8 to 4 and re-extract. Focus on top-level structure.\n- **Accessibility snapshot**: If it exceeds ~20KB, this is normal for complex pages. Summarize key landmarks rather than keeping the full tree.\n- **Interactive elements**: Cap at 50 elements. If more exist, keep only visible ones (`isVisible: true`).\n- **Total extraction context**: Aim for under 60KB combined. If exceeded, prioritize: screenshot > accessibility snapshot > interactive elements > DOM styles.\n- **Image tokens**: Full-page screenshots are expensive. Take one baseline in Pass 1 and one comparison in Pass 4. Do not take screenshots between iterations unless debugging a specific region.\n\u003C\u002FContext_Budget>\n\n\u003CSteps>\n\n## Pass 1 — Extract\n\nCapture the target page's structure, styles, interactions, and visual baseline.\n\n1. **Navigate**: `browser_navigate` to `target_url`.\n2. **Wait for render**: `browser_wait_for` with appropriate condition (network idle or timeout of 5s) to ensure full render including lazy-loaded content.\n3. **Accessibility snapshot**: `browser_snapshot` — captures the semantic tree (roles, names, values, interactive states). This is your primary structural reference.\n4. **Full-page screenshot**: `browser_take_screenshot` with `fullPage: true` — save as reference baseline `target-full.png`.\n5. **DOM + computed styles**: `browser_evaluate` with the following script. **COPY THIS SCRIPT EXACTLY — do not modify it**:\n   ```javascript\n   (() => {\n     const walk = (el, depth = 0) => {\n       if (depth > 8 || !el.tagName) return null;\n       const cs = window.getComputedStyle(el);\n       return {\n         tag: el.tagName.toLowerCase(),\n         id: el.id || undefined,\n         classes: [...el.classList].slice(0, 5),\n         styles: {\n           display: cs.display, position: cs.position,\n           width: cs.width, height: cs.height,\n           padding: cs.padding, margin: cs.margin,\n           fontSize: cs.fontSize, fontFamily: cs.fontFamily,\n           fontWeight: cs.fontWeight, lineHeight: cs.lineHeight,\n           color: cs.color, backgroundColor: cs.backgroundColor,\n           border: cs.border, borderRadius: cs.borderRadius,\n           flexDirection: cs.flexDirection, justifyContent: cs.justifyContent,\n           alignItems: cs.alignItems, gap: cs.gap,\n           gridTemplateColumns: cs.gridTemplateColumns,\n         },\n         text: el.childNodes.length === 1 && el.childNodes[0].nodeType === 3\n           ? el.textContent?.trim().slice(0, 100) : undefined,\n         children: [...el.children].map(c => walk(c, depth + 1)).filter(Boolean),\n       };\n     };\n     return walk(document.body);\n   })()\n   ```\n6. **Interactive elements**: `browser_evaluate` to catalog all interactable elements. **COPY THIS SCRIPT EXACTLY — do not modify it**:\n   ```javascript\n   (() => {\n     const results = [];\n     document.querySelectorAll(\n       'button, a[href], input, select, textarea, [role=\"button\"], ' +\n       '[onclick], [aria-haspopup], [aria-expanded], details, dialog'\n     ).forEach(el => {\n       results.push({\n         tag: el.tagName.toLowerCase(),\n         type: el.type || el.getAttribute('role') || 'interactive',\n         text: (el.textContent || '').trim().slice(0, 80),\n         href: el.href || undefined,\n         ariaLabel: el.getAttribute('aria-label') || undefined,\n         isVisible: el.offsetParent !== null,\n       });\n     });\n     return results;\n   })()\n   ```\n7. **Network patterns** (optional): `browser_network_requests` — note XHR\u002Ffetch calls for reference. Do not attempt to replicate backends.\n\nKeep all extraction results in working memory for Pass 2.\n\n## Pass 2 — Build Plan\n\nAnalyze extraction results and decompose into a component plan.\n\n1. **Identify page regions**: From DOM tree + accessibility snapshot, identify major sections:\n   - Navigation bar \u002F header\n   - Hero \u002F banner section\n   - Main content area(s)\n   - Sidebar (if present)\n   - Footer\n   - Overlay elements (modals, drawers)\n\n2. **Map components**: For each region, define:\n   - Component name and responsibility\n   - Key style properties (from computed styles)\n   - Content summary (headings, text, images)\n   - Child components if nested\n\n3. **Create interaction map**: From interactive elements list:\n   - Navigation links → anchor tags with `href`\n   - Form elements → proper `\u003Cform>` with inputs, labels, validation\n   - Buttons → click handlers (toggle, submit, navigate)\n   - Dropdowns\u002Fmodals → show\u002Fhide toggle with transitions\n   - Accordions\u002Ftabs → state-based visibility\n\n4. **Extract design tokens**: Identify recurring values:\n   - Color palette (primary, secondary, background, text colors)\n   - Font stack (families, size scale, weight scale)\n   - Spacing scale (padding\u002Fmargin patterns)\n   - Border radius values\n\n5. **Define file structure**:\n   ```\n   {output_dir}\u002F\n   ├── index.html          (or App.tsx \u002F App.vue)\n   ├── styles\u002F\n   │   ├── globals.css      (reset + tokens)\n   │   └── components.css   (or scoped styles)\n   ├── scripts\u002F\n   │   └── interactions.js  (toggle, modal, dropdown logic)\n   └── assets\u002F              (placeholder images)\n   ```\n   Adapt to `tech_stack` if specified (React components, Vue SFCs, etc.).\n\n## Pass 3 — Generate Clone\n\nImplement the clone from the plan. Work component-by-component.\n\n1. **Scaffold**: Create the directory structure and base files.\n2. **Design tokens first**: Implement CSS custom properties or Tailwind config from extracted tokens.\n3. **Layout shell**: Build the page-level layout matching the original's flexbox\u002Fgrid structure.\n4. **Components**: Implement each region top-down:\n   - Match DOM structure from extraction (semantic tags, landmark roles)\n   - Apply computed styles — prioritize layout properties, then typography, then decorative\n   - Use actual extracted text content; use placeholder `\u003Cimg>` for external images\n5. **Interactions**: Wire up detected behaviors:\n   - Navigation: working `\u003Ca>` tags (to `#` anchors or stubs for v1)\n   - Forms: proper structure with `\u003Clabel>`, input types, placeholder text\n   - Toggles: JavaScript for dropdowns, modals, accordions\n   - Hover\u002Ffocus states: CSS transitions matching original behavior\n6. **Responsive**: If the original uses responsive breakpoints (detectable from media queries in computed styles or from viewport behavior), add basic responsive rules.\n\n## Pass 4 — Verify\n\nCompare the clone against the original across three dimensions.\n\n1. **Serve the clone**: Start a local server for the generated project:\n   ```bash\n   npx serve {output_dir} -l 3456 --no-clipboard\n   ```\n   If `npx serve` is unavailable, fall back to: `python3 -m http.server 3456 -d {output_dir}`.\n   The clone will be accessible at `http:\u002F\u002Flocalhost:3456`.\n2. **Visual verification**:\n   - Navigate to the clone with Playwright: `browser_navigate` to clone URL.\n   - Take full-page screenshot of clone.\n   - Run `$visual-verdict` with: `reference_images=[\"target-full.png\"]`, `generated_screenshot=\"clone-full.png\"`, `category_hint=\"web-clone\"`.\n   - The visual portion of the verdict feeds directly into the composite verdict below.\n   - Visual pass threshold: **score >= 85**.\n\n3. **Structural verification**: Compare landmark counts:\n   - Count `\u003Cnav>`, `\u003Cmain>`, `\u003Cfooter>`, `\u003Cform>`, `\u003Cbutton>`, `\u003Ca>` in both original and clone.\n   - Structure passes when all major landmarks exist (missing landmarks = fail).\n\n4. **Functional spot-check**: Test 2–3 detected interactions via Playwright:\n   - Click a navigation link → verify URL change or scroll behavior\n   - Toggle a dropdown\u002Fmodal → verify visibility change\n   - Interact with a form field → verify it accepts input\n   - Use `browser_click` and `browser_snapshot` to verify state changes.\n\n5. **Emit composite verdict**:\n\n```json\n{\n  \"visual\": {\n    \"score\": 82,\n    \"verdict\": \"revise\",\n    \"category_match\": true,\n    \"differences\": [\"Header spacing tighter than original\"],\n    \"suggestions\": [\"Increase nav gap to 24px\"]\n  },\n  \"functional\": {\n    \"tested\": 3,\n    \"passed\": 2,\n    \"failures\": [\"Dropdown does not open on click\"]\n  },\n  \"structure\": {\n    \"landmark_match\": true,\n    \"missing\": [],\n    \"extra\": []\n  },\n  \"overall_verdict\": \"revise\",\n  \"priority_fixes\": [\n    \"Fix dropdown toggle interaction\",\n    \"Increase header nav spacing\"\n  ]\n}\n```\n\n## Pass 5 — Iterate\n\nFix highest-impact issues and re-verify.\n\n1. **Prioritize fixes** by impact: layout > interactions > spacing > typography > colors.\n2. **Apply targeted edits**: Fix only the issues listed in `priority_fixes`. Do not refactor working code.\n3. **Re-verify**: Repeat Pass 4.\n4. **Loop**: Continue until `overall_verdict` is `pass` OR max **5 iterations** reached.\n5. **Final report**: Summarize what was successfully cloned, any remaining differences, and elements that could not be replicated.\n\n\u003C\u002FSteps>\n\n\u003COutput_Contract>\nAfter each verification pass, emit a **composite web-clone verdict** JSON:\n\n```json\n{\n  \"visual\": {\n    \"score\": 0,\n    \"verdict\": \"revise\",\n    \"category_match\": false,\n    \"differences\": [\"...\"],\n    \"suggestions\": [\"...\"],\n    \"reasoning\": \"short explanation\"\n  },\n  \"functional\": {\n    \"tested\": 0,\n    \"passed\": 0,\n    \"failures\": [\"...\"]\n  },\n  \"structure\": {\n    \"landmark_match\": false,\n    \"missing\": [\"...\"],\n    \"extra\": [\"...\"]\n  },\n  \"overall_verdict\": \"revise\",\n  \"priority_fixes\": [\"...\"]\n}\n```\n\nRules:\n- `visual` follows the `VisualVerdict` shape from `$visual-verdict`\n- `functional.tested\u002Fpassed` are counts; `failures` list specific interaction failures\n- `structure.landmark_match` is `true` when all major HTML landmarks (nav, main, footer, forms) are present\n- `overall_verdict`: `pass` when visual.score >= 85 AND functional.failures is empty AND structure.landmark_match is true\n- `priority_fixes`: ordered by impact, drives the next iteration\n\u003C\u002FOutput_Contract>\n\n\u003CIteration_Thresholds>\n- **Visual pass**: score >= 85\n- **Functional pass**: zero failures on tested interactions\n- **Structure pass**: all major landmarks present\n- **Overall pass**: all three dimensions pass\n- **Max iterations**: 5 (report best achieved result if threshold not met)\n\u003C\u002FIteration_Thresholds>\n\n\u003CError_Handling>\n- **Playwright MCP unavailable**: Stop. Instruct user to configure it. Do not attempt to clone without browser tools.\n- **Page fails to load**: Report the URL and HTTP status. Suggest the user verify the URL is accessible.\n- **browser_evaluate returns empty**: The page may use heavy client-side rendering. Wait longer (`browser_wait_for` with extended timeout) and retry once.\n- **Visual score stuck below threshold after 3 iterations**: Report the current state as best-effort. List the unresolved differences for the user.\n- **Extraction data too large for context**: Truncate deep DOM branches (depth > 6). Focus on top-level structure and defer nested details to iteration fixes.\n\u003C\u002FError_Handling>\n\n\u003CExample>\n**User**: \"Clone https:\u002F\u002Fnews.ycombinator.com\"\n\n**Pass 1**: Navigate to HN. Extract: table-based layout, orange (#ff6600) nav bar, story list with links + points + comments, footer. Screenshot saved.\n\n**Pass 2**: Regions: nav bar (logo + links), story table (30 rows × title + meta), footer. Tokens: orange #ff6600, gray #828282, Verdana font, 10pt base. Interaction map: story links (external), comment links, \"more\" pagination.\n\n**Pass 3**: Generate index.html with HN-style table layout, CSS matching extracted colors\u002Ffonts, working `\u003Ca>` tags for stories.\n\n**Pass 4**: Visual score=78 (font size off, spacing between stories too tight). Functional 2\u002F2 (links work). Structure match=true.\n\n**Pass 5 iteration 1**: Fix font to Verdana 10pt, increase row padding → score=88. Functional 2\u002F2. Structure match. → `overall_verdict: pass`. Done.\n\u003C\u002FExample>\n\n\u003CFinal_Checklist>\n- [ ] Pass 1 extraction completed and summarized (screenshot + accessibility tree + DOM styles + interactions)\n- [ ] Pass 2 component plan created with file structure\n- [ ] Pass 3 clone generated and files written to `output_dir`\n- [ ] Clone serves locally without errors\n- [ ] Pass 4 composite verdict emitted with all three dimensions\n- [ ] `overall_verdict` is `pass`, or max 5 iterations reached with best-effort report\n- [ ] When in ralph: visual verdict persisted to `ralph-progress.json`\n- [ ] Extraction summary persisted to `web-clone-extraction.json`\n\u003C\u002FFinal_Checklist>\n",{"name":5,"description":7},"main","f37de8f681f0c0ca0e0ebab6e5fddf764ca7553d","skills\u002Foh-my-codex\u002Fskills\u002Fweb-clone",1,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one","https:\u002F\u002Fagisota.github.io\u002Fold-one\u002F","https:\u002F\u002Fgithub.com\u002Fagisota","pzd.world","2026-07-04 22:32:06",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add agisota\u002Fold-one --skill web-clone",{"tool":38,"command":39},"bunx","bunx skills add agisota\u002Fold-one --skill web-clone",{"tool":41,"command":42},"pnpm","pnpm dlx skills add agisota\u002Fold-one --skill web-clone","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Foh-my-codex\u002Fskills\u002Fweb-clone\u002FSKILL.md",true,[],[47,54,61,70,77,84],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M75KRGZWQWE9JDBS6RX42NWV","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M75KRCZHKE0ZYAQFFYHS0YNP","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":65,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M75KR94KYQ30DTE1P9WNDAE0","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M75KR3H13YJ9QHMD49818FA1","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M75KQMPY8A4Y8XTDD2DT0M9T","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M75KQHNZ0ANZNJGZY6M8MDAK","x-api","X\u002FTwitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]