Agent skill

Better Auth

by Microck in Microck/ordinary-claude-skills

Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework.

MITAuto-check: notesBackend & APIs

Install Better Auth

skills CLI
$ npx skills add Microck/ordinary-claude-skills --skill better-auth -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Microck/ordinary-claude-skills better-auth --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Microck/ordinary-claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills_all/better-auth .claude/skills/better-auth && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
better-auth
GitHub stars
401
Token cost
~1.8k tokens
SKILL.md length
451 words
Files
2
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework.

  • Works in 3 steps: Server (better-auth): Handles auth… → Client (better-auth/client): Provides… → Plugins: Extend both server/client…
  • Adding authentication to applications
  • SKILL.md covers When to Use, Quick Start, Feature Selection Matrix and Auth Method Selection Guide, plus 5 more sections
  • Calls npx and npm; needs BETTER_AUTH_SECRET and GITHUB_CLIENT_SECRET

What it does

Better Auth is an agent skill from Microck/ordinary-claude-skills. Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework. Features include email/password authentication with verification, OAuth providers (Google, GitHub, Discord, etc.), two-factor authentication (TOTP, SMS), passkeys/WebAuthn support, session management, role-based access control (RBAC), rate limiting, and database adapters. Use when adding authentication to applications, implementing OAuth flows, setting up 2FA/MFA, managing user sessions…

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).

It sits in Backend & APIs, covering Authorization and RBAC, Authentication and OAuth and OpenID Connect. It works with Better Auth, TypeScript, GitHub and Discord. The repository describes itself as: An unappealing collection of Claude Skills and resources. The licence is MIT.

When your agent uses it

  • Adding authentication to applications
  • Implementing OAuth flows
  • Setting up 2FA/MFA
  • Managing user sessions

Example prompts

  • “/better-auth”

Requirements

  • Node.js
  • A credential in BETTER_AUTH_SECRET
  • A credential in GITHUB_CLIENT_SECRET

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Server (better-auth): Handles auth logic, database ops, API routes
  2. Client (better-auth/client): Provides hooks/methods for frontend
  3. Plugins: Extend both server/client functionality

What it can do on your machine

Read from SKILL.md and the folder at commit 1056d29. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • better-auth.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • BETTER_AUTH_SECRET
    • GITHUB_CLIENT_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Better Auth loads about 1.8k tokens when it runs. Until then it costs about 155 tokens; SKILL.md has 451 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~155
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:32
    Create `.env`:

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Microck/ordinary-claude-skills at commit 1056d29, republished under its MIT licence (© Microck). 451 words, ~1,847 tokens.

Download SKILL.mdSave it as .claude/skills/better-auth/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
better-auth
description
Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework. Features include email/password authentication with verification, OAuth providers (Google, GitHub, Discord, etc.), two-factor authentication (TOTP, SMS), passkeys/WebAuthn support, session management, role-based access control (RBAC), rate limiting, and database adapters. Use when adding authentication to applications, implementing OAuth flows, setting up 2FA/MFA, managing user sessions, configuring authorization rules, or building secure authentication systems for web applications.
license
MIT
version
2.0.0

Better Auth Skill

Better Auth is comprehensive, framework-agnostic authentication/authorization framework for TypeScript with built-in email/password, social OAuth, and powerful plugin ecosystem for advanced features.

When to Use

  • Implementing auth in TypeScript/JavaScript applications
  • Adding email/password or social OAuth authentication
  • Setting up 2FA, passkeys, magic links, advanced auth features
  • Building multi-tenant apps with organization support
  • Managing sessions and user lifecycle
  • Working with any framework (Next.js, Nuxt, SvelteKit, Remix, Astro, Hono, Express, etc.)

Quick Start

Installation
bash
npm install better-auth
# or pnpm/yarn/bun add better-auth
Environment Setup

Create .env:

env
BETTER_AUTH_SECRET=<generated-secret-32-chars-min>
BETTER_AUTH_URL=http://localhost:3000
Basic Server Setup

Create auth.ts (root, lib/, utils/, or under src/app/server/):

ts
import { betterAuth } from "better-auth";

export const auth = betterAuth({
  database: {
    // See references/database-integration.md
  },
  emailAndPassword: {
    enabled: true,
    autoSignIn: true
  },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID!,
      clientSecret: process.env.GITHUB_CLIENT_SECRET!,
    }
  }
});
Database Schema
bash
npx @better-auth/cli generate  # Generate schema/migrations
npx @better-auth/cli migrate   # Apply migrations (Kysely only)
Mount API Handler

