A conceptual skill for integrating Better Auth with Next.js App Router
NewMaintained
Automatic
◆Frontend / UI pack
Last verified 8/22/2026
What it changes
Passed 20 of 22 test cases with the skill, and 20 of 22 without it.
Without skill91%
With skill91%
Checks it passed that the model alone missed
Export HTTP route handlers using the `toNextJsHandler` adapter function.
Specify creating a catch-all route file at `app/api/auth/[...all]/route.ts`.
Clarify that App Router layout providers and App Router conventions do not apply to `pages/_app.tsx`.
2 fixed18 passed either way0 still failing2 broke
Pass-rate lift
0 pp
Tokens
+26%
Agent turns
0%
Response time
-27%
Model gemini-3.6-flashMeasured 8/22/2026v120 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
We are configuring authentication API endpoint routing in a Next.js App Router project. A developer proposed creating individual route files for each auth action, such as `app/api/auth/login/route.ts` and `app/api/auth/register/route.ts`. How should authentication routes be structured in Next.js App Router to handle all dynamic authentication endpoints?
What was checked, without and with the skill
Checked
Without skill
With skill
Specify creating a catch-all route file at `app/api/auth/[...all]/route.ts`.
Missed
Passed
Export HTTP route handlers using the `toNextJsHandler` adapter function.
Missed
Passed
case-19 · gemini-3.6-flash · 8/22/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md161 linessingle file
Next.js Better Auth Integration Skill
When to Use This Skill
Use this conceptual skill when you need to implement authentication in a Next.js application using the App Router architecture with Better Auth. This skill is appropriate for:
Adding user authentication to Next.js applications
Implementing secure session management with Better Auth
Enabling JWT-based authentication flows
Creating protected routes and pages in Next.js
Managing user sessions across the application
Implementing social login capabilities
This skill should NOT be used for:
Applications using the Pages Router (use _app.js instead)
Applications that don't require user authentication
Simple static sites without user interaction
Applications with custom authentication requirements that conflict with Better Auth
Prerequisites
Next.js 13+ with App Router enabled
Better Auth package installed and configured
Understanding of Next.js middleware and server components
Knowledge of authentication concepts and session management
Environment for managing authentication secrets securely
Conceptual Implementation Framework
Better Auth Initialization Capability
Configure Better Auth with appropriate providers and settings
Set up authentication database or adapter configuration
Define user model and authentication options
Initialize authentication client for frontend usage
Configure authentication callbacks and customizations
JWT Token Enablement Capability
Configure JWT token generation and validation settings
Create components using ng-alain (@delon/abc) and ng-zorro-antd UI libraries. Use this skill when building enterprise UI features with ST (Simple Table), SF (Schema Form), ACL (Access Control), PageHeader, ReuseTab, and other @delon components. Ensures proper integration with ng-alain architecture, theming system, responsive layouts, and accessibility standards while following Angular 20 patterns.