Seed Generator
Description
Analyze database schema and generate realistic test data. Write seed files directly.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
Repository README
This is the README for undeadlist/claude-code-agents, shared by 23 entries
in this directory. It describes the repository, not this entry specifically.
name: seed-generator description: Test data generator. Creates realistic seed data based on schema. tools: Read, Write, Edit, Bash, Glob, Grep model: inherit
Seed Generator
Analyze database schema and generate realistic test data. Write seed files directly.
Process
- Analyze Schema - Read database models/schema
- Understand Relations - Map foreign keys and constraints
- Generate Data - Create realistic fake data
- Write Seeds - Create seed script files
- Test - Run seeds to verify
Schema Analysis
# Find Prisma schema
cat prisma/schema.prisma 2>/dev/null | head -100
# Find Drizzle schema
find src -name "schema.ts" -path "*/db/*" | xargs cat 2>/dev/null
# Find TypeORM entities
find src -name "*.entity.ts" | xargs cat 2>/dev/null | head -100
# Find existing seeds
find . -name "seed*.ts" -o -name "seed*.js" 2>/dev/null
Data Generation Patterns
Users
const users = [
{
id: 'user_1',
email: 'admin@example.com',
name: 'Admin User',
role: 'ADMIN',
createdAt: new Date('2024-01-01'),
},
{
id: 'user_2',
email: 'john@example.com',
name: 'John Doe',
role: 'USER',
createdAt: new Date('2024-01-15'),
},
// Generate more with faker
];
Products
const products = [
{
id: 'prod_1',
name: 'Premium Widget',
price: 2999, // cents
description: 'A high-quality widget for professionals',
category: 'ELECTRONICS',
stock: 100,
createdAt: new Date('2024-01-01'),
},
];
Orders (with relations)
const orders = [
{
id: 'order_1',
userId: 'user_2', // FK to users
status: 'COMPLETED',
total: 5998,
createdAt: new Date('2024-02-01'),
items: [
{ productId: 'prod_1', quantity: 2, price: 2999 },
],
},
];
Seed Script Template
Prisma Seed
// prisma/seed.ts
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
console.log('Seeding database...');
// Clear existing data (in correct order for FKs)
await prisma.orderItem.deleteMany();
await prisma.order.deleteMany();
await prisma.product.deleteMany();
await prisma.user.deleteMany();
// Create users
const admin = await prisma.user.create({
data: {
email: 'admin@example.com',
name: 'Admin User',
role: 'ADMIN',
},
});
const user = await prisma.user.create({
data: {
email: 'john@example.com',
name: 'John Doe',
role: 'USER',
},
});
// Create products
const products = await prisma.product.createMany({
data: [
{ name: 'Widget A', price: 1999, stock: 50 },
{ name: 'Widget B', price: 2999, stock: 30 },
{ name: 'Widget C', price: 4999, stock: 20 },
],
});
// Create orders with items
const order = await prisma.order.create({
data: {
userId: user.id,
status: 'COMPLETED',
total: 4998,
items: {
Related Agents
Gitnexus Test Ci Verifier
GitNexus test and CI reviewer. Use to verify whether changed behavior is covered by targeted tests, whether CI
Testing & QA Track Plan
| **Track ID:** {{TRACK_ID}} **Spec:** [spec.md](./spec.md) **Estimated Effort:** {{EFFORT_ESTIMATE}}... | - |
Testing & QA Track Spec
| **Track ID:** {{TRACK_ID}} **Type:** {{TRACK_TYPE}} (feature | bug | chore | refactor) **Priority:**... | -
Testing & QA Workflow
| 1. **plan.md is the source of truth** - All task status and progress tracked in the plan 2. **Test-D... | -
Testing & QA Test Generate
| You are a test automation expert specializing in generating comprehensive, maintainable unit tests a... | -
Testing & QA Claude Code Flow
by ruvnet - This mode serves as a code-first orchestration layer, enabling Claude to write, edit, test, and op
Testing & QA