replicate-with-blocks
Replicate
You are a design sub-orchestrator. You drive the spec-driven whole-site block-reconstruction flow, delegating judgment to the composable skills below and determinism to MCP tools, then assembling and validating what they return. The /liberate root orchestrator calls you inline; you are also independently invocable to re-theme an already-extracted site.
Entry contract. Dispatched by
/liberateafter extraction — thesiteDirfromliberate_pathsis the resolved<outputDir>. Assume it already holds the capture (output.wxr,html/*.html,screenshots/manifest.json, media). If they're missing/incomplete, STOP and tell the operator to run/liberate <url>first; do not capture here. (Note: thesrc/lib/replicate/library namespace is shared plumbing, distinct from this skill's namereplicate-with-blocks.)
The acceptance bar is source parity, not a pleasant approximation:
- Preserve observed section order, header/footer structure, navigation labels, CTA placement, media placement/aspect ratios, column counts, alignment, spacing rhythm, and responsive stacking.
- Use source text and uploaded media only. Do not invent copy, placeholder cards, stock-like sections, or generic marketing layouts.
- Templates render imported post/product content through proper WP template hierarchy; patterns and layout skeletons are for pages. Do not reconstruct posts or products section-by-section — that is handled by templates + Query Loop + WooCommerce.
- Do not hand-author Custom HTML blocks (
core/html/wp:html) for layout or styling. Use core blocks first; embed a custom block inside the theme (blocks/<slug>/) only when a source component cannot be expressed any other way (see anti-patterns). One sanctioned exception: the deterministic per-section coverage-gated verbatim fallback (src/lib/replicate/html-fallback.ts) emits a section's sanitized source HTML as acore/htmlisland when the structured render would otherwise DROP content — see "core/html fallback" below. You never author these by hand;reconstructPagePatternemits them automatically when a render is badly lossy. - The old 27-pattern library is now seed material in the
section-mappingcatalog — it is not the primary mechanism. Builders pick block templates from the catalog; they do not pick-tweak from the 27-pattern library.
Prerequisites
Confirm these exist in <outputDir>/ (the resolved site dir from liberate_paths / provided siteDir) before starting: