ORM review reference

Detect ORM-layer correctness and performance anti-patterns in PR diffs.

Updated May 15, 2026
One-click install
npx skills add https://github.com/mattnowdev/super-review --skill orm-review-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ORM review reference
Source: https://github.com/mattnowdev/super-review/tree/main/skills/orm
Command: npx skills add https://github.com/mattnowdev/super-review --skill orm-review-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common ORM mistakes that cause silent data corruption, insecure SQL, and performance regressions during PRs, especially across Prisma, MikroORM, TypeORM, and Drizzle.

Core Features & Use Cases

  • Evidence-first anti-pattern detection: Targets specific ORM smells like N+1 from conditional includes, unsafe raw SQL, and soft-delete bypasses so reviewers can act on concrete issues.
  • Transaction correctness guidance: Flags patterns that accidentally run outside a transaction, such as capturing the outer Prisma client or using Drizzle helpers that close over module-scoped db.
  • Framework-specific ORM safety rules: Covers Prisma 6 breaking changes (Bytes → Uint8Array) and MikroORM identity-map lifecycle issues that can leak memory across requests.

Quick Start

Use the ORM review reference to check a PR that touches Prisma or MikroORM data access and request the reviewer to flag N+1, unsafe raw queries, and transaction boundary mistakes.

Frequently Asked Questions about ORM review reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect ORM N+1 queries and performance traps in a PR review?

To detect ORM N+1 queries during a PR review, analyze code diffs for conditional includes and relational loading anti-patterns. The review matches rule-specific detection signals to code evidence, enforcing safe replacements for performance regressions in Prisma, MikroORM, TypeORM, or Drizzle applications.

What is the best way to prevent unsafe raw SQL injection in Prisma and Drizzle code?

Preventing unsafe raw SQL injection involves flagging raw query execution patterns in PR diffs that bypass parameterization. This review process identifies unsafe raw SQL usage in Prisma and Drizzle, matching code evidence to enforce safe replacements and prevent insecure SQL vulnerabilities.

How do I check if my ORM transactions are running outside their boundaries?

Checking ORM transaction boundaries requires flagging patterns that accidentally run outside a transaction, such as capturing the outer Prisma client or using Drizzle helpers closing over module-scoped db objects. The review identifies these code paths to enforce proper transactional correctness.

Why does my MikroORM application leak memory across server requests?

MikroORM memory leaks across requests often stem from identity-map lifecycle issues. Reviewing PR diffs for entity lifecycle and identity map anti-patterns catches these leaks early, ensuring request-scoped isolation and preventing silent memory accumulation in long-running applications.

Does this ORM review reference work with both Prisma and TypeORM?

This ORM review reference works with Prisma, TypeORM, MikroORM, and Drizzle. It detects framework-specific safety issues, including Prisma 6 breaking changes like Bytes to Uint8Array and TypeORM relational loading anti-patterns, by identifying ORM usage from package.json.

How do I stop soft-delete filters from being bypassed in ORM queries?

Stopping soft-delete filter bypasses requires flagging code paths where soft-delete filtering is accidentally skipped during relational loading. The review targets these ORM smells in PR diffs, providing concrete code evidence so reviewers can enforce safe query replacements.