create-model

Create Prisma model layer functions with standardized CRUD helpers.

4|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/tech-with-seth/iridium --skill create-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-model
Source: https://github.com/tech-with-seth/iridium/tree/main/.github/skills/create-model
Command: npx skills add https://github.com/tech-with-seth/iridium --skill create-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create Prisma model layer functions. Use when adding database operations. Never call Prisma directly in routes.

Core Features & Use Cases

  • Standardized CRUD helpers: getItem, getItemsByUser, createItem, updateItem, deleteItem, and helpers for common queries.
  • Enforced separation of concerns: All data access goes through the model layer, not routes.
  • Use Case: When adding a new data feature, generate a consistent model layer to encapsulate Prisma logic and validations.

Quick Start

  • Create a model layer file at app/models/yourModel.server.ts with standard CRUD functions (getItem, getItemsByUser, createItem, updateItem, deleteItem) utilizing the Prisma client and export them for route usage.

Frequently Asked Questions about create-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop calling Prisma directly in Node.js route handlers?

To stop calling Prisma directly in Node.js routes, wrap database operations in a server-side model layer by exporting standardized CRUD functions from app/models/[feature].server.ts. This enforces separation of concerns and ensures all data access is consistent and testable.

What is a Prisma model layer in TypeScript?

A Prisma model layer in TypeScript is a server-side module that encapsulates database access. By implementing exported functions for create, read, update, and delete flows, it prevents direct Prisma client calls in routes and centralizes data validations.

How do I create standardized CRUD helpers for Prisma?

To create standardized CRUD helpers for Prisma, implement a model layer file at app/models/yourModel.server.ts. Define standard functions like getItem, getItemsByUser, createItem, updateItem, and deleteItem utilizing the Prisma client, then export them for route usage.

Does my Prisma data access layer work with database migrations?

Yes, the Prisma data access layer works with database migrations. The generated model layer functions are ready to integrate with Prisma migrations and require proper import paths to ensure seamless schema synchronization and consistent server-side data access.

What's the best way to structure database access in a Node.js application?

The best way to structure database access in a Node.js application is using a server-side model layer. By placing Prisma logic in app/models/[feature].server.ts rather than routes, you achieve enforced separation of concerns and testable data access flows.