agentleFS
DobroslavRadosavljevicDobroslavRadosavljevic/cabrakan/.agents/skills/better-auth/SKILL.md

better-auth

Skill1 starsChanged 3 months agoMITView on GitHub

Build, review, debug, configure, migrate, teach, or plan Better Auth TypeScript auth with current docs and official ecosystem packages. Use for better-auth, betterAuth, createAuthClient, auth.api, auth.handler, emailAndPassword, socialProviders, genericOAuth, organization, admin, twoFactor, passkey, magicLink, emailOTP, phoneNumber, username, anonymous, bearer, apiKey, jwt, oauth-provider, sso, scim, stripe, drizzleAdapter, prismaAdapter, redis-storage, Expo, Electron, nextCookies, trustedOrigins, and bunx auth@latest generate/migrate.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use Problem-Solving Techniques, ads-management and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • truongtv22Skill

    Problem-Solving Techniques

    Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

    Also in 6 projects that use this

  • OpenAnalystIncSkill

    ads-management

    Activate for paid advertising campaigns on Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads. Includes ad copywriting, audience targeting, budget optimization, A/B testing, and ROAS tracking. Used by ads-specialist and campaign-manager agents.

    Also in 3 projects that use this

  • OpenAnalystIncSkill

    ai-artist

    Write and optimize prompts for AI-generated outcomes across text and image models. Use when crafting prompts for LLMs (Claude, GPT, Gemini), image generators (Midjourney, DALL-E, Stable Diffusion, Imagen, Flux), or video generators (Veo, Runway). Covers prompt structure, style keywords, negative prompts, chain-of-thought, few-shot examples, iterative refinement, and domain-specific patterns for marketing, code, and creative writing.

    Also in 3 projects that use this

  • truongtv22Skill

    mobile-development

    Build modern mobile applications with React Native, Flutter, Swift/SwiftUI, and Kotlin/Jetpack Compose. Covers mobile-first design principles, performance optimization (battery, memory, network), offline-first architecture, platform-specific guidelines (iOS HIG, Material Design), testing strategies, security best practices, accessibility, app store deployment, and mobile development mindset. Use when building mobile apps, implementing mobile UX patterns, optimizing for mobile constraints, or making native vs cross-platform decisions.

    Also in 4 projects that use this

  • sumuligeSkill

    seo-optimization

    SEO best practices for Git, documentation, and web projects

    Also in 3 projects that use this

  • claude-office-skillsSkill

    email-marketing

    Email marketing automation - campaign creation, sequence building, A/B testing, deliverability optimization, and analytics

    Also in 3 projects that use this

  • +6 more from OpenAnalystInc

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill for self-hosted TypeScript authentication with Better Auth (better-auth@1.6.25): server instance, client SDK, plugins, …

    line 8
  2. Very specific:

    Verify with session smoke (auth.api.getSession), sign-in/out, plugin schema migrate, and production secret/origins checks.

    line 26
  3. Very specific:

    Prefer @better-auth/oauth-provider over legacy built-in oidcProvider.

    line 35
  4. Distinctive:

    Never treat middleware cookie presence as auth — validate session.

    line 36
  5. Very specific:

    Prefer bun / bunx in command examples.

    line 38
  6. Distinctive:

    Prefer repository-owned commands.

    line 42

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Better Auth

Use this skill for self-hosted TypeScript authentication with Better Auth (better-auth@1.6.25): server instance, client SDK, plugins, adapters, framework mounts, and security.

Workflow

  1. Inspect the local surface:
    • Core: better-auth (snapshot 1.6.25). CLI: bunx auth@latest (package auth@1.6.25) — not stale @better-auth/cli@1.4.x.
    • Env: BETTER_AUTH_SECRET (≥32), BETTER_AUTH_URL / baseURL, trustedOrigins.
    • Database: Kysely/pool vs Drizzle/Prisma/Mongo adapter; secondary storage (Redis).
    • Plugins: server + matching client plugins; schema generated after changes.
    • Mount: /api/auth/* (default basePath) via auth.handler / framework helper.
  2. For day-to-day setup, follow usage-guide.md first.
  3. Refresh docs when versions drift. Start from source-map.md.
  4. Route deeper detail:
    • Plugins & scoped packages: plugins-ecosystem.md.
    • Schema, adapters, CLI: adapters-schema.md.
    • Framework mounts & clients: frameworks-client.md.
    • Security, sessions, patterns: security-patterns.md.
  5. Align every installed @better-auth/* at 1.6.x with core (except separate lines: utils, infra, agent-auth, beta cimd). Prefer scoped adapters when optimizing (better-auth/minimal).
  6. Verify with session smoke (auth.api.getSession), sign-in/out, plugin schema migrate, and production secret/origins checks.

Core Judgment

  • Cookie DB sessions by default — not JWT. Use jwt / bearer / API keys only when cookies aren’t enough.
  • Singleton auth in lib/auth.ts (named export helps CLI discovery). Separate auth-client.ts.
  • Server: auth.api.* with real request headers. Client: createAuthClient + framework entry (better-auth/react, …).
  • Most features are plugins: register server + client, then bunx auth@latest generate (ORM) or migrate (Kysely).
  • Passkey / API key / SSO / SCIM / OAuth-provider / Stripe / Expo are scoped packages — don’t invent old better-auth/plugins import paths for those.
  • Prefer @better-auth/oauth-provider over legacy built-in oidcProvider.
  • Never treat middleware cookie presence as auth — validate session. Don’t disable CSRF/origin checks to “fix” CORS.
  • Rate limit is off/weak in dev; memory storage fails on multi-instance — use Redis/DB in prod.
  • Prefer bun / bunx in command examples.

Verification

Prefer repository-owned commands. Cover the relevant subset:

  • bun pm ls better-auth and matching @better-auth/* versions.
  • bunx auth@latest info / secret as needed; schema generate/migrate after plugin changes.
  • Smoke: mount handler, getSession, email or social sign-in, sign-out.
  • Plugins: client methods resolve; org/2FA/passkey flows if enabled.
  • Prod: baseURL, secret length, trustedOrigins, HTTPS cookies, rate-limit storage.
  • Security: roles/additionalFields with input: false; no testUtils in prod config.

Report which checks ran, which did not, and version assumptions that remain.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.