# create-auth

A skill that walks the agent through planning and wiring authentication in a TypeScript/JavaScript app with Better Auth, from codebase scan to sign-in pages.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 13400 installs · ★ 226
- Author: better-auth
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/better-auth/skills/tree/HEAD/better-auth/create-auth/SKILL.md
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/skills/create-auth

## What it does

The skill starts by reading the project: framework configs (`next.config`, `svelte.config`, `nuxt.config`, `astro.config`, `vite.config`), ORM files such as `prisma/schema.prisma` and `drizzle.config.ts`, any auth library already in `package.json`, and the lockfile that tells it which package manager you use. Whatever it finds becomes a default answer, so fewer questions come your way.

Then the agent asks everything in one `AskQuestion` call: project type, framework, database and ORM, sign-in methods (password, OAuth, magic link, passkey, phone), social providers, email verification, plugins like 2FA and organizations, which pages you need, and the UI style. Answers turn into a markdown checklist, and no code gets written until you confirm that plan. Implementation branches three ways: a fresh project, adding auth to an existing one, or migrating off another library.

The core install is `npm install better-auth`, and the CLI runs as `npx auth@latest` with nothing extra to install. OAuth needs app credentials from each provider, and env vars have to be set in your deploy — the skill covers those closing steps. If `next-auth`, `lucia`, `clerk` or `supabase/auth` is already in the project, expect the migration branch: the new library goes in alongside the old one, routes move first, then session logic, then the UI.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add better-auth/skills --skill create-auth -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/create-auth/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/create-auth/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add better-auth/skills --skill create-auth -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/create-auth/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add better-auth/skills --skill create-auth -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/create-auth/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install better-auth/skills create-auth
```

2. **Manually: put the files in place**
- File: `.github/skills/create-auth/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add better-auth/skills --skill create-auth -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/better-auth/skills --path better-auth/create-auth
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/create-auth/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add better-auth/skills --skill create-auth -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/better-auth/skills/tree/HEAD/better-auth/create-auth/SKILL.md

## When to use it
- add sign-in and sign-up to an existing Next.js app
- pick an ORM and database adapter for Better Auth
- wire up Google and GitHub OAuth providers
- enable 2FA and organizations through plugins
- migrate off another auth library without a full rewrite

## Example prompts
- Add authentication to this project with Better Auth
- Set up email and password plus Google OAuth
- Plan a migration from next-auth to Better Auth

## Similar
- [better-auth-authentication](https://affpapa.org/en/nevibecode/skills/better-auth-authentication.md) — skill · 389 installs
- [safe-action-better-auth](https://affpapa.org/en/nevibecode/skills/safe-action-better-auth.md) — skill · 477 installs
- [better-auth-core](https://affpapa.org/en/nevibecode/skills/better-auth-core.md) — skill · 358 installs
- [better-auth](https://affpapa.org/en/nevibecode/skills/mrgoonie-better-auth.md) — skill · 390 installs
- [nuxt-better-auth](https://affpapa.org/en/nevibecode/skills/nuxt-better-auth.md) — skill · 2000 installs
- [neon-auth](https://affpapa.org/en/nevibecode/skills/neon-auth.md) — skill · 20300 installs

From the same set: [better-auth/skills](https://affpapa.org/en/nevibecode/by/better-auth/skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
