Source: better-auth/skills · Maintainer: Better Auth · License: None stated (no LICENSE file in the repo) · Checked: 24 October 2026
What is the Better Auth skill?
The Better Auth skill, better-auth-best-practices, is a one-file guide that teaches Claude Code and other agents how to set up and configure Better Auth, the TypeScript authentication library: auth.ts, environment variables, database adapters, sessions, plugins and the client. It is for developers adding or changing Better Auth in an app who want the agent to use the current config options and CLI.
It lives in the better-auth/skills repo under better-auth/best-practices. Its description reads: "Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration."
As of 24 October 2026, its skills.sh page listed 126.0K installs (snapshot, 24 October 2026), the most of any skill in the repo.
What does it do?
The skill is model-invoked: the agent can load it whenever you mention Better Auth or an auth.ts file. The folder holds a single SKILL.md of about 1,000 words, organized as a quick reference.
Version-matched docs first. The skill opens by telling the agent to use documentation for the Better Auth version in your lockfile, not the latest. With the Better Auth MCP server available, it resolves that version through get_doc and search_docs; without it, it starts at better-auth.com/llms.txt.
A six-step setup workflow. Install better-auth, set BETTER_AUTH_SECRET and BETTER_AUTH_URL, create auth.ts, add a route handler, run migrations, then check that GET /api/auth/ok returns { status: "ok" }. Migrations depend on your database layer:
| Setup | Migration commands in the skill |
|---|---|
| Built-in adapter | npx auth@latest migrate |
| Drizzle | npx auth@latest generate --output src/db/auth-schema.ts, then drizzle-kit push (dev) or generate and migrate (prod) |
| Prisma | npx auth@latest generate --output prisma/schema.prisma, then npx prisma migrate dev |
These match the Better Auth CLI docs, which also note that migrate works only with the built-in Kysely adapter.
Reference sections. The rest is compact notes on:
- Config options:
baseURL,basePath(default/api/auth),database,secondaryStorage,emailAndPassword,socialProviders,plugins,trustedOrigins. - Databases: direct pools (
pg,mysql2,better-sqlite3,bun:sqlite, postgres.js,@neondatabase/serverless) and ORM adapters for Drizzle, Prisma and MongoDB. - Sessions: where sessions are stored when
secondaryStorageis set, stateless mode, cookie cache strategies (compact,jwt,jwe) and a defaultexpiresInof 7 days. - Security options in
advanced, withdisableCSRFCheckanddisableOriginCheckflagged as security risks, plus rate limit settings. - Hooks, plugins and the client: endpoint and database hooks, a list of popular plugins (
twoFactor,organization,passkey,magicLinkand more), and the framework client imports for React, Vue, Svelte and Solid.
It ends with eight common gotchas, such as using the ORM model name rather than the table name, and re-running the CLI after adding a plugin.
How do you install it?
The skills.sh page gives this command:
npx skills add https://github.com/better-auth/skills --skill better-auth-best-practices
The skills CLI places it under .claude/skills/ in your project, or under ~/.claude/skills/ for all projects, which are the Claude Code skill locations. Codex and Cursor read the same SKILL.md format; see Codex skills and Cursor skills.
The repo has no README, so there are no documented plugin install commands. It does contain a Claude Code marketplace file that lists this skill and create-auth together.
Note the naming: the folder is best-practices, but the skill's name is better-auth-best-practices. The Agent Skills specification says the name must match the parent directory name. The skills CLI names the installed folder after the name field, so the command above already creates better-auth-best-practices/; if you place the folder by hand, use that name too.
How do you use it?
Mention Better Auth or your auth.ts and describe the change. Example prompts (suggestions, not from the repo):
Add Better Auth to this Next.js app with email and password, using our existing Prisma setup.Add GitHub sign-in to auth.ts and generate the schema changes.Sessions keep logging people out after an hour. Check our cookie cache and session settings.Add the twoFactor plugin on the server and client, then tell me which migration to run.We're upgrading Better Auth. Compare our current config against the target version's docs.
Requirements: a JavaScript or TypeScript project, a database (or a deliberate choice of stateless mode), and a secret of at least 32 characters for BETTER_AUTH_SECRET; the skill suggests openssl rand -base64 32. The skill itself has no scripts or dependencies.
Tips and limits
- No license. The repo has no LICENSE file and has never had one, and GitHub reports no license. Without a license, default copyright applies, so the repo grants no explicit permission to copy, modify or redistribute the skill. The main better-auth/better-auth library is MIT, but that doesn't extend to this repo.
- Snyk Warn. On 24 October 2026, skills.sh showed Pass from Gen Agent Trust Hub and Socket and Warn from Snyk. Snyk's audit, dated 14 September 2026, rated it medium for "Third-party content exposure detected (indirect prompt injection risk)", because the workflow fetches
better-auth.com/llms.txt. Snyk judged that source itself low risk as public developer documentation. - It's a reference, not a scaffolder. For detecting your framework and generating auth pages, the repo's
create-authskill does that work. Security hardening, email and password flows, organizations and two-factor have their own skills in the same repo. - Plugin imports. The skill tells the agent to import plugins from dedicated paths such as
better-auth/plugins/two-factorfor tree-shaking. Expect it to change existing imports.
Save it in your Kipt library
Kipt keeps prompts and skills as Markdown in a private GitHub repo you own, and its Skills import copies a skill's files into that repo. Because better-auth/skills has no license, this page does not suggest importing a copy. Install it from the source with the command above instead, and if you want it findable in your library, save a short prompt there with the install command and a link to the folder. Kipt is not affiliated with Better Auth.
Similar skills
- Security and hardening skill: Addy Osmani's MIT-licensed skill for auth, input validation and secrets in general.
- Prisma skill: Prisma's Client API reference, useful once Better Auth's Prisma schema is generated.
- Neon Postgres skill: Neon's guide for the database behind your auth tables, including its Managed Better Auth sibling skill.
- Stripe skill: Stripe's best practices skill for the billing that often follows sign-up.