better-skills: Skill for Claude Code

.agents/skills/better-auth-best-practices/SKILL.md

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

A guide for adding Better Auth, a TypeScript library for user sign-in and account management, to an application. It covers configuration, database setup, and features such as passwords, OAuth, magic links, and passkeys.

In plain words
What is it for?
Use it to configure authentication, generate or migrate database tables, add sign-in methods, and connect Better Auth to a TypeScript project.
Why use it?
It reduces setup mistakes around secrets, URLs, schemas, plugins, and framework integration.

Skill for Claude CodeCodex

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

This is LeonardoTrapani/better-skills's own configuration. It tells Claude Code and Codex how to work on better-skills itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything better-skills configures →

Reuse

Borrowing it

Nothing to install: this file belongs to LeonardoTrapani/better-skills. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/LeonardoTrapani/better-skills/master/.agents/skills/better-auth-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/LeonardoTrapani/better-skills

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/leonardotrapani/better-skills/better-auth-best-practices/github.svg)](https://agentmods.dev/skills/leonardotrapani/better-skills/better-auth-best-practices)
Your own site
<a href="https://agentmods.dev/skills/leonardotrapani/better-skills/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/leonardotrapani/better-skills/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/leonardotrapani/better-skills/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/leonardotrapani/better-skills/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 12d ago against content hash 83ce44689986, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 12d 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. 12d 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 LeonardoTrapani/better-skills (11 stars, last pushed 6mo ago), 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

pipefy-ipaas

Use when the user wants to build, test, publish, or manage iPaaS (Advanced Automations) flows: multi-step integrations with external apps (Slack, Gmail, Google Sheets), incoming webhooks, schedules, routers, code steps, or iPaaS data tables. MCP-only, driven through 4 meta-tools over a per-pipe catalog discovered at…

pipefy/ai-toolkit · 104 tokens

pipefy-api-fallback

Use this skill when an MCP tool fails AND the introspection skill could not resolve the problem. This is the last-resort fallback (Tier 3): call the Pipefy GraphQL API directly using curl or httpx, authenticating with the Service Account (OAuth2) or a Personal Access Token (PAT) available as env var. Follow the 3-tier…

pipefy/ai-toolkit · 86 tokens

pipefy-introspection

Use this skill when you need to discover GraphQL type shapes, mutation signatures, enum values, or execute arbitrary GraphQL as a fallback. This is the first fallback tier (Tier 2) when dedicated MCP tools fail or don't exist for an operation. 7 MCP tools.

pipefy/ai-toolkit · 61 tokens

doris-debug-deployment

Use for Doris FE/BE startup failures, port conflicts, prioritynetworks misrouting, metadir corruption, and ADD/DROP BACKEND issues.

apache/doris-skills · 36 tokens

pipefy-members-email-webhooks

Use this skill when the user wants to manage pipe membership, send or read card inbox emails, use email templates, or manage webhooks. Covers 12 MCP tools.

pipefy/ai-toolkit · 41 tokens

zeabur-email

Use when managing Zeabur Email (ZSend) service or sending emails. Use when user says "email", "send email", "send mail", "email domain", "email API key", "email webhook", or "ZSend".

zeabur/agent-skills · 54 tokens