create-auth-skill

Implements authentication layers in TypeScript and JavaScript applications using Better Auth.

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/masakinihirota/2026src-ni --skill create-auth-skill-masakinihirota
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-auth-skill
Source: https://github.com/masakinihirota/2026src-ni/tree/main/.agents/skills/create-auth-skill
Command: npx skills add https://github.com/masakinihirota/2026src-ni --skill create-auth-skill-masakinihirota

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding authentication to a TypeScript or JavaScript app involves many decisions—framework integration, database adapters, OAuth providers, plugins, and UI pages—and mistakes in any of them create security risks. This Skill guides the process with a structured planning phase and a decision-tree implementation so the auth setup matches the project's actual stack. ## Core Features & Use Cases - Guided Planning Phase: Scans the project to auto-detect framework, database/ORM, existing auth libraries, and package manager, then asks structured questions about sign-in methods, providers, plugins, and UI style before writing code. - Framework-Specific Implementation: Provides route handler setup, client imports, and config patterns for Next.js, SvelteKit, Nuxt, Astro, Express, Hono, and SolidStart. - Database & Plugin Coverage: Includes adapter setup for Prisma, Drizzle, MongoDB, and raw drivers, plus plugin patterns for 2FA, organizations, admin, bearer tokens, passkeys, and SSO. - Use Case: A developer adding email/password plus Google and GitHub OAuth to an existing Next.js app with PostgreSQL and Prisma gets a confirmed plan, then step-by-step config files, migrations, and sign-in/sign-up pages. ## Quick Start Add authentication with email/password and Google OAuth to my Next.js app using Better Auth and Prisma.

Frequently Asked Questions about create-auth-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add authentication to a Next.js app with Better Auth?▼

Install better-auth, create a server config in lib/auth.ts with your database adapter, and add a route handler at app/api/auth/[...all]/route.ts using toNextJsHandler. Create a client with createAuthClient from better-auth/react, then run the CLI migrate or generate command for your schema.

How do I set up Google and GitHub OAuth with Better Auth?▼

Add the providers to the socialProviders field in your auth config with their client IDs and secrets as environment variables. Then call signIn.social with the provider name and a callbackURL from your client code, and verify the redirect URIs in each provider's dashboard.

Does Better Auth support Prisma and Drizzle adapters?▼

Yes, Better Auth provides prismaAdapter from better-auth/adapters/prisma and drizzleAdapter from better-auth/adapters/drizzle. Use the CLI generate command to output the schema, then run prisma migrate dev or drizzle-kit push to apply it.

Can I migrate from NextAuth or Lucia to Better Auth?▼

Yes, the migration path audits your current auth for gaps, installs Better Auth alongside the existing library, then migrates routes, session logic, and UI incrementally before removing the old library. Migration guides are available in the Better Auth docs.

Why are Better Auth cookies not being set in production?▼

Cookies fail when the baseURL does not match your domain or secure cookies are not enabled. Set advanced.useSecureCookies to true in production, configure trustedOrigins with your domain, and confirm BETTER_AUTH_URL matches the deployed URL.