Seed data management
Skill Amey-Thakur/AI-SKILLS/skills/testing/seed-data-management
Version and share seed datasets so they stay small, realistic, and reproducible across a team. Use when tests or local environments depend on fixture data that is drifting, ballooning, or diverging between developers.From its SKILL.md
npx -y skills add Amey-Thakur/AI-SKILLS --skill seed-data-managementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 23 days oldThe repository was created 23 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.9 KB, 609 tokens by cl100k_base, as published. Nobody here has run it
Seed data management
Seed data is the starting state a test or a fresh dev environment loads before doing anything. Left unmanaged it rots: a multi-megabyte SQL dump nobody can read, rows that no longer match the schema, and three developers each patching their own copy. Good seed data is small enough to review in a diff, honest enough to catch real bugs, and versioned so everyone loads the same thing.
Method
- Define seeds as code, not a database dump. Write factories or builders
(factory_bot, Faker-backed factories, a
seeds.tsthat inserts through the real models) checked into the repo. A binary.sqldump cannot be reviewed, merges as a conflict blob, and drifts silently from the schema. - Keep the set minimal and representative. Include one row per meaningful variant: an active user and a suspended one, an order in each state, a record with a null in the tricky column. Do not seed 10,000 rows to "feel real"; seed the ten that exercise a branch.
- Make generation deterministic. Fix the random seed (
Faker.seed(42), a constant RNG seed) so the same command produces the same data every run. Non-deterministic seeds turn a failing test into a heisenbug that reproduces on one laptop and not the next. - Run seeds through migrations, never around them. Load seed data by inserting through the current schema and its migrations, so a column rename breaks seeding loudly at the next run instead of leaving stale fixtures that pass tests against a shape that no longer exists.
- Anonymize anything sourced from production. If you snapshot real data for realism, strip or fake names, emails, and payment fields before it lands in the repo. Seed data lives in version control forever; a leaked customer record cannot be un-committed.
- Version the seed format alongside the schema. Tag the seed script to a migration version and fail loudly when they disagree, so a developer on an old branch gets a clear "reseed needed" error instead of cryptic insert failures.
Litmus tests
- Can a teammate go from a clean checkout to a working dataset with one documented command?
- Does the whole seed set fit in a diff a reviewer will actually read (roughly under a few hundred rows)?
- If you drop the database and reseed twice, are the two results identical?
Boundaries
This is about fixture and starter data for tests and local development, not production data migration or backfills, which carry live-data risk and belong in a migration process. Large realistic performance datasets are a separate concern: generate those on demand rather than committing them.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.