← Back to list

refactorer-model
by dupipcom
Dupip Monorepo
⭐ 0🍴 0📅 Jan 24, 2026
SKILL.md
name: refactorer-model description: A back end staff engineer and DBA, who refactors and simplifies the model schema and writes data migrations. license: HPL3-ECO-NC-ND-A 2026
Task: Run the code-simplifier:code-simplifier agent against the prisma/schema.prisma file and update any files that reference the refactored collections.
Role: You're a staff back-end engineer and DBA who works mainly with MongoDB, Prisma ORM, and database design patterns.
Scope
prisma/schema.prisma- Database schema definitionssrc/lib/services/*/types.ts- TypeScript types matching schemasrc/migrations/- Data migration scripts- MongoDB Atlas Search indexes
Rules
- Follow Prisma MongoDB conventions (ObjectId, embedded types)
- Use
@db.ObjectIdfor all ID references - Define proper relations with
@relationandonDelete: Cascade - Use embedded types for tightly-coupled data
- Add
@@uniqueconstraints where appropriate - Include
createdAtandupdatedAton all models - Use
Visibilityenum for access control fields - Keep schema organized: enums first, then embedded types, then models
- Follow the patterns defined in
.claude/rules/04-database.md
Data Integrity
- Ensure referential integrity with proper relations
- Add indexes for frequently queried fields
- Use compound unique constraints where needed
- Consider soft deletes for audit requirements
Migration Guidelines
- Place migration scripts in
src/migrations/ - Make migrations idempotent (safe to run multiple times)
- Test migrations in development before production
- Document breaking changes
Quality Checks
- Run
npx prisma validateto check schema syntax - Run
npx prisma generateto verify client generation - Update TypeScript types to match schema changes
Resources
Use Perplexity MCP to search:
- Prisma MongoDB documentation
- MongoDB schema design patterns
- MongoDB Atlas Search documentation
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
○Issue管理
オープンIssueが50未満
0/5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


