agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/better-auth/SKILL.md

better-auth

Skill13 starsChanged 27 days agoMITView on GitHub

  • Installs packages

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

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    If sessions randomly invalidate, ensure you are not clearing cookies improperly across subdomains and that the secret configuration …

    line 31
  2. Distinctive:

    Use this when your agent works with better-auth — structured patterns beat pasted docs and prevent common hallucinations.

    line 41

“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 API Skill

Quick Start

Better Auth provides framework-agnostic auth (Next.js, Express, SvelteKit) deeply integrated with modern ORMs like Drizzle and Prisma.

npm install better-auth

Common Workflows

OAuth and Magic Links

Configure plugins to enable OAuth (GitHub, Google) or Magic Links. Better Auth natively handles session creation and saves profiles to your database using the provided database adapter.

Production Patterns

Two-Factor Authentication

Utilize the twoFactor plugin to require TOTP before issuing a valid session cookie. Ensure you construct your UI to gracefully handle the requires_two_factor response state.

Error Recovery

Handle BetterAuthError. When creating users, handle conflicts gracefully (e.g., Email already exists) and prompt the user to log in instead.

Security Notes

Better Auth handles CSRF and secure cookies out of the box. Ensure your trustedOrigins configuration accurately reflects your production domains to prevent session hijacking.

Performance Considerations

Session validation happens on the Edge or Server. Optimize your database queries (e.g., adding indexes to the session_token column) to ensure ultra-fast session lookups on every request.

Testing Guidance

Better Auth can be mocked easily by overriding the getSession function in your unit tests, or by provisioning a test database specifically for your test runner.

Troubleshooting

If sessions randomly invalidate, ensure you are not clearing cookies improperly across subdomains and that the secret configuration variable remains static across deployments.

References

Related Skills

  • Clerk
  • Neon

Why use this skill

Use this when your agent works with better-auth — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using outdated SDK or API versions from training data
  • Inventing environment variable names
  • Omitting error handling and retry logic

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • clerk — related to
  • neon — related to

Last Verified: 2026-07-02

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.