ワンクリックで
clone
Clone a pattern/component from a source repo OR mirror a live URL section pixel-exact
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Clone a pattern/component from a source repo OR mirror a live URL section pixel-exact
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | clone |
| description | Clone a pattern/component from a source repo OR mirror a live URL section pixel-exact |
| when_to_use | Use when reproducing something that already exists somewhere else — a live site section to mirror pixel-exact into the house stack (url-mode: deterministic Playwright capture → tiered Workflow), a Figma frame to implement, or code to adapt from github:/shadcn:/codebase:/pattern: sources. Triggers on: clone <url>, clone this section, make ours look like <site>, clone the figma design, clone shadcn:<component>, pattern:<keyword>. Distinct from /atom or /template (net-new components) — clone always starts from an existing source. |
| argument-hint | <url|figma|github:|shadcn:|codebase:|pattern:> [section|target] [--pick] [--devtools] [--into atom|template|block] |
| model | opus |
Polymorphic. Two families of source:
http(s)://) → url-mode: deterministically capture a section's
DOM + exact computed styles and mirror it pixel-exact into the house stack. Replaces the
manual Inspect-and-rebuild loop. Playbook below.Mode detection (check $1 in this order):
http(s):// containing figma.com → Figma branch (below).http(s):// → url-mode playbook (below).figma: / github: / shadcn: / codebase: / pattern: / bare path → source branches./clone https://stripe.com # full page → name a section
/clone https://stripe.com "Pricing" # target a section by heading/copy
/clone https://stripe.com --pick # click the section in a headed browser
/clone https://linear.app "hero" --into atom # land as an atom
/clone https://app.example.com/dash --devtools # logged-in page via real Chrome
/clone https://figma.com/design/abc/File?node-id=1-234
/clone https://figma.com/design/abc/File?node-id=1-234 src/components/messaging/
/clone github:vercel/ai/examples/next-openai
/clone github:shadcn-ui/ui/apps/www/components/ui/button
/clone shadcn:button
/clone shadcn:data-table
/clone codebase:src/components/atom/stat-card
/clone codebase:src/registry/new-york/templates/hero-01
Point at a live URL and faithfully reproduce a section in the house stack — pixel-exact. The capture spends zero model tokens; only translate (Opus) and reconcile (Sonnet) cost reasoning.
Don't set
/effort maxfor clone. The Workflow already pins Opus·high on translate (the only fidelity-critical phase) and Sonnet·medium/low on the rest. A session-widemaxjust inflates the cost of the deterministic capture + orchestration glue — the exact tax this design removes. Leave session effort at its default; the per-phase tiers do the right thing.
Parse: the URL; an optional section name (heading/copy text to target); flags --pick,
--devtools, --into atom|template|block.
<slug> = <host>-<section|page>. Snapshot dir = <repoRoot>/.clone/<slug>/..clone/ is gitignored (append if missing — it's scratch, never committed).--devtools (real Chrome via chrome-devtools
MCP) when the section is behind a login or a value won't reproduce and you need the network/
cascade. Use --pick when the user wants to click the element instead of naming it.Run the capture script. Playwright resolves from the global @playwright/mcp (zero install on
the kun default); on a bare machine run the one-time bootstrap first:
(cd ~/.claude/skills/clone/scripts && npm run bootstrap).
node ~/.claude/skills/clone/scripts/clone-capture.mjs \
--url "<url>" --out "<repoRoot>/.clone/<slug>" \
[--section "<heading/copy text>"] [--pick] [--devtools] \
--breakpoints 375,768,1440
Section selection (most → least automated, per the user's preference):
sections.json (heading-anchored,
script-stripped — usable even on pages that wrap everything in one <main> child). Show the
user that index (headings + sample copy) and let them name the section. Then re-run with
--section "<their text>" for a focused snapshot.
manifest.capped === true (the page exceeded the
node cap — typical for store/marketing pages), do not translate the whole page. Present
the section index and clone one section at a time (--section), each landing as its own
atom/template. A focused section stays well under the cap and yields a faithful component;
the whole page in one translate does not.--section "<text>" → resolves the smallest element containing the copy/heading, climbs
to the nearest semantic ancestor.--pick → opens a headed browser; hover highlights, click selects (the watchable
mode the user asked to see).Confirm the snapshot: manifest.json, dom.html, styles.json (≈10–25 exact props/node),
tokens.json, shots/{375,768,1440}.png, assets/. The script prints a tight JSON summary
(node count, palette, font, spacing scale, sections) — read that, not the raw files.
Hand the snapshot to the clone Workflow. It sets model + effort per phase (the only mechanism that controls both) so the blanket Opus-max tax is gone:
| Phase | Model | Effort | Work |
|---|---|---|---|
| Translate | opus | high | DOM + exact styles → pixel-exact JSX (clone agent) |
| Reconcile | sonnet | medium | render on port 3000, screenshot ×3, diff vs shots/, fix loop |
| Land | sonnet | low | place into atom/template/block, pnpm build, report |
Workflow({
scriptPath: "~/.claude/skills/clone/scripts/clone.workflow.mjs",
args: { snapshotDir: "<abs path to .clone/<slug>>", into: "<atom|template|block|auto>", repoRoot: "<abs repo root>" }
})
The Workflow runs in the background and notifies on completion. (Invoking a Workflow is the multi-agent opt-in — it's intrinsic to this skill's tiered design, not a separate ask.)
Relay the Workflow result: final component path + level, build pass/fail, whether all 3
breakpoints matched, exact-value class count, fonts substituted, any token equivalences worth
adopting later, and any unresolved diffs. The .clone/<slug> snapshot stays as the scratch record.
figma.com):Parse URL — Extract fileKey and nodeId from the Figma URL:
figma.com/design/:fileKey/:fileName?node-id=:nodeId → convert - to : in nodeIdfigma.com/design/:fileKey/branch/:branchKey/:fileName → use branchKey as fileKeyRead design — Call these tools in parallel:
mcp__claude_ai_Figma__get_design_context with fileKey, nodeId, clientFrameworks="react,nextjs", clientLanguages="typescript,css"mcp__claude_ai_Figma__get_screenshot with fileKey, nodeId (visual reference)Extract tokens — If the design uses variables:
mcp__claude_ai_Figma__get_variable_defs with fileKey, nodeId--msg-*, --color-*) or Tailwind tokens--font-heading, --font-sans)Check component mappings:
mcp__claude_ai_Figma__get_code_connect_map — resolve Figma components to existing codebase importsGenerate code at target path (or infer from design context):
ms, me, ps, pe, start, end)Build check — Run pnpm build to verify TypeScript compilation
Visual verify — If dev server is running:
Iterate — Fix differences and repeat steps 7-8 until visually indistinguishable:
pattern::.claude/patterns/registry.jsonpattern:form → keyword form)src/components/form/).claude/patterns/cards/{keyword}.md for context/Users/abdout/{repo}/{path}schoolId → parameterized)pnpm build passes and the reconcile phase reports all 3 breakpoints
(375 / 768 / 1440) within tolerance of the captured screenshots.pnpm build passes; for Figma, the implementation is visually
indistinguishable from the design screenshot.getComputedStyle, not token-snapping.
The one idiomatic concession is logical RTL properties (lossless in LTR).--devtools escalation (logins, network waterfall, CSS cascade),
not the default capture path — the headless script is.next/font substitute has different metrics, so
line-count/wrapping can differ even when sizing, columns, and spacing are exact. This is a
font artifact, not a structural miss — reconcile reports it and moves on; consumers wire the
substituted --font-* variables on an ancestor.Multi-slide bilingual brand carousels — Claude writes the deck, kun renders Anthropic-styled slides at exact platform sizes, a human approves, channels receive
Draft, stage, and publish brand social posts — Claude drafts, /higgs renders, a human approves, Hermes relays
Convert a file or URL to Markdown via MarkItDown (PDF, Office, images, audio, web)
Full pipeline — idea to production (chains every stage)
Autonomous block QA — detect, adversarially verify, fix safe tiers, hand the residual to a human
Technical spec — data model, file plan, refined acceptance criteria