Next.js App Router:

ts
// app/api/auth/[...all]/route.ts
import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";

export const { POST, GET } = toNextJsHandler(auth);

Other frameworks: See references/email-password-auth.md#framework-setup

Client Setup

Create auth-client.ts:

ts
import { createAuthClient } from "better-auth/client";

export const authClient = createAuthClient({
  baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL || "http://localhost:3000"
});
Basic Usage
ts
// Sign up
await authClient.signUp.email({
  email: "user@example.com",
  password: "secure123",
  name: "John Doe"
});

// Sign in
await authClient.signIn.email({
  email: "user@example.com",
  password: "secure123"
});

// OAuth
await authClient.signIn.social({ provider: "github" });

// Session
const { data: session } = authClient.useSession(); // React/Vue/Svelte
const { data: session } = await authClient.getSession(); // Vanilla JS

Feature Selection Matrix

FeaturePlugin RequiredUse CaseReference
Email/PasswordNo (built-in)Basic authemail-password-auth.md
OAuth (GitHub, Google, etc.)No (built-in)Social loginoauth-providers.md
Email VerificationNo (built-in)Verify email addressesemail-password-auth.md
Password ResetNo (built-in)Forgot password flowemail-password-auth.md
Two-Factor Auth (2FA/TOTP)Yes (twoFactor)Enhanced securityadvanced-features.md
Passkeys/WebAuthnYes (passkey)Passwordless authadvanced-features.md
Magic LinkYes (magicLink)Email-based loginadvanced-features.md
Username AuthYes (username)Username loginemail-password-auth.md
Organizations/Multi-tenantYes (organization)Team/org featuresadvanced-features.md
Rate LimitingNo (built-in)Prevent abuseadvanced-features.md
Session ManagementNo (built-in)User sessionsadvanced-features.md

Auth Method Selection Guide

Choose Email/Password when:

  • Building standard web app with traditional auth
  • Need full control over user credentials
  • Targeting users who prefer email-based accounts

Choose OAuth when:

  • Want quick signup with minimal friction
  • Users already have social accounts
  • Need access to social profile data

Choose Passkeys when:

  • Want passwordless experience
  • Targeting modern browsers/devices
  • Security is top priority

Choose Magic Link when:

  • Want passwordless without WebAuthn complexity
  • Targeting email-first users
  • Need temporary access links

Combine Multiple Methods when:

  • Want flexibility for different user preferences
  • Building enterprise apps with various auth requirements
  • Need progressive enhancement (start simple, add more options)
Show full SKILL.md (157 more words)Show less

Core Architecture

Better Auth uses client-server architecture:

  1. Server (better-auth): Handles auth logic, database ops, API routes
  2. Client (better-auth/client): Provides hooks/methods for frontend
  3. Plugins: Extend both server/client functionality

Implementation Checklist

  • Install better-auth package
  • Set environment variables (SECRET, URL)
  • Create auth server instance with database config
  • Run schema migration (npx @better-auth/cli generate)
  • Mount API handler in framework
  • Create client instance
  • Implement sign-up/sign-in UI
  • Add session management to components
  • Set up protected routes/middleware
  • Add plugins as needed (regenerate schema after)
  • Test complete auth flow
  • Configure email sending (verification/reset)
  • Enable rate limiting for production
  • Set up error handling

Reference Documentation

Core Authentication
Advanced Features
  • Advanced Features - 2FA/MFA, passkeys, magic links, organizations, rate limiting, session management

Scripts

  • scripts/better_auth_init.py - Initialize Better Auth configuration with interactive setup

Resources

© Microck, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills_all/better-auth of Microck/ordinary-claude-skills.

  • SKILL.md
  • metadata.json

Open the folder on GitHubat commit 1056d29

Compare with similar skills

Better Auth next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Better Auth compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Better Auth this skillMicrock/ordinary-claude-skills401—~1.8kAutomated safety check: NotesMIT
Better Autheinverne/dotfiles121—~4kAutomated safety check: NotesMIT
Better Auth Best Practiceslatitude-dev/latitude-llm4.7k7 repos~1.6kAutomated safety check: PassMIT
Better Authsecondsky/claude-skills227—~7.5kAutomated safety check: PassMIT
Authaiskillstore/marketplace430—~1.6kAutomated safety check: PassNone
Better Authpproenca/dot-skills214—~2.2kAutomated safety check: PassMIT

