Stitch page port
Convert a Stitch wireframe → production React for the route/cluster in $ARGUMENTS
(e.g. homepage, pathways, content, courses, chrome, /contact).
This skill is the orchestration + tenant-correctness layer around the existing
stitch-react skill (which does the raw HTML→React decomposition). Always prefer
delegating the mechanical conversion to stitch-react, then apply the rules here.
Read first
TENANT_MANIFEST.md — copy slots, pathways table, feature flags, {{REFERENCE_REPO}},
excluded/tenant-unique routes.
COMPONENT_CHECKLIST.md — the row(s) for the route(s) in scope (required section order).
docs/build/notes/stitch-token-bridge.md — the token mapping (from stitch-token-bridge).
docs/build/notes/stitch-screen-route-map.md — cache paths (from stitch-intake-audit).
references/clusters.md (in this skill) — section-order spec for the cluster in scope.
- The reference page + components:
{{REFERENCE_REPO}}/src/app/(public)/<route> and src/components/<area>/.
Per-route conversion procedure
- Visual audit — read the cached HTML + PNG (
.stitch/designs/{slug}.html|png).
- Read the reference page and components for data-wiring patterns.
- Archive the existing
page.tsx → page-old.tsx (stitch-react Archive Protocol).
- Decompose the Stitch HTML into L4 section components under
src/components/<area>/.
If a route needs >4 new sections, plan first and get approval.
- Apply the token bridge — semantic tokens only; never wireframe hex.
- Wire data — use Layer-5 hooks from
src/hooks/ if they exist; otherwise render
static tenant placeholder copy from the manifest and flag the route for
tenant-backend-parity (Prompts 13–14) before it can be marked BUILT.
- Compose the Server Component
page.tsx with feature gates at page level, e.g.
{tenantConfig.features.chat && <AILabTeaser />}. Never add "use client" to a layout.
- Handle states — loading / empty / error in client sections. Empty DB ⇒ empty state,
never a removed section and never fake data.
Incomplete-template synthesis (critical)
When the cached Stitch screen omits a section the checklist/L5 requires:
- Read
STITCH_ROUTE_INDEX.md + L5 page spec + COMPONENT_CHECKLIST.md for the required sections.
- Implement the missing section in tenant design — spacing rhythm, shadcn primitives
(Card, Button, Input, Tabs, Accordion), manifest copy slots.
- If the section exists in
{{REFERENCE_REPO}}, port its structure and re-skin with tenant tokens.
- Mark the route
PARTIAL in REFERENCE_PAGE_COMPARISON.md with note Stitch gap: {section}.
- Never delete routes or reorder sections without documenting it.
Global chrome (run before page clusters)
Chrome lives in (public)/layout.tsx only — exclude header/footer from individual page
conversions. Create src/components/navigation/{site-header,site-footer,mobile-nav}.tsx,
wire tenantConfig.logo, tenantConfig.copyright, feature-gate nav items
({features.courses && <CoursesLink/>}), and use shadcn NavigationMenu + Sheet (mobile).
Server layout where possible; client only for mobile menu + theme toggle.
Tenant correctness (every route)
- Tenant strings come from
tenantConfig / research, never hardcoded — no source-tenant
(reference) or wireframe-placeholder (Stitch) copy unless a feature is enabled.
- Pathway names, featured book, AI assistant label, podcast name → manifest tables.
- One
<h1> per page. Section order matches the checklist exactly.
Per route, finish with
pnpm typecheck → confirm section order → update COMPONENT_CHECKLIST.md row to
BUILT or PARTIAL. Emit a stitch-react conversion report (screens converted, archived
page-old files, new component paths, hooks wired vs static stubs, flagged gaps).
Full UI gate runs separately in stitch-migration-validate.
Cluster specs
See references/clusters.md for the exact section order, route lists, and L4 component
paths for: global chrome · home/marketing · pathways · content library · courses ·
AI/chat/auth/account · utility/legal/tenant-unique.
Related skills
stitch-react (conversion primitive) · stitch-token-bridge · stitch-intake-audit ·
stitch-migration-validate · tenant-backend-parity · course-ux · new-page ·
tenant-migration-playbook
1---2name: stitch-page-port3description: >4 Phase B/03–09 of the Movemental tenant migration — the repeatable workhorse that5 converts a cached Google Stitch wireframe into production React for one route or one6 route cluster (global chrome, home/marketing, pathways, content library, courses, AI/7 chat/auth/account, utility/legal/tenant-unique). Replaces PlaceholderPage scaffolds8 with Server Component pages composing L4 section components, applies the token bridge,9 wires Layer-5 hooks when they exist, and SYNTHESIZES missing sections from the reference10 repo when a Stitch screen is incomplete. Use when the user says "port the homepage",11 "convert the courses pages", "build the content cluster from stitch", "migrate this12 route", or runs the playbook per-cluster. Underlying per-screen mechanic is the13 stitch-react skill. Tenant-agnostic: copy slots, pathways, and design come from14 TENANT_MANIFEST.md. See references/clusters.md for per-cluster section orders.15user-invocable: true16allowed-tools: Read, Write, Edit, Grep, Glob, Bash, Agent, mcp__stitch__get_screen17metadata:18 source: https://skillmd.com/skills/joshuashepherd/stitch-page-port19---2021# Stitch page port2223Convert a Stitch wireframe → production React for the route/cluster in `$ARGUMENTS`24(e.g. `homepage`, `pathways`, `content`, `courses`, `chrome`, `/contact`).2526This skill is the orchestration + tenant-correctness layer around the existing27**`stitch-react`** skill (which does the raw HTML→React decomposition). Always prefer28delegating the mechanical conversion to `stitch-react`, then apply the rules here.2930## Read first3132- `TENANT_MANIFEST.md` — copy slots, pathways table, feature flags, `{{REFERENCE_REPO}}`,33 excluded/tenant-unique routes.34- `COMPONENT_CHECKLIST.md` — the row(s) for the route(s) in scope (required section order).35- `docs/build/notes/stitch-token-bridge.md` — the token mapping (from `stitch-token-bridge`).36- `docs/build/notes/stitch-screen-route-map.md` — cache paths (from `stitch-intake-audit`).37- `references/clusters.md` (in this skill) — section-order spec for the cluster in scope.38- The reference page + components: `{{REFERENCE_REPO}}/src/app/(public)/<route>` and `src/components/<area>/`.3940## Per-route conversion procedure41421. **Visual audit** — read the cached HTML + PNG (`.stitch/designs/{slug}.html|png`).432. **Read the reference** page and components for data-wiring patterns.443. **Archive** the existing `page.tsx` → `page-old.tsx` (stitch-react Archive Protocol).454. **Decompose** the Stitch HTML into L4 section components under `src/components/<area>/`.46 If a route needs >4 new sections, plan first and get approval.475. **Apply the token bridge** — semantic tokens only; never wireframe hex.486. **Wire data** — use Layer-5 hooks from `src/hooks/` if they exist; otherwise render49 static tenant placeholder copy from the manifest and **flag the route for50 `tenant-backend-parity`** (Prompts 13–14) before it can be marked `BUILT`.517. **Compose the Server Component** `page.tsx` with feature gates at page level, e.g.52 `{tenantConfig.features.chat && <AILabTeaser />}`. Never add `"use client"` to a layout.538. **Handle states** — loading / empty / error in client sections. Empty DB ⇒ empty state,54 never a removed section and never fake data.5556## Incomplete-template synthesis (critical)5758When the cached Stitch screen omits a section the checklist/L5 requires:59601. Read `STITCH_ROUTE_INDEX.md` + L5 page spec + `COMPONENT_CHECKLIST.md` for the required sections.612. Implement the missing section in tenant design — spacing rhythm, shadcn primitives62 (Card, Button, Input, Tabs, Accordion), manifest copy slots.633. If the section exists in `{{REFERENCE_REPO}}`, port its **structure** and re-skin with tenant tokens.644. Mark the route `PARTIAL` in `REFERENCE_PAGE_COMPARISON.md` with note `Stitch gap: {section}`.655. Never delete routes or reorder sections without documenting it.6667## Global chrome (run before page clusters)6869Chrome lives in `(public)/layout.tsx` only — exclude header/footer from individual page70conversions. Create `src/components/navigation/{site-header,site-footer,mobile-nav}.tsx`,71wire `tenantConfig.logo`, `tenantConfig.copyright`, feature-gate nav items72(`{features.courses && <CoursesLink/>}`), and use shadcn `NavigationMenu` + `Sheet` (mobile).73Server layout where possible; client only for mobile menu + theme toggle.7475## Tenant correctness (every route)7677- Tenant strings come from `tenantConfig` / research, never hardcoded — no source-tenant78 (reference) or wireframe-placeholder (Stitch) copy unless a feature is enabled.79- Pathway names, featured book, AI assistant label, podcast name → manifest tables.80- One `<h1>` per page. Section order matches the checklist exactly.8182## Per route, finish with8384`pnpm typecheck` → confirm section order → update `COMPONENT_CHECKLIST.md` row to85`BUILT` or `PARTIAL`. Emit a stitch-react conversion report (screens converted, archived86page-old files, new component paths, hooks wired vs static stubs, flagged gaps).8788Full UI gate runs separately in **`stitch-migration-validate`**.8990## Cluster specs9192See `references/clusters.md` for the exact section order, route lists, and L4 component93paths for: global chrome · home/marketing · pathways · content library · courses ·94AI/chat/auth/account · utility/legal/tenant-unique.9596## Related skills9798`stitch-react` (conversion primitive) · `stitch-token-bridge` · `stitch-intake-audit` ·99`stitch-migration-validate` · `tenant-backend-parity` · `course-ux` · `new-page` ·100`tenant-migration-playbook`