skills/stack-nextjs-supabase/SKILL.md
--- name: "stack-nextjs-supabase" description: "Integration seams for Next.js App Router + Supabase: dual-client auth (browser/server), middleware token refresh, RLS policies, typed queries, and real-time subscriptions" version: "1.0.0" type: composite layer: stack requires: sage: ">=1.0.0" skills: - "web" - "baas" - "nextjs" activates-when: detected: [next, @supabase/supabase-js, @supabase/ssr] tags: [next,@supabase/supabase-js,@supabase/ssr] --- # stack-nextjs-supabase **La
npx skillsauth add xoai/sage skills/stack-nextjs-supabaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Layer 3 — Stack Composition
Integration seams for Next.js App Router + Supabase. Covers the five critical integration points that neither Next.js docs nor Supabase docs adequately address together.
| Seam | What Goes Wrong |
|------|----------------|
| Dual Clients | Agents create one client — auth silently breaks across server/client boundary |
| Middleware Token Refresh | Agents skip middleware — users randomly get logged out on expired tokens |
| RLS as Authorization | Agents rely on Next.js middleware for auth — database is still publicly accessible |
| Typed Queries | Agents use untyped select('*') — typos are silent runtime errors |
| Server Actions | Agents build REST API routes for same-app mutations instead of using Server Actions |
L1: web (domain) + baas (backend domain)
L2: nextjs (framework) + react (framework)
L3: stack-nextjs-supabase (this pack — integration seams)
testing
Root cause diagnosis with evidence, Reproducing test, Minimal patch
tools
Session resumption with context
tools
Configure Sage preset and project settings. Switch between base, startup, enterprise, or opensource constitution presets. Use when the user says "configure sage", "change preset", or "sage settings".
development
Brief (medium+ tasks), Spec, Implementation plan