review-database

review-database is a skill for Claude Code, Codex from paultyng/skill-issue. It costs 62 tokens per session (1,939 once invoked), scanned B, original, MIT.

A process for reviewing databases and SQL, including migrations, queries, connections, transactions, and schema design. A migration is a controlled change to a database’s structure or data.

In plain words
What is it for?
Use it to review PostgreSQL or MySQL code, SQL files, migrations, database packages, or changes in a pull request.
Why use it?
It helps identify unsafe schema changes, slow queries, connection or transaction mistakes, and design problems before they affect users or production data.

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/paultyng/skill-issue/review-database
Any agent
npx skills add paultyng/skill-issue --skill review-database
Clone the repo
git clone --depth 1 https://github.com/paultyng/skill-issue

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 review-database

README.md
[![agentmods](https://agentmods.dev/badge/skills/paultyng/skill-issue/review-database.svg)](https://agentmods.dev/skills/paultyng/skill-issue/review-database)
Your own site
<a href="https://agentmods.dev/skills/paultyng/skill-issue/review-database"><img src="https://agentmods.dev/badge/skills/paultyng/skill-issue/review-database.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,939 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00062 $0.01939
Opus 5 $0.00031 $0.00970
Sonnet 5 $0.00012 $0.00388
Haiku 4.5 $0.00006 $0.00194

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

Security

Grade B, and why

review-database scanned grade B with 1 finding 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.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Findings must cite probed evidence (`path:line`, grep output, command result), not pattern-matched suspicion. Per `~/.claude/rules/probe-not-assume.md`.
skills/review-database/SKILL.md · 132 lines

How it starts

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

Database & SQL Review

Structured database review producing actionable, prioritized findings with code-level references.

Workflow

1. Scope and explore

  • Confirm scope with the user: full codebase, specific packages/directories, specific migrations, changed files only (PR or branch diff), or specific concern.
  • Resolve scope to a file/package list. Based on what the user requested:
    • Changed files (PR or branch): Run git diff --name-only --diff-filter=d <base>...HEAD to get changed files (default <base> is main). If the user references a PR number, use gh pr diff <number> --name-only instead. Filter to relevant file types (.go, .sql). Derive affected Go packages from the file paths (unique parent directories containing .go files).
    • Explicit paths/packages: The user may specify directories (e.g. internal/store/), Go package patterns (e.g. ./internal/store/...), individual files, or specific migration files. When given a directory or package pattern, include all files under it.
    • Full codebase: No filtering. Explore everything (default).
  • Pass the resolved scope (file list) to all exploration and investigation subagents so they only read and analyze scoped files.
  • Explore the scoped code using parallel subagents (subagent_type="explore"). Read all in-scope .sql files, schema definitions, and source files that interact with the database (queries, connection setup, transaction handling).

2. Launch investigation subagent

Launch a single investigation subagent (subagent_type="generalPurpose", model: sonnet per subagent-model-routing) with the list of in-scope files.

Prompt it to:

  • Read all in-scope .sql files, schema definitions, and source files that interact with the database.
  • Detect which database engine is in use by checking imports (pgx, pq, lib/pq for PostgreSQL; go-sql-driver/mysql for MySQL), migration tool configs, and connection strings. Apply the appropriate engine-specific checklist from reference.md.
  • Analyze against all database categories: migration safety, query performance, connection & transaction management, and schema design (see reference.md).
  • Detect if horizontal sharding is in use (VSchema files, Citus distribution config, Spanner interleaved tables, shard-routing middleware, or multi-column partition keys). If detected, analyze hot-path queries against the checklist in reference-sharding.md: flag scatter queries, missing sharding keys in WHERE clauses, cross-shard JOINs, and cross-shard transactions.
  • For PostgreSQL projects: check if npx is on PATH (which npx). If available, run npx squawk-cli <migration_files> against in-scope .sql migration files only (when scope is narrowed, limit to .sql files in the resolved file list). If npx is not available, check for squawk directly on PATH. If neither is available, note in Tool Availability and continue with manual review only.
  • Include a Tool Availability section listing each tool's status (ran / skipped + reason).
  • For each finding, search nearby code and project documentation for existing TODOs or notes.
  • Return findings using the per-category findings template with DB- prefixed IDs (e.g. DB1, DB2).
  • Every finding must include specific file paths, line numbers or function names, a severity rating (CRITICAL / HIGH / MEDIUM / LOW), and tracking status.

Read the full file on GitHub · 132 lines

Files

What ships with it

2 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 · 132 lines · 62 tokens per session scan B adc54362d2bb

Subscribe to this mod's changes

review-database is a skill published in the GitHub repository paultyng/skill-issue (9 stars, last pushed 23d ago), licensed MIT. It adds 62 tokens to every session and 1,939 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

postgresql

PostgreSQL schema design, query optimization, indexing, and administration. Use when working with PostgreSQL, JSONB, partitioning, RLS, CTEs, window functions, or EXPLAIN ANALYZE.

iliaal/ai-skills · 48 tokens

postgresql

PostgreSQL schema design, query optimization, indexing, and administration. Use when writing schemas, queries, migrations, or mentions PostgreSQL, Postgres, JSONB, partitioning, RLS, CTEs, window functions, EXPLAIN ANALYZE, or connection pooling.

iliaal/whetstone · 61 tokens

factory-data-layer

Database schema, ORM, and migration conventions across builds. Drizzle as default with domain-partitioned schema modules, shared timestamps helper, multi-tenancy keys with cascade delete, pgTableCreator prefixing, JSONB for flexible attributes, schema-derived type exports, polymorphic table patterns, ESLint Drizzle…

nonlinear-xyz/factory-kit · 84 tokens

sql-expert

Expert SQL & relational databases: queries, schema design, indexing, query-plan optimization, and transactions (Postgres/MySQL/SQLite). Trigger keywords: SQL, database, Postgres, MySQL, SQLite, JOIN, index, EXPLAIN, query plan, slow query, N+1, normalization, transaction, isolation, deadlock, migration. Use for…

Miaoge-Ge/coding-agent-skills · 93 tokens

bitrix-postgresql

Covers PostgreSQL support in Bitrix — PgsqlConnection, migration from MySQL, compatible code, module support matrix. Applied when configuring or migrating to PostgreSQL Enterprise editions. Key terms — PostgreSQL, PgsqlConnection, migration, compatible-code.

bxmaximum/bitrix-framework-skills · 56 tokens

sql_mastery

CREATE OR REPLACE PROCEDURE sprefreshattributiondaily() LANGUAGE plpgsql AS $$ BEGIN -- 1. Truncate Staging TRUNCATE TABLE stgdailytraffic.

MidOSresearch/midos · 0 tokens