Agent Skill
Better Auth best practices
Configures Better Auth server and client: database adapters, sessions, email flows, plugins, hooks, environment variables and common gotchas.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit 20c9e88, the version we read, wherever the install method supports it.
npx skills
npx skills add better-auth/skills@20c9e88a5c007461a703f1c213572b073196113e --skill better-auth-best-practices -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add better-auth/skills
/plugin install auth-skills@better-auth-agent-skillsRun inside Claude Code. Installs the whole auth-skills plugin from its default branch, not the pinned commit.
npx skills
npx skills add better-auth/skills@20c9e88a5c007461a703f1c213572b073196113e --skill better-auth-best-practices -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add better-auth/skills@20c9e88a5c007461a703f1c213572b073196113e --skill better-auth-best-practices -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install better-auth/skills better-auth/best-practices --pin 20c9e88a5c007461a703f1c213572b073196113e --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add better-auth/skills@20c9e88a5c007461a703f1c213572b073196113e --skill better-auth-best-practicesPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
What it does
An integration guide from the Better Auth team. It starts with the documentation version it was written against, then gives a setup workflow, environment variables, file location and CLI commands, followed by sections on core config, database adapters, sessions, user and account config, email flows, security, hooks, plugins, the client and type safety. A common-gotchas section closes it.
When to use it
Setting up Better Auth in a TypeScript app, adding plugins such as two-factor or organisations, choosing a database adapter, or debugging sessions and cookies. The common-gotchas section covers the configuration mistakes that produce confusing login failures.
When to skip it
Other auth libraries, and projects on a much newer or older Better Auth version than the one the skill states. Check that version first, because auth configuration changes between releases.
Try it
Add Better Auth to this Next.js app with email and password plus
GitHub OAuth, using the Drizzle adapter with Postgres. Set up the
client, protect /dashboard and list the environment variables needed.
What it can touch
- Bundles scripts
- No
- Pre-approved tools
- See source
- Needs
- Nothing beyond the agent
- Client-specific fields
- None, spec fields only
- Files
- At commit
20c9e88the SKILL.md is 193 lines long and it is the only file in the folder.
Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.
Instructions only. The name (better-auth-best-practices) does not match the folder (best-practices), so claude.ai uploads need the folder renamed. Check the documentation version it states against the version in your project.
Outline of the SKILL.md
We have not reproduced this SKILL.md because neither the skill nor the better-auth/skills repository declares a licence, so we have no permission to republish it. We checked again on 20 November 2026. These are its section headings at the reviewed commit; read the full file at the source link.
- Documentation Version
- Setup Workflow
- Quick Reference
- Core Config Options
- Database
- Session Management
- User & Account Config
- Email Flows
- Security
- Hooks
- Plugins
- Client
- Type Safety
- Common Gotchas
- Resources
Alternatives
The same repository has a create-auth skill for new projects, which we have not reviewed. For the database side, see Prisma ORM setup or Neon Postgres, and run security review on the result.
SKILL.md
We have not reproduced this file here; the outline above lists its sections. Read the SKILL.md on GitHub.
Related skills
Agents SDK (Cloudflare)
Cloudflare's skill for building, debugging and reviewing agents on its Agents SDK: Agent classes, routing, state, scheduling, chat, MCP and the React client.
Durable Objects (Cloudflare)
Cloudflare's skill to build, debug and review Durable Objects: when to use them, wrangler config, storage, alarms, stubs, authorisation and testing.
EAS Update (Expo)
Expo's skill that sets up and publishes over-the-air updates with EAS CLI, and debugs installed builds that still show old code after an update ships.
Guides and recipes that use Better Auth best practices
- AI security
Defending against prompt injection, data leakage and over-permissioned agents.