name: nextjs-auth
description: OAuth2 authentication feature for Next.js + shadcn/ui application with Neon Auth
stack: nextjs-neon

request: |
  Add user authentication to the Next.js application using Neon Auth (Better Auth).
  Users should be able to sign in with Google OAuth, view their profile page
  showing name, email, and avatar using shadcn/ui Card and Avatar components,
  and sign out. Use TanStack Query for data fetching and cache management.
  Protect authenticated routes with Next.js middleware.
  Session data lives in the Neon PostgreSQL database.

phases_to_eval:
  - proposal
  - spec
  - tasks

skip_implementation: true

dimensions:
  proposal:
    completeness: "Covers sign-in, profile with shadcn/ui components, sign-out, Neon Auth session storage, middleware route protection"
    scope: "Appropriately scoped — no admin dashboard, no multi-provider auth beyond Google"
  spec:
    specificity: "Each FR has testable acceptance criteria with specific status codes, Neon Auth config, TanStack Query hooks"
    data_model: "User and Session entities defined with Prisma schema or Drizzle schema for Neon PostgreSQL"
    architecture: "Next.js App Router structure, API routes, middleware, shadcn/ui component boundaries, TanStack Query patterns"
    completeness: "OAuth flow via Neon Auth, token refresh, error handling, logout flow, loading states with Framer Motion"
  tasks:
    granularity: "Each task 15-60 minutes, no mega-tasks"
    coverage: "All spec FRs mapped to at least one task"
    ordering: "Dependencies respected — Neon Auth setup before routes, routes before UI, UI before tests"
  cross_phase:
    fr_coverage_threshold: 0.95
    mandate_completeness: 0.9

threshold: 8.0
max_iterations: 3
