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.
curl -O https://raw.githubusercontent.com/LeonardoTrapani/better-skills/master/.agents/skills/better-auth-best-practices/SKILL.mdgit clone --depth 1 https://github.com/LeonardoTrapani/better-skillsWrote 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.
[](https://agentmods.dev/skills/leonardotrapani/better-skills/better-auth-best-practices)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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 32BETTER_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/Drizzlenpx @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.
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.
- 12d ago First seen · 175 lines · 20 tokens per session scan A 83ce44689986
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.
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-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-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.
doris-debug-deployment
Use for Doris FE/BE startup failures, port conflicts, prioritynetworks misrouting, metadir corruption, and ADD/DROP BACKEND issues.
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.
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".