From aj-geddes-useful-ai-prompts-4
Generates realistic, consistent test data using factories, fixtures, and fake data libraries. Use for seeding databases, building test builders, and creating mock data.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:test-data-generationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Test data generation creates realistic, consistent, and maintainable test data for automated testing. Well-designed test data reduces test brittleness, improves readability, and makes it easier to create diverse test scenarios.
Minimal working example:
// tests/factories/userFactory.js
const { faker } = require("@faker-js/faker");
class UserFactory {
static build(overrides = {}) {
return {
id: faker.string.uuid(),
email: faker.internet.email(),
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
age: faker.number.int({ min: 18, max: 80 }),
phone: faker.phone.number(),
address: {
street: faker.location.streetAddress(),
city: faker.location.city(),
state: faker.location.state(),
zip: faker.location.zipCode(),
country: "USA",
},
role: "user",
isActive: true,
createdAt: faker.date.past(),
...overrides,
};
}
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Factory Pattern for Test Data | Factory Pattern for Test Data |
| Builder Pattern for Complex Objects | Builder Pattern for Complex Objects |
| Fixtures for Integration Tests | Fixtures for Integration Tests |
| Realistic Data Generation | Realistic Data Generation |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Generates realistic test data including fixtures, factory functions, seed datasets, and edge case values. Supports Faker.js, Fishery, factory-boy, and database seed scripts.
Creating and managing test data via fixtures, builders, factories, and minimal realistic datasets.
Generates test fixtures, mock data, factories, and builders for unit/integration tests in JavaScript/TypeScript and Python, including pytest and Jest fixtures.