nextjs-supabase-auth · davila7 — Claude Code skill for Supabase Auth
Guides the agent through Supabase Auth in Next.js App Router: middleware, OAuth callback, protected routes and cookie-based sessions.
npx claude-code-templates@latest --skill development/nextjs-supabase-authWhat nextjs-supabase-auth does
This skill sets the boundaries for auth work in App Router projects. The agent keeps track of the server/client split: where a session gets read, where it gets refreshed, what must stay out of the browser. Middleware, Server Components, Client Components and Server Actions each get their own treatment.
Three patterns are covered. Configuring Supabase clients for different contexts. Middleware that guards routes and refreshes the session. A callback route that trades an OAuth code for a session. The skill also lists anti-patterns, among them calling getSession inside Server Components and keeping tokens by hand.
It builds on @supabase/ssr and cookie sessions, so a project still on @supabase/auth-helpers will need its dependencies reworked first. Pairs with the nextjs-app-router and supabase-backend skills.
What it helps with
- guard routes in middleware without dropping the session
- exchange an OAuth code for a session in the callback route
- separate Supabase clients for server and browser
- drop
getSessioncalls from Server Components - stop storing tokens manually
Example prompts for the agent
- Wire up Supabase login in App Router with
@supabase/ssr - Add middleware that refreshes the session and blocks private routes
- Create a callback route that turns an OAuth code into a session
How to install nextjs-supabase-auth
1claude-code-templates
npx claude-code-templates@latest --skill development/nextjs-supabase-auth2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill nextjs-supabase-auth -a claude-code3Manually: put the files in place
~/.claude/skills/nextjs-supabase-auth/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/nextjs-supabase-auth/
Manually: put the files in place
.agents/skills/nextjs-supabase-auth/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/nextjs-supabase-auth/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates nextjs-supabase-auth2Manually: put the files in place
.github/skills/nextjs-supabase-auth/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/nextjs-supabase-authManually: put the files in place
.devin/skills/nextjs-supabase-auth/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about nextjs-supabase-auth
How do I install nextjs-supabase-auth in Claude Code?
With the templates CLI: npx claude-code-templates@latest --skill development/nextjs-supabase-auth. Or through the skills CLI: npx skills add davila7/claude-code-templates --skill nextjs-supabase-auth -a claude-code.
What does nextjs-supabase-auth do?
It steers the agent through Supabase Auth in Next.js App Router: client setup, middleware, the OAuth callback and protected routes.
What do I need before using it?
A Next.js App Router project and a Supabase backend. The integration relies on @supabase/ssr and cookie sessions.
Similar skills
All skills for Backend and APIs →nextjs-supabase-auth by other authors comes first.