Engineering
create-auth-skill avatar

create-auth-skill

Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth. Detects frameworks, configures database adapters, sets up route handlers, adds OAuth providers, and scaffolds UI pages.

Introduction

This skill acts as an expert assistant for integrating Better Auth into your TypeScript or JavaScript projects. It guides developers through the entire authentication lifecycle, starting from project scanning and requirement gathering to full production-ready implementation. It is designed for developers building web applications who need secure, scalable, and customizable auth solutions without the heavy overhead of traditional enterprise libraries.

  • Automatically scans your project to detect the framework (Next.js, SvelteKit, Nuxt, Astro, Express, Hono, etc.) and database/ORM (Prisma, Drizzle, MongoDB, PostgreSQL, MySQL, SQLite).

  • Manages complex configuration logic including server-side auth initialization, client-side React/JS configuration, and environment variable setup for BETTER_AUTH_SECRET and BETTER_AUTH_URL.

  • Supports advanced authentication patterns such as Email & Password, Magic Links, Social OAuth (Google, GitHub, Apple, Discord, etc.), Passkeys (WebAuthn), and Phone Number authentication.

  • Integrates complex plugins for 2FA (Multi-factor authentication), Organization/Multi-tenancy support (RBAC), Admin Dashboards, and API Bearer token management.

  • Generates schema migrations and handles database adapter setup using the @better-auth/cli tool to ensure your database models are always in sync with your auth logic.

  • Before starting, the skill performs a discovery phase to identify existing authentication libraries you might be migrating from, such as NextAuth, Lucia, or Clerk.

  • Expect structured planning interactions where you confirm the auth flow, UI style, and feature sets before the agent generates any code.

  • The output includes clear step-by-step implementation plans, CLI commands for migration, and boilerplate code for auth.ts and auth-client.ts.

  • It strictly follows the official Better Auth documentation patterns to ensure code validity and security best practices.

  • Constraints: The skill requires access to your project files to perform accurate scans and expects a clear, modular folder structure for best results.

Repository Stats

Stars
187
Forks
24
Open Issues
3
Language
Not provided
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 05:49 AM
View on GitHub