ctxpipe: Skill for Claude Code

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

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

A skill for integrating Better Auth, a TypeScript framework for adding user authentication to applications.

In plain words
What is it for?
Setting up and integrating Better Auth in TypeScript applications.
Why use it?
It provides guidance when an application needs sign-in and related authentication 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 ctxpipe-ai/ctxpipe's own configuration. It tells Claude Code and Codex how to work on ctxpipe 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 ctxpipe configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ctxpipe-ai/ctxpipe. 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/ctxpipe-ai/ctxpipe/main/.agents/skills/better-auth-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ctxpipe-ai/ctxpipe

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/ctxpipe-ai/ctxpipe/better-auth-best-practices/github.svg)](https://agentmods.dev/skills/ctxpipe-ai/ctxpipe/better-auth-best-practices)
Your own site
<a href="https://agentmods.dev/skills/ctxpipe-ai/ctxpipe/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/ctxpipe-ai/ctxpipe/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/ctxpipe-ai/ctxpipe/better-auth-best-practices"><img src="https://agentmods.dev/badge/skills/ctxpipe-ai/ctxpipe/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,571 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.01571
Opus 5.5 $0.00008 $0.00628
Sonnet 5.5 $0.00004 $0.00314
Haiku 4.5 $0.00002 $0.00157

Measured 1mo ago against content hash d67a75a83202, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 — 13 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 · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 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.

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".


Session Management

Read the full file on GitHub · 166 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. 1mo ago First seen · 166 lines · 20 tokens per session scan A d67a75a83202

Subscribe to this mod's changes

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

Related

Other skills, from other repositories

design-an-interface

Generate radically-different module or API contract designs in parallel, then compare on depth, simplicity, and ease-of-correct-use. Trigger when the user is shaping a new module surface, exploring contract options, comparing module shapes, or applying "design it twice" to a first-pass sketch.

OutlineDriven/odin-gemini-cli-extension · 62 tokens

moai-ref-api-patterns

REST/GraphQL API design patterns, error handling conventions, and input validation reference for backend development. Agent-extending skill that amplifies backend domain work (spawned via Agent(general-purpose) with backend instructions) with production-grade API patterns. Use when designing APIs, implementing…

modu-ai/moai-adk · 85 tokens

inkbox-agent-self-signup

Use when guiding or implementing the Inkbox agent self-signup flow, including verification, resend-verification, signup restrictions, and optional signup fields like agent handles or mailbox local parts.

inkbox-ai/inkbox · 43 tokens

loom-event-driven

Event-driven architecture: message queues, pub/sub, event sourcing, CQRS, sagas. Not for: webhooks.

cosmix/loom · 29 tokens

blueprint-from-collection-actions

Build the source's actions and ingests the spec decided to build, and write down the ones left to a person.

receptron/mulmoterminal · 31 tokens

blueprint-from-collection-actions

Build the source's actions and ingests the spec decided to build as Postgres functions and Supabase Edge Functions, and write down the ones left to a person.

receptron/mulmoterminal · 40 tokens