Prisma ORM is a Node.js and TypeScript database toolkit that lets applications work with databases through a programming interface instead of writing every query directly in SQL. Developers use it with databases including PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB, and CockroachDB. The catalogue add-ons provide agent rules, skills, hooks, agents, and other workflows for using Prisma.
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 skills/prisma/orm/no-bare-castsnpx skills add prisma/orm --skill no-bare-castsgit clone --depth 1 https://github.com/prisma/ormWrote 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/prisma/orm/no-bare-casts)<a href="https://agentmods.dev/skills/prisma/orm/no-bare-casts"><img src="https://agentmods.dev/badge/skills/prisma/orm/no-bare-casts.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.00052 | $0.00662 |
| Opus 5 | $0.00026 | $0.00331 |
| Sonnet 5 | $0.00010 | $0.00132 |
| Haiku 4.5 | $0.00005 | $0.00066 |
Grade A, and why
no-bare-casts 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 yesterday.
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.
Copies of this mod
1 near-identical copy found in the catalogue:
- no-bare-casts — 100% identical, 2 lines differ
How it starts
The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
No bare as casts
Any bare as in production TypeScript is a signal to stop and work through the decision tree below. Test files (*.test.ts, *.test-d.ts, test/**/*.ts) are exempt — tests use as for stubbing and type assertions and that's fine.
Decision tree
Work through these in order before writing or keeping a cast:
- Tighten the input type. Can the parameter, generic bound, or return type at the source be made more specific so the cast is unnecessary?
- Add a runtime check. Can a type predicate (
function isUser(x): x is User) narrow the type at runtime, eliminating the cast? - Restructure a generic. Can a bound or constraint carry the needed information, making the cast unnecessary?
- Use
satisfies.expr satisfies Tchecks the type without coercing it and is unaffected by this rule. Prefer it when you want a type-check, not a coercion. - Use
castAs<T>(value). When the value already satisfiesTand the assertion is purely declarative,castAsis the right form. - Only if none of the above: use
blindCast<T, "Reason">(value). TheReasonliteral must name the specific compromise in language a reviewer can evaluate.
Import
import { blindCast, castAs } from '@internal/utils/casts';
Helper signatures
// Escape hatch — the value is genuinely opaque or unrelated to the target type.
// The Reason literal documents the compromise; the reviewer evaluates it.
function blindCast<TargetType, Reason extends string>(input: unknown): TargetType
// Declarative assertion — the value already satisfies T at runtime.
function castAs<T>(value: T): T
The Reason bar
blindCast is the auditable escape hatch of last resort — not a convenience wrapper. Reach for it only after the decision tree above has been exhausted. The second type argument must be a string literal that a reviewer can act on:
// ✅ Names the specific constraint
blindCast<User, "deserialized from contract validator; shape has already been checked">(raw)
// ❌ Adds no information — reviewer has nothing to evaluate
blindCast<User, "trust me">(raw)
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.
- yesterday First seen · 58 lines · 52 tokens per session scan A 838dec32cd47
no-bare-casts is a skill published in the GitHub repository prisma/orm (47,601 stars, last pushed 2d ago), licensed Apache-2.0. It adds 52 tokens to every session and 662 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-09-03.
Other skills, from other repositories
ast-visitor-pattern
Use the frozen-class/visitor pattern for discriminated unions that have multiple dispatch sites. Use when creating a new set of variants (commands, IR nodes, factory calls) that will be switched over in 2+ places, or when refactoring an existing union type that has grown multiple switch sites.
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.
lint-all
Lint all code (Rust + JS/TS). Use before opening a PR when Rust code was changed.
lint-js
Lint JS/TS code only. Use before opening a PR when only JavaScript or TypeScript files were changed (no Rust).
type-inference
Use this skill when working on Biome's Salsa-backed JavaScript and TypeScript inference, including type-aware lint rules, raw collection or inferred representations, analyzer requests, tracked queries, import or cycle resolution, profiling, and Salsa invalidation tests. Do not use for standalone CSS/HTML module-graph…
migrate-oxfmt
Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's formatter from Prettier or Biome to Oxfmt.