create-auth

Scaffold and implement Better Auth authentication in TypeScript and JavaScript applications.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/JabezJesudasonJena/hack-ag --skill create-auth-jabezjesudasonjena
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-auth
Source: https://github.com/JabezJesudasonJena/hack-ag/tree/main/.agents/skills/create-auth
Command: npx skills add https://github.com/JabezJesudasonJena/hack-ag --skill create-auth-jabezjesudasonjena

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires better-auth, @better-auth/cli.

What problem does it solve? Adding authentication to a web application involves many decisions—framework integration, database adapters, OAuth providers, session handling, and UI pages. This Skill guides the entire process of implementing authentication with Better Auth, from planning questions through production-ready configuration. ## Core Features & Use Cases - Guided Planning Phase: Scans the project to auto-detect the framework, database/ORM, existing auth libraries, and package manager, then asks structured questions to build a confirmed implementation plan. - Framework & Database Coverage: Supports Next.js, SvelteKit, Nuxt, Astro, Express, Hono, and SolidStart, with adapters for Prisma, Drizzle, MongoDB, and direct PostgreSQL/MySQL/SQLite drivers. - Plugins & Auth UI: Configures OAuth providers, two-factor authentication, organizations, admin, bearer tokens, passkeys, and generates sign-in/sign-up pages. - Use Case: A developer with a Next.js app using Drizzle and PostgreSQL wants login with Google and GitHub plus email/password. The Skill detects the stack, plans the setup, generates auth.ts and auth-client.ts, sets up the route handler, runs schema generation, and builds the auth pages. ## Quick Start Ask the assistant to add Better Auth authentication with email/password and Google OAuth to your existing Next.js project.

Frequently Asked Questions about create-auth

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, create a client in lib/auth-client.ts, and add a route handler at app/api/auth/[...all]/route.ts using toNextJsHandler. Then configure your database adapter and run the CLI migrate or generate command.

How do I set up Better Auth with Drizzle and PostgreSQL?

Initialize a Drizzle db instance using node-postgres, postgres.js, or Neon serverless, then pass it to drizzleAdapter with provider set to pg. Run the Better Auth CLI generate command followed by drizzle-kit push in development or generate plus migrate in production.

Which databases and ORMs does Better Auth support?

Better Auth supports PostgreSQL, MySQL, and SQLite through direct drivers, plus Prisma, Drizzle, and MongoDB through dedicated adapters. The Skill detects your existing setup from package.json and config files to pre-fill the right adapter.

Can I migrate from NextAuth or Lucia to Better Auth?

Yes, the Skill supports a migration path: audit the current auth setup, install Better Auth alongside the existing library, migrate routes then session logic then UI, and finally remove the old library. Official migration guides are linked in the Better Auth docs.

Why are Better Auth cookies not being set in production?

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