Atlas / Skills / jeremylongshore / Generating Database Seed Data

Generating Database Seed DataSAFE

skills/jeremylongshore/generating-database-seed-data

Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.

Verdict
SAFE
Grade
B
Trust score
89 /100
Version
1.22.0
Hosts
1 documented
License
MIT
Stars
2,823
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

Bundled resources for data-seeder-generator skill

  • [ ] exampleseedscript.sql: Example SQL script generated by the skill for seeding a database.
Read from source at commit 4f83675ca38aOBSERVED · 2026-10-08
02

Host compatibility

What the documentation claims. We have not run a compatibility test.

HostStatusNotes
claude-codementioned
03

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

---
name: generating-database-seed-data
description: 'Process this skill enables AI assistant to generate realistic test data
  and database seed scripts for development and testing environments. it uses faker
  libraries to create realistic data, maintains relational integrity, and allows configurable
  data volumes. u... Use when working with databases or data models. Trigger with
  phrases like ''database'', ''query'', or ''schema''.

  '
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*)
version: 1.22.0
author: Jeremy Longshore <[email protected]>
license: MIT
tags:
- database
- testing
- database-seed
compatibility: Designed for Claude Code
---
# Data Seeder Generator

## Overview

Generate realistic database seed scripts that populate development and testing environments with representative data. This skill creates seed data that respects foreign key relationships, unique constraints, check constraints, and data type validations using Faker libraries (faker.js, Faker for Python, or raw SQL with random functions).

## Prerequisites

- Database schema definition (SQL DDL, ORM models, or Prisma schema) to understand table structures
- Target database connection for schema introspection (optional, can work from DDL files)
- Faker library available: `@faker-js/faker` (Node.js), `faker` (Python), or `Bogus` (.NET)
- Knowledge of referential integrity constraints (foreign keys, cascades)
- Target data volume per table (e.g., 100 users, 1000 orders, 5000 line items)

## Instructions

1. Analyze the database schema to catalog all tables, columns, data types, constraints, and foreign key relationships. Build a dependency graph where parent tables (referenced by foreign keys) must be seeded before child tables.

2. Determine the seeding order by topologically sorting the dependency graph. Tables with no foreign keys are seeded first (users, categories, products), then tables referencing them (orders, reviews), then junction tables and deeply nested tables last.

3. Map each column to an appropriate Faker generator based on column name and data type:
   - `first_name`, `last_name` -> `faker.person.firstName()`, `faker.person.lastName()`
   - `email` -> `faker.internet.email()` with unique enforcement
   - `phone` -> `faker.phone.number()`
   - `address`, `city`, `state`, `zip` -> `faker.location.*`
   - `created_at`, `updated_at` -> `faker.date.between({ from: '2023-01-01', to: '2024-12-31' })`
   - `price`, `amount` -> `faker.commerce.price({ min: 1, max: 999 })`
   - `description`, `bio` -> `faker.lorem.paragraph()`
   - `status` -> Random selection from CHECK constraint values or enum values
   - `uuid` -> `faker.string.uuid()`

4. Generate foreign key values by referencing previously inserted parent records. Store parent IDs in arrays during generation and randomly select from them for child records. Ensure every parent has at least one child (if the relationship is expected) and distribute children realistically (e.g., Zipf distribution where some users have many orders, most have few).

5. Handle unique constraints by tracking generated values in a Set and regenerating on collision. For email addresses, append a counter or use `faker.internet.email({ firstName, lastName })` with unique names.

6. Respect CHECK constraints and ENUM types by reading the allowed values from the schema and restricting random selection to valid options. For range constraints (`CHECK (age >= 18 AND age <= 120)`), configure Faker to generate within the valid range.

7. Generate the seed script in the appropriate format:
   - **Raw SQL**: `INSERT INTO users (name, email, ...) VALUES ('John Doe', '[email protected]', ...);` with proper escaping
   - **TypeORM/Prisma**: TypeScript seed file using `prisma.user.createMany()` or `repository.save()`
   - **Django**: Python fixtures in JSON format or management command
   - **Knex**: JavaScript seed file using `knex('users').insert([...])`

8. Make seed scripts idempotent: wrap in a transaction, truncate target tables in reverse dependency order before inserting, or use upsert operations (`ON CONFLICT DO NOTHING`).

9. Add configurable volume control: accept a scale factor parameter that multiplies base counts (scale=1: 100 users, scale=10: 1000 users). Maintain consistent ratios between related tables (1 user : 5 orders : 15 line items).

10. Validate the generated seed data by running it against an empty database, then checking: all foreign key references resolve, unique constraints hold, check constraints pass, and row counts match expectations.

## Output

- **Seed script files** in SQL, TypeScript, Python, or JavaScript format
- **Faker configuration** mapping columns to appropriate generators
- **Dependency order** listing the correct table insertion sequence
- **Validation queries** to verify seed data integrity after insertion
- **Volume configuration** with scale factor and per-table row counts

## Error Handling

| Error | Cause | Solution |
|-------|-------|---------|
| Foreign key constraint violation during seeding | Child records reference parent IDs that do not exist | Verify seeding order follows dependency graph; ensure parent seed completes before child seed starts |
| Unique constraint violation | Faker generated duplicate values for unique columns | Track generated values in a Set; use `faker.helpers.unique()` wrapper; append sequential suffix for high-volume unique fields |
| CHECK constraint violation | Generated value outside allowed range or not in enum list | Read CHECK constraints from schema; configure Faker min/max ranges; restrict enum selection to valid values |
| Seed script too slow for large volumes | Individual INSERT statements instead of batch operations | Use batch inserts (`INSERT INTO ... VALUES (...), (...), (...)`); use COPY command for PostgreSQL; disable indexes during bulk insert |
| Unrealistic data distribution | All records have uniform random values | Use weighted random selection for status fields; apply Zi
04

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codePASS
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (0)

No findings outside the package's declared scope.

Gates applied: no_behavioural_pass.

Audited 2026-10-08 · audit v0.4.1 · source sha 4f83675ca38afull audit observations/trust-audit/skill/jeremylongshore__generating-database-seed-data.json · Report an issue / request a re-scan
05

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-084f83675ca38aSAFEB89first audit
06

Questions

What does the Generating Database Seed Data skill do?

Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.

Is Generating Database Seed Data safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can Generating Database Seed Data access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

Which assistants does Generating Database Seed Data work with?

Its documentation mentions claude-code. That is what the text claims, not a compatibility test we ran.

How current is this page?

The grade is for one exact copy of the source (4f83675ca38a), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.

Advertisement