prisma-data-model

Enforce tenant isolation, soft deletes, and RBAC in Prisma schemas.

Updated Dec 26, 2025
One-click install
npx skills add https://github.com/dthompsonfl/crispy-fishstick --skill prisma-data-model-dthompsonfl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-data-model
Source: https://github.com/dthompsonfl/crispy-fishstick/tree/main/.agent/skills/prisma-data-model
Command: npx skills add https://github.com/dthompsonfl/crispy-fishstick --skill prisma-data-model-dthompsonfl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves the complexity of multi-tenant Prisma schemas by enforcing isolation and auditability.

Core Features & Use Cases

  • Multi-tenant isolation: ensure tenant-scoped queries and safe cross-tenant access.
  • Soft delete and archival: consistently filter deleted records to preserve data integrity.
  • RBAC-aware data access: align data queries with RoleAssignment constraints.
  • Audit integration: automatically log privileged mutations for compliance.
  • Transactions & consistency: coordinate related model changes using Prisma transactions.

Quick Start

Modify prisma/schema.prisma to add new models or fields, then generate the client, apply migrations, and update validation schemas.

Frequently Asked Questions about prisma-data-model

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

FAQPage Schema
How do I enforce tenant isolation in a Prisma schema?

To enforce tenant isolation in a Prisma schema, you apply tenant-scoped queries and ensure safe cross-tenant access rules. This guarantees queries remain restricted to their specific tenant boundaries.

How do I implement soft deletes and audit logging with Prisma migrations?

Implementing soft deletes and audit logging with Prisma involves consistently filtering deleted records to preserve data integrity while automatically logging privileged mutations for compliance. This ensures data changes are trackable and recoverable.

What is the best way to align RoleAssignment RBAC constraints with Prisma queries?

The best way to align RBAC constraints with Prisma queries is to map RoleAssignment rules directly to data access queries. This ensures data retrieval strictly adheres to role-based permissions and compliance requirements.

Can I use Prisma transactions to coordinate multi-tenant data changes?

Yes, you can use Prisma transactions to coordinate related model changes in a multi-tenant environment. Transactions ensure that complex tenant-scoped updates maintain consistency across your database.

Does Prisma support explicit field selection and validation for production-grade schemas?

Yes, Prisma supports production-grade requirements by enforcing explicit field selection and validation. This ensures strict data access control and schema integrity for multi-tenant applications.