sql-review-orm-query

sql-review-orm-query is a skill for Claude Code, Codex from Nikxxx007/agents-skills. It costs 63 tokens per session (1,423 once invoked), scanned A, original, MIT.

A review guide for database queries written through an object-relational mapper, a library that turns code into SQL. It checks likely database behavior in tools such as TypeORM, Prisma, and Knex.

In plain words
What is it for?
Use it to review, debug, or optimize ORM database access, especially with PostgreSQL. It examines generated-SQL risks, joins, transactions, projections, pagination, and index effects.
Why use it?
It helps find performance and correctness problems hidden by ORM code, such as repeated queries, loading too much data, weak pagination, or unsuitable indexes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review, debug, or optimize ORM database access, especially with…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nikxxx007/agents-skills/sql-review-orm-query
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.

Any agent
npx skills add Nikxxx007/agents-skills --skill sql-review-orm-query
Clone the repo
git clone --depth 1 https://github.com/Nikxxx007/agents-skills

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 sql-review-orm-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/nikxxx007/agents-skills/sql-review-orm-query.svg)](https://agentmods.dev/skills/nikxxx007/agents-skills/sql-review-orm-query)
Your own site
<a href="https://agentmods.dev/skills/nikxxx007/agents-skills/sql-review-orm-query"><img src="https://agentmods.dev/badge/skills/nikxxx007/agents-skills/sql-review-orm-query.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,423 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.00063 $0.01423
Opus 5 $0.00032 $0.00711
Sonnet 5 $0.00013 $0.00285
Haiku 4.5 $0.00006 $0.00142

Measured 6d ago against content hash 7b7c99a376b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

sql-review-orm-query 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 6d 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.

skills/sql-review-orm-query/SKILL.md · 259 lines

How it starts

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

SQL Review ORM Query

You are a strict senior backend/database engineer reviewing ORM-based database access code.

Your job is to find database performance and correctness risks hidden behind ORM abstractions.

Do not give generic ORM advice. Tie every issue to a concrete database access problem.

Assume PostgreSQL by default unless the user specifies another database.

Supported ORM scope

Strongest support:

  • TypeORM
  • Prisma
  • Knex

Best-effort support:

  • Sequelize
  • MikroORM
  • GORM
  • sqlc
  • Drizzle
  • Entity Framework
  • Hibernate

If the ORM is unclear, identify likely ORM patterns and state assumptions.

Core principles

  • ORM code must be reviewed based on the SQL it likely produces.
  • Separate correctness from performance.
  • Do not optimize by changing returned data.
  • Do not claim a rewrite is safe without a verification plan.
  • Prefer explicit selected fields over loading whole entities when only a subset is needed.
  • Watch for hidden joins, hidden lazy loading, and N+1 query patterns.
  • If generated SQL is not provided, infer likely SQL carefully and ask the user to capture/log generated SQL for confirmation.
  • If an index is suggested, explain read benefit, write cost, storage cost, migration risk, and verification steps.
  • If raw SQL is more appropriate than ORM for this path, say so directly.

Inputs to look for

Useful context:

  • ORM code
  • ORM name and version
  • generated SQL, if available
  • entity/model definitions
  • table schemas
  • existing indexes
  • relation definitions
  • row counts
  • expected result size
  • query frequency
  • latency target
  • whether this code runs in a request path, background job, or migration
  • transaction boundaries
  • pagination requirements
  • whether returned ordering matters

Do not block the review if some context is missing.

Review checklist

Check for:

  • N+1 queries
  • lazy loading inside loops
  • excessive eager loading
  • unnecessary include / relations
  • loading full entities when only a few fields are needed
  • missing projection / select
  • unbounded findMany, find, findAll
  • missing take / limit
  • large skip / offset
  • application-side filtering
  • application-side sorting
  • application-side grouping
  • relation loading that creates large joins
  • repeated queries that could be batched
  • inefficient nested includes
  • unnecessary hydration of ORM entities
  • heavy queries inside transactions
  • transaction scope too wide
  • missing transaction where consistency is required

Read the full file on GitHub · 259 lines

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. 6d ago First seen · 259 lines · 63 tokens per session scan A 7b7c99a376b7

Subscribe to this mod's changes

sql-review-orm-query is a skill published in the GitHub repository Nikxxx007/agents-skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 63 tokens to every session and 1,423 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-08-31.

Related

Other skills, from other repositories

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…

googleapis/mcp-toolbox · 162 tokens

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.

rohitg00/ai-engineering-from-scratch · 35 tokens

product-review-report

A product-review workflow that researches a product and writes a Markdown report for deciding whether it is worth buying and using. It compares products from both the decision-maker's and everyday user's viewpoints.

digoal/blog · 153 tokens

migration-ready-schema

Data-model rules that make a schema importable from day one, so the migration-import-engineer is never blocked on missing columns. Every SMB Product-Builder product must let a customer bring their data from an incumbent (ServiceTitan/Toast/Mindbody/Shopify) — that requires provenance (sourceref) and rollback…

avelikiy/great_cto · 133 tokens

doris-repo-review

Review an Apache Doris PR from a local clone with the same multi-agent, shared-ledger convergence workflow as the CI Code Review Runner. Use when the user supplies a PR to /doris-repo-review, asks to review a Doris PR locally, or asks for the CI-style review flow. Safely align only the current worktree to the exact PR…

apache/doris-skills · 177 tokens

database-migration-service-expertise

AWS Database Migration Service (DMS) operational review and troubleshooting skill. Conducts best practices validation, health assessments, performance diagnostics, cost optimization reviews, and migration cutover guidance. Triggers on requests like "DMS review", "DMS health check", "DMS troubleshooting", "migration…

aws/tools-for-devops-agent · 99 tokens