一键导入
new-repository
Scaffold a Prisma-backed repository for a given Prisma model
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a Prisma-backed repository for a given Prisma model
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Implement a numbered testing strategy phase from docs/testing_strategy_phases/phase_$ARGUMENTS_*.md step by step
Implement a numbered phase from docs/phases/phase-$ARGUMENTS.md step by step
Review changed code for correctness, security, and project conventions. Invoke this skill automatically whenever a complete unit of work is done — a full implementation phase, a complete feature (repository + service + route + component all connected), or just before creating a PR. Do NOT invoke after editing a single file or mid-way through a feature. If the user says "done", "finished", "phase complete", "ready to commit", or similar, trigger this review immediately.
Run prisma migrate dev, regenerate client to the correct output path, and verify import paths
Scaffold a service class for a given domain following project conventions
Final pre-commit check: run type-check (npx tsc --noEmit), lint (npm run lint), and tests (npm test)
| name | new-repository |
| description | Scaffold a Prisma-backed repository for a given Prisma model |
| disable-model-invocation | true |
| argument-hint | [ModelName] |
Scaffold a Prisma repository for the $ARGUMENTS model.
Check that $ARGUMENTS exists in prisma/schema.prisma. If not, stop and tell the user to define the model and run /db-migrate first.
src/repositories/${kebab-case($ARGUMENTS)}.repository.ts
(e.g., InvoiceLineItem → invoice-line-item.repository.ts)
// CORRECT
import { prisma } from '@/lib/prisma'
import { Prisma } from '@/app/generated/prisma/client'
// NEVER write this — runtime failure
// import { ... } from '@prisma/client'
import { prisma } from '@/lib/prisma'
import { Prisma } from '@/app/generated/prisma/client'
export const ${camelCase}Repository = {
async create(data: Prisma.${ModelName}CreateInput) {
return prisma.${camelCase}.create({ data })
},
async findById(id: string) {
return prisma.${camelCase}.findUnique({ where: { id } })
},
async findMany(where?: Prisma.${ModelName}WhereInput) {
return prisma.${camelCase}.findMany({ where })
},
async update(id: string, data: Prisma.${ModelName}UpdateInput) {
return prisma.${camelCase}.update({ where: { id }, data })
},
async delete(id: string) {
return prisma.${camelCase}.delete({ where: { id } })
},
}
null on not-found; do not throwPrisma.${ModelName}GetPayload<...> for complex return types with includenpx tsc --noEmit