validate-auth-schema

validate-auth-schema is a command for Claude Code from kriasoft/react-starter-kit. It costs 0 tokens per session (470 once invoked), scanned A, original, MIT.

A check that compares a Drizzle database schema with the tables and fields required by Better Auth, an authentication library. It uses generated data from the project's enabled authentication integrations as the reference.

In plain words
What is it for?
Use it to validate authentication database tables, columns, types, required and unique settings, foreign keys, and indexes against the configured Better Auth setup.
Why use it?
It finds missing or unnecessary tables, field mismatches, incorrect relationships, and index differences before they cause authentication problems.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

Good fit Use it to validate authentication database tables, columns, types, required and unique settings, foreign keys, and indexes against the configured Better Auth setup.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kriasoft/react-starter-kit/validate-auth-schema
About the project

React Starter Kit is a full-stack monorepo template for building SaaS web applications with React, TypeScript, tRPC, and Cloudflare Workers. A monorepo keeps related applications and packages in one repository, while the template provides frontend, backend, authentication, billing, database, and development-tool foundations. The catalogue instructions, skills, and command help developers work with this starter kit.

kriasoft/react-starter-kit · 23,693 stars · on GitHub · reactstarter.com

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.

Clone the repo
git clone --depth 1 https://github.com/kriasoft/react-starter-kit

Made for: Claude Code.

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 validate-auth-schema

README.md
[![agentmods](https://agentmods.dev/badge/commands/kriasoft/react-starter-kit/validate-auth-schema/github.svg)](https://agentmods.dev/commands/kriasoft/react-starter-kit/validate-auth-schema)
Your own site
<a href="https://agentmods.dev/commands/kriasoft/react-starter-kit/validate-auth-schema"><img src="https://agentmods.dev/badge/commands/kriasoft/react-starter-kit/validate-auth-schema/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 validate-auth-schema

Your own site · 80×15
<a href="https://agentmods.dev/commands/kriasoft/react-starter-kit/validate-auth-schema"><img src="https://agentmods.dev/badge/commands/kriasoft/react-starter-kit/validate-auth-schema.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 470 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 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.1 $0.00000 $0.00470
Opus 5.5 $0.00000 $0.00188
Sonnet 5.5 $0.00000 $0.00094
Haiku 4.5 $0.00000 $0.00047

Measured 1mo ago against content hash ce13130ed215, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

validate-auth-schema 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.

.claude/commands/validate-auth-schema.md · 21 lines

What it actually says

Validate Auth Schema

Check that the Drizzle schema in db/schema/ still satisfies what Better Auth expects. Better Auth derives its required tables from the enabled plugins, so the generated JSON — not the upstream docs — is the source of truth:

bun run db/scripts/generate-auth-schema.ts

The script builds a real auth instance from apps/api/lib/auth.ts with fixed placeholder credentials, every optional integration switched on, so the output is the full set of tables rather than the subset your environment happens to enable. Per field it carries the type, the required, unique and index flags, any literal defaultValue, and the reference target with its onDelete. Per table it carries indexes: the composite indexes a plugin declares.

Compare that output against db/schema/ and report:

  • Tables Better Auth expects that are missing, and tables no plugin in auth.ts needs any more.
  • Field-level drift: missing or extra columns, mismatched types, and required or unique flags that disagree.
  • Foreign keys pointing at the wrong table or column.
  • A true index flag, a table-level entry in indexes, a literal defaultValue, or an onDelete in the output is Better Auth asking for it: report a schema that lacks one. Indexes, defaults and cascades the project adds beyond that list are its own decisions — check those against the conventions in db/AGENTS.md and do not report them as drift.
  • Local naming that must stay mapped, not renamed away: Better Auth's account is our identity table.
  • Project-specific columns, indexes, and constraints are expected and fine on their own. Flag any that constrain a write Better Auth performs: a NOT NULL column with no database default breaks every insert into that table, and an extra unique or check constraint can reject a row Better Auth considers valid. Fields that must participate in its models belong in additionalFields rather than added to the table behind its back.

Report findings with the specific fix for each. Do not run db:push, db:generate, or db:migrate as part of a validation — schema changes are a separate, deliberate step.

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 Changed ce13130ed215
  2. 1mo ago First seen · 21 lines · 0 tokens per session scan A 2d19e2fb5777

Subscribe to this mod's changes

validate-auth-schema is a command published in the GitHub repository kriasoft/react-starter-kit (23,693 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 470 tokens. 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.