create-auth-skill
Scaffold and implement authentication in TypeScript/JavaScript apps with Better Auth framework detection, database adapter setup, and OAuth integration.
- Detects frameworks (Next.js, SvelteKit, Nuxt, Astro, Express, Hono), databases (Prisma, Drizzle, MongoDB, raw drivers), and existing auth libraries through project scanning
- Supports email/password, OAuth (Google, GitHub, Apple, Microsoft, Discord, Twitter), magic links, passkeys, and phone authentication with configurable email verification and password reset
- Includes plugins for two-factor authentication, organizations/teams, admin dashboards, API bearer tokens, and enterprise SSO via scoped packages
- Generates server config (auth.ts), client config (auth-client.ts), route handlers, database migrations, and auth UI pages tailored to your framework and requirements
Create Auth Skill
Guide for adding authentication to TypeScript/JavaScript applications using Better Auth.
For code examples and syntax, see better-auth.com/docs.
Phase 1: Planning (REQUIRED before implementation)
Before writing any code, gather requirements by scanning the project and asking the user structured questions. This ensures the implementation matches their needs.
Step 1: Scan the project
Analyze the codebase to auto-detect:
- Framework — Look for
next.config,svelte.config,nuxt.config,astro.config,vite.config, or Express/Hono entry files. - Database/ORM — Look for
prisma/schema.prisma,drizzle.config,package.jsondeps (pg,mysql2,better-sqlite3,mongoose,mongodb). - Existing auth — Look for existing auth libraries (
next-auth,lucia,clerk,supabase/auth,firebase/auth) inpackage.jsonor imports. - Package manager — Check for
pnpm-lock.yaml,yarn.lock,bun.lockb, orpackage-lock.json.
More from better-auth/skills
better-auth-best-practices
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.
48.9Kemail-and-password-best-practices
Configure email verification, implement password reset flows, set password policies, and customise hashing algorithms for Better Auth email/password authentication. Use when users need to set up login, sign-in, sign-up, credential authentication, or password security with Better Auth.
15.5Korganization-best-practices
Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.
14.4Ktwo-factor-authentication-best-practices
Configure TOTP authenticator apps, send OTP codes via email/SMS, manage backup codes, handle trusted devices, and implement 2FA sign-in flows using Better Auth's twoFactor plugin. Use when users need MFA, multi-factor authentication, authenticator setup, or login security with Better Auth.
13.7Kemail & password best practices
This skill provides guidance and enforcement rules for implementing secure email and password authentication using Better Auth.
2organization best practices
Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.
1