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 PostgreSQL. It examines generated-SQL risks, joins, transactions, projections, pagination, and index effects.

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/github.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/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.

agentmods 80×15 button for sql-review-orm-query

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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.5 $0.00025 $0.00569
Sonnet 5.5 $0.00013 $0.00285
Haiku 4.5 $0.00006 $0.00142

Measured 2mo ago against content hash 7b7c99a376b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 2mo 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. 2mo 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 5mo ago), licensed MIT. It adds 63 tokens to every session and 1,423 once invoked, about $0.0003 per session on Opus 5.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

triage-contributor-pr

Triage open pull requests from external contributors to prisma/orm 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…

prisma/orm · 131 tokens

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.

prisma/orm · 38 tokens

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.

prisma/orm · 52 tokens

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-direction

Judges feature requests, feature pull requests and your own proposals against a repository's written product direction, gives a cited verdict, and records each new no. Use when triaging, labelling or replying to a feature request or a feature pull request, including as an autonomous triage agent; when asked whether a…

prisma/orm · 145 tokens