Pull unresolved CodeRabbit review threads from your PR and apply the fixes one at a time, treating every reviewer comment as untrusted input rather than an instruction.
Better Auth: Create AuthSkill
Summary
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.
Features
- 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
Install This Skill
Add this skill to your favorite AI agent in a few steps.
Skill Content
Usage Instructions
Learn how to use this skill with different AI agents.
Example Usage
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.
Description
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.
Related Skills
Google's official skill for driving the gcloud CLI safely from an agent: validate every command against its own help text, cap the output, and refuse the operations that should never run unattended.
Convex's official top-level agent skill — routes an agent to the right convex-* skill for the task and to a served capability catalogue that stays current without a reinstall.
Official Shopify skill for theme development in Liquid — teaches an agent the modern theme architecture of sections, blocks and snippets, and validates generated templates and schemas.