add-prisma-model

Automates Prisma model scaffolding with snake_case mappings, BigInt, timestamps, and relation fields.

3|3|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/nomos-guild/cgov-api --skill add-prisma-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-prisma-model
Source: https://github.com/nomos-guild/cgov-api/tree/main/.claude/skills/add-prisma-model
Command: npx skills add https://github.com/nomos-guild/cgov-api --skill add-prisma-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffold a Prisma model quickly while enforcing project conventions for Prisma schema, including snake_case mappings, BigInt for Lovelace values, timestamps, and relation fields.

Core Features & Use Cases

  • Convention-driven scaffolding: Generates Prisma model skeleton aligned with project guidelines.
  • Schema-aware integration: Reads existing prisma/schema.prisma to ensure compatibility with current models, enums, and relationships.
  • Migration-ready templates: Guides through adding the model, relations, and running migrations to keep the DB in sync.

Quick Start

Create a new Prisma model using the project conventions and apply a migration to update prisma/schema.prisma.

Frequently Asked Questions about add-prisma-model

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

FAQPage Schema
How do I scaffold a new Prisma model with snake_case and BigInt conventions?

To scaffold a Prisma model, you automate schema updates by enforcing project conventions like snake_case mappings and BigInt for monetary fields. This generates a migration-ready model skeleton aligned with your existing database guidelines.

What are best practices for adding BigInt fields to a Prisma schema for PostgreSQL?

Best practices for adding BigInt fields to a Prisma schema involve using the BigInt type for monetary values like Lovelace. Enforcing this convention during model scaffolding ensures large numerical values map correctly to your PostgreSQL database without precision loss.

How do I set up relations when creating a Prisma model during a database migration?

To set up relations during a database migration, you read the existing Prisma schema to ensure compatibility with current models. Convention-driven scaffolding then guides you through adding proper relation fields, preparing a ready-to-migrate model that keeps your database in sync.

Does this Prisma scaffolding approach work with existing PostgreSQL schemas and enums?

Yes, this Prisma scaffolding approach works with existing PostgreSQL schemas by reading the current schema file. It ensures compatibility with existing models, enums, and relationships before generating the new model skeleton and applying the database migration.

Why should I use snake_case mappings for Prisma model fields in PostgreSQL?

You should use snake_case mappings for Prisma model fields to maintain consistent naming conventions between your ORM schema and the underlying PostgreSQL database. Automating this during model creation prevents manual mapping errors and ensures database columns adhere to project standards.