Agent skill

Better Auth

by pproenca in 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…

MITAuto-check passedBackend & APIs

Install Better Auth

skills CLI
$ npx skills add pproenca/dot-skills --skill better-auth -a claude-code

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

GitHub CLI
$ gh skill install pproenca/dot-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/pproenca/dot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.experimental/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
214
Token cost
~2.2k tokens
SKILL.md length
642 words
Files
47 (incl. references, assets)
Skills in repo
182
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Works in 8 steps: Setup & Configuration (CRITICAL) → Database Adapters & Schema (CRITICAL) → API Route Handlers (CRITICAL) → …
  • Migrating Better Auth code — and even when the user doesnt explicitly mention Better Auth but is working on TypeScript authentication
  • SKILL.md covers When to Apply, Rule Categories by Priority, Quick Reference and How to Use, plus 1 more section
  • Needs BETTER_AUTH_SECRET

What it does

Better Auth is an agent skill from 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, JWT), or porting from NextAuth/Auth.js, Clerk, Auth0, or Supabase Auth. Covers Next.js, SvelteKit, Hono, Express, Nuxt, Astro, and React/Vue/Svelte clients. Trigger when writing, reviewing, or migrating Better Auth code — and even when the user doesn't explicitly mention Better Auth but is working on TypeScript…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 49 other files, including reference files and assets (for example `AGENTS.md`, `assets/templates/_template.md` and `metadata.json`).

It sits in Backend & APIs, covering Authentication, Static sites and blogs and OAuth and OpenID Connect. It works with Better Auth, TypeScript, Supabase and Astro. The repository describes itself as: A collection of AI agent skills following the Agent Skills open format. The licence is MIT.

When your agent uses it

  • Migrating Better Auth code — and even when the user doesnt explicitly mention Better Auth but is working on TypeScript authentication
  • Session cookies
  • OAuth providers
  • Auth-library migration

Example prompts

  • “/better-auth”

Requirements

  • Node.js
  • A credential in BETTER_AUTH_SECRET

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Setup & Configuration (CRITICAL)
  2. Database Adapters & Schema (CRITICAL)
  3. API Route Handlers (CRITICAL)
  4. Session & Cookies (HIGH)
  5. Auth Methods & Providers (HIGH)
  6. Security & Hardening (HIGH)
  7. Plugins & Extensions (MEDIUM)
  8. Migration from Other Auth (MEDIUM)

What it can do on your machine

Read from SKILL.md and the folder at commit cf93c57. 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

    No scripts in the folder and no shell commands in SKILL.md.

    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

    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

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

Context cost

Better Auth loads about 2.2k tokens when it runs, and up to ~30k if it reads all its reference files. Until then it costs about 164 tokens; SKILL.md has 642 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~164
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~30k

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 passed

The automated check found no risky patterns in SKILL.md.

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 pproenca/dot-skills at commit cf93c57, republished under its MIT licence (© pproenca). 642 words, ~2,204 tokens.

Download SKILL.mdSave it as .claude/skills/better-auth/SKILL.md (or your agent's skills folder). This skill also uses 46 other files; get the full folder from GitHub.
name
better-auth
description
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, JWT), or porting from NextAuth/Auth.js, Clerk, Auth0, or Supabase Auth. Covers Next.js, SvelteKit, Hono, Express, Nuxt, Astro, and React/Vue/Svelte clients. Trigger when writing, reviewing, or migrating Better Auth code — and even when the user doesn't explicitly mention Better Auth but is working on TypeScript authentication, session cookies, OAuth providers, or auth-library migration. Contains 42 rules organized by impact across 8 categories.

Better Auth Best Practices

Implementation and migration guide for Better Auth, the framework-agnostic TypeScript authentication and authorization library. This skill contains 42 rules organized by impact across 8 categories, derived from the official documentation and migration guides.

When to Apply

Reference these guidelines when:

  • Setting up a fresh Better Auth instance (config, adapter, route handler, client)
  • Wiring framework-specific integrations (Next.js App/Pages Router, SvelteKit, Hono, Express, Nuxt, Astro)
  • Configuring sessions, cookies, and security (rate limit, trusted origins, password hashing)
  • Adding plugins: 2FA, organization, admin, magicLink, JWT, passkey, multi-session
  • Migrating from another auth library (NextAuth/Auth.js, Clerk, Auth0, Supabase Auth)
  • Debugging "session is null" / "redirect_uri_mismatch" / 403 CSRF errors
  • Reviewing PRs that touch lib/auth.ts, auth-client.ts, or /api/auth/ route handlers

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Setup & ConfigurationCRITICALsetup-
2Database Adapters & SchemaCRITICALdb-
3API Route HandlersCRITICALroute-
4Session & CookiesHIGHsession-
5Auth Methods & ProvidersHIGHauth-
6Security & HardeningHIGHsecurity-
7Plugins & ExtensionsMEDIUMplugins-
8Migration from Other AuthMEDIUMmigrate-

Quick Reference

1. Setup & Configuration (CRITICAL)
2. Database Adapters & Schema (CRITICAL)
3. API Route Handlers (CRITICAL)
4. Session & Cookies (HIGH)
5. Auth Methods & Providers (HIGH)
Show full SKILL.md (248 more words)Show less
6. Security & Hardening (HIGH)
7. Plugins & Extensions (MEDIUM)
8. Migration from Other Auth (MEDIUM)

