database-review
Skill19 starsChanged 6 months agoMITView on GitHub
Reviews database schema changes, migrations, and queries.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- frnkgns/Overgeared-Skillstheir own version, first seen Nov 8, 2026
- pirafrank/skillstheir own version, first seen Oct 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- frnkgns/Overgeared-Skills★ 7same name
- pirafrank/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- ci-fixSkill
- codeql-fixSkill
- debuggingSkill
- frontend-implementationSkill
- git-conflict-resolveSkill
- provider-debugSkill
- pr-reviewSkill
- security-auditSkill
- test-writerSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
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
- Distinctive: line 50
Read the migration. For each statement, ask:
- Distinctive: line 65
Check rolling-deploy compatibility.
- Very specific: line 91
Ask for an EXPLAIN (or EXPLAIN ANALYZE against a copy with realistic data volume) when the query is non-trivial or the table is large.
- Distinctive: line 94
Check for data integrity hazards: missing foreign keys, missing uniqueness constraints, soft-delete columns that queries forget to filter, …
- Distinctive: line 103
Check that the migration runs cleanly on a copy of production- sized data, not just the dev seed.
- Distinctive: line 115
Verify the new column doesn't break old code mid-deploy.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database Review
Review a migration, schema change, or query. The dangerous failures are silent at code-review time and loud at 2 AM — locks held during a deploy, an index that gets bypassed, a constraint that breaks existing rows. Catch them now.
Use this skill when
- The user has a migration file (SQL, Knex, Prisma, Alembic, etc.) they want reviewed before merging.
- The user is changing schema — adding/dropping columns, indexes, constraints, types.
- The user has a slow query and wants help reading the plan.
- The user asks about indexing strategy for an existing query.
- The user wants to know if a deploy is safe under rolling releases.
Do NOT use this skill when
- The user wants to design a brand-new schema from scratch with no constraints. Out of scope; ask for the access patterns and the data shape first.
- The user is troubleshooting an ORM behavior that is not actually
the SQL's fault. Use
debugging. - The user wants help writing CRUD code on top of a schema. Use a coding skill.
Procedure
- Identify the database and version. Postgres 14 differs from 16,
MySQL 5.7 from 8, SQLite from both. Migration safety depends on
what
ALTER TABLEactually does on that engine. - Read the migration. For each statement, ask:
- Lock duration: does this take an ACCESS EXCLUSIVE / table-
level lock that blocks reads or writes? In Postgres,
ALTER TABLE ... ADD COLUMNwith a default rewrites the table on older versions; in newer versions it doesn't, but aNOT NULLconstraint without a default still does. - Index builds: does it use
CONCURRENTLYwhere supported? A blockingCREATE INDEXon a hot table is a deploy outage. - Backfills: does the migration backfill data inline? Large backfills should run outside the migration as a batched job.
- Constraint additions:
NOT NULLandCHECKconstraints scan the table.NOT VALIDthenVALIDATEseparately avoids blocking. - Type changes: column type changes often rewrite the table. Same for dropping a column with a stored value.
- Lock duration: does this take an ACCESS EXCLUSIVE / table-
level lock that blocks reads or writes? In Postgres,
- Check rolling-deploy compatibility. If the application is
deployed in stages, the schema must be compatible with both
the old and new code for the window of the rollout. Common
patterns that break this:
- Renaming a column the old code still selects.
- Adding a
NOT NULLcolumn without a default — old code inserting without the column fails. - Dropping a column the old code still references. The safe shape is two-step: add the new shape compatible with both, deploy the code, then drop the old in a follow-up.
- Review indexes against query patterns. For each new index, name the query that uses it. For each new query, name the index that serves it. An index without a query is overhead; a query without an index over a large table is a sequential scan waiting to happen.
- Review the query itself. Walk through:
- Predicates — do they match an index prefix?
WHERE a = ? AND b = ?with an index on(a)only uses half the index. - JOIN order and types — large × small with the small on the build side, nested-loop vs hash vs merge.
- N+1 patterns — code that iterates a result set issuing a follow-up query per row.
- OFFSET on deep pages — anything past a few hundred rows
should use keyset pagination, not
LIMIT/OFFSET. - Implicit casts —
WHERE int_col = '42'can disable index use on some engines.
- Predicates — do they match an index prefix?
- Ask for an
EXPLAIN(orEXPLAIN ANALYZEagainst a copy with realistic data volume) when the query is non-trivial or the table is large. A plan is worth ten guesses. - Check for data integrity hazards: missing foreign keys, missing uniqueness constraints, soft-delete columns that queries forget to filter, default values that don't match the application's expectations.
- Insist on a reversible migration. Every migration should have a
down(or its equivalent) that brings the schema back to the prior state, or a written note explaining why it cannot be reversed. A migration that ships without a path back is a migration you cannot deploy on a Friday. - Check that the migration runs cleanly on a copy of production- sized data, not just the dev seed. A statement that takes 200ms on 10 rows can take 40 minutes on 10 million.
Examples
In scope: "Add a last_login_at column to users."
→ On Postgres 11+, ADD COLUMN last_login_at timestamptz without
a default is fast (metadata-only). Adding NOT NULL will scan
the table — if users is large, either allow NULL or backfill
in batches and add NOT NULL later as NOT VALID + VALIDATE.
Verify the new column doesn't break old code mid-deploy.
In scope: "This query is slow: SELECT * FROM orders WHERE
status = 'pending' ORDER BY created_at DESC LIMIT 50."
→ Look for an index on (status, created_at DESC). A plain
index on status will still scan and sort. If pending is a
small fraction of rows, a partial index WHERE status =
'pending' is even better and cheaper to maintain.
In scope: "Drop the legacy_id column from products."
→ Two-step. First deploy that removes all reads/writes of
legacy_id from application code. Then a follow-up migration
drops the column. A single-step drop will break any pod still
running the old code during rollout.
Out of scope: "Design a schema for a new SaaS product."
→ Needs a brief and access patterns first. Not a review task.
Self-check before responding
- Did I name the database engine and version?
- For each migration statement, did I evaluate lock duration?
- Did I check rolling-deploy compatibility (old code + new schema, new code + old schema)?
- Did I match every new index to a query, and every slow query to an index plan?
- Did I look for backfills hidden inside the migration?
- Did I ask for an
EXPLAINwhen the query was non-trivial? - Did I check data integrity (FKs, uniqueness, soft-delete filters)?
- Did I avoid generic advice ("add an index") in favor of named indexes against named queries?
- Did I confirm the migration is reversible or note explicitly why not?
- Did I consider production-sized data, not just the dev seed?
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
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.

