audit-db-schema

audit-db-schema is a skill for Claude Code, Codex from kensaurus/cursor-kenji. It costs 66 tokens per session (4,098 once invoked), scanned A, original, MIT.

A database-schema review guide for checking how tables, fields, relationships, constraints, indexes, and migrations are designed.

In plain words
What is it for?
Use it to review schema naming, data types, foreign keys, validation rules, indexes, row-level security, and migration safety.
Why use it?
It helps prevent invalid data, slow lookups, broken migrations, and unauthorised access caused by weak database structure.

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/kensaurus/cursor-kenji/audit-db-schema
Any agent
npx skills add kensaurus/cursor-kenji --skill audit-db-schema
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

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 audit-db-schema

README.md
[![agentmods](https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/audit-db-schema.svg)](https://agentmods.dev/skills/kensaurus/cursor-kenji/audit-db-schema)
Your own site
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/audit-db-schema"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/audit-db-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,098 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.00066 $0.04098
Opus 5 $0.00033 $0.02049
Sonnet 5 $0.00013 $0.00820
Haiku 4.5 $0.00007 $0.00410

Measured yesterday against content hash b07350c2cc2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit-db-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 yesterday.

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.

skills/audit-db-schema/SKILL.md · 475 lines

How it starts

The opening of the file, as written. The whole thing — 475 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Schema Audit Skill

Degree of freedom: MIXED — Steps 0, 1, 3 [HIGH freedom]; Steps 2 and 4 MCP/SQL probes [LOW freedom — run exactly] (run the query; do not invent a schema).

How to reason

  1. Observe — quote the column, constraint, advisor row, or query result
  2. Interpret — what fails at write-time, read-time, or migrate-time?
  3. Classify — naming / type / constraint / index / RLS / migration / correct
  4. Severity — missing FK/RLS on public data = P0; type/index drift = P1; naming = P2

Worked example

Observe: orders.user_id is nullable text, no FK, no index; rowsecurity = false. Interpret: orphan rows can insert; the client can SELECT every order; lookups seq-scan. Classify: constraint + index + RLS (not a naming nit). Severity: P0 — public table, no RLS, no FK. Finding: orders | RLS+FK | P0 | enable RLS + user_id uuid references users(id) + index.

Self-critique before reporting [LOW freedom — do not skip]

  1. Evidenced — query result or advisor URL, not "Postgres usually…"
  2. Reproducible — same SQL twice; do not cite a stale list_tables
  3. Severity justified — P0 = data loss, leak, or unconstrained money type
  4. Right owner — who-can-read-what → plan-rls-audit; DELETE/TRUNCATE → plan-data-integrity; RPO → plan-backup-dr
  5. No migrations applied — findings only

Step 0: Auto-Detect Database Environment

0a. Detect Database and ORM

Signal Technology
@supabase/supabase-js in package.json Supabase (Postgres)
prisma in devDependencies, prisma/schema.prisma Prisma ORM
drizzle-orm in dependencies, drizzle/ directory Drizzle ORM
sequelize in dependencies Sequelize ORM
sqlalchemy in requirements SQLAlchemy (Python)
supabase/migrations/*.sql directory Supabase migrations
prisma/migrations/ directory Prisma migrations
drizzle/migrations/ or drizzle/*.sql Drizzle migrations

Read the full file on GitHub · 475 lines

Files

What ships with it

1 file 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. yesterday First seen · 475 lines · 66 tokens per session scan A b07350c2cc2d

Subscribe to this mod's changes

audit-db-schema is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 7d ago), licensed MIT. It adds 66 tokens to every session and 4,098 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

firebase-cloud-firestore

Use when setting up Firestore, designing schemas, doing CRUD, creating listeners, paginating queries, configuring indexes, enabling offline persistence, or writing security rules.

evanca/flutter-ai-rules · 37 tokens

firebase-database

Use when syncing real-time data, structuring JSON trees, reading/writing, creating listeners, enabling offline persistence, managing presence, sharding, or writing security rules.

evanca/flutter-ai-rules · 38 tokens

firebase-data-connect

Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.

evanca/flutter-ai-rules · 31 tokens

055-design-parallel-change

Use when a database schema or data-meaning change needs Parallel Change, including expand, migrate, and contract sequencing for column renames, type or data reinterpretation, large-table backfills, relationship-table changes, enum/status transitions, timezone/default changes, and index or uniqueness changes. This…

jabrena/plinth · 94 tokens

705-technologies-nosql-mongodb

Use when you need framework-agnostic MongoDB and non-relational database query guidance — document schema design, collection modeling, JSON Schema validation, indexes, aggregation pipelines, query performance, consistency trade-offs, transactions, and operational safety — without choosing Spring Boot, Quarkus, or…

jabrena/plinth · 116 tokens

311-frameworks-spring-jdbc

Use when you need to write or review programmatic JDBC with Spring — including JdbcClient (Spring Framework 7+) as the default API, JdbcTemplate only where batch/streaming APIs require JdbcOperations, NamedParameterJdbcTemplate for legacy named-param code, parameterized SQL, RowMapper mapping to records, batch…

jabrena/plinth · 173 tokens