authjs-skills — Claude Code skill: Auth.js v5 setup for Next.js
An agent skill that walks through Auth.js v5 authentication in Next.js: Google OAuth, email and password sign-in, environment variables.
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a claude-codeWhat authjs-skills does
The skill covers installing and wiring Auth.js v5 into a Next.js project. It walks through creating auth.ts at the project root, the route handler at app/api/auth/[...nextauth]/route.ts, and an optional middleware.ts. Separate sections handle the Google provider and the credentials provider.
Google sign-in needs AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET from Google Cloud Console, plus an AUTH_SECRET. You can generate the secret with openssl rand -base64 32 or pnpm dlx auth secret, and the skill tells you to keep it in .env.local rather than in version control.
Install the package as pnpm add next-auth@beta. Auth.js v5 is in beta, so skipping the @beta tag pulls v4 and a different API. The credentials path also wants bcryptjs and zod. Migrating an existing v4 app? The config shape and the auth() export changed, so check the migration guide instead of copying your old setup.
What it helps with
- add Google sign-in to a Next.js app
- build an email and password form with bcrypt hashing
- protect
/dashboardand/profileroutes with middleware - keep auth config in one
auth.tsinstead of scattered files - generate
AUTH_SECRETand organise environment variables in.env.local
Example prompts for the agent
- set up Auth.js v5 in this Next.js project
- add the Google OAuth provider to
auth.ts - configure middleware to redirect signed-out users to
/auth/signin
How to install authjs-skills
1Skills CLI (Vercel)
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a claude-code2Manually: put the files in place
~/.claude/skills/authjs-skills/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/authjs-skills/
1Skills CLI (Vercel)
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a codex2Manually: put the files in place
.agents/skills/authjs-skills/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a cursor2Manually: put the files in place
.cursor/skills/authjs-skills/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install gocallum/nextjs16-agent-skills authjs-skills2Manually: put the files in place
.github/skills/authjs-skills/SKILL.md1Skills CLI (Vercel)
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a gemini-cli2Platform CLI
gemini skills install https://github.com/gocallum/nextjs16-agent-skills --path skills/authjs-skillsManually: put the files in place
.devin/skills/authjs-skills/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a opencodeClaude.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 authjs-skills
How do I install authjs-skills in Claude?
Run npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a claude-code. The skill lands at ~/.claude/skills/authjs-skills/SKILL.md.
What does authjs-skills do?
It guides the agent through Auth.js v5 setup in Next.js: auth.ts config, the route handler, middleware, the Google and Credentials providers, and environment variables.
What do I need before using it?
A Next.js project and next-auth@beta installed. Google sign-in requires AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET; the credentials provider needs bcryptjs and zod.