[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMWCKWDMGP6JWFN1BJ1GVB":3,"skill-same:01M7EMWCKWDMGP6JWFN1BJ1GVB":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},"01M7EMWCKWDMGP6JWFN1BJ1GVB","drizzle-pro",null,"Drizzle ORM guidance — schema-as-code, relational queries, migrations, and SQL-first TypeScript data access.","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-drizzle-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: drizzle-pro\ndescription: Drizzle ORM guidance — schema-as-code, relational queries, migrations, and SQL-first TypeScript data access.\ncategory: development\n---\n\n## Overview\n\nDrizzle is a TypeScript ORM that stays close to SQL: you define tables as code, write queries with a relational query builder that mirrors SQL structure, and get full type safety without a schema DSL or heavy runtime. If Prisma feels like a layer above SQL, Drizzle feels like SQL with types.\n\nThat closeness is the point — and the responsibility. Drizzle won't hide query behavior from you, which means you need to understand joins, indexes, and transactions yourself. This skill covers Drizzle's schema-as-code model, its relational query API, migration workflow, and the SQL-first patterns that make it shine.\n\n## When to use\n\n- Choosing a lightweight, SQL-first TypeScript ORM.\n- Defining Drizzle schemas (tables, relations, indexes).\n- Writing relational queries without N+1 problems.\n- Running Drizzle migrations (drizzle-kit workflow).\n- Using Drizzle with serverless\u002Fedge databases (Neon, PlanetScale, Turso, D1).\n- Dropping to raw SQL for complex queries.\n- Migrating from Prisma\u002FTypeORM to Drizzle.\n\n## Core concepts\n\n- **Schema as TypeScript.** Tables are defined with `pgTable`\u002F`mysqlTable`\u002F`sqliteTable` — plain code, versioned in git, refactorable with your IDE. No DSL to learn, no codegen step for the schema itself.\n- **Two query APIs.** The relational query builder (`db.query.users.findMany({ with: { posts: true } })`) for nested relational reads, and the SQL-like core API (`db.select().from(users).where(...)`) for everything else. Learn both; use each where it fits.\n- **Relations are explicit.** `defineRelations` (or the `relations` helper) declares how tables join; the relational API uses them to build joins for you. Explicit relations mean no magic — and no surprise queries.\n- **Migrations via drizzle-kit.** `drizzle-kit generate` diffs schema code into SQL migrations; `drizzle-kit migrate` applies them. Review generated SQL like any other migration; snapshot-based diffing can surprise on renames.\n- **SQL-first, always.** Every Drizzle query maps predictably to SQL. When the builder can't express something, `sql` template literals drop you to raw SQL with parameterization built in — no string concatenation.\n- **Dialect differences matter.** Postgres, MySQL, and SQLite have different types, index kinds, and capabilities. Drizzle exposes them honestly; write dialect-aware schema code and test against the real database.\n- **Transactions.** `db.transaction(async (tx) => {...})` — same rules as everywhere: short, ordered row access, no network calls inside.\n- **Prepared statements.** Drizzle supports prepared queries for hot paths; use them for repeated queries where parse overhead matters.\n- **Indexes and constraints in code.** `index()`, `uniqueIndex()`, foreign keys with `onDelete` actions — declared alongside the table, migrated with everything else.\n- **Edge\u002Fserverless friendly.** Zero-dependency, tiny bundle, HTTP-based drivers for Neon\u002FPlanetScale\u002FTurso — Drizzle was built for the serverless world where Prisma's engine is heavy.\n- **No magic N+1 hiding.** The relational API generates joins (not per-row queries) for `with` clauses — understand which API you're using and what SQL it emits.\n- **Zod integration.** `drizzle-zod` generates Zod schemas from table definitions — one source of truth for DB schema and API validation.\n- **Seeding.** Plain scripts using the same client; idempotent seeds, environment-gated.\n- **Introspection.** `drizzle-kit pull` reverse-engineers existing databases for brownfield adoption.\n\n## Practical workflow\n\n1. **Define tables as code.** One module per domain; declare columns, indexes, and relations together.\n   ```ts\n   export const orders = pgTable(\"orders\", {\n     id: uuid(\"id\").primaryKey().defaultRandom(),\n     status: text(\"status\").notNull().default(\"pending\"),\n     total: numeric(\"total\", { precision: 10, scale: 2 }).notNull(),\n     createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n   }, (t) => [index(\"orders_status_created_idx\").on(t.status, t.createdAt)]);\n   ```\n2. **Declare relations.** Map the joins once so the relational API can use them everywhere.\n   ```ts\n   export const ordersRelations = defineRelations(orders, (r) => ({\n     items: r.many.orderItems,\n     customer: r.one.customers, { from: r.customerId, to: r.customers.id },\n   }));\n   ```\n3. **Generate and review migrations.** `drizzle-kit generate` then read the SQL — especially renames, which the differ may express as drop\u002Fadd. Fix destructive diffs before applying.\n4. **Query relationally for reads.** `db.query.orders.findMany({ with: { items: true }, where, orderBy, limit })` — nested reads as joins, typed end to end.\n   - For complex reporting, switch to the core API or `sql` — don't fight the relational API into shapes it wasn't built for.\n5. **Use the core API for writes and complex filters.** `db.insert\u002Fupdate\u002Fdelete` with `where` clauses; `onConflictDoUpdate` for upserts; returning clauses to get rows back.\n   ```ts\n   const [order] = await db.insert(orders)\n     .values({ status: \"paid\", total: \"99.99\" })\n     .returning({ id: orders.id });\n   ```\n6. **Wrap multi-step writes in transactions.** Short, ordered, no I\u002FO inside — the universal rules apply.\n7. **Validate at the boundary.** `drizzle-zod` schemas for API input; the DB schema and the API schema stay in sync by construction.\n8. **Test against the real dialect.** SQLite in tests while Postgres runs in prod hides real behavior; use containers (or a cheap hosted branch) for integration tests.\n\n## Common pitfalls\n\n- **Rename expressed as drop\u002Fadd** — the differ can't always tell; review generated SQL and hand-write renames with `sql` when needed.\n- **Using the wrong query API** — forcing reporting queries through the relational API; switch to core\u002F`sql` for aggregations and complex joins.\n- **Missing indexes** — declaring tables without indexes for hot filter\u002Fjoin columns; add them in the table definition.\n- **N+1 in application code** — looping queries instead of one relational fetch; fetch nested data in a single query.\n- **SQLite\u002FPostgres drift** — testing on one dialect, deploying another; type and behavior differences will bite.\n- **Long transactions** — same universal rule: short, ordered, no network calls inside.\n- **Unparameterized `sql`** — interpolating values into `sql` fragments instead of using its parameter binding; that's SQL injection.\n- **No migration review** — auto-applying generated migrations; always read the SQL, especially on existing tables.\n- **Ignoring connection limits** — serverless HTTP drivers vs pooled TCP drivers; pick the driver for your runtime and set limits.\n- **Schema code sprawl** — one giant schema file; split by domain like any other code.\n- **Forgetting `onDelete` actions** — default restrict behavior surprising deletes; declare referential actions explicitly.\n- **Returning full rows from APIs** — select only needed columns; the builder makes projection easy, so use it.\n","## Overview\n\nDrizzle is a TypeScript ORM that stays close to SQL: you define tables as code, write queries with a relational query builder that mirrors SQL structure, and get full type safety without a schema DSL or heavy runtime. If Prisma feels like a layer above SQL, Drizzle feels like SQL with types.\n\nThat closeness is the point — and the responsibility. Drizzle won't hide query behavior from you, which means you need to understand joins, indexes, and transactions yourself. This skill covers Drizzle's schema-as-code model, its relational query API, migration workflow, and the SQL-first patterns that make it shine.\n\n## When to use\n\n- Choosing a lightweight, SQL-first TypeScript ORM.\n- Defining Drizzle schemas (tables, relations, indexes).\n- Writing relational queries without N+1 problems.\n- Running Drizzle migrations (drizzle-kit workflow).\n- Using Drizzle with serverless\u002Fedge databases (Neon, PlanetScale, Turso, D1).\n- Dropping to raw SQL for complex queries.\n- Migrating from Prisma\u002FTypeORM to Drizzle.\n\n## Core concepts\n\n- **Schema as TypeScript.** Tables are defined with `pgTable`\u002F`mysqlTable`\u002F`sqliteTable` — plain code, versioned in git, refactorable with your IDE. No DSL to learn, no codegen step for the schema itself.\n- **Two query APIs.** The relational query builder (`db.query.users.findMany({ with: { posts: true } })`) for nested relational reads, and the SQL-like core API (`db.select().from(users).where(...)`) for everything else. Learn both; use each where it fits.\n- **Relations are explicit.** `defineRelations` (or the `relations` helper) declares how tables join; the relational API uses them to build joins for you. Explicit relations mean no magic — and no surprise queries.\n- **Migrations via drizzle-kit.** `drizzle-kit generate` diffs schema code into SQL migrations; `drizzle-kit migrate` applies them. Review generated SQL like any other migration; snapshot-based diffing can surprise on renames.\n- **SQL-first, always.** Every Drizzle query maps predictably to SQL. When the builder can't express something, `sql` template literals drop you to raw SQL with parameterization built in — no string concatenation.\n- **Dialect differences matter.** Postgres, MySQL, and SQLite have different types, index kinds, and capabilities. Drizzle exposes them honestly; write dialect-aware schema code and test against the real database.\n- **Transactions.** `db.transaction(async (tx) => {...})` — same rules as everywhere: short, ordered row access, no network calls inside.\n- **Prepared statements.** Drizzle supports prepared queries for hot paths; use them for repeated queries where parse overhead matters.\n- **Indexes and constraints in code.** `index()`, `uniqueIndex()`, foreign keys with `onDelete` actions — declared alongside the table, migrated with everything else.\n- **Edge\u002Fserverless friendly.** Zero-dependency, tiny bundle, HTTP-based drivers for Neon\u002FPlanetScale\u002FTurso — Drizzle was built for the serverless world where Prisma's engine is heavy.\n- **No magic N+1 hiding.** The relational API generates joins (not per-row queries) for `with` clauses — understand which API you're using and what SQL it emits.\n- **Zod integration.** `drizzle-zod` generates Zod schemas from table definitions — one source of truth for DB schema and API validation.\n- **Seeding.** Plain scripts using the same client; idempotent seeds, environment-gated.\n- **Introspection.** `drizzle-kit pull` reverse-engineers existing databases for brownfield adoption.\n\n## Practical workflow\n\n1. **Define tables as code.** One module per domain; declare columns, indexes, and relations together.\n   ```ts\n   export const orders = pgTable(\"orders\", {\n     id: uuid(\"id\").primaryKey().defaultRandom(),\n     status: text(\"status\").notNull().default(\"pending\"),\n     total: numeric(\"total\", { precision: 10, scale: 2 }).notNull(),\n     createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n   }, (t) => [index(\"orders_status_created_idx\").on(t.status, t.createdAt)]);\n   ```\n2. **Declare relations.** Map the joins once so the relational API can use them everywhere.\n   ```ts\n   export const ordersRelations = defineRelations(orders, (r) => ({\n     items: r.many.orderItems,\n     customer: r.one.customers, { from: r.customerId, to: r.customers.id },\n   }));\n   ```\n3. **Generate and review migrations.** `drizzle-kit generate` then read the SQL — especially renames, which the differ may express as drop\u002Fadd. Fix destructive diffs before applying.\n4. **Query relationally for reads.** `db.query.orders.findMany({ with: { items: true }, where, orderBy, limit })` — nested reads as joins, typed end to end.\n   - For complex reporting, switch to the core API or `sql` — don't fight the relational API into shapes it wasn't built for.\n5. **Use the core API for writes and complex filters.** `db.insert\u002Fupdate\u002Fdelete` with `where` clauses; `onConflictDoUpdate` for upserts; returning clauses to get rows back.\n   ```ts\n   const [order] = await db.insert(orders)\n     .values({ status: \"paid\", total: \"99.99\" })\n     .returning({ id: orders.id });\n   ```\n6. **Wrap multi-step writes in transactions.** Short, ordered, no I\u002FO inside — the universal rules apply.\n7. **Validate at the boundary.** `drizzle-zod` schemas for API input; the DB schema and the API schema stay in sync by construction.\n8. **Test against the real dialect.** SQLite in tests while Postgres runs in prod hides real behavior; use containers (or a cheap hosted branch) for integration tests.\n\n## Common pitfalls\n\n- **Rename expressed as drop\u002Fadd** — the differ can't always tell; review generated SQL and hand-write renames with `sql` when needed.\n- **Using the wrong query API** — forcing reporting queries through the relational API; switch to core\u002F`sql` for aggregations and complex joins.\n- **Missing indexes** — declaring tables without indexes for hot filter\u002Fjoin columns; add them in the table definition.\n- **N+1 in application code** — looping queries instead of one relational fetch; fetch nested data in a single query.\n- **SQLite\u002FPostgres drift** — testing on one dialect, deploying another; type and behavior differences will bite.\n- **Long transactions** — same universal rule: short, ordered, no network calls inside.\n- **Unparameterized `sql`** — interpolating values into `sql` fragments instead of using its parameter binding; that's SQL injection.\n- **No migration review** — auto-applying generated migrations; always read the SQL, especially on existing tables.\n- **Ignoring connection limits** — serverless HTTP drivers vs pooled TCP drivers; pick the driver for your runtime and set limits.\n- **Schema code sprawl** — one giant schema file; split by domain like any other code.\n- **Forgetting `onDelete` actions** — default restrict behavior surprising deletes; declare referential actions explicitly.\n- **Returning full rows from APIs** — select only needed columns; the builder makes projection easy, so use it.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-drizzle-pro",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 drizzle-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill drizzle-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill drizzle-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-drizzle-pro\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",[],[]]