seed-fixtures

Guides writing idempotent, production-safe Prisma database seed fixtures for development environments.

Updated Jan 12, 2026
One-click install
npx skills add https://github.com/brandonarbini/arbini.family --skill seed-fixtures-brandonarbini
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: seed-fixtures
Source: https://github.com/brandonarbini/arbini.family/tree/main/.agents/skills/seed-fixtures
Command: npx skills add https://github.com/brandonarbini/arbini.family --skill seed-fixtures-brandonarbini

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Development database seeds often fail on re-run, require a database reset first, produce unrealistically clean data that hides UI bugs, or worse — risk running against a production database through a pasted connection string. This Skill provides the rules and guardrails for writing seeds that are safe, re-runnable, and realistic. ## Core Features & Use Cases - Production Safety Guard: Enforces a three-part check (NODE_ENV, deploy-platform variables, and a database host allowlist) in a dedicated, unit-tested prisma/seed-guard.ts module so a seed can never rewrite production data. - Idempotent Seeding: Requires upserts on natural keys (slugs, emails, external identifiers) so running the seed twice yields the same state as one run. - Minimal Mode & Realistic Fixtures: Defines a --minimal flag for onboarding and empty-state testing, and directs copying real production data shapes (long names, near-duplicates, hash collisions) instead of inventing tidy values. - Use Case: When adding a new fixture to prisma/seeders/, use this Skill to ensure the fixture upserts on a natural key, links correctly to other fixtures, and survives a second pnpm db:seed run. ## Quick Start Review my prisma/seed.ts and seeders to make the seed idempotent, add a production safety guard, and support a minimal mode.

Frequently Asked Questions about seed-fixtures

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

FAQPage Schema
How do I make a Prisma database seed idempotent?▼

Make a Prisma seed idempotent by upserting every record on a natural key such as a slug, email, or external identifier instead of inserting blindly or keying on generated ids. The test is running the seed twice and getting the same state as one run.

How do I prevent a seed script from running against production?▼

Prevent production seeding with a dedicated guard module that requires all three checks: NODE_ENV is not production, no deploy-platform variables like VERCEL_ENV are set, and the database URL host is on an allowlist of development hosts such as localhost or the Compose service name.

Why does my seed fail the second time it runs?▼

A seed fails on re-run when it inserts records blindly instead of upserting on natural keys, causing unique-constraint violations or duplicates. This is common with ordered or hierarchical fixtures where the lazy version appends duplicates.

Should production reference data be created by a seed script?▼

No, production reference data should never come from a seed. Data that is part of the schema's meaning belongs in a migration, and one-time records like an initial admin belong in a separate idempotent bootstrap script run deliberately.

Why does my local seed data not reproduce production UI bugs?▼

Invented fixture data is too tidy: every slug is unique, strings are ASCII, and nothing collides, so hash-based colors, sorts, and overflow cases never appear. Copy real production shapes including long names, near-duplicates, and colliding values.