better-auth-best-practices

better-auth-best-practices is a skill for Claude Code, Codex from willdady/platypus. It costs 20 tokens per session (1,592 once invoked), scanned A, a copy of better-auth-best-practices, MIT.

Integration guidance for Better Auth, a TypeScript framework for adding user sign-in and related authentication features to applications.

In plain words
What is it for?
Use it when integrating Better Auth for email passwords, OAuth, magic links, passkeys, or other supported authentication options.
Why use it?
It helps avoid configuration mistakes when setting up authentication, environment variables, plugins, and database changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when integrating Better Auth for email passwords, OAuth, magic links, passkeys, or other supported authentication options.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/willdady/platypus/better-auth-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add willdady/platypus --skill better-auth-best-practices
Clone the repo
git clone --depth 1 https://github.com/willdady/platypus

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for better-auth-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/willdady/platypus/better-auth-best-practices/github.svg)](https://agentmods.dev/skills/willdady/platypus/better-auth-best-practices)
Your own site
<a href="https://agentmods.dev/skills/willdady/platypus/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/willdady/platypus/better-auth-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for better-auth-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/willdady/platypus/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/willdady/platypus/better-auth-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,592 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 86% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.01592
Opus 5 $0.00010 $0.00796
Sonnet 5 $0.00004 $0.00318
Haiku 4.5 $0.00002 $0.00159

Measured 8d ago against content hash 83ce44689986, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

better-auth-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

86% identical to better-auth-best-practices — 48 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/better-auth-best-practices/SKILL.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Better Auth Integration Guide

Always consult better-auth.com/docs for code examples and latest API.

Better Auth is a TypeScript-first, framework-agnostic auth framework supporting email/password, OAuth, magic links, passkeys, and more via plugins.


Quick Reference

Environment Variables

  • BETTER_AUTH_SECRET - Encryption secret (min 32 chars). Generate: openssl rand -base64 32
  • BETTER_AUTH_URL - Base URL (e.g., https://example.com)

Only define baseURL/secret in config if env vars are NOT set.

File Location

CLI looks for auth.ts in: ./, ./lib, ./utils, or under ./src. Use --config for custom path.

CLI Commands

  • npx @better-auth/cli@latest migrate - Apply schema (built-in adapter)
  • npx @better-auth/cli@latest generate - Generate schema for Prisma/Drizzle
  • npx @better-auth/cli mcp --cursor - Add MCP to AI tools

Re-run after adding/changing plugins.


Core Config Options

Option Notes
appName Optional display name
baseURL Only if BETTER_AUTH_URL not set
basePath Default /api/auth. Set / for root.
secret Only if BETTER_AUTH_SECRET not set
database Required for most features. See adapters docs.
secondaryStorage Redis/KV for sessions & rate limits
emailAndPassword { enabled: true } to activate
socialProviders { google: { clientId, clientSecret }, ... }
plugins Array of plugins
trustedOrigins CSRF whitelist

Database

Direct connections: Pass pg.Pool, mysql2 pool, better-sqlite3, or bun:sqlite instance.

ORM adapters: Import from better-auth/adapters/drizzle, better-auth/adapters/prisma, better-auth/adapters/mongodb.

Read the full file on GitHub · 175 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 175 lines · 20 tokens per session scan A 83ce44689986

Subscribe to this mod's changes

better-auth-best-practices is a skill published in the GitHub repository willdady/platypus (71 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 1,592 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 86% identical to better-auth-best-practices, differing in 48 lines, and is treated as a copy.

Related

Other skills, from other repositories

webhook-subscriptions

Create and manage webhook subscriptions for event-driven agent activation. Use when the user wants external services (GitHub, GitLab, Stripe, Linear, PagerDuty, Sentry, or any generic source) to trigger agent runs by POSTing events to a URL.

moltis-org/moltis · 57 tokens

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

langfuse/langfuse · 58 tokens

technical-integrations

Hunt existing integration patterns and design vendor/framework-agnostic API, RFC, SDK, and integration plans for new external vendor integrations.

vincentkoc/dotskills · 31 tokens

go-context

Use when working with context.Context in Go — placement in signatures, propagating cancellation and deadlines, and storing values in context vs parameters. Also use when cancelling long-running operations, setting timeouts, or passing request-scoped data, even if they don't mention context.Context directly. Does not…

cxuu/golang-skills · 73 tokens

go-functional-options

Use when designing a Go constructor or factory function with optional configuration — especially with 3+ optional parameters or extensible APIs. Also use when building a New function that takes many settings, even if they don't mention "functional options" by name. Does not cover general function design (see…

cxuu/golang-skills · 65 tokens

app-ai-wiring

A guide for connecting an app to an AI language model or to the tiguclaw assistant. It compares a tiguclaw-specific endpoint with an OpenAI-compatible gateway, a standard interface used by several model services.

tigu77/tiguclaw · 232 tokens