원클릭으로
prisma-change
Guide through a full Prisma schema change workflow — edit schema, create migration, regenerate client, update affected services.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Guide through a full Prisma schema change workflow — edit schema, create migration, regenerate client, update affected services.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create an End-to-End (E2E) test for a REST controller or GraphQL resolver using Fastify injection.
Add a new BullMQ job queue to the project — processor, producer injection, module registration, Bull Board integration, and unit tests.
Write unit tests for an existing NestJS service, resolver, or controller in the project following its Vitest + NestJS Testing conventions.
Run the full code quality pipeline (TypeScript + Biome + Knip), fix all issues, and clean up comments in changed code.
Create a git commit with all unstaged changes. Use this skill whenever the user asks to commit, make a commit, save changes to git, or says something like "commit this", "commit all changes". Always runs npm run check before committing and fixes any errors found.
Use this workflow to implement ANY new feature following Test-Driven Development strictly.
| name | prisma-change |
| description | Guide through a full Prisma schema change workflow — edit schema, create migration, regenerate client, update affected services. |
The user wants to modify the database schema in the project. This is a multi-step workflow where skipping any step causes runtime errors.
prisma/schema.prismasrc/@generated/prisma (NOT the default node_modules)import { ... } from '@/@generated/prisma/client'@prisma/adapter-pg (PostgreSQL)prisma/migrations/prisma/schema.prismaApply the requested model/enum/field changes. Key conventions:
id Int @id @default(autoincrement())createdAt DateTime @default(now()) and updatedAt DateTime @updatedAtString? for optional strings, not empty string defaultsnpm run db:migrations:create -- --name <migration-name>
This creates a new migration file in prisma/migrations/ without applying it yet.
Use a descriptive kebab-case name, e.g. add-user-email or add-posts-model.
In production, migrations are applied via
npm run db:migrations:apply(runsprisma migrate deploy). In development, usenpm run db:pushonly for fast prototyping (no migration file created).
npm run db:gen
This runs prisma generate --no-hints and outputs the client to src/@generated/prisma.
Always run this after any schema change — TypeScript types come from here.
After regenerating the client, check and update:
PrismaService and reference the changed model@ObjectType classes and Enums must be kept in sync manually. CRITICAL: Invoke the /add-graphql-type skill to scaffold or update the corresponding GraphQL types to match the new Prisma schema.types/*-role.enum.ts or similar — must match Prisma enumsImportant: The Prisma-generated types in src/@generated/prisma/client and the GraphQL @ObjectType classes are separate. The GraphQL types are NOT auto-generated — update them manually.
npm run check
If it fails, do not proceed. Invoke the /check skill to diagnose and automatically fix linting, typing, or unused code errors, then return to this workflow.
Adding a field to an existing model:
npm run db:migrations:create -- --name add-<field>-to-<model>npm run db:gen@ObjectType class to add the @Field() decoratorAdding a new model:
npm run db:migrations:create -- --name add-<model-name>-modelnpm run db:gen/new-module skill)Adding an enum:
src/modules/<module>/types/<name>.enum.ts with registerEnumTypeUse the /add-graphql-type skill for the enum file template and conventions.