Agent skill
mm
Create and deploy Prisma database migrations. Use when schema.prisma changes, migration guard fires, or you need to run prisma migrate. NOT for schema design — only for generating and deploying migrations.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/mm-alexandrbasis-wythm-claude-workflo
SKILL.md
Command: Make Migrations (/mm)
Purpose: Create and deploy Prisma migrations for the backend when the schema changes.
When to use
- You modified
backend/prisma/schema.prismaand need to generate a migration. - The pre-commit migration guard indicates a missing migration.
What it does
- Generate a migration (files only) with a given or auto-generated name
- Deploy all pending migrations to the database
- Regenerate Prisma Client
Usage
# From repo root — auto name: auto_YYYYMMDD_HHMMSS
npm --prefix backend run prisma:migrate:dev -- --name "auto_$(date +%Y%m%d_%H%M%S)" --create-only
# Deploy and regenerate client
npm --prefix backend run prisma:migrate:deploy
npm --prefix backend run prisma:generate
Or with a custom name:
npm --prefix backend run prisma:migrate:dev -- --name my_change --create-only
npm --prefix backend run prisma:migrate:deploy
npm --prefix backend run prisma:generate
Requirements
- Environment variables configured as per
backend/docs/migration-structure.md:DATABASE_URL(pooled)DIRECT_URL(direct for migrations)SHADOW_DATABASE_URL(shadow schema/DB)
Troubleshooting
- Generation fails — Fix schema errors and re-run.
- Shadow DB error — Check
SHADOW_DATABASE_URLin.env. Must be a separate DB, not the main one. - Migration drift — Run
npx prisma migrate diffto inspect. May needprisma migrate resolve. - Dirty database — If dev DB has manual changes, consider
prisma migrate reset(destroys data).
See also
- Full migration docs:
backend/docs/migration-structure.md - Schema file:
backend/prisma/schema.prisma
Notes
- This command is non-interactive and safe for CI usage.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?