Use when adding authentication to Next.js applications with both server and client-side auth - supports App Router and Pages Router with @auth0/nextjs-auth0 SDK
86
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillEvaluation — 100%
↑ 1.08xAgent success when using this skill
Validation for skill structure
V4 SDK setup and environment configuration
Correct SDK package
100%
100%
Auth0Client import path
100%
100%
lib/auth0.ts location
100%
100%
APP_BASE_URL env var
100%
100%
AUTH0_DOMAIN no scheme
100%
100%
Correct env file
100%
100%
.gitignore entry
100%
100%
AUTH0_SECRET generation
100%
100%
Regular Web Application type
100%
100%
v4 callback URL
100%
100%
Auth0Client constructor fields
0%
100%
No deprecated env vars
100%
100%
Without context: $0.3697 · 1m 44s · 22 turns · 79 in / 5,675 out tokens
With context: $0.5136 · 1m 49s · 28 turns · 888 in / 5,912 out tokens
Middleware route protection configuration
Middleware file location
100%
100%
Correct function name
100%
100%
Calls auth0.middleware()
100%
100%
Correct matcher pattern
100%
100%
v4 login route in redirect
100%
100%
Session check uses getSession
100%
100%
Auth routes pass-through
100%
100%
Auth0Client imported from server
100%
100%
returnTo parameter
100%
100%
No /api/auth/* references
100%
100%
Without context: $0.2455 · 1m 19s · 12 turns · 17 in / 4,028 out tokens
With context: $0.3177 · 57s · 15 turns · 5,075 in / 2,922 out tokens
Server-side session and API route patterns
getSession() no args (App Router)
100%
100%
No withPageAuthRequired
100%
100%
No withApiAuthRequired
100%
100%
useUser() client-only
100%
100%
getSession() for server auth check
100%
100%
getAccessToken() for external API
100%
100%
Redirect to /auth/login
0%
100%
Auth0Client from server import
0%
100%
useUser() import path
100%
100%
Auth0Provider optional
100%
100%
401 for unauthenticated API
100%
100%
Without context: $0.4068 · 1m 53s · 22 turns · 28 in / 6,520 out tokens
With context: $0.7885 · 2m 20s · 36 turns · 2,347 in / 6,989 out tokens
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.