How to Use

For a fresh implementation, read in priority order: start with all setup- rules, then db-, then route- — these CRITICAL categories must be correct or nothing else works. After the foundation, pick the rules that match your scope: session- for cookie/expiry tuning, auth- for provider configuration, security- for production hardening.

For a migration from another auth library, read migrate-parallel-cutover first (strategy), then security-password-hash-interop (preserve user passwords), then migrate-oauth-account-mapping and migrate-nextauth-schema-mapping (data layout).

Read individual reference files for detailed explanations, incorrect vs. correct code examples, and links to the canonical Better Auth documentation.

Reference Files

FileDescription
references/_sections.mdCategory definitions ordered by impact
assets/templates/_template.mdTemplate for adding new rules
metadata.jsonVersion, references, and discipline metadata

© pproenca, 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 46 other files (references, assets) in skills/.experimental/better-auth of pproenca/dot-skills.

  • SKILL.md
  • AGENTS.md
  • assets/templates/_template.md
  • metadata.json
  • references/_sections.md
  • references/auth-client-sign-in-helpers.md
  • references/auth-infer-additional-fields.md
  • references/auth-magic-link-setup.md
  • references/auth-oauth-env-vars.md
  • references/auth-oauth-redirect-uri.md
  • references/auth-require-email-verification.md
  • references/db-adapter-selection.md
  • references/db-additional-fields.md
  • references/db-connection-pooling.md
  • references/db-database-hooks.md
  • references/db-plugin-schema-customization.md
  • references/db-schema-generate.md
  • references/migrate-force-allow-id.md
  • … and 29 more

Open the folder on GitHubat commit cf93c57

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 skillpproenca/dot-skills214—~2.2kAutomated safety check: PassMIT
Better Autheinverne/dotfiles121—~4kAutomated safety check: NotesMIT
Supabasecurvenote/curvenote1695 repos~2.2kAutomated safety check: PassCustom licence
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Better Auth Best Practiceslatitude-dev/latitude-llm4.7k7 repos~1.6kAutomated safety check: PassMIT
Clerkgeekskai/blog1033 repos~1.5kAutomated 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
  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    169 GitHub starsUsed in 5 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • 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
  • Clerk

    geekskai/blog

    Clerk authentication router. An agent skill from geekskai/blog.

    103 GitHub starsUsed in 3 repos~1.5k 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

More from pproenca/dot-skills

All 182 skills in this repo
  • Audio Voice Recovery

    pproenca/dot-skills

    Audio forensics and voice recovery guidelines for CSI-level audio analysis.

    214 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Codemod React Pipeline

    pproenca/dot-skills

    Guided, scripted pipeline for running JSX/TSX/React codemods safely across large legacy codebases.

    214 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    214 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Dx Harness

    pproenca/dot-skills

    Developer-experience friction auditing and fixing — slow onboarding, repeated manual setup steps, missing bootstrap/reset/seed scripts, undiscoverable conventions.

    214 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Language Spec Author

    pproenca/dot-skills

    Turn a rough idea for a language into a complete, implementable specification — a DSL, query, config/data, template, or protocol language — by interviewing the author dimension by dimension until…

    214 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Python Pep Author

    pproenca/dot-skills

    Drafting Python Enhancement Proposals (PEPs) — proposing a Python language feature, a standard library change, an interoperability standard, or an informational/process document for the Python…

    214 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Better Auth

What does Better Auth do?

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…. Better Auth is an agent skill from pproenca/dot-skills.js, Clerk, Auth0, or Supabase Auth.

When should I use Better Auth?

Better Auth fits situations like: migrating Better Auth code — and even when the user doesnt explicitly mention Better Auth but is working on TypeScript authentication; session cookies; OAuth providers; auth-library migration.

How do I install Better Auth in Claude Code?

Run `npx skills add pproenca/dot-skills --skill better-auth -a claude-code`. Or copy the skill folder (skills/.experimental/better-auth in pproenca/dot-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 pproenca/dot-skills --skill better-auth -a codex`. Or copy the skill folder (skills/.experimental/better-auth in pproenca/dot-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 pproenca/dot-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 credentials named BETTER_AUTH_SECRET. Our summary lists: Node.js; A credential in BETTER_AUTH_SECRET.

Does Better Auth access the network?

SKILL.md names 1 domain. As links in the text: better-auth.com. This is read from the text; nothing was executed.

Is Better Auth safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Better Auth use?

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

How many tokens does Better Auth use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 28k tokens, read only when the agent opens those files.

What are the alternatives to Better Auth?

Skills that share tags, products or a category with Better Auth: Better Auth (einverne/dotfiles, 121 stars), Supabase (curvenote/curvenote, 169 stars), Supabase Development and Debugging (supabase/agent-skills, 2.7k stars) and Better Auth Best Practices (latitude-dev/latitude-llm, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Better Auth?

pproenca (a GitHub user) maintains it in pproenca/dot-skills, which has 214 GitHub stars. The repository holds 182 skills in this directory. The repository was last updated on August 15, 2026.

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