SKILL.md--- name: seed-data-generator description: Generate realistic test data for database development, testing, and demos. --- # Seed Data Generator Skill Generate realistic test data for database development, testing, and demos. ## Instructions You are a test data generation expert. When invoked: 1. **Analyze Schema**: - Identify tables and relationships - Understand column types and constraints - Detect foreign key dependencies - Recognize data patterns (email, phone, dates, etc.) 2. **Generate Realistic Data**: - Use faker libraries for realistic data - Maintain referential integrity - Follow business logic constraints - Create diverse but realistic scenarios 3. **Seed Database**: - Insert data in correct order (respect foreign keys) - Handle different database systems - Provide both SQL and ORM-based seeders - Support incremental seeding 4. **Customize Generation**: - Allow quantity specification - Support different data scenarios (edge cases, happy path) - Enable data relationships customization - Provide reproducible seeds (with random seed values) ## Supported Tools - **JavaScript/TypeScript**: Faker.js, Chance.js, Casual - **Python**: Faker, Factory Boy, Mimesis - **Ruby**: Faker, FactoryBot - **Raw SQL**: Generate INSERT statements - **ORMs**: Prisma, TypeORM, Sequelize, Django, Rails ## Usage Examples ``` @seed-data-generator @seed-data-generator --count 100 @seed-data-generator --table users @seed-data-generator --scenario e-commerce @seed-data-generator --realistic-relationships ``` ## SQL Seed Data ### PostgreSQL - Basic Insert ```sql -- seed/001_users.sql INSERT INTO users (username, email, password_hash, active, created_at) VALUES ('john_doe', 'john@example.com', '$2b$10$...', true, '2024-01-15 10:00:00'), ('jane_smith', 'jane@example.com', '$2b$10$...', true, '2024-01-16 11:30:00'), ('bob_wilson', 'bob@example.com', '$2b$10$...', true, '2024-01-17 09:15:00'), ('alice_brown', 'alice@example.com', '$2b$10$...', false, '2024-01-18 14:45:00'), ('charlie_davis', 'charlie@example.com', '$2b$10$...', true, '2024-01-19 16:20:00'); -- seed/002_categories.sql INSERT INTO categories (name, slug, parent_id) VALUES ('Electronics', 'electronics', NULL), ('Computers', 'computers', 1), ('Laptops', 'laptops', 2), ('Desktops', 'desktops', 2), ('Accessories', 'accessories', 1), ('Clothing', 'clothing', NULL), ('Men', 'men', 6), ('Women', 'women', 6); -- seed/003_products.sql INSERT INTO products (name, description, price, stock_quantity, category_id, created_at) VALUES ( 'MacBook Pro 16"', 'Powerful laptop with M3 chip, 16GB RAM, 512GB SSD', 2499.99, 15, 3, NOW() ), ( 'Dell XPS 13', 'Compact laptop with Intel i7, 16GB RAM, 512GB SSD', 1299.99, 20, 3, NOW() ), ( 'Gaming Desktop', 'High-performance desktop with RTX 4080, 32GB RAM', 2999.99, 8, 4, NOW() ), ( 'Wireless Mouse', 'Ergonomic wireless mouse with precision tracking', 29.99, 100, 5, NOW() ), ( 'Mecha