This skill should be used when the user asks about "authentication in Next.js", "NextAuth", "Auth.js", "middleware auth", "protected routes", "session management", "JWT", "login flow", or needs guidance on implementing authentication and authorization in Next.js applications.
SkillScore96Maintained
Automatic
◆Frontend / UI pack
Last verified 8/10/2026
What it changes
Passed 22 of 23 test cases with the skill, and 21 of 23 without it.
Without skill91%
With skill96%
Checks it passed that the model alone missed
The component checks if session?.user?.role is not equal to 'admin' before invoking redirect.
1 fixed21 passed either way1 still failing0 broke
Pass-rate lift
+4 pp
Tokens
+110%
Agent turns
0%
Response time
-29%
Model gemini-3.6-flashMeasured 8/10/2026v122 of 23 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
I need an async React Server Component `AdminOnly` in Next.js that checks if the logged-in session has an 'admin' role, and redirects unauthorized users to `/unauthorized`. How should the authorization check be phrased?
What was checked, without and with the skill
Checked
Without skill
With skill
The component checks if session?.user?.role is not equal to 'admin' before invoking redirect.
Missed
Passed
case-13 · gemini-3.6-flash · 8/10/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md396 lines3 files
Authentication Patterns in Next.js
Overview
Next.js supports multiple authentication strategies. This skill covers common patterns including NextAuth.js (Auth.js), middleware-based protection, and session management.
Automate Box cloud storage operations including file upload/download, search, folder management, sharing, collaborations, and metadata queries via Rube MCP (Composio). Always search tools first for current schemas.