Consistent Screens Require a Consistent Process
Without a gated workflow, every "build a screen" request produces inconsistent results. The /build-screen skill enforces the same checklist for all 40+ TiffinConnect screens.
Ad-hoc screen building skips context gathering, misses SVG extraction, creates route conflicts, and never updates the project docs. By the time you notice a problem — an icon that does not exist, a route that collides with an existing page, a Redux slice that duplicates state — you have already built on top of the mistake.
The /build-screen skill lives at .claude/commands/build-screen.md. It defines a 5-phase, gated workflow. Claude reads it and follows its phases exactly — no shortcuts, no skipped gates. The result is 40+ screens with consistent token usage, naming, and Redux patterns because the same checklist ran for every one of them.
SVG gate: no JSX is written before Phase 1b (SVG extraction) completes. This single rule eliminates the most common source of broken screens — references to icons that do not exist yet.
Phase-by-Phase Breakdown
Each phase is a gate for the next. Trust the order.
Step -1: Surface Lock /build-screen [web] role screen-name "web" as first arg → SURFACE: WEB; otherwise SURFACE: MOBILE Step 0: Role Lock First remaining word → vendor or consumer → ROLE locked All file reads use only that role's design files and token map Phase 1a: Context Gathering (parallel reads) - Flow doc (role-matched) → route, Redux reads/writes, navigation, validation - PROJECT_REF.md → folder structure, Redux store, components, design tokens - components.md → exact prop signatures for all UI primitives - Sibling page → exact code pattern to match - Design reference JSX → primary visual source - Primitive/token source → tokens.jsx (consumer) or shared.jsx (vendor) Phase 1b: SVG Extraction (HARD GATE — no JSX before this) - List /public/icons/ to find what already exists - Scan design JSX for all Icon / Glyph calls in this screen - Look up each icon's SVG child elements from the primitive file - Check the alias table (nonveg → non-veg.svg, star-fill → starF.svg) - Write only icons that do not exist yet — never overwrite existing files Phase 2: Visual Analysis Map every design element → Tailwind class using locked role's token table TC.* → Tailwind (consumer) | T.* → Tailwind (vendor) Note design deltas before writing code Phase 3: Build Route conflict check before creating the file "use client" at top; default export for page.tsx Create new slice if needed; register in store/index.ts Use only existing UI primitives from components/ui/ Phase 4: Doc Updates Add row to PROJECT_REF.md CHANGELOG Update FOLDER STRUCTURE if new files were created Mark screen as built in the flow doc Phase 5: OQ Scan Every hardcoded value, stub, mock, or missing API → new OQ entry
Walking Through /build-screen consumer checkout review
A concrete example showing how each phase produces real, load-bearing output.
Invocation: /build-screen consumer checkout review
Step -1 & 0: No "web" prefix → SURFACE: MOBILE. First word is "consumer" → ROLE: consumer. All file reads will use CONSUMER_FLOW.md and tokens.jsx.
Phase 1a: Claude reads CONSUMER_FLOW.md entry for "Checkout — Review Order" and learns: route is /checkout/review, reads checkout.items and checkout.address, CTA disabled until both are set, navigation out to /checkout/payment.
Phase 1b (gate): Scans screens-checkout.jsx for Icon calls → finds Icon("edit") and Icon("timer"). Checks /public/icons/ — timer.svg exists, edit.svg does not. Writes edit.svg only.
Phase 3: Route conflict check confirms (consumer)/checkout/review/page.tsx does not exist. Builds the component using checkoutSlice already in store. No new slice needed.
Phase 5: Hardcoded delivery window "12:00–13:00" → OQ-14 registered.
Ad-hoc vs Gated: The Difference in Practice
The same "build checkout review screen" request produces very different outcomes depending on whether the skill ran.
| Dimension | Ad-hoc "build it" | /build-screen skill |
|---|---|---|
| Route | Guessed from screen name | Read from flow doc |
| Icons | Referenced but may not exist | Extracted and written before JSX |
| Redux slice | New slice created regardless | Existing slice reused after checking store |
| Route conflicts | Not checked — silent collision | Checked before file creation |
| Docs updated | Never | CHANGELOG, flow doc status, OQ tracker |
| Stubs tracked | Silently left in code | Registered in open-questions.md (Phase 5) |
Further Reading
Primary sources for this module.
- .claude/commands/build-screen.md — the /build-screen skill definition
- .claude/commands/add-component.md — /add-component skill for new UI primitives
- docs/CONSUMER_FLOW.md — read in Phase 1a for consumer screens
- docs/VENDOR_FLOW.md — read in Phase 1a for vendor screens
- docs/components.md — prop signatures read in Phase 1a
- docs/open-questions.md — receives new OQ entries from Phase 5