Similar skills

  • Better Auth

    einverne/dotfiles

    Guide for implementing Better Auth - a framework-agnostic authentication and authorization framework for TypeScript.

    121 GitHub stars~4k tokensUpdated 28 days ago
    Backend & APIsAuto-check: notes
  • Better Auth Best Practices

    latitude-dev/latitude-llm

    Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

    4.7k GitHub starsUsed in 7 repos~1.6k tokens
    Backend & APIsAuto-check passed
  • Better Auth

    secondsky/claude-skills

    Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks.

    227 GitHub stars~7.5k tokensUpdated 9 days ago
    Backend & APIsAuto-check passed
  • Auth

    aiskillstore/marketplace

    Authentication and access control skill for Next.js 15 + Supabase applications.

    430 GitHub stars~1.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Better Auth

    pproenca/dot-skills

    Better Auth in TypeScript — setting up the auth instance, picking adapters, wiring framework route handlers, configuring sessions and cookies, adding plugins (2FA, organization, admin, magicLink…

    214 GitHub stars~2.2k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Local better-auth documentation reference (latest). An agent skill from olorehq/olore.

    103 GitHub stars~470 tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from Microck/ordinary-claude-skills

All 97 skills in this repo
  • Every Style Editor

    Microck/ordinary-claude-skills

    This skill should be used when reviewing or editing copy to ensure adherence to Every's style guide.

    401 GitHub starsUsed in 3 repos~1.2k tokens
    Auto-check passed
  • Gemini Imagegen

    Microck/ordinary-claude-skills

    Generate and edit images using the Gemini API (Nano Banana Pro).

    401 GitHub starsUsed in 3 repos~1.6k tokens
    Auto-check passed
  • Andrew Kane Gem Writer

    Microck/ordinary-claude-skills

    Write Ruby gems following Andrew Kane's proven patterns and philosophy.

    401 GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Codex

    Microck/ordinary-claude-skills

    Execute Codex CLI for code analysis, refactoring, and automated code changes.

    401 GitHub starsUsed in 2 repos~2.8k tokens
    Auto-check passed
  • Docs Review

    Microck/ordinary-claude-skills

    Review documentation changes for compliance with the Metabase writing style guide.

    401 GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check: notes
  • File Todos

    Microck/ordinary-claude-skills

    This skill should be used when managing the file-based todo tracking system in the todos/ directory.

    401 GitHub starsUsed in 2 repos~1.9k tokens
    Auto-check passed

Categories

Questions about Better Auth

What does Better Auth do?

Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework. Better Auth is an agent skill from Microck/ordinary-claude-skills. Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework.

When should I use Better Auth?

Better Auth fits situations like: adding authentication to applications; implementing OAuth flows; setting up 2FA/MFA; managing user sessions.

How do I install Better Auth in Claude Code?

Run `npx skills add Microck/ordinary-claude-skills --skill better-auth -a claude-code`. Or copy the skill folder (skills_all/better-auth in Microck/ordinary-claude-skills) into .claude/skills/better-auth in your project. Claude Code loads it when a task matches its description.

How do I install Better Auth in Codex?

Run `npx skills add Microck/ordinary-claude-skills --skill better-auth -a codex`. Or copy the skill folder (skills_all/better-auth in Microck/ordinary-claude-skills) into .agents/skills/better-auth in your project. Codex loads it when a task matches its description.

Can I use Better Auth in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Microck/ordinary-claude-skills --skill better-auth -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/better-auth, .gemini/skills/better-auth, .github/skills/better-auth and .opencode/skills/better-auth in your project.

What does Better Auth need to run?

Going by SKILL.md and its folder, Better Auth needs the command-line tools its instructions call (npx and npm) and credentials named BETTER_AUTH_SECRET and GITHUB_CLIENT_SECRET. Our summary lists: Node.js; A credential in BETTER_AUTH_SECRET; A credential in GITHUB_CLIENT_SECRET.

Does Better Auth access the network?

SKILL.md names 2 domains. As links in the text: better-auth.com and github.com. This is read from the text; nothing was executed.

Is Better Auth safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Better Auth use?

Better Auth is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Better Auth use?

About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Better Auth?

Skills that share tags, products or a category with Better Auth: Better Auth (einverne/dotfiles, 121 stars), Better Auth Best Practices (latitude-dev/latitude-llm, 4.7k stars), Better Auth (secondsky/claude-skills, 227 stars) and Auth (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Better Auth?

Microck (a GitHub user) maintains it in Microck/ordinary-claude-skills, which has 401 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on September 6, 2026.

Source: Microck/ordinary-claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.