prisma-seed-reset-pattern

Community

Correct Prisma seed role associations for AdminPanel.

Authorfreedomw1987
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill resolves the issue where Prisma seed scripts fail to maintain correct user role associations when AdminPanel allows administrators to create custom roles. Empty upsert update blocks in seed scripts do not clear existing stale role data, causing custom roles added via AdminPanel to never associate with users, and re-running seeds cannot fix the broken associations.

Core Features & Use Cases

  • Validated Seed Pattern: Provides a step-by-step, tested pattern for Prisma seed scripts that explicitly resets all user role associations on every seed run, regardless of existing AdminPanel custom roles.
  • Reference Error Prevention: Includes a lookup map pattern to avoid common ReferenceErrors when seeding related user data that depends on other seeded records.
  • Cross-Environment Consistency: Ensures user role data remains consistent across development, staging, and production environments, even after custom roles are added via AdminPanel. For example, a SaaS platform with an AdminPanel that lets admins create custom user roles can use this skill to guarantee seed data always has correct role mappings.

Quick Start

Use the prisma-seed-reset-pattern skill to update your Prisma seed script to correctly reset user role associations when running seed operations for your AdminPanel-enabled application.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: prisma-seed-reset-pattern
Download link: https://github.com/freedomw1987/tree_monstor/archive/main.zip#prisma-seed-reset-pattern

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 537,000+ vetted skills library on demand.