Life prototype

Build or update a standalone, full-viewport React and Tailwind product prototype in the Life Studio. Use for clickable UI flows from a brief, existing product, or visual reference.

Deliver a working product flow at /prototypes/<slug>. Studio opens it in a new tab. Keep all prototype-specific screens, components, fixtures, and assets in its route folder.

1. Plan before you build

  1. Read AGENTS.md, the relevant Next.js guides in apps/studio/node_modules/next/dist/docs/, and Life DESIGN.md.
  2. Check apps/studio/src/lib/prototype-navigation.ts and the folders under apps/studio/src/app/(products)/prototypes/. For an existing flow, edit its folder and preserve its shared URL. For a new flow, follow the copy and registration guide. The live starter demonstrates the launch and navigation behavior.
  3. Write the screen inventory from Data and states and get it agreed on a complex flow before coding: every noun the product shows, its list, its detail page, how a person reaches it, and its states. A noun with a list but no page behind it is a gap in the plan, not a finishing touch.
  4. Ask once, up front, for anything the brief leaves open that would cause rework: the product model (what contains what, what is locked, how many of each can be chosen), body text size, border strength, corner radius, which things get colour, which panels share a fill. Then record the answers in the prototype's GAPS.md or its header comment so they hold for every screen.
  5. Use the supplied product or reference for the shell, content, and interactions. Match its geometry, spacing, typography, and assets at the reference viewport. When the brief leaves visual details open, use Visual Direction.

2. Build

  • Reuse public components from @sarvam/life and use Tailwind for layout. The shared prototype layout supplies the same Life stylesheet and active profile as the catalog. Match the preview’s public props and slots. Put page spacing on the surrounding layout. Use semantic content, background, and border roles with greyscale focus rings. Frames, dividers and card edges use the subtle border unless the reference says otherwise.
  • Give the product the full viewport and its own responsive shell, built the way Shell and alignment says. Keep author notes and review controls in the Studio directory.
  • Align every element to one content edge by construction. Never offset a Life component with negative margins to cancel its own padding: that breaks silently when the component changes. If a component's inset does not match the page, record a component gap. No bleed: contain hover fills inside a clipped frame.
  • Give each category, level, status or group its own hue from one prototype palette, and pick icons by the rules in Colour and icons. Write every Tailwind class out in full so it is generated.
  • Follow the settled interaction choices in Patterns instead of re-deciding them: row actions, menus, pagination, search, groups, breadcrumbs, install flows.
  • Build missing UI inside the prototype. Append each reusable component gap, and the workaround you used, to the prototype's GAPS.md as you go (template), so the handoff list already exists. Promotion happens later through the production-ready process.
  • Use realistic local fixtures, sized and varied as Data and states describes. Wire each visible action to its result, carry choices into subsequent screens, and support revision or recovery where the flow calls for it.
  • Give navigable screens stable URLs. Browser Back and Forward should retrace visits, and a direct link or reload should open the addressed screen. Keep transient UI state such as drafts, selections, and overlays in React. In the starter, a reload resets task edits and retains the screen.

3. Check and hand off

The author does not test in a browser; the person reviewing the prototype does. Run lint and type checks, and fix what they report. Do not drive the dev server, automate the browser, or run manual UI checks unless the user asks for it in this session.

Before saying the work is done:

  • Re-read every earlier request in the session and confirm each one is implemented end to end, not just the latest.
  • Confirm every row, card and banner that names a thing leads to that thing's page.
  • Confirm numbers and names agree wherever the same fact appears twice.
  • Confirm GAPS.md lists every workaround.
  • If a colour or token changed, run pnpm colors:publish (or pnpm tokens:validate) and report any failure and the unperformed Figma and comparison-board sync as they are.
  • Confirm each panel has exactly one border, one corner radius is used throughout, and every scroll area reaches its container edge.

Hand off with the launch URL, a short list of what to check in the browser (the main path, an alternate outcome, a deep link, Back and Forward, keyboard focus, both themes, a narrow viewport, and the alignment overlay on any new row or header), any mocked behavior, and the component gaps that matter to the reviewer. When a prototype is verified in a browser by someone else, launch it from the directory, the sidebar and search, and confirm Studio stays in its original tab.