01 — Why /build-screen Exists

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.

02 — The 5 Phases

Phase-by-Phase Breakdown

Each phase is a gate for the next. Trust the order.

text
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
03 — TiffinConnect: OrderSummary Screen

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.

04 — Before vs After

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
RouteGuessed from screen nameRead from flow doc
IconsReferenced but may not existExtracted and written before JSX
Redux sliceNew slice created regardlessExisting slice reused after checking store
Route conflictsNot checked — silent collisionChecked before file creation
Docs updatedNeverCHANGELOG, flow doc status, OQ tracker
Stubs trackedSilently left in codeRegistered in open-questions.md (Phase 5)
05 — References

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
Check your understanding
1. What is the "hard gate" in the /build-screen workflow and what does it prevent?
Correct.Not quite — the correct answer is highlighted above.
2. If you invoke /build-screen vendor today home, which design token file does Claude use?
Correct.Not quite — the correct answer is highlighted above.
3. What is the purpose of the route conflict check in Phase 3?
Correct.Not quite — the correct answer is highlighted above.