Skip to content

Instantly share code, notes, and snippets.

@AOrobator
Created January 11, 2026 17:18
Show Gist options
  • Select an option

  • Save AOrobator/f1ca4f068a1f0aab6679061d4c5a65b3 to your computer and use it in GitHub Desktop.

Select an option

Save AOrobator/f1ca4f068a1f0aab6679061d4c5a65b3 to your computer and use it in GitHub Desktop.
User Registration Flow - Spec Example from Vibe Engineering Starter Kit

Product Spec Example: User Registration Flow

This example shows how to document a user flow in your PRODUCT_SPEC.md. Notice how it covers happy paths, sad paths, and constraints—giving the AI everything it needs to implement without guessing.


User Registration Flow

Happy Path

  1. User enters email on /login
  2. System sends magic link email
  3. User clicks link within 24 hours
  4. System creates session, redirects to /dashboard

Sad Paths

  • Invalid email format → Show inline validation error
  • Email send fails → Show error, suggest retry
  • Link expired → Redirect to /login?error=expired
  • Link already used → Redirect to /login?error=used

Constraints

  • Rate limit: 5 magic links per email per hour
  • Rate limit: 10 magic links per IP per hour
  • Token storage: SHA256 hash (never store plaintext)
  • Session: HTTP-only cookie, 7-day expiry

Why This Works

When you give the AI this level of detail:

  • No guessing about expiry times
  • No inventing rate limits
  • No "should I hash the token?" decisions

The spec is the source of truth. The AI implements; you verify it matches the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment