Individual skill
better-auth
Better Auth in TypeScript — setting up the auth instance, picking adapters, wiring framework route handlers, configuring sessions and cookies, adding plugins (2FA, organization, admin, magicLink, JWT), or porting from NextAuth/Auth.js, Clerk, Auth0, or Supabase Auth. Covers Next.js, SvelteKit, Hono, Express, Nuxt, Astro, and React/Vue/Svelte clients. Trigger when writing, reviewing, or migrating Better Auth code — and even when the user doesn't explicitly mention Better Auth but is working on TypeScript authentication, session cookies, OAuth providers, or auth-library migration. Contains 42 rules organized by impact across 8 categories.
skills/.experimental/better-auth/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- Yes
- Observed behavior
- Network or broad shell
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 221
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- writing Derived category
- security Derived category
- engineering Derived category
- engineering-web Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 14,008 bytesSKILL.mdcore · 8,906 bytesassets/templates/_template.mddoc · 2,539 bytesmetadata.jsonasset · 2,585 bytesreferences/_sections.mddoc · 3,089 bytesreferences/auth-client-sign-in-helpers.mddoc · 2,555 bytesreferences/auth-infer-additional-fields.mddoc · 2,693 bytesreferences/auth-magic-link-setup.mddoc · 2,777 bytesreferences/auth-oauth-env-vars.mddoc · 2,690 bytesreferences/auth-oauth-redirect-uri.mddoc · 2,853 bytesreferences/auth-require-email-verification.mddoc · 2,700 bytesreferences/db-adapter-selection.mddoc · 2,310 bytesreferences/db-additional-fields.mddoc · 2,642 bytesreferences/db-connection-pooling.mddoc · 2,500 bytesreferences/db-database-hooks.mddoc · 2,896 bytesreferences/db-plugin-schema-customization.mddoc · 2,294 bytesreferences/db-schema-generate.mddoc · 2,125 bytesreferences/migrate-force-allow-id.mddoc · 2,783 bytesreferences/migrate-nextauth-schema-mapping.mddoc · 3,503 bytesreferences/migrate-oauth-account-mapping.mddoc · 3,346 bytesreferences/migrate-parallel-cutover.mddoc · 3,017 bytesreferences/plugins-admin-impersonation.mddoc · 2,604 bytesreferences/plugins-jwt-when-to-use.mddoc · 3,049 bytesreferences/plugins-next-cookies-last.mddoc · 2,235 bytesreferences/plugins-organization-active-context.mddoc · 2,771 bytesreferences/plugins-pair-client-server.mddoc · 2,960 bytesreferences/plugins-shared-access-control.mddoc · 3,167 bytesreferences/plugins-two-factor-issuer.mddoc · 2,288 bytesreferences/route-mount-catchall.mddoc · 2,723 bytesreferences/route-no-body-consumers.mddoc · 2,587 bytesreferences/route-runtime-selection.mddoc · 3,221 bytesreferences/security-min-password-length.mddoc · 2,326 bytesreferences/security-password-hash-interop.mddoc · 2,821 bytesreferences/security-rate-limit.mddoc · 2,693 bytesreferences/security-revoke-on-password-reset.mddoc · 2,664 bytesreferences/security-trusted-origins-strict.mddoc · 2,557 bytesreferences/session-cookie-attributes.mddoc · 2,333 bytesreferences/session-cookie-cache.mddoc · 2,129 bytesreferences/session-cross-subdomain.mddoc · 2,321 bytesreferences/session-customsession-fields.mddoc · 2,720 bytesreferences/session-expiry-tuning.mddoc · 2,216 bytesreferences/session-server-vs-client.mddoc · 2,641 bytesreferences/setup-base-url.mddoc · 2,110 bytesreferences/setup-client-base-url.mddoc · 1,988 bytesreferences/setup-secret.mddoc · 1,548 bytesreferences/setup-singleton.mddoc · 2,250 bytesreferences/setup-trusted-origins.mddoc · 2,250 bytes
Read excerpt
# Better Auth Best Practices
Implementation and migration guide for [Better Auth](https://www.better-auth.com), the framework-agnostic TypeScript authentication and authorization library. This skill contains 42 rules organized by impact across 8 categories, derived from the official documentation and migration guides.
## When to Apply
Reference these guidelines when:
- Setting up a fresh Better Auth instance (config, adapter, route handler, client)
- Wiring framework-specific integrations (Next.js App/Pages Router, SvelteKit, Hono, Express, Nuxt, Astro)
- Configuring sessions, cookies, and security (rate limit, trusted origins, password hashing)
- Adding plugins: 2FA, organization, admin, magicLink, JWT, passkey, multi-session
- Migrating from another auth library (NextAuth/Auth.js, Clerk, Auth0, Supabase Auth)
- Debugging "session is null" / "redirect_uri_mismatch" / 403 CSRF errors
- Reviewing PRs that touch `lib/auth.ts`, `auth-client.ts`, or `/api/auth/` route handlers