What problem does it solve?
Migrating a large codebase from Mongoose to Prisma one model at a time is error-prone: indexes can silently disappear, relation optionality can cause production 500s, and API response shapes can break the frontend. This Skill walks a developer through migrating one Mongoose model file to Prisma extensions with human approval at every stage, following GROWI's established conventions.
Core Features & Use Cases
- Guided six-step migration: Analyzes the model (fields, statics, virtuals, hooks, plugins, callers), verifies schema.prisma, generates a Prisma extension, updates callers, reviews tests, and cleans up superseded Mongoose code.
- Backward compatibility handling: Preserves
_id/__v computed fields, remaps renamed relation fields (e.g. ownerId back to owner) in API responses, and keeps the Mongoose schema block so autoIndex continues creating indexes.
- Edge-case detection: Flags sparse indexes needing migrate-mongo migrations, hard-delete paths that force optional relations, factory-pattern
crowi dependencies, and __v behavior changes.
- Use Case: Run it on
apps/app/src/server/models/tag.ts to produce a Prisma extension, updated callers, and a cleaned-up model file, with a diff review and approval gate before every write.
Quick Start
Ask the AI to migrate the Mongoose model at apps/app/src/server/models/tag.ts to Prisma using this skill, then approve each proposed step as it is presented.