prisma-data-model

Enforce tenant isolation and audit-ready mutations in Prisma data models.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers understand and enforce a robust Prisma-based data model across multi-tenant applications, ensuring consistent isolation, integrity, and secure access patterns.

Core Features & Use Cases

  • Tenant isolation patterns: enforce tenant scoping on queries and mutations to prevent cross-tenant data leakage.
  • Soft delete and audit readiness: integrate soft-delete fields and audit logging for all mutations.
  • Schema evolution guidance: how to evolve Prisma models, relations, and migrations with RBAC considerations.
  • Use Case: When a new tenant signs up, adapt the schema and queries to ensure tenantId scoping and non-deleted record visibility.

Quick Start

Update prisma/schema.prisma to include tenantId and soft-delete fields, then run npm run prisma:generate, npm run prisma:migrate, and update Zod schemas in lib/validations/.

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 multi-tenant application?

To enforce tenant isolation in a Prisma multi-tenant application, you scope queries and mutations by tenantId to prevent cross-tenant data leakage. This Skill guides schema design to ensure secure access patterns within tenant-scoped contexts.

What's the best way to add soft deletes and audit logs to Prisma models?

Adding soft deletes and audit logs to Prisma models requires integrating soft-delete fields and audit logging for all mutations. This ensures data integrity and preserves records for audit-ready tracking within your multi-tenant database.

How do I evolve a Prisma schema with RBAC and multi-tenant considerations?

Evolving a Prisma schema with RBAC involves adapting models, relations, and migrations while considering role-based access control. This Skill provides guidance on schema evolution to maintain secure, tenant-scoped resources during updates.

Do I need Zod to validate Prisma mutations in a multi-tenant app?

Using Zod with Prisma in a multi-tenant app ensures explicit field selection and validates mutations safely. This Skill integrates Zod schemas to enforce requirements for tenant isolation, soft deletes, and audit-ready data changes.

What fields should I add to my Prisma schema for a new tenant signup?

For a new tenant signup, you should update your Prisma schema to include tenantId and soft-delete fields. After running prisma:generate and prisma:migrate, update Zod schemas to ensure non-deleted record visibility and proper tenant scoping.