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 agentmods add rules/prisma/prisma-next/sql-orm-client-whole-shape-assertionsgit clone --depth 1 https://github.com/prisma/prisma-nextWrote 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/rules/prisma/prisma-next/sql-orm-client-whole-shape-assertions)<a href="https://agentmods.dev/rules/prisma/prisma-next/sql-orm-client-whole-shape-assertions"><img src="https://agentmods.dev/badge/rules/prisma/prisma-next/sql-orm-client-whole-shape-assertions.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.00756 |
| Opus 5 | $0.00000 | $0.00378 |
| Sonnet 5 | $0.00000 | $0.00151 |
| Haiku 4.5 | $0.00000 | $0.00076 |
Grade A, and why
sql-orm-client-whole-shape-assertions 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 today.
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 — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Assert the whole result shape, with explicit projections
In sql-orm-client tests (unit and integration), assert the entire result with toEqual
(or an inline/file snapshot), and pin the projected columns with explicit varargs .select(...)
(.select('id', 'name')) on the root collection and on every included relation. Order
deterministically with a base-table column — .orderBy((c) => c.<baseColumn>.asc()) (typically
id; don't order by a variant table's column unless that path is under test) — so toEqual on
arrays is reliable.
Why
- Partial matchers (
toMatchObject,toHaveProperty/not.toHaveProperty, lone single-fieldtoBe/toEqual) pass silently on wrong shapes — extra fields, a sibling-variant field that should have been dropped, a misspelled key elsewhere. The result's shape is the contract. toEqualon a full model row with noselectcouples every test to the full model field set, so adding one field breaks tests far from the change.select+toEqualis both complete (catches extra/missing/wrong fields in the projected shape) and stable (immune to model growth).
Good
const rows = await db.orm.Account
.select('id', 'name')
.orderBy((a) => a.id.asc())
.include('members', (m) => m.select('id', 'kind', 'role', 'plan').orderBy((u) => u.id.asc()))
.all();
expect(rows).toEqual([
{ id: 1, name: 'Acme', members: [
{ id: 1, kind: 'admin', role: 'superadmin' }, // polymorphic: variant fields surface per row's
{ id: 2, kind: 'regular', plan: 'free' }, // variant — pin them to lock the per-variant shape
] },
{ id: 2, name: 'Empty', members: [] },
]);
Notes
- Implicit-default-projection tests are the deliberate exception: a test whose explicit purpose
is to verify the default projection (no
.select(...)) should assert the full default row shape withtoEqual; name it as such. Everywhere else,toEqualon a full row with noselectis the brittleness this rule warns against. - Snapshots (
toMatchInlineSnapshot) are an acceptable alternative to a hand-writtentoEqual, but still pair them with explicitselectso the snapshot is stable. - Asserting a single scalar (a count, a thrown error code, a boolean) with
toBe/expect().rejectsis fine and expected. - Relationship to
prefer-object-matcher.mdc: this is the stricter, sql-orm-client specialization of that rule for query results — assert the result row completely withtoEqual+selectrather than partially.toMatchObjectstays fine for the non-result, constructed-object casesprefer-object-matchertargets.
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.
- today First seen · 57 lines · 0 tokens per session scan A b2a3d74547f6
sql-orm-client-whole-shape-assertions is a cursor rule published in the GitHub repository prisma/prisma-next (419 stars, last pushed 9d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 756 tokens. 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-09-03.
Other cursor rules, from other repositories
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.
import-validation
Import validation and package layering rules.
no-target-branches
Never branch on target - use adapters instead.