| name | test-data-factory |
| description | Generate realistic test data (SQL, CSV, JSON) for any schema. Use when the user needs seed data, fixtures, or fake records. |
Test Data Factory
Generate realistic, consistent test data for any schema or domain.
Description
This skill generates realistic test data based on schemas, table definitions, or domain descriptions. It creates data that respects constraints, relationships, and business rules while covering edge cases that matter for testing.
Instructions
When the user provides a schema or describes the data they need:
- Understand the Schema: Parse table definitions, data types, constraints, and relationships
- Generate Realistic Data: Create data that looks real (proper names, valid emails, realistic dates)
- Cover Edge Cases: Include boundary values, special characters, minimum/maximum lengths
- Maintain Relationships: Ensure foreign keys are valid across related tables
- Output Formats: Generate in the requested format (SQL INSERT, CSV, JSON, or fixture files)
Data Categories
Standard Test Data
- Valid records with typical values
- Covering all enum/status values
- Multiple records per foreign key relationship
Edge Case Data
- Empty strings vs. NULL
- Maximum-length strings
- Minimum/maximum numeric values
- Boundary dates (leap years, timezone edges, epoch)
- Unicode characters, emojis, RTL text
- Special characters in text fields (
', ", <, >, &, \n)
- Zero, negative numbers where applicable
Negative Test Data
- Invalid email formats
- Future dates where past is expected
- Duplicate unique fields
- Orphaned foreign keys
- Values exceeding field length
Performance Test Data
- Large volume generation (1K, 10K, 100K records)
- Varied distribution patterns
- Realistic cardinality ratios
Output Formats
SQL INSERT Statements
INSERT INTO users (id, email, name, created_at, status) VALUES
(1, 'maria.garcia@example.com', 'Maria Garcia', '2024-01-15 08:30:00', 'active'),
(2, 'james.chen@example.com', 'James Chen', '2024-02-20 14:15:00', 'active'),
(3, 'test+special@example.co.uk', 'O''Brien, Ana-Maria', '2024-03-01 00:00:00', 'pending');
CSV
id,email,name,created_at,status
1,maria.garcia@example.com,Maria Garcia,2024-01-15T08:30:00Z,active
JSON
[
{
"id": 1,
"email": "maria.garcia@example.com",
"name": "Maria Garcia",
"created_at": "2024-01-15T08:30:00Z",
"status": "active"
}
]
Python/JavaScript Fixtures
TEST_USERS = [
{"id": 1, "email": "maria.garcia@example.com", "name": "Maria Garcia"},
]
Smart Defaults
- Names: Culturally diverse, realistic first + last names
- Emails: Derived from names + various domains
- Dates: Distributed across realistic ranges
- Phones: Valid format for specified locale
- Addresses: Realistic but fictional
- IDs: Sequential or UUID based on schema
Example Usage
Generate 50 test users with orders. Each user should have 1-5 orders.
Schema: users(id, email, name, plan), orders(id, user_id, total, status, created_at)
Output as SQL INSERTs for PostgreSQL.
Create edge case test data for a registration form:
fields: name (required, max 100), email (required, unique), age (optional, 13-120), bio (optional, max 500)