[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EVGHWEV66APNVC2H5MHRZX":3,"skill-same:01M7EVGHWEV66APNVC2H5MHRZX":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EVGHWEV66APNVC2H5MHRZX","prisma-pro-dev",null,"Prisma ORM guidance — schema design, migrations, query optimization, relations, and production operations.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-prisma-pro-dev\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: prisma-pro-dev\ndescription: Prisma ORM guidance — schema design, migrations, query optimization, relations, and production operations.\ncategory: development\n---\n\n## Overview\n\nPrisma is a next-generation ORM for Node.js and TypeScript: you declare models in a human-readable schema file, and Prisma generates a fully typed client. The schema becomes the single source of truth for your data model, and the generated client makes invalid queries a compile error rather than a runtime surprise.\n\nThe tradeoffs are real: the schema DSL adds a layer between you and SQL, migrations need care on large tables, and the client hides query behavior you must still understand. This skill covers using Prisma well — schema design, the migration workflow, relation loading without N+1s, and production operations.\n\n## When to use\n\n- Starting a new TypeScript project and choosing an ORM.\n- Designing a Prisma schema (models, relations, indexes).\n- Running migrations safely (dev workflow, production deploys).\n- Fixing slow queries or N+1 problems in Prisma code.\n- Modeling complex relations (many-to-many, self-relations, polymorphic patterns).\n- Configuring Prisma for serverless or edge runtimes.\n- Debugging Prisma Client errors and migration drift.\n\n## Core concepts\n\n- **Schema as source of truth.** `schema.prisma` declares models, relations, indexes, and the datasource. The generated client mirrors it exactly — change the schema, regenerate, and TypeScript tells you what broke.\n- **Migrations are versioned SQL.** `prisma migrate dev` generates SQL migrations from schema diffs; `prisma migrate deploy` applies them in production. Never edit a migration that's been applied anywhere; always add a new one.\n- **`include` vs `select`.** `include` loads relations (watch for over-fetching), `select` picks scalar fields. Combine them to fetch exactly what's needed — returning whole object graphs by default is how APIs get slow.\n- **N+1 still applies.** Prisma batches some relation loads, but nested `include` chains and loops over queries still produce N+1 patterns. Inspect generated SQL with logging or the Prisma Studio\u002Fquery insights before assuming efficiency.\n- **Relation modes and referential actions.** `onDelete: Cascade` \u002F `SetNull` \u002F `Restrict` encode lifecycle rules in the schema. Choose deliberately — cascading deletes are convenient until they delete the wrong thing.\n- **Indexes belong in the schema.** `@@index`, `@@unique`, and `@@fulltext` map to real database indexes. Add them for every foreign key you filter\u002Fjoin on and every `where`\u002F`orderBy` pattern in hot queries.\n- **Transactions.** `prisma.$transaction([...])` for interactive transactions; keep them short, touch rows in consistent order to avoid deadlocks, and never put network calls inside.\n- **Raw SQL escape hatch.** `queryRaw` \u002F `executeRaw` for what the fluent API can't express (complex aggregations, CTEs, window functions). Use typed variants so results stay type-safe.\n- **Connection pooling.** Prisma manages its own pool; in serverless, connections explode without an external pooler (PgBouncer) or Prisma Accelerate. Set `connection_limit` deliberately.\n- **Multi-schema and multi-database.** Prisma supports multiple schemas and databases with separate clients or datasource blocks — know the setup before committing to a topology.\n- **Middleware and extensions.** Client extensions (`prisma.$extends`) for soft deletes, computed fields, and query logging — cleaner than scattering logic across call sites.\n- **Seeding.** `prisma\u002Fseed.ts` with idempotent seeds for dev\u002Fstaging; never seed production with destructive scripts.\n- **Introspection.** `prisma db pull` reverse-engineers an existing database into a schema — the pragmatic start for brownfield projects.\n- **Prisma Studio.** A GUI for browsing data during development. Useful for inspection; never a substitute for proper admin tooling or migrations.\n\n## Practical workflow\n\n1. **Design the schema first.** Model entities and relations on paper; encode referential actions, indexes, and uniqueness in the schema from the start.\n   ```prisma\n   model Order {\n     id        String   @id @default(cuid())\n     status    OrderStatus @default(PENDING)\n     total     Decimal  @db.Decimal(10, 2)\n     items     OrderItem[]\n     createdAt DateTime @default(now())\n     @@index([status, createdAt])\n   }\n   ```\n2. **Migrate in dev, deploy in prod.** `prisma migrate dev --name add_orders` locally; review the generated SQL; in CI\u002FCD run `prisma migrate deploy` as a separate release step — never from the app boot path.\n   - For large tables: expand-contract migrations (add nullable → backfill → add constraint) to avoid long locks.\n3. **Generate and use the typed client.** One shared `PrismaClient` instance (singleton in dev to survive hot reload); import types from the generated client for DTOs.\n4. **Shape every query.** Default to `select` for scalars + `include` only for needed relations; paginate with cursor-based pagination for feeds.\n   ```ts\n   const orders = await prisma.order.findMany({\n     where: { status: \"PAID\" },\n     select: { id: true, total: true, createdAt: true, items: { select: { sku: true, qty: true } } },\n     orderBy: { createdAt: \"desc\" },\n     take: 20,\n   });\n   ```\n5. **Wrap multi-write operations in transactions.** Keep them short and ordered; handle serialization failures with retry at the call site.\n   ```ts\n   await prisma.$transaction(async (tx) => {\n     const order = await tx.order.create({ data: {...} });\n     await tx.inventory.updateMany({ where: {...}, data: { reserved: { increment: 1 } } });\n   });\n   ```\n6. **Add client extensions for cross-cutting logic.** Soft-delete filters, audit fields, and query timing in one place instead of repeated inline code.\n7. **Configure for your runtime.** Serverless: external pooler or Accelerate, `connection_limit=1` per instance; long-lived servers: tune pool size to workload; always set statement timeouts.\n8. **Observe.** Enable query logging in dev; in production track slow queries via the database (pg_stat_statements), not the ORM — the DB sees the truth.\n\n## Common pitfalls\n\n- **N+1 via nested includes** — deep `include` chains generating dozens of queries; inspect SQL and restructure.\n- **Editing applied migrations** — corrupts every environment's migration history; always create a new migration.\n- **Running `migrate dev` in production** — it can reset the database; `deploy` is the only prod-safe command.\n- **Connection exhaustion in serverless** — each instance opening its own pool; use PgBouncer or Accelerate.\n- **Missing indexes on foreign keys** — Prisma doesn't add them automatically; declare `@@index` for join\u002Ffilter columns.\n- **Cascading deletes by default** — convenient in dev, catastrophic with real data; choose referential actions per relation.\n- **Long interactive transactions** — holding locks across awaits and network calls; keep transactions short and ordered.\n- **Returning full models from APIs** — leaking internal fields and over-fetching; project with `select` at the boundary.\n- **Multiple PrismaClient instances** — hot-reload creating clients until the pool exhausts; singleton pattern in dev.\n- **Drift between schema and database** — manual DB changes bypassing migrations; `prisma migrate diff` to detect and reconcile.\n- **No statement timeouts** — one bad query holding connections; set timeouts at the database level.\n- **Seeding production destructively** — seed scripts that truncate; make seeds idempotent and environment-gated.\n","## Overview\n\nPrisma is a next-generation ORM for Node.js and TypeScript: you declare models in a human-readable schema file, and Prisma generates a fully typed client. The schema becomes the single source of truth for your data model, and the generated client makes invalid queries a compile error rather than a runtime surprise.\n\nThe tradeoffs are real: the schema DSL adds a layer between you and SQL, migrations need care on large tables, and the client hides query behavior you must still understand. This skill covers using Prisma well — schema design, the migration workflow, relation loading without N+1s, and production operations.\n\n## When to use\n\n- Starting a new TypeScript project and choosing an ORM.\n- Designing a Prisma schema (models, relations, indexes).\n- Running migrations safely (dev workflow, production deploys).\n- Fixing slow queries or N+1 problems in Prisma code.\n- Modeling complex relations (many-to-many, self-relations, polymorphic patterns).\n- Configuring Prisma for serverless or edge runtimes.\n- Debugging Prisma Client errors and migration drift.\n\n## Core concepts\n\n- **Schema as source of truth.** `schema.prisma` declares models, relations, indexes, and the datasource. The generated client mirrors it exactly — change the schema, regenerate, and TypeScript tells you what broke.\n- **Migrations are versioned SQL.** `prisma migrate dev` generates SQL migrations from schema diffs; `prisma migrate deploy` applies them in production. Never edit a migration that's been applied anywhere; always add a new one.\n- **`include` vs `select`.** `include` loads relations (watch for over-fetching), `select` picks scalar fields. Combine them to fetch exactly what's needed — returning whole object graphs by default is how APIs get slow.\n- **N+1 still applies.** Prisma batches some relation loads, but nested `include` chains and loops over queries still produce N+1 patterns. Inspect generated SQL with logging or the Prisma Studio\u002Fquery insights before assuming efficiency.\n- **Relation modes and referential actions.** `onDelete: Cascade` \u002F `SetNull` \u002F `Restrict` encode lifecycle rules in the schema. Choose deliberately — cascading deletes are convenient until they delete the wrong thing.\n- **Indexes belong in the schema.** `@@index`, `@@unique`, and `@@fulltext` map to real database indexes. Add them for every foreign key you filter\u002Fjoin on and every `where`\u002F`orderBy` pattern in hot queries.\n- **Transactions.** `prisma.$transaction([...])` for interactive transactions; keep them short, touch rows in consistent order to avoid deadlocks, and never put network calls inside.\n- **Raw SQL escape hatch.** `queryRaw` \u002F `executeRaw` for what the fluent API can't express (complex aggregations, CTEs, window functions). Use typed variants so results stay type-safe.\n- **Connection pooling.** Prisma manages its own pool; in serverless, connections explode without an external pooler (PgBouncer) or Prisma Accelerate. Set `connection_limit` deliberately.\n- **Multi-schema and multi-database.** Prisma supports multiple schemas and databases with separate clients or datasource blocks — know the setup before committing to a topology.\n- **Middleware and extensions.** Client extensions (`prisma.$extends`) for soft deletes, computed fields, and query logging — cleaner than scattering logic across call sites.\n- **Seeding.** `prisma\u002Fseed.ts` with idempotent seeds for dev\u002Fstaging; never seed production with destructive scripts.\n- **Introspection.** `prisma db pull` reverse-engineers an existing database into a schema — the pragmatic start for brownfield projects.\n- **Prisma Studio.** A GUI for browsing data during development. Useful for inspection; never a substitute for proper admin tooling or migrations.\n\n## Practical workflow\n\n1. **Design the schema first.** Model entities and relations on paper; encode referential actions, indexes, and uniqueness in the schema from the start.\n   ```prisma\n   model Order {\n     id        String   @id @default(cuid())\n     status    OrderStatus @default(PENDING)\n     total     Decimal  @db.Decimal(10, 2)\n     items     OrderItem[]\n     createdAt DateTime @default(now())\n     @@index([status, createdAt])\n   }\n   ```\n2. **Migrate in dev, deploy in prod.** `prisma migrate dev --name add_orders` locally; review the generated SQL; in CI\u002FCD run `prisma migrate deploy` as a separate release step — never from the app boot path.\n   - For large tables: expand-contract migrations (add nullable → backfill → add constraint) to avoid long locks.\n3. **Generate and use the typed client.** One shared `PrismaClient` instance (singleton in dev to survive hot reload); import types from the generated client for DTOs.\n4. **Shape every query.** Default to `select` for scalars + `include` only for needed relations; paginate with cursor-based pagination for feeds.\n   ```ts\n   const orders = await prisma.order.findMany({\n     where: { status: \"PAID\" },\n     select: { id: true, total: true, createdAt: true, items: { select: { sku: true, qty: true } } },\n     orderBy: { createdAt: \"desc\" },\n     take: 20,\n   });\n   ```\n5. **Wrap multi-write operations in transactions.** Keep them short and ordered; handle serialization failures with retry at the call site.\n   ```ts\n   await prisma.$transaction(async (tx) => {\n     const order = await tx.order.create({ data: {...} });\n     await tx.inventory.updateMany({ where: {...}, data: { reserved: { increment: 1 } } });\n   });\n   ```\n6. **Add client extensions for cross-cutting logic.** Soft-delete filters, audit fields, and query timing in one place instead of repeated inline code.\n7. **Configure for your runtime.** Serverless: external pooler or Accelerate, `connection_limit=1` per instance; long-lived servers: tune pool size to workload; always set statement timeouts.\n8. **Observe.** Enable query logging in dev; in production track slow queries via the database (pg_stat_statements), not the ORM — the DB sees the truth.\n\n## Common pitfalls\n\n- **N+1 via nested includes** — deep `include` chains generating dozens of queries; inspect SQL and restructure.\n- **Editing applied migrations** — corrupts every environment's migration history; always create a new migration.\n- **Running `migrate dev` in production** — it can reset the database; `deploy` is the only prod-safe command.\n- **Connection exhaustion in serverless** — each instance opening its own pool; use PgBouncer or Accelerate.\n- **Missing indexes on foreign keys** — Prisma doesn't add them automatically; declare `@@index` for join\u002Ffilter columns.\n- **Cascading deletes by default** — convenient in dev, catastrophic with real data; choose referential actions per relation.\n- **Long interactive transactions** — holding locks across awaits and network calls; keep transactions short and ordered.\n- **Returning full models from APIs** — leaking internal fields and over-fetching; project with `select` at the boundary.\n- **Multiple PrismaClient instances** — hot-reload creating clients until the pool exhausts; singleton pattern in dev.\n- **Drift between schema and database** — manual DB changes bypassing migrations; `prisma migrate diff` to detect and reconcile.\n- **No statement timeouts** — one bad query holding connections; set timeouts at the database level.\n- **Seeding production destructively** — seed scripts that truncate; make seeds idempotent and environment-gated.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-prisma-pro-dev",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill prisma-pro-dev",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill prisma-pro-dev",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill prisma-pro-dev","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-prisma-pro-dev\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]