Agent skill · software engineering · aiskillstore

auth-integration

Use when implementing authentication - login/signup forms, session management, protected routes, or role-based access control. NOT when non-auth UI, plain data fetching, or unrelated backend logic. Triggers: "login page", "signup form", "auth setup", "protected route", "role-based access", "Better Auth", "NextAuth".

Why this skill is useful

Provides specific implementation patterns and code snippets for Better Auth and NextAuth v5 that the AI wouldn't reliably generate on its own.

What it needs

Requires better-auth, react-hook-form, zod installed locally. About 9k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Better Auth Integration Skill Overview Expert guidance for authentication implementation using Better Auth/NextAuth v5, including login/signup forms, session management with Zustand, protected routes via middleware, and role-based access control for ERP systems. When This Skill Applies This skill triggers when users request: Auth Setup: "Setup Better Auth", "Configure authentication", "Auth providers" Auth Forms: "Login page", "Signup form", "Forgot password", "Email verification" Session Management: "Auth store", "Session handling", "Zustand auth" Protected Routes: "Protected dashboard", "Auth middleware", "Route guards" Role-Based Access: "Role guard", "Permission check", "Admin only", "Teacher access" Core Rules 1. Provider Setup Requirements: Use Better Auth v5 for Next.js App Router Configure providers (Google, Email/Password) Enable email verification for new users Set appropriate session expiration Use environment variables for secrets (never hardcode) Prisma adapter for database integration 2. Auth Forms with Validation Requirements: Use React Hook Form + Zod for validation shadcn/ui components for form inputs Clear error messages with localization support Loading states for better UX Accessibility: proper labels, ARIA attributes Password strength indicator for signup 3. Session Management Requirements: Use Zustand for client-side auth state Sync with Better Auth session Type-safe user and session data Automatic session refresh on hydration Secure cookie storage (httpOnly, secure, sameSite) Clear sessions on sign out 4. Protected Routes Requirements: Middleware for server-side route protection Path matchers for protected routes Role-based access control in middleware Client-side auth guard HOC for extra protection Redirect unauthorized users to appropriate pages Loading states during auth checks 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/auth-integration

View the source on GitHub

Browse the @skills marketplace