[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109926":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":12,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":34,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":14,"starSnapshotCount":14,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},109926,"replica","albertirgi\u002Freplica","albertirgi","Rebuild any UI from a reference and prove it with a score. An Agent Skill for Claude Code and other coding agents: captures a site, screenshot or screen recording, then scores the clone on layout, style, pixels and motion until it passes.",null,"JavaScript",131,3,56,0,1,6,74,54.21,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33],"agent-skills","claude-code","coding-agents","design-to-code","frontend","pixel-perfect","playwright","ui-cloning","visual-regression","web-animation","2026-11-07 12:46:05","2026-11-23 18:41:14","# Replica\n\n**Rebuild any UI from a reference, and prove it with a score.**\n\nReplica is an [Agent Skill](https:\u002F\u002Fagentskills.io) for Claude Code and other coding agents. You point your agent at a live site, a local page, a screenshot or a screen recording. The agent rebuilds that UI in your own codebase, then Replica measures the rebuild against the reference and scores it on four axes: layout, style, pixels and motion. The agent keeps going until the score passes, so \"close enough\" is a number rather than a judgement call.\n\n[![Replica demo: an agent's clone of the family.co hero looks done but its words rise flat; Replica catches the missing 3D tilt, scores round 1 at 77.8, and round 2 passes](.github\u002Fassets\u002Fdemo-family.gif)](.github\u002Fassets\u002Fdemo-family.mp4)\n\n\u003Csub>25 seconds. The reference is the animated hero of [family.co](https:\u002F\u002Ffamily.co), shown to demonstrate. Its headline font is licensed, so the clone uses Inter and runs at level `structure`. The illustrations and their motion are family.co's own, recorded from the site and reused for this demo. Every score, screenshot and animation frame comes from real Replica runs; findings are trimmed to fit. [Watch with sound (MP4)](.github\u002Fassets\u002Fdemo-family.mp4).\u003C\u002Fsub>\n\n## Why\n\nAgents are good at writing UI and bad at checking it. They glance at a screenshot, write something plausible, and say they're done. The font size is 8px off, the stagger is wrong, the easing is linear, and nobody can say by how much.\n\nReplica gives the agent what a careful frontend engineer would gather:\n\n- **A blueprint instead of raw HTML.** The rendered page becomes a compact spec an LLM can read: design tokens, an outline of every visible element with exact boxes and computed styles, what changes per breakpoint, and a motion timeline with fitted easings.\n- **A score that can't be talked around.** `compare` exits non-zero until every gated axis passes at the chosen level.\n- **Fixes ranked by what they're worth.** Each finding says what is wrong, by how much, and how many points fixing it gains. It also traces root causes (\"9 elements sit 16px too high — likely cause: the h1 is 16px shorter because its font-size is 48, not 56\").\n\n## What it measures\n\n| axis | how |\n|---|---|\n| **layout** | Every visible element in the reference is paired with its counterpart in your build, regardless of markup. Each box is checked within a tolerance of a few pixels. |\n| **style** | Computed font family, size, weight, line-height, letter-spacing, colours, backgrounds, borders, radii, shadows, opacity and filters, pair by pair. |\n| **pixels** | A perceptual (YIQ) diff that tolerates anti-aliasing, with hotspots tied back to the elements under them. |\n| **motion** | Every moving element is broken into segments: when it starts, how long it lasts, how far it goes, and the curve's shape (named easing, fitted cubic-bezier, or spring stiffness and damping). |\n\n### Built to be fair to your code\n\n- **Markup-agnostic.** `\u003Ca>\u003Cspan>Go\u003C\u002Fspan>\u003C\u002Fa>` equals `\u003Ca>Go\u003C\u002Fa>`. A painted wrapper equals an element that paints itself. An inset `box-shadow` ring equals a `border`. A white background on a white page counts as nothing. Your clone can use any framework, class names or component structure.\n- **Nested motion counted once.** When a card springs in, everything inside it moves too. That is one finding on the card (\"12 elements inside move with it… fix it here and they follow\"), not twelve. A child's own motion (a stagger, a pop, a spin) is still checked on its own.\n- **Placeholders don't count against you.** Mark a stand-in for an asset you can't reuse with `data-replica=\"placeholder\"`. Its box is still checked; its pixels are left out of the pixel score and listed in the report. Text painted over it still counts.\n- **Technique-agnostic motion.** A CSS `@keyframes` reference and a Web Animations API or Framer Motion clone with the same timing score 100.\n- **Deterministic.** Pages run on a virtual clock with frozen CSS timelines, a seeded `Math.random`, and fixed time, locale and DPR. Stills are shot from the viewport, not a full-page resize that makes some sites re-lay out. Capturing a live, animated production site twice gives a 100\u002F100 match, so every difference is real.\n\n## Install\n\nWith the open [`skills`](https:\u002F\u002Fgithub.com\u002Fvercel-labs\u002Fskills) CLI:\n\n```bash\nnpx skills add albertirgi\u002Freplica\n```\n\nOr by hand: copy `skills\u002Freplica` into your agent's skills folder (for Claude Code, `~\u002F.claude\u002Fskills\u002Freplica` or `.claude\u002Fskills\u002Freplica` in a project). Then install its one dependency:\n\n```bash\nnpm install --prefix ~\u002F.claude\u002Fskills\u002Freplica\u002Fscripts\nnode ~\u002F.claude\u002Fskills\u002Freplica\u002Fscripts\u002Freplica.mjs doctor\n```\n\nRequirements: Node 20+. Replica uses Playwright's Chromium, or falls back to an installed Google Chrome. `ffmpeg` is needed only for video and GIF references. No API keys.\n\n## Use\n\nAsk your agent in plain language:\n\n> Rebuild the hero from https:\u002F\u002Fexample.com in `app\u002Fpage.tsx` with our copy. Faithful level.\n\n> Make the pricing card hover feel exactly like stripe.com's — pixel-perfect.\n\n> Here's a screen recording of the menu opening (`menu.mov`). Build it in `components\u002FMenu.tsx`.\n\nThe skill makes the agent:\n\n1. **Scope**: work out the target, destination, level and trigger.\n2. **Capture** the reference into `.replica\u002F\u003Cname>\u002Fref\u002F`: `blueprint.md`, screenshots per viewport, motion frames and a filmstrip.\n3. **Build** from measurements, in your existing stack.\n4. **Compare, fix, repeat**: each round writes `report.md`, `issues.json` and comparison sheets. The agent fixes the highest-value findings first and stops when the score passes, or after 8 rounds with an honest account of what's left.\n\n### Levels\n\n| level | for | gates |\n|---|---|---|\n| `structure` | same layout and motion, your own brand and content | layout ≥ 90 · motion ≥ 85 |\n| `faithful` (default) | \"clone this\" | layout ≥ 95 · style ≥ 95 · pixels ≥ 85 · motion ≥ 90 |\n| `exact` | \"pixel-perfect\", \"1:1\" | layout ≥ 98 · style ≥ 98 · pixels ≥ 97 · motion ≥ 95 |\n\n### What a report looks like\n\nRound 1 of the family.co demo, at level `structure` (findings trimmed):\n\n```\n# Replica · round 1 · level `structure`\n**Score 77.8 — NOT YET ✗**\n| layout 99.8 ✓ | style 89.3 info | pixels 76.1 info | motion 55.9 ✗ |\n\n## Fix next (highest gain first)\n1. motion · span \"favorite\" — height: reference goes 50.4 → 74.8 from 333ms over 803ms\n   (≈ cubic-bezier(0.15, 1.21, 0.12, 0.99) (nearest named: out-expo)); yours doesn't … (+12.1 motion)\n2. motion · span \"crypto\" — height: reference goes 43.8 → 74.8 from 600ms over 803ms … (+11.4 motion)\n5. layout · p \"Explore Ethereum with the best wallet for iOS. …\" — 9px too far right, 18px too narrow. (+0.2 layout)\n6. style · h1 \"Your favorite crypto wallet.\" — font-family Family (yours Inter). Same on 4 more … (+8.8 style)\n7. style · a \"Download on iOS\" — font-weight 500 (yours 400). Same on 1 more: a \"Watch the Video\". (+1.9 style)\n```\n\nEach round also writes comparison sheets: the reference, yours and the diff, with numbered hotspots.\n\n![family.co reference, the clone and the diff side by side, with numbered hotspots](.github\u002Fassets\u002Ffamily-sheet.png)\n\nHotspots are zoomed, and motion is compared frame by frame:\n\n![A zoomed hotspot: the headline in family.co's font and in Inter](.github\u002Fassets\u002Ffamily-hotspot.png)\n![family.co reference and the clone over the first two seconds](.github\u002Fassets\u002Ffamily-motion.png)\n\n## CLI\n\nThe agent drives this, but you can run it yourself:\n\n```bash\nnode skills\u002Freplica\u002Fscripts\u002Freplica.mjs capture \u003Curl|file.html|image|video> --out .replica\u002Fhero\u002Fref \\\n  [--selector \"#hero\"] [--viewports 1440x900,390x844] [--action load|reveal|hover:\u003Ccss>|click:\u003Ccss>|scroll:\u003Cpx>|scrub:\u003Cpx>] \\\n  [--motion 1500] [--fps 30] [--level structure|faithful|exact] [--hide \"\u003Ccss>\"] [--storage auth.json]\n\nnode skills\u002Freplica\u002Fscripts\u002Freplica.mjs compare .replica\u002Fhero\u002Fref http:\u002F\u002Flocalhost:3000 [--selector \"#my-hero\"]\n```\n\n`compare` exits `0` on a pass, `1` when it hasn't passed yet, and `2` on error. Run `--help` for every option.\n\n## Limits\n\n- Web UI only. Native mobile isn't covered.\n- Stills stop at 8000px tall. Capture long pages section by section with `--selector`.\n- `\u003Cvideo>` elements are frozen on their first frame. Canvas and WebGL are judged by pixels and motion frames only.\n- Streaming links (YouTube, Loom) can't be fetched. Use a screen recording.\n- The reference's fonts, images, icons and copy belong to their owners. The skill tells the agent to use your assets, or placeholders, unless you have the rights.\n\n## Development\n\n```bash\ncd skills\u002Freplica\u002Fscripts && npm install && npm test\n```\n\nThe self-test captures three fixture pages and compares clones against them.\n\n- **A hero section.** The reference itself must score exactly 100. A clone with different markup and JS-driven animations must pass `faithful`. A clone with five planted bugs must fail, and the report must name every one.\n- **An animated deploy card.** It has a spring, staggered rows, popping dots, a 360° spin, a growing bar and a colour change. The blueprint must read each one back exactly as authored (the spring's stiffness to within a few percent). A clone rebuilt from the report must pass. A clone with generic easing must fail, with the spring reported once and the missing spin named.\n- **A section under a header that compacts on resize.** A clone with a placeholder where the artwork was must score just under 100 on pixels: the still fires no resize, the placeholder is left out, and a caption chip painted over it still counts.\n\n## Acknowledgements\n\nInspired by [reanimate](https:\u002F\u002Fgithub.com\u002FNiazMorshed2007\u002Freanimate), which showed that measuring a clone frame by frame beats eyeballing it.\n\n## License\n\nMIT\n","Replica 是一个面向编码智能体（如 Claude Code）的 UI 克隆验证工具，用于将参考界面（网页、截图或录屏）自动重建为代码，并通过多维度评分判定克隆质量。其核心功能包括布局对齐、样式比对、像素级视觉差异检测和动画运动轨迹分析，支持 markup-agnostic 匹配与根因定位；技术上基于 Playwright 实现渲染捕获与自动化比对，输出可量化的分数而非主观判断。适用于前端自动化测试、AI 编程代理的 UI 生成闭环验证、设计稿到代码的质量保障等场景。",2,"2026-11-24 04:37:55","CREATED_QUERY"]