Better Auth's official skill for hardening a Better Auth deployment: secret management, rate limiting, CSRF protection, trusted origins, session and cookie security, OAuth token encryption, IP tracking and audit logging.
Better Auth: Create Auth Skill
Scaffold authentication in a TypeScript or JavaScript app with Better Auth — the skill detects the framework, ORM and package manager first, then plans before writing code.
Install
Other ways to install
About
- Auto-detects framework, ORM, database driver, existing auth library and package manager
- Batches the remaining planning questions into one round instead of interrogating step by step
- Configures the database adapter and framework route handler for the stack it found
- Adds OAuth providers, 2FA, organisations, admin and password-reset plugins on request
- Generates sign-in, sign-up and account pages
Adding authentication to an existing app is mostly a discovery problem: which framework, which ORM, which database driver, which package manager, and is there already an auth library in the way. This official Better Auth skill front-loads exactly that, and refuses to write code until it has an answer.
Phase 1 — plan before implementing
The skill scans the project to auto-detect:
- Framework —
next.config,svelte.config,nuxt.config,astro.config,vite.config, or an Express/Hono entry file. - Database and ORM —
prisma/schema.prisma,drizzle.config.ts(reading itsdialectand the installed driver to distinguishpgfrompostgresfrom Neon), orpackage.jsondependencies such asmysql2,better-sqlite3,mongoose. - Existing auth — NextAuth, Lucia, Clerk, Supabase Auth or Firebase Auth already present.
- Package manager — from the lockfile.
Whatever it cannot infer, it asks in a single batched round of questions: project type, sign-in methods (email and password, social OAuth, magic link, passkey/WebAuthn, phone), social providers, email verification and provider, plugins (2FA, organisations and teams, admin dashboard, bearer tokens, password reset) and which auth pages to generate.
Phase 2 — implementation
With the plan agreed it configures the Better Auth instance and database adapter, wires the route handler for the detected framework, adds the chosen OAuth providers and plugins, and generates the sign-in, sign-up and account pages.
Who it is for
TypeScript and JavaScript teams adopting Better Auth — on a greenfield project, on an existing app, or migrating off another auth library. Because the detection step reads the codebase rather than assuming a template, it fits an established project as well as a new one.
Source
Part of Better Auth's official agent-skills collection, which also covers providers, organisations, two-factor authentication, email-and-password flows and error explanation. Full API syntax lives in the Better Auth documentation, which the skill defers to rather than duplicating.
Try it
Once installed, ask your agent something like:
Add Better Auth to this Next.js App Router project with Drizzle and Postgres — email and password plus Google OAuth, with email verification through Resend.
SKILL.md
The instructions your agent loads, as published by Better Auth.
Related Skills
See all Better Auth: Create Auth alternativesSkill: Convex Auth Setup
by Convex
Convex's official skill for adding passkey or OAuth authentication to a Convex app — including the auth.config.ts wiring and a headless key-generation path that avoids the interactive wizard.
Skill: Better Auth: Integration Guide
by Better Auth
The reference an agent needs to configure Better Auth correctly: adapters, session strategy, hooks, plugins, type safety and the gotchas that bite in production.
Auth0's official agent skill: a router that detects your framework and intent, then loads the right Auth0 guidance for login, MFA, Organizations, tenant audits, debugging or provider migration.