feat(wix-headless): combinatorial layout composition (CODEAI-696)#408
Draft
yanivefraim wants to merge 1 commit into
Draft
feat(wix-headless): combinatorial layout composition (CODEAI-696)#408yanivefraim wants to merge 1 commit into
yanivefraim wants to merge 1 commit into
Conversation
0a81532 to
ab86ad1
Compare
Generated sites all shared one fixed layout — same hero, same nav — so two
sites from different prompts looked like the same template re-skinned (only
colors/fonts varied). This makes the homepage STRUCTURE vary per build while
keeping the deterministic, no-LLM-layout pipeline (≤600s, reliable).
compose.mjs now ASSEMBLES the homepage from one randomly chosen fragment per
slot rather than filling a single fixed skeleton:
- index.astro is a thin shell ({{hero}} {{home-markers}} {{about}}).
- fragments/hero/ (4), fragments/about/ (3), fragments/nav/ (3) → 36 homepage
combinations; new fragments are auto-discovered (drop-in, no code change).
- Selection is random per run (Math.random); pass an integer `layoutSeed` for a
reproducible pick (tests). The chosen combo + seed are recorded in the
manifest (data.layout) since the run is otherwise non-reproducible.
- Every fragment preserves the exact slots/markers the pipeline depends on
(heroHeadline/heroSub, data-decorative-slot hero|about, home:* and nav:links
markers, nav-actions, site-nav, transition:persist) so downstream build
agents stay variant-agnostic; global.css/Layout/Footer are shared (View-
Transitions wiring untouched).
BUILD-astro.md documents that layout is auto-randomized by compose (no input
required; optional layoutSeed for reproducibility). DISCOVERY-create.md no
longer promises a specific layout in the plan (structure is chosen post-approval
at compose time).
v1 scope: homepage hero + navigation. Per-vertical page fragments
(products/services/blog) are a documented follow-up.
Verified: compose across 16 seeds renders all slots/markers with no leftover
placeholders; same seed reproducible; random runs produce distinct combos;
shared shell files stable across layouts. End-to-end: 3 minimal yoga sites built
+ published, each with a visibly different hero/nav layout (centered-banner,
stacked-top, split-left).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ab86ad1 to
d89dcb4
Compare
This was referenced Jun 17, 2026
Draft
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CODEAI-696 — generated sites share one layout
Every site
wix-headlessgenerated used the same fixed layout (same hero, same nav), so two sites from different prompts looked like the same template re-skinned — only colors/fonts varied. This makes the homepage structure vary per build while keeping the deterministic, no-LLM-layout pipeline (≤600s, reliable).Approach — combinatorial section composition
compose.mjsnow assembles the homepage from one randomly chosen fragment per slot instead of filling a single fixed skeleton:index.astrois a thin shell —{{hero}} {{home-markers}} {{about}}.fragments/hero/(4) ×fragments/about/(3) ×fragments/nav/(3) = 36 homepage combinations. New fragments are auto-discovered (drop a file in, no code change).Math.random); pass an integerlayoutSeedfor a reproducible pick (tests). The chosen combo + seed are recorded in the manifest (data.layout) since the run is otherwise non-reproducible.heroHeadline/heroSub,data-decorative-slot="hero"|"about",<!-- home:* -->/<!-- nav:links -->,nav-actions,site-nav,transition:persist) → downstream build agents stay variant-agnostic.global.css/Layout.astro/Footer.astroare shared (View-Transitions wiring untouched).BUILD-astro.mddocuments that layout is auto-randomized by compose (no input required).DISCOVERY-create.mdno longer promises a specific layout in the plan (structure is chosen post-approval at compose time).Verification
{{…}}; samelayoutSeedreproducible; random runs produce distinct combos;global.css/Layout/Footerstable across layouts.Scope & follow-ups
.wix/layout.json/AGENTS.mdfor after-the-fact reproducibility; fragment-authoring contract doc + build-all-combos smoke test.🤖 Generated with Claude Code