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 skills add prisma/orm --skill psl-ast-layersgit 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/psl-ast-layers)<a href="https://agentmods.dev/skills/prisma/orm/psl-ast-layers"><img src="https://agentmods.dev/badge/skills/prisma/orm/psl-ast-layers/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.
<a href="https://agentmods.dev/skills/prisma/orm/psl-ast-layers"><img src="https://agentmods.dev/badge/skills/prisma/orm/psl-ast-layers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Snyk pass
- NVIDIA SkillSpector pass
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.1 | $0.00078 | $0.02163 |
| Opus 5.5 | $0.00031 | $0.00865 |
| Sonnet 5.5 | $0.00016 | $0.00433 |
| Haiku 4.5 | $0.00008 | $0.00216 |
Grade A, and why
psl-ast-layers 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 1mo 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- psl-ast-layers — 91% identical, 4 lines differ
How it starts
The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PSL AST Layers
The PSL parser (packages/1-framework/2-authoring/psl-parser) produces a three-layer syntax tree. Each layer has exactly one job — pick the right one and the code stays lossless, typed, and cheap.
| Layer | Types | Job | Use in consumer code? |
|---|---|---|---|
| Green tree | GreenNode, GreenToken (syntax/green.ts) |
Immutable, position-independent storage. Foundation only. | Never |
| Red tree | SyntaxNode, SyntaxToken (syntax/red.ts, syntax/navigation.ts) |
Navigation with offsets and parents: findAncestor(), tokenAtOffset(), nextToken/prevToken, nonTriviaSibling() |
Navigation outside the current node |
| Typed AST | ModelDeclarationAst, FieldDeclarationAst, … (syntax/ast/) |
Structural information about a known node via getters (name(), fields(), lbrace(), value()) |
Default choice |
Everything is exported from @internal/psl-parser/syntax. parse(source) returns { document: DocumentAst, diagnostics, sourceFile } — you start in the typed layer.
Choosing a layer
-
You know what the node is (you hold a
ModelDeclarationAst, aFieldAttributeAst, …) and want its parts → call the typed getters. Never dig through children yourself. -
You need to move outward or sideways (find the enclosing model, the previous declaration, the token after the cursor) → use the red tree's navigation helpers, then immediately re-enter the typed layer with a static
cast:// enclosing model (tests the node itself first, then walks ancestors) const model = node.syntax.findAncestor(ModelDeclarationAst.cast); // enclosing model OR composite type — combine casts with any(…) const owner = node.syntax.findAncestor( any(ModelDeclarationAst.cast, CompositeTypeDeclarationAst.cast), );Sideways and token-level movement all have dedicated helpers — do not hand-roll the walks:
nextSiblingOrToken/prevSiblingOrToken— adjacent element within the same parent (works from both nodes and tokens)token.nextToken/token.prevToken— document order, crossing node boundariesnonTriviaSibling(element, 'next' | 'prev'),skipTriviaToken(token, direction),isTrivia(token)(fromsyntax/navigation.ts) — trivia-aware movement; never write your own whitespace/comment-skipping loop
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.
- 1mo ago First seen · 153 lines · 78 tokens per session scan A 883290244d66
psl-ast-layers is a skill published in the GitHub repository prisma/orm (47,697 stars, last pushed today), licensed Apache-2.0. It adds 78 tokens to every session and 2,163 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-09-03.
Other skills, from other repositories
prisma-orm
Use when modeling data or writing type-safe queries with Prisma ORM in TypeScript — schema.prisma, prisma.config.ts, the generated Prisma Client, and Prisma Migrate, including the v6 to v7 upgrade. NOT schema-as-TS with a SQL builder (that is drizzle-orm), NOT ORM-agnostic zero-downtime migration (that is…
adding-personhog-rpc
Guide for adding a new RPC to personhog-replica and personhog-router. Covers eligibility checks, proto definition, code generation for Python and Node.js clients, Rust implementation (storage trait, postgres queries, service handler, router wiring), and index compatibility validation. Use when adding a new gRPC…
typescript-expert
Expert-level TypeScript development with modern tooling, advanced types, and best practices. Use this skill for TypeScript projects requiring type-safe code, modern bundling, and comprehensive testing.
using-prisma
Prisma 5+ ORM with schema-first design, type-safe client, migrations, and database integrations (Supabase, PlanetScale, Neon). Use for TypeScript/JavaScript database access.
api-first
Maintain the OpenAPI contract in docs, regenerate TypeScript types into src/generated/api, and wire client/server imports without hand-editing generated files.
javascript-typescript
Modern JavaScript and TypeScript development patterns.