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.
npx skills add mickeyyaya/refactoring-skills --skill database-review-patternsgit clone --depth 1 https://github.com/mickeyyaya/refactoring-skillsWrote 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.
[](https://agentmods.dev/skills/mickeyyaya/refactoring-skills/database-review-patterns)<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/database-review-patterns"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/database-review-patterns/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.
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/database-review-patterns"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/database-review-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00041 | $0.02634 |
| Opus 5 | $0.00020 | $0.01317 |
| Sonnet 5 | $0.00008 | $0.00527 |
| Haiku 4.5 | $0.00004 | $0.00263 |
Grade A, and why
database-review-patterns 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 296 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Patterns for Code Review
Overview
Database anti-patterns are among the most damaging production defects: invisible in unit tests, appearing only under realistic data volumes, degrading performance non-linearly. This catalog covers patterns identifiable from code alone.
Use alongside performance-anti-patterns (N+1 and unbounded fetching) and security-patterns-code-review (SQL injection).
Quick Reference
| Area | Red Flag | Severity | Fix |
|---|---|---|---|
| N+1 Query | ORM call inside a loop | HIGH | Eager load / JOIN / DataLoader |
| Missing Index | WHERE/ORDER on non-indexed column | HIGH | Add targeted index |
| SELECT * | findAll() without projection |
MEDIUM | Select specific columns |
| Unbounded Query | No LIMIT/pagination | HIGH | Cursor or offset pagination |
| SQL Injection | String interpolation in query | CRITICAL | Parameterized queries |
| Missing Transaction | Multi-step write without BEGIN/COMMIT | HIGH | Wrap in transaction |
| Schema Design | Missing FK, wrong type, excessive NULLs | HIGH | Normalize, add constraints |
| Migration Safety | NOT NULL without default, column drop in use | CRITICAL | Expand-contract migration |
| Connection Pool | New connection per request | HIGH | Module-scoped pool |
| ORM Misuse | Lazy load in loop, .save() on partial entity |
MEDIUM | Explicit eager load / .update() |
| Data Integrity | No constraints, orphaned rows | HIGH | FK constraints, cascades |
| Query Optimization | Leading LIKE wildcard, correlated subquery | MEDIUM | Profile and index |
Area 1: N+1 Query Problem
Red Flags: ORM call inside for/forEach/map; Promise.all(ids.map(id => repo.findOne(id))); relationship accessed in loop without eager loading.
// BEFORE — N+1: one query per order
const orders = await Order.findAll();
for (const order of orders) {
order.customer = await Customer.findByPk(order.customerId);
}
// AFTER — single JOIN
const orders = await Order.findAll({
include: [{ model: Customer, as: 'customer' }],
});
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.
- 8d ago First seen · 296 lines · 41 tokens per session scan A ae2094725fbf
database-review-patterns is a skill published in the GitHub repository mickeyyaya/refactoring-skills (6 stars, last pushed 5mo ago), licensed MIT. It adds 41 tokens to every session and 2,634 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-31.
Other skills, from other repositories
triage-contributor-pr
Triage open pull requests from external contributors to prisma/prisma and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…
review-implement-phase
Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.
review-triage-phase
Produces canonical review actions from fetched review state and renders action markdown. Use when the user wants only triage/action-planning for the review-framework workflow.
no-bare-casts
Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.
review-prs
Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…
migration-review
Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.