Design JSX tells Claude what a screen looks like. Flow docs tell it how the screen behaves.
TiffinConnect uses two markdown files — docs/CONSUMER_FLOW.md and docs/VENDOR_FLOW.md — that spec every screen for each user role. They are the authoritative record of routes, Redux state, navigation triggers, CTA validation rules, and stub status.
Without flow docs the AI builds screens that look pixel-perfect but navigate to the wrong route, miss validation logic, or create duplicate Redux slices that already exist elsewhere. The design JSX is a static mock — it cannot tell Claude what router.push() a button fires or what condition disables the CTA.
Two sources of truth, never one: design JSX wins on visual layout, flow doc wins on routing and Redux behavior.
02 — Screen Entry Format
How Every Screen Is Documented
A consistent 9-field entry format ensures Claude always gets complete behavioral context.
markdown
### Checkout — Review Order
Route: /checkout/review
Component: src/app/(consumer)/checkout/review/page.tsx
What it shows: Order summary, cook details, delivery window, total price
Actions:
- Tap "Change address" -> navigates to /checkout/address
- Tap "Confirm & Pay" -> dispatches checkout/submitOrder(payload)
State (reads): checkout.items, checkout.address, checkout.deliverySlot
State (writes): checkout.status, checkout.orderId
Navigation out: -> /checkout/payment on submitOrder.fulfilled
Validation: CTA disabled until checkout.address is set AND checkout.items.length > 0
Status: not built
TODOs: deliverySlot is hardcoded to "12:00–13:00"; real slot API not integrated
Every field is mandatory. Skipping Validation means Claude guesses the CTA condition. Skipping TODOs means mocks silently ship to production. The Status field gets flipped to built by the /build-screen skill in Phase 4 — never manually.
03 — How Claude Reads Flow Docs
Conditional Loading Inside /build-screen
Claude reads only the relevant flow file — not both — so tokens are spent on the right context.
When you invoke /build-screen consumer checkout review, Phase 1a instructs Claude to load CONSUMER_FLOW.md. When you invoke /build-screen vendor today home, it loads VENDOR_FLOW.md instead. The role argument is locked in Step 0 and controls every subsequent file read.
This conditional loading is the reason flow docs must be role-specific rather than merged into one file. A combined file would force Claude to parse the entire behavioral spec — consumer and vendor — every time, burning tokens on context it will never use for that screen.
✓
Add before building
Create the flow doc entry before invoking /build-screen. Phase 1 needs it to determine route and slice.
✗
Build without an entry
Claude will invent route names and Redux patterns. The resulting screen needs heavy correction.
✓
Mark built in Phase 4
Let /build-screen update the Status field. Never flip it manually; the skill also updates CHANGELOG.
✗
Use design JSX for routing
Design JSX is a static mock. It does not reflect real Next.js route groups or App Router conventions.
04 — Docs Ecosystem
The Full Frontend Docs Folder
Flow docs live inside a broader documentation system. Each file has one job.
Beyond the two flow docs, TiffinConnect keeps a layered docs folder so Claude always has the right information at the right granularity:
The rule: every file has one job. Merging behavioral spec into PROJECT_REF bloats the reference file and causes Claude to read things irrelevant to the current task. Flow docs stay separate and role-split.