directory-layout

directory-layout is a cursor rule for Cursor from prisma/orm. It costs 0 tokens per session (903 once invoked), scanned A, original, Apache-2.0.

A fixed folder structure that uses numbered names to show software domains, layers, and dependency direction. A domain is a broad area such as SQL, while a layer is a level of responsibility within it.

In plain words
What is it for?
Use it when adding packages, deciding where files belong, or checking whether one part of a codebase may depend on another.
Why use it?
It makes large repositories easier to navigate and helps prevent code from depending on the wrong part of the system.

Cursor rule for Cursor ✓ vendor

Written for Cursor: a Cursor rule (.mdc). Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when adding packages, deciding where files belong, or checking whether one part of a codebase may depend on another.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/prisma/orm/directory-layout
About the project

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.

prisma/orm · 47,810 stars · on GitHub · prisma.io

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.

Clone the repo
git clone --depth 1 https://github.com/prisma/orm

Made for: Cursor.

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 directory-layout

README.md
[![agentmods](https://agentmods.dev/badge/rules/prisma/orm/directory-layout/github.svg)](https://agentmods.dev/rules/prisma/orm/directory-layout)
Your own site
<a href="https://agentmods.dev/rules/prisma/orm/directory-layout"><img src="https://agentmods.dev/badge/rules/prisma/orm/directory-layout/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 directory-layout

Your own site · 80×15
<a href="https://agentmods.dev/rules/prisma/orm/directory-layout"><img src="https://agentmods.dev/badge/rules/prisma/orm/directory-layout.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 903 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.00000 $0.00903
Opus 5.5 $0.00000 $0.00361
Sonnet 5.5 $0.00000 $0.00181
Haiku 4.5 $0.00000 $0.00090

Measured 11d ago against content hash 54a8544def6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

directory-layout 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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/rules/directory-layout.mdc · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Directory Layout — Numbered Prefixes, Domains, Layers, and Planes

Numbered prefixes in directory names show dependency direction: a lower number may be imported by a higher one, never the reverse.

Directory Structure

packages/
  1-framework/           # Domain 1: Framework (target-agnostic)
    0-foundation/  1-core/  2-authoring/  3-tooling/
  2-sql-family/          # Domain 2: SQL family
    1-core/  2-authoring/  3-tooling/  4-lanes/  5-runtime/  9-family/
  2-mongo-family/        # Domain 2: Mongo family
  3-targets/             # Domain 3: Targets, one folder per database
    postgres/
      1-target/          # @internal/target-postgres
      2-adapter/         # @internal/adapter-postgres
      3-driver/          # @internal/driver-postgres
      4-codec-testkit/   # @internal/postgres-codec-testkit
      9-facade/          # @internal/postgres
    sqlite/  mongo/      # the same shape
    mysql/
      1-mysql/           # MySQL: 1-target, 2-adapter, 3-driver, 9-facade
      2-mariadb/         # MariaDB: 1-target, 2-adapter, 3-driver, 9-facade (ADR 325)
      3-live-tests/      # @internal/mysql-live-tests: ORM suites run against both servers
  3-extensions/          # Domain 3: Extension packs
    pgvector/

Planes (shared, migration, runtime) are not directories. architecture.config.json assigns them per file glob.

Families vs Targets

  • Family code (packages/2-<family>-family/**): contract types, operations, emitter hooks, lanes, family runtime. It never names a concrete database.
  • Target code (packages/3-targets/<db>/**): everything one database needs. A new database adds one folder with the same numbered packages; a database without a codec testkit skips 4-. See ADR 278.
  • Extension packs (packages/3-extensions/**) stay outside the target folders, including packs that work with only one database.

Registering a target package

Read the full file on GitHub · 56 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. 11d ago Changed · +1 lines 54a8544def6b
  2. 19d ago Changed · +3 lines 6f452b57371e
  3. 1mo ago Changed · -43 lines 72fe25e1cb2e
  4. 3mo ago First seen · 95 lines · 0 tokens per session scan A acf969f71fb8

Subscribe to this mod's changes

directory-layout is a cursor rule published in the GitHub repository prisma/orm (47,810 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 903 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-08-30.

Related

directory-layout compared with cursor rules from other repositories

directory-layout next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
directory-layoutprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prismabernierllc/agents-environment-configCursor rule11yesterdayMITA0Cursor
typescript-stylebobbylkchao/ai-phone-agentCursor rule1105d agoMITA0Cursor
drizzle-patternsopenstory-so/openstoryCursor rule730todayMITA0Cursor
security-archivevltpkg/vltpkgCursor rule5783d agoBSD-2-Clause-PatentA0Cursor
code-validation-workflowvltpkg/vltpkgCursor rule5783d agoBSD-2-Clause-PatentA0Cursor
release-ts-sdkaptos-labs/aptos-ts-sdkCursor rule1184d agononeA42Cursor