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.
npx skills add autohandai/community-skills --skill better-auth-best-practicesgit clone --depth 1 https://github.com/autohandai/community-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/autohandai/community-skills/better-auth-best-practices)<a href="https://agentmods.dev/skills/autohandai/community-skills/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/autohandai/community-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/autohandai/community-skills/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/autohandai/community-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.00061 | $0.01675 |
| Opus 5.5 | $0.00024 | $0.00670 |
| Sonnet 5.5 | $0.00012 | $0.00335 |
| Haiku 4.5 | $0.00006 | $0.00168 |
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 2mo 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
100% identical to better-auth-best-practices — 1 line 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 — 176 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.
Setup Workflow
- Install:
npm install better-auth - Set env vars:
BETTER_AUTH_SECRETandBETTER_AUTH_URL - Create
auth.tswith database + config - Create route handler for your framework
- Run
npx @better-auth/cli@latest migrate - Verify: call
GET /api/auth/ok— should return{ status: "ok" }
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.
Critical: Better Auth uses adapter model names, NOT underlying table names. If Prisma model is User mapping to table users, use modelName: "user" (Prisma reference), not "users".
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.
- 2mo ago First seen · 176 lines · 61 tokens per session scan A 16f378dcda82
better-auth-best-practices is a skill published in the GitHub repository autohandai/community-skills (14 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 1,675 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to better-auth-best-practices, differing in 1 line, and is treated as a copy.
better-auth-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| better-auth-best-practicesautohandai/community-skills | Skill | 14 | 4mo ago | Apache-2.0 | A | 61 | Claude Code, Codex |
| amazon-location-serviceawslabs/agent-plugins | Skill | 953 | yesterday | Apache-2.0 | A | 107 | Claude Code |
| amplify-workflowawslabs/agent-plugins | Skill | 953 | yesterday | Apache-2.0 | A | 214 | Claude Code |
| aws-lambda-durable-functionsawslabs/agent-plugins | Skill | 953 | yesterday | Apache-2.0 | A | 109 | Claude Code |
| api-gatewayawslabs/agent-plugins | Skill | 953 | yesterday | Apache-2.0 | A | 108 | Claude Code |
| aws-lambdaawslabs/agent-plugins | Skill | 953 | yesterday | Apache-2.0 | A | 74 | Claude Code |
| agentsop-http-tool-wrappingagentsope/SkillAlchemy | Skill | 513 | 22d ago | MIT | A | 155 | Claude Code |