Generate ORM schemas (Prisma, SQLAlchemy, Mongoose, Drizzle) from blueprint shared types and database definitions
Generates production-ready ORM schemas from shared types for Prisma, SQLAlchemy, Mongoose, or Drizzle with relationships and seed data.
npx claudepluginhub navraj007in/architecture-cowork-plugin/architect:generate-data-model
After generating a blueprint with /architect:blueprint, this command takes the shared types (deliverable 4d) and database definitions from the manifest and generates real, working ORM schemas. Turns type stubs into Prisma schemas, SQLAlchemy models, Mongoose schemas, or Drizzle tables — with relationships, indexes, enums, and seed data.
Check if a blueprint with shared types (deliverable 4d) and database definitions exists earlier in the conversation.
If no shared types exist, respond:
"I need shared types and database definitions to generate from. Run
/architect:blueprintfirst to define your data model, then come back here to generate ORM schemas."
Ask the user:
"Which ORM should I generate for?"
- Prisma (default for TypeScript) — Type-safe PostgreSQL/MySQL ORM
- Drizzle — Lightweight TypeScript ORM
- SQLAlchemy (default for Python) — Python SQL toolkit
- Mongoose — MongoDB ODM for Node.js
"Which project should I add the schema to?" (path to scaffolded project)
"Should I run the initial migration?" (yes/no — requires database connection)
Pass the following to the data-model-generator agent:
Data model generated!
ORM: Prisma (PostgreSQL)
| Model | Fields | Relations | Indexes |
|-------|--------|-----------|---------|
| User | 6 | products, orders, reviews | email (unique) |
| Product | 8 | seller, orderItems, reviews | sellerId, status |
| Order | 7 | buyer, items | buyerId, status |
| Review | 6 | product, user | productId |
Enums: Role (3), ProductStatus (4), OrderStatus (5)
Seed file: prisma/seed.ts (20 test records)
Migration: Applied (init)
Files created:
prisma/schema.prisma
prisma/seed.ts
Next: Run `npx prisma db seed` to populate test data