Install any skill in seconds. Free to start, no credit card required.
Get Started Free →seb1n/database-seeding
Populate databases with realistic, reproducible test data for development, testing, and staging environments.
Passed 11 of 21 test cases with the skill, and 11 of 21 without it.
2 fixed19 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I need a Python script to populate my local PostgreSQL database with realistic mock data for testing our new project management system. The schema has three related tables: `organizations` (parent), `projects` (belongs to organization), and `tasks` (belongs to project). Could you generate a complete runnable script using Faker and psycopg2 that populates realistic names, titles, descriptions, and timestamps across these tables? I want to be able to execute this script multiple times safely during development without failing on duplicate key constraints or breaking relational ties.
| Checked | Without skill | With skill |
|---|---|---|
| Invokes a seed setting function on the generator for deterministic output. | Missed | Passed |
| Includes an environment variable check preventing execution when configured for production. | Missed | Passed |
The instructions your model reads when the skill loads.
This skill enables an AI agent to generate and insert realistic test data into databases for development, testing, and staging environments. The agent creates idempotent seed scripts using deterministic generators or faker libraries, handles relational data with proper foreign key ordering, supports environment-specific seed profiles (minimal dev data vs. large-scale load testing), and ensures seeds can be run repeatedly without duplicating data.
Analyze the target schema: Inspect the database schema to identify all tables, their columns, data types, constraints (NOT NULL, UNIQUE, CHECK, foreign keys), and relationships. Determine the correct insertion order to satisfy foreign key dependencies — parent tables must be seeded before child tables.
Design the seed data strategy: Choose the appropriate approach based on the use case. Use deterministic data with fixed seeds for reproducible test suites. Use faker-based generation for realistic-looking development data. Use anonymized production snapshots for staging environments that need realistic data distributions. Define the volume of data for each table.
Generate seed scripts: Write seed scripts in the project's language (Python, JavaScript, SQL, etc.) that create data matching all schema constraints. Use the Faker library or equivalent for realistic names, emails, addresses, and dates. Handle unique constraints by generating unique values or using sequence-based patterns. Wrap inserts in transactions for atomicity.
Ensure idempotency: Design scripts to be safely re-runnable. Use INSERT ON CONFLICT DO NOTHING, UPSERT patterns, or truncate-then-insert strategies. Check for existing data before inserting to avoid duplicates or constraint violations on repeated runs.
Support environment-specific profiles: Create different seed profiles — a small dataset (10-50 records per table) for local development, a medium dataset (1,000-10,000 records) for integration testing, and a large dataset (100K+ records) for performance testing. Control the profile via environment variables or command-line arguments.
Execute and verify: Run the seed script against the target database, verify row counts match expectations, and confirm relational integrity by checking that all foreign keys reference existing rows. Log the seeding results with counts per table.
Provide the database schema (or point to your migration files) and specify the target environment and desired data volume. The agent will generate a complete seed script that respects all constraints and relationships. You can request specific data characteristics (e.g., "include users from multiple time zones" or "create orders spanning the last 12 months").
Request: Seed a PostgreSQL database with users, products, and orders for development.
"""seed.py — Seed development database with realistic test data."""
import random
from datetime import datetime, timedelta
test cases passed, vs 11 / 21 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.