data-seeding-fixtures-builder

Generates deterministic seed data with factory functions, fixtures, and database reset scripts.

2|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/sathishssj3/NexVR-Engine --skill data-seeding-fixtures-builder-sathishssj3
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: data-seeding-fixtures-builder
Source: https://github.com/sathishssj3/NexVR-Engine/tree/main/.agents/skills/data-seeding-fixtures-builder
Command: npx skills add https://github.com/sathishssj3/NexVR-Engine --skill data-seeding-fixtures-builder-sathishssj3

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @prisma/client, @faker-js/faker, @playwright/test, tsx.

What problem does it solve? Setting up realistic, reproducible test and development data manually is slow and error-prone, and inconsistent data makes tests flaky and debugging painful. ## Core Features & Use Cases - Factory Functions: Reusable TypeScript factory classes (e.g., UserFactory, OrderFactory) built on Prisma and @faker-js/faker for creating single or bulk records with sensible defaults. - Deterministic Seeding: Fixed faker seed values produce identical data across test runs, making tests predictable and reproducible. - Environment-Specific Seeds: Separate seed strategies for development, staging, and test environments with appropriate data volumes. - Database Reset & E2E Fixtures: PostgreSQL truncation scripts and Playwright test fixtures with automatic cleanup. - Use Case: You are building a Node.js API with Prisma and need 50 users with realistic orders for staging. Run the staging seed script to populate related records with proper foreign keys in one command. ## Quick Start Ask the AI to generate a Prisma seed script with factory functions and deterministic faker data for your database models.

Frequently Asked Questions about data-seeding-fixtures-builder

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

FAQPage Schema
How do I seed a Prisma database with test data?▼

Create a prisma/seed.ts script that clears existing records with deleteMany, then inserts data using factory functions. Register it in package.json as a db:seed script and run it with tsx.

How to generate deterministic fake data with faker?▼

Call faker.seed() with a fixed integer before generating data, such as faker.seed(12345). Every subsequent faker call produces the same values, making test data reproducible across runs.

What is the best way to create test fixtures for Playwright E2E tests?▼

Extend Playwright's base test with custom fixtures that create records via factory functions before the test and delete them afterward. This isolates each test with fresh, pre-seeded data.

Can I reset a PostgreSQL database without dropping migrations?▼

Yes, truncate all tables except _prisma_migrations using TRUNCATE TABLE ... CASCADE, and temporarily disable foreign key checks with session_replication_role. This preserves migration history while clearing data.

How do I seed related records with foreign keys in Prisma?▼

Create the parent record first, then pass its id to child factories. For example, create an order with a userId, then create order items referencing both the order id and product ids.

When should I use different seed data per environment?▼

Use minimal deterministic data for tests, small datasets for development debugging, and larger realistic volumes for staging. Branch on NODE_ENV in your main seed function to select the appropriate strategy.