Rebuild Reference Site
Turn a visual reference into a measured implementation. Prefer evidence from the running reference over aesthetic guesses.
Workflow
- Define the route, viewport, state, and deployment acceptance matrix before editing.
- Capture reference top, full-page, section, and interaction-state screenshots.
- Inventory browser-delivered images, fonts, models, textures, media, CSS, and relevant runtime requests. Localize required assets and record URL, path, MIME type, byte size, and hash.
- Measure document geometry, section rectangles, typography, colors, borders, and overflow behavior.
- Inspect 3D models, cameras, named focus nodes, animations, materials, lighting clues, post-processing, and mobile fallbacks when present.
- Implement structure first, then typography and spacing, then assets and interaction, then motion and post-processing.
- Compare captures repeatedly. Fix large geometry deltas before small decorative deltas.
- Exercise every route, viewport, toggle, accordion, navigation state, animation stop, and reduced-motion path.
- Build and deploy through the repository's configured workflow. Verify the production URL in a fresh browser context.
Evidence layout
Keep generated evidence outside application source when possible:
.replica/
|-- config.json
|-- reference/
|-- local/
|-- assets/
| `-- manifest.json
|-- metrics/
`-- reports/
Do not commit large generated captures unless the repository explicitly tracks visual fixtures.
Use bundled scripts
- Run
scripts/capture-reference.mjs to capture routes at multiple viewports.
- Run
scripts/inventory-assets.mjs to record and optionally download browser-delivered assets.
- Run
scripts/measure-layout.mjs to export document and section geometry.
- Run
scripts/inspect-glb.mjs to inventory nodes, cameras, meshes, materials, and animations in GLB or glTF files.
- Run
scripts/compare-screenshots.py to produce visual diffs and numeric image metrics.
- Run
scripts/qa-production.mjs after implementation and again against the deployed URL.
Read references/capture-and-measure.md before creating the evidence configuration. Read references/threejs-and-motion.md when the reference uses WebGL, Three.js, R3F, GLB, HDR, shaders, or cinematic motion. Read references/visual-qa.md before final visual and interaction acceptance.
Implementation rules
- Reuse the target repository's framework and conventions unless a rebuild is necessary.
- Check the reference network waterfall before substituting or generating assets.
- Preserve intrinsic image aspect ratios and identify desktop/mobile variants.
- Model responsive layouts as distinct compositions, not a uniformly scaled desktop page.
- Preserve meaningful DOM semantics, keyboard operation, focus state, and reduced-motion behavior.
- Keep WebGL optional on constrained devices when the reference provides or benefits from a fallback.
- Keep reference measurement, implementation, and verification reproducible through configuration and scripts.
- Preserve unrelated user changes in the target repository.
Acceptance contract
Do not call the reconstruction complete until all requested routes and states pass:
- no unexpected horizontal overflow;
- no uncaught browser or console errors;
- required assets load from the intended local or production paths;
- reference and implementation captures exist at every requested viewport;
- controls reach the expected state and expose accessible state where applicable;
- reduced-motion and mobile behavior are verified;
- the production URL returns the expected page rather than a gate, redirect, or error;
- remaining visual differences are recorded rather than silently ignored.
1---2name: rebuild-reference-site3description: Reconstruct reference websites with measured visual fidelity across routes, responsive viewports, interaction states, animation states, and production deployment. Use when Codex is asked to replicate, clone, reproduce, reverse-engineer, or pixel-match a public landing page, marketing site, product page, pricing page, FAQ, Three.js experience, or other browser-visible interface from a URL or supplied reference captures.4---56# Rebuild Reference Site78Turn a visual reference into a measured implementation. Prefer evidence from the running reference over aesthetic guesses.910## Workflow11121. Define the route, viewport, state, and deployment acceptance matrix before editing.132. Capture reference top, full-page, section, and interaction-state screenshots.143. Inventory browser-delivered images, fonts, models, textures, media, CSS, and relevant runtime requests. Localize required assets and record URL, path, MIME type, byte size, and hash.154. Measure document geometry, section rectangles, typography, colors, borders, and overflow behavior.165. Inspect 3D models, cameras, named focus nodes, animations, materials, lighting clues, post-processing, and mobile fallbacks when present.176. Implement structure first, then typography and spacing, then assets and interaction, then motion and post-processing.187. Compare captures repeatedly. Fix large geometry deltas before small decorative deltas.198. Exercise every route, viewport, toggle, accordion, navigation state, animation stop, and reduced-motion path.209. Build and deploy through the repository's configured workflow. Verify the production URL in a fresh browser context.2122## Evidence layout2324Keep generated evidence outside application source when possible:2526```text27.replica/28|-- config.json29|-- reference/30|-- local/31|-- assets/32| `-- manifest.json33|-- metrics/34`-- reports/35```3637Do not commit large generated captures unless the repository explicitly tracks visual fixtures.3839## Use bundled scripts4041- Run `scripts/capture-reference.mjs` to capture routes at multiple viewports.42- Run `scripts/inventory-assets.mjs` to record and optionally download browser-delivered assets.43- Run `scripts/measure-layout.mjs` to export document and section geometry.44- Run `scripts/inspect-glb.mjs` to inventory nodes, cameras, meshes, materials, and animations in GLB or glTF files.45- Run `scripts/compare-screenshots.py` to produce visual diffs and numeric image metrics.46- Run `scripts/qa-production.mjs` after implementation and again against the deployed URL.4748Read [references/capture-and-measure.md](references/capture-and-measure.md) before creating the evidence configuration. Read [references/threejs-and-motion.md](references/threejs-and-motion.md) when the reference uses WebGL, Three.js, R3F, GLB, HDR, shaders, or cinematic motion. Read [references/visual-qa.md](references/visual-qa.md) before final visual and interaction acceptance.4950## Implementation rules5152- Reuse the target repository's framework and conventions unless a rebuild is necessary.53- Check the reference network waterfall before substituting or generating assets.54- Preserve intrinsic image aspect ratios and identify desktop/mobile variants.55- Model responsive layouts as distinct compositions, not a uniformly scaled desktop page.56- Preserve meaningful DOM semantics, keyboard operation, focus state, and reduced-motion behavior.57- Keep WebGL optional on constrained devices when the reference provides or benefits from a fallback.58- Keep reference measurement, implementation, and verification reproducible through configuration and scripts.59- Preserve unrelated user changes in the target repository.6061## Acceptance contract6263Do not call the reconstruction complete until all requested routes and states pass:6465- no unexpected horizontal overflow;66- no uncaught browser or console errors;67- required assets load from the intended local or production paths;68- reference and implementation captures exist at every requested viewport;69- controls reach the expected state and expose accessible state where applicable;70- reduced-motion and mobile behavior are verified;71- the production URL returns the expected page rather than a gate, redirect, or error;72- remaining visual differences are recorded rather than silently ignored.