[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76SN9ESTC7M35JK1J37TP3B":3,"skill-same:01M76SN9ESTC7M35JK1J37TP3B":45},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M76SN9ESTC7M35JK1J37TP3B","nextjs-add-prisma-db",null,"Setup Prisma ORM with PostgreSQL in a Next.js project with schema, migrations, and seed data","zuzu59\u002Fz-skills","zuzu59","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F15345233?v=4","01M756RFXRYFCM8DCAHTP0F5YW","Christian Zufferey","01M756RFYZRYH7F070CKQRMW38",0,"MIT","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fnextjs-add-prisma-db\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: nextjs-add-prisma-db\ndescription: Setup Prisma ORM with PostgreSQL in a Next.js project with schema, migrations, and seed data\n---\n\n\u003Cobjective>\nSetup Prisma in the current Next.js project with a production-ready database configuration.\n\nThis creates a complete database layer including schema, migrations, client helper, seed script, and API routes for verification. Designed for projects using Neon PostgreSQL.\n\u003C\u002Fobjective>\n\n\u003Ccontext>\nProject structure: !`ls -la`\nPackage manager: !`cat package.json | grep -A2 '\"packageManager\"'`\nExisting prisma config: !`ls prisma\u002F 2>\u002Fdev\u002Fnull || echo \"No prisma folder yet\"`\nTypeScript config: !`cat tsconfig.json | head -30`\n\u003C\u002Fcontext>\n\n\u003Cprocess>\n## Phase 1: Information Gathering\n\n1. **Ask for table structure** - Prompt user to describe ONE simple table to verify Prisma works:\n   - Table name and purpose\n   - Fields with types (String, Int, DateTime, Boolean)\n   - Example: \"Post table with id, title, content, published, createdAt\"\n\n2. **Inspect existing structure** - Before coding:\n   - Check if `src\u002F` folder exists\n   - Read `tsconfig.json` for path aliases\n   - Identify where `lib\u002F` folder should be created\n\n## Phase 2: Installation\n\n3. **Install dependencies**:\n   ```bash\n   pnpm add prisma @prisma\u002Fclient\n   pnpm add -D tsx\n   npx prisma init\n   ```\n\n4. **Configure database provider** - Update `prisma\u002Fschema.prisma`:\n   - Set provider to \"postgresql\"\n   - Configure generator output path based on project structure\n\n## Phase 3: Schema & Configuration\n\n5. **Create schema** - Add the user-defined table with:\n   - `id` as String with `@id @default(cuid())`\n   - User-specified fields\n   - `createdAt DateTime @default(now())`\n   - `updatedAt DateTime @updatedAt`\n\n6. **Configure exclusions**:\n   - Add generated folder to `.eslintignore`\n   - Add generated folder to `tsconfig.json` exclude array\n\n7. **Create Prisma client helper** - Create singleton pattern in `lib\u002Fprisma.ts`:\n   ```typescript\n   import { PrismaClient } from \"@\u002Fgenerated\u002Fclient\";\n\n   const globalForPrisma = globalThis as unknown as {\n     prisma: PrismaClient | undefined;\n   };\n\n   export const prisma = globalForPrisma.prisma ?? new PrismaClient();\n\n   if (process.env.NODE_ENV !== \"production\") globalForPrisma.prisma = prisma;\n   ```\n\n8. **Create prisma.config.ts** - Root configuration:\n   ```typescript\n   import path from \"node:path\";\n   import { defineConfig } from \"prisma\u002Fconfig\";\n\n   export default defineConfig({\n     schema: path.join(\"prisma\", \"schema.prisma\"),\n     migrations: {\n       seed: `tsx prisma\u002Fseed.ts`,\n     },\n   });\n   ```\n\n## Phase 4: Data & Verification\n\n9. **Create seed script** - `prisma\u002Fseed.ts` with 5-10 realistic records\n\n10. **Run migrations**:\n    ```bash\n    npx prisma generate\n    npx prisma migrate dev --name init\n    npx prisma db seed\n    ```\n\n11. **Create example API route** - `app\u002Fapi\u002Fexample\u002Froute.ts`:\n    - GET endpoint fetching all records\n    - POST endpoint creating new record\n    - Proper error handling\n\n12. **Add package.json scripts**:\n    ```json\n    {\n      \"db:generate\": \"prisma generate\",\n      \"db:push\": \"prisma db push\",\n      \"db:migrate\": \"prisma migrate dev\",\n      \"db:studio\": \"prisma studio\",\n      \"db:seed\": \"prisma db seed\"\n    }\n    ```\n\n## Phase 5: Documentation\n\n13. **Update CLAUDE.md** with:\n    - Database provider and connection info\n    - Schema overview\n    - Available db scripts\n\u003C\u002Fprocess>\n\n\u003Cconstraints>\n**FORBIDDEN - Do not create**:\n- User, Account, Session, VerificationToken tables (auth tables)\n- Any user-related fields or foreign keys\n- More than ONE table (keep it minimal for verification)\n\n**REQUIRED**:\n- Adapt paths to existing project structure\n- Use cuid() for IDs, not uuid or auto-increment\n- Configure generator output path correctly\n- Create seed data with realistic values\n\u003C\u002Fconstraints>\n\n\u003Csuccess_criteria>\n- `pnpm prisma generate` completes without errors\n- `pnpm prisma migrate dev` creates migration successfully\n- `pnpm prisma db seed` populates database\n- API route returns data when called\n- No TypeScript or ESLint errors in generated files\n\u003C\u002Fsuccess_criteria>\n","\u003Cobjective>\nSetup Prisma in the current Next.js project with a production-ready database configuration.\n\nThis creates a complete database layer including schema, migrations, client helper, seed script, and API routes for verification. Designed for projects using Neon PostgreSQL.\n\u003C\u002Fobjective>\n\n\u003Ccontext>\nProject structure: !`ls -la`\nPackage manager: !`cat package.json | grep -A2 '\"packageManager\"'`\nExisting prisma config: !`ls prisma\u002F 2>\u002Fdev\u002Fnull || echo \"No prisma folder yet\"`\nTypeScript config: !`cat tsconfig.json | head -30`\n\u003C\u002Fcontext>\n\n\u003Cprocess>\n## Phase 1: Information Gathering\n\n1. **Ask for table structure** - Prompt user to describe ONE simple table to verify Prisma works:\n   - Table name and purpose\n   - Fields with types (String, Int, DateTime, Boolean)\n   - Example: \"Post table with id, title, content, published, createdAt\"\n\n2. **Inspect existing structure** - Before coding:\n   - Check if `src\u002F` folder exists\n   - Read `tsconfig.json` for path aliases\n   - Identify where `lib\u002F` folder should be created\n\n## Phase 2: Installation\n\n3. **Install dependencies**:\n   ```bash\n   pnpm add prisma @prisma\u002Fclient\n   pnpm add -D tsx\n   npx prisma init\n   ```\n\n4. **Configure database provider** - Update `prisma\u002Fschema.prisma`:\n   - Set provider to \"postgresql\"\n   - Configure generator output path based on project structure\n\n## Phase 3: Schema & Configuration\n\n5. **Create schema** - Add the user-defined table with:\n   - `id` as String with `@id @default(cuid())`\n   - User-specified fields\n   - `createdAt DateTime @default(now())`\n   - `updatedAt DateTime @updatedAt`\n\n6. **Configure exclusions**:\n   - Add generated folder to `.eslintignore`\n   - Add generated folder to `tsconfig.json` exclude array\n\n7. **Create Prisma client helper** - Create singleton pattern in `lib\u002Fprisma.ts`:\n   ```typescript\n   import { PrismaClient } from \"@\u002Fgenerated\u002Fclient\";\n\n   const globalForPrisma = globalThis as unknown as {\n     prisma: PrismaClient | undefined;\n   };\n\n   export const prisma = globalForPrisma.prisma ?? new PrismaClient();\n\n   if (process.env.NODE_ENV !== \"production\") globalForPrisma.prisma = prisma;\n   ```\n\n8. **Create prisma.config.ts** - Root configuration:\n   ```typescript\n   import path from \"node:path\";\n   import { defineConfig } from \"prisma\u002Fconfig\";\n\n   export default defineConfig({\n     schema: path.join(\"prisma\", \"schema.prisma\"),\n     migrations: {\n       seed: `tsx prisma\u002Fseed.ts`,\n     },\n   });\n   ```\n\n## Phase 4: Data & Verification\n\n9. **Create seed script** - `prisma\u002Fseed.ts` with 5-10 realistic records\n\n10. **Run migrations**:\n    ```bash\n    npx prisma generate\n    npx prisma migrate dev --name init\n    npx prisma db seed\n    ```\n\n11. **Create example API route** - `app\u002Fapi\u002Fexample\u002Froute.ts`:\n    - GET endpoint fetching all records\n    - POST endpoint creating new record\n    - Proper error handling\n\n12. **Add package.json scripts**:\n    ```json\n    {\n      \"db:generate\": \"prisma generate\",\n      \"db:push\": \"prisma db push\",\n      \"db:migrate\": \"prisma migrate dev\",\n      \"db:studio\": \"prisma studio\",\n      \"db:seed\": \"prisma db seed\"\n    }\n    ```\n\n## Phase 5: Documentation\n\n13. **Update CLAUDE.md** with:\n    - Database provider and connection info\n    - Schema overview\n    - Available db scripts\n\u003C\u002Fprocess>\n\n\u003Cconstraints>\n**FORBIDDEN - Do not create**:\n- User, Account, Session, VerificationToken tables (auth tables)\n- Any user-related fields or foreign keys\n- More than ONE table (keep it minimal for verification)\n\n**REQUIRED**:\n- Adapt paths to existing project structure\n- Use cuid() for IDs, not uuid or auto-increment\n- Configure generator output path correctly\n- Create seed data with realistic values\n\u003C\u002Fconstraints>\n\n\u003Csuccess_criteria>\n- `pnpm prisma generate` completes without errors\n- `pnpm prisma migrate dev` creates migration successfully\n- `pnpm prisma db seed` populates database\n- API route returns data when called\n- No TypeScript or ESLint errors in generated files\n\u003C\u002Fsuccess_criteria>\n",{"name":5,"description":7},"master","46a82833a3f7f6f5f408511246a55e0485c5f7ab","skills\u002Fnextjs-add-prisma-db",1,"https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills","https:\u002F\u002Fgithub.com\u002Fzuzu59","2026-09-30 17:58:42",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add zuzu59\u002Fz-skills --skill nextjs-add-prisma-db",{"tool":37,"command":38},"bunx","bunx skills add zuzu59\u002Fz-skills --skill nextjs-add-prisma-db",{"tool":40,"command":41},"pnpm","pnpm dlx skills add zuzu59\u002Fz-skills --skill nextjs-add-prisma-db","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fnextjs-add-prisma-db\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M76SQGVSKRYNQX4AA4RXV3K0","writing-great-skills","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-great-skills\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M76SQDSAZSA1272D56JY8Q2G","use-style","Apply named visual style guides to landing pages, app shells, and UI. Use for $use-style, \u002Fuseskill, list styles, or styles like ios-app, grid, vercel, black-grid, stripe, linear, raycast, gumroad, dusk, or luma.","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fuse-style\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M76SQAXDVX02V4JH4PF1MC9G","use-goal","Use when the user asks to create, draft, set, start, or refine a Codex or Claude Code `\u002Fgoal` objective for persistent multi-turn work.","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fuse-goal\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M76SQ8B11GTTGQ5CZHHGXFXM","use-fable","Orchestrator mode for Fable: Fable thinks, plans, and reviews while Codex CLI and subagents execute all heavy work. Use when the user invokes \u002Fuse-fable, says 'use fable', 'fable mode', 'orchestrator mode', or wants to save Fable tokens\u002Frate limits.","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fuse-fable\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M76SQ4SB7Q4CXEGGPA75KGFK","use-delegate","Delegation mode: the host agent (Claude or Codex) plans and reviews while heavy work runs on cheap executors: OpenCode Kimi K3, Codex GPT-5.6 terra\u002Fsol. Use when the user invokes \u002Fuse-delegate, says 'use delegate', 'delegate mode', 'orchestrator mode', or wants to save tokens\u002Frate limits.","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fuse-delegate\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M76SQ24836GDGMGGPV6Z2B7N","use-artifacts","Create Claude-style local HTML artifacts under ~\u002F.agents\u002Fartifacts. Use for plans, prototypes, visualizations, dashboards, diagrams, options, or substantial reusable content, with a portable local runtime and no Anthropic API.","https:\u002F\u002Fgithub.com\u002Fzuzu59\u002Fz-skills\u002Fblob\u002Fmaster\u002Fskills\u002Fuse-artifacts\u002FSKILL.md",[],[]]