better-auth

better-auth is a skill for Claude Code, Codex from ihatesea69/kiro-kit. It costs 35 tokens per session (429 once invoked), scanned A, original, MIT.

A coding guide for adding login, permissions, and account security to applications. It covers OAuth, which lets users sign in through services such as Google or GitHub, as well as tokens, sessions, roles, multi-factor authentication, and passkeys.

In plain words
What is it for?
Use it to build OAuth sign-in, JWT or session-based login, role-based access control, multi-factor authentication, session management, and passkey/WebAuthn support.
Why use it?
It helps avoid common mistakes when deciding how users sign in, how long access lasts, and what each user may do. It also addresses protecting sessions and handling token refresh and account changes.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/ihatesea69/kiro-kit/better-auth
Any agent
npx skills add ihatesea69/kiro-kit --skill better-auth
Clone the repo
git clone --depth 1 https://github.com/ihatesea69/kiro-kit

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/ihatesea69/kiro-kit/better-auth.svg)](https://agentmods.dev/skills/ihatesea69/kiro-kit/better-auth)
Your own site
<a href="https://agentmods.dev/skills/ihatesea69/kiro-kit/better-auth"><img src="https://agentmods.dev/badge/skills/ihatesea69/kiro-kit/better-auth.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 429 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00035 $0.00429
Opus 5 $0.00017 $0.00215
Sonnet 5 $0.00007 $0.00086
Haiku 4.5 $0.00003 $0.00043

Measured 4d ago against content hash 7d38cc1b324a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

better-auth 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 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/better_auth_init.py, scripts/tests/test_better_auth_init.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.kiro/skills/better-auth/SKILL.md · 63 lines

What it actually says

Better Auth

Activate this skill when implementing authentication or authorization systems.

When to Use

  • Adding authentication to an application
  • Implementing OAuth flows (Google, GitHub, Discord)
  • Setting up JWT or session-based auth
  • Implementing role-based access control (RBAC)
  • Adding multi-factor authentication (TOTP, SMS)
  • Managing user sessions and token refresh
  • Implementing passkeys/WebAuthn

Authentication Patterns

JWT (Stateless)

  • Short-lived access tokens (15-60 minutes)
  • Long-lived refresh tokens (7-30 days, stored securely)
  • Rotate refresh tokens on use (detect token theft)
  • Include minimal claims (user ID, roles)
  • Validate signature, expiry, and issuer on every request

Session-Based (Stateful)

  • Store sessions server-side (Redis for distributed)
  • Use httpOnly, secure, sameSite cookies
  • Implement session rotation on privilege escalation
  • Set absolute and idle timeouts
  • Invalidate all sessions on password change

OAuth 2.1

  • Use PKCE for all flows (including server-side)
  • Validate state parameter to prevent CSRF
  • Store tokens encrypted at rest
  • Implement token refresh before expiry
  • Handle provider-specific scopes and claims

Authorization Patterns

  • RBAC: roles with permission sets
  • ABAC: attribute-based policies for complex rules
  • Resource-based: check ownership before access
  • Always check authorization server-side (never trust client)

Security Rules

  • Hash passwords with bcrypt (cost 12+) or argon2id
  • Use constant-time comparison for tokens
  • Implement account lockout after failed attempts
  • Log all auth events for audit trail
  • Never store plain-text passwords or tokens
  • Validate redirect URIs strictly (no open redirects)
Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 63 lines · 35 tokens per session scan A 7d38cc1b324a

Subscribe to this mod's changes

better-auth is a skill published in the GitHub repository ihatesea69/kiro-kit (18 stars, last pushed 15d ago), licensed MIT. It adds 35 tokens to every session and 429 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kirocrew-app-dev

Build, package, and publish KiroCrew external apps. Covers app.json manifest, UI components, crons, skills, self-healing install, git publishing, and common pitfalls.

kirodotdev/KiroCrew · 43 tokens

goal-conductor

Own a long-horizon goal end to end - decompose it into work items, stand up one top-level session per item, patrol their state on a nudge loop, and decide each next round until the goal is met or a stop condition fires. Use when the user hands over a goal too large for one session ("clear the flaky-test backlog"…

kirodotdev/KiroCrew · 105 tokens

feature-demo-recording

Record a demo video of a web feature from a real browser. Two modes -- a NARRATED film where measured voiceover drives the timeline (designed slides, subtitles, punch-in camera, rendered from an HTML timeline), and a SILENT evidence clip for a PR or a QA pass. Use when the user asks to record a video, demo, or screen…

kirodotdev/KiroCrew · 90 tokens

artifact-deploy

One-click deploy a user's pre-built app/artifact into their OWN AWS account and get a global public HTTPS link (Vercel-like), with a default TTL and promote-to-persistent. Use when the user says "deploy this", "ship this demo", "give me a public link", "share this externally", or "deploy to AWS".

kirodotdev/KiroCrew · 74 tokens

explain-for

Explain a topic, a piece of code, an error, or a design decision calibrated to one named audience — a 5-year-old, a 5th grader, a manager, a designer, a graduate student, a parent. Resolves who the explanation is for (from the request, or from what memory already records about that person), establishes the ground…

kirodotdev/KiroCrew · 102 tokens

rubber-duck

Adversarial "rubber duck" review that turns explaining-out-loud into a hallucination check. The main session is the PRESENTER (it did the work — a design doc, investigation, or analysis — and holds the real reasoning) and reconstructs the topic to a LISTENER — a spawned subagent pinned to a DIFFERENT-vendor model that…

kirodotdev/KiroCrew · 161 tokens