Skip to content

Commit b436d39

Browse files
ankur-archclaude
andcommitted
docs(data-modeling): plain language, tested syntax, structured key guidance
Revision per review feedback, with every schema snippet emit-tested against @prisma-next 0.14.0 (PostgreSQL app + MongoDB app): - Rewrite intros in plain language: idea first, blog example second, terms last. Remove all em dashes. The docs-writer skill gains a "Teach in plain language" section codifying this for other PRs. - Fix syntax that the published packages reject: @relation(from:, to:) does not exist (unsupported argument on 0.14.0 and on main, which accepts fields/references/map/onDelete/onUpdate), so all examples use @relation(fields:, references:). Implicit many-to-many and @relation(through:) are also rejected ("use an explicit join model"), so the m:n section now teaches the explicit junction model as the working pattern and names the implicit form as not supported yet. Verified as PASS: composite @@id junctions, @@discriminator/@@base (both layouts, SQL and Mongo), Mongo type blocks (single + list), uuid()/autoincrement defaults. - Fix broken rendering: bare (1:1) / (1:n) / (m:n) were parsed as remark directives and rendered as "(1\n)". Now backticked; verified intact in rendered HTML. - Break dense guidance into scannable subsections with code blocks: natural vs surrogate keys (Country ISO example, User/Product with @unique), surrogate type choice, data type choice (zip/priceCents/ publishedAt examples), and "Which side owns the foreign key" as an assertive checklist. - MongoDB shown explicitly with tab switchers where it differs (primary keys), cross-links to Fundamentals for querying each shape, "Prompt your coding agent" sections, direct link phrasing. - Park the DR-8679 redirect map, commented out, in next.config.mjs under the shared "Prisma Next URL cutover (DR-8687)" block. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 8878659 commit b436d39

5 files changed

Lines changed: 358 additions & 180 deletions

File tree

.claude/skills/docs-writer/SKILL.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,26 @@ Better:
118118
- Use exact product names: Prisma Postgres, Prisma Compute, Prisma Next. Don't shorten "Prisma Postgres" to "the database" or "Prisma Next" to "the ORM" once a page covers more than one product.
119119
- When you tell the reader something is automatic, show the trigger that makes it happen and how to confirm it did. "Compute injects `DATABASE_URL` automatically" needs a follow-up: "Run `prisma compute env` to confirm it's set."
120120
121+
## Teach in plain language
122+
123+
Open every concept with the plain-words version a newcomer can repeat, then a concrete everyday example, and only then the precise terms. Jargon may appear after the reader has the idea, never as the introduction to it.
124+
125+
Weak (jargon-first):
126+
127+
> Data modeling is the step where you describe the shape of your application's data: the entities it works with, the fields each entity carries, and how those entities connect. You author that description as a schema, and it compiles into a versioned contract that your code, migrations, and tooling all read from.
128+
129+
Better (idea first, example second, terms last):
130+
131+
> Data modeling is the process of describing the data your application needs and how that data is connected.
132+
>
133+
> For example, a blog has users, posts, and comments. A user has fields like an email and a name. These models also relate to each other: a user can write many posts, and a post can have many comments.
134+
>
135+
> In Prisma Next, you define this structure in a `contract.prisma` file. This file becomes the shared contract between your application code, database migrations, and developer tools.
136+
137+
The same rule applies inside sections: when a paragraph packs several decisions together, split it into short subsections, one decision each, and show a code block for every option you name. Guidance that lives only in inline code (`Int @id @default(autoincrement())` mid-sentence) belongs in a fenced block with a sentence of its own.
138+
139+
Never lean on internal vocabulary ("runtime family", "lowering", "execution stack") without a one-line plain definition at first use.
140+
121141
## Cut the slop
122142
123143
Delete these on sight. They add length, not clarity.

0 commit comments

Comments
 (0)