test-data-factory-builder

Generate factories and builders for realistic test data with relationships and persistence.

1|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/zinohome/CozyChat --skill test-data-factory-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-data-factory-builder
Source: https://github.com/zinohome/CozyChat/tree/main/.claude/skills/test-data-factory-builder
Command: npx skills add https://github.com/zinohome/CozyChat --skill test-data-factory-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the creation of consistent, composable, and realistic test data for software development, reducing the effort and improving the reliability of testing.

Core Features & Use Cases

  • Factory Pattern: Define reusable factories for creating objects with default and overridden properties.
  • Builder Pattern: Construct complex objects step-by-step, ideal for scenarios with many optional configurations.
  • Relationship Handling: Easily generate related data entities (e.g., users with orders).
  • Traits: Apply predefined sets of attributes to objects for specific scenarios (e.g., 'verified', 'suspended').
  • Realistic Data: Utilizes libraries like Faker to generate lifelike data for various fields.
  • Database Persistence: Integrates with ORMs like Prisma for direct database seeding.
  • Use Case: When testing an e-commerce application, use this Skill to generate a user, several products, and a complete order with associated items, ensuring all relationships and data types are correctly represented.

Quick Start

Use the test-data-factory-builder skill to create a new user with the email '[email protected]'.

Frequently Asked Questions about test-data-factory-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to generate realistic mock data for software testing?

Using the factory and builder patterns to generate realistic mock data allows you to define reusable templates with default and overridden properties. This approach ensures consistent, composable test data creation, reducing manual effort and improving testing reliability by leveraging libraries like Faker for lifelike values.

How do I generate test data with relationships for an e-commerce application?

You generate test data with relationships by applying factory and builder patterns that support relationship handling. This enables you to easily generate related data entities, such as creating a user, several products, and a complete order with associated items, ensuring all relationships and data types are correctly represented.

Can I seed a database directly using generated test data factories?

Yes, you can seed a database directly using generated test data factories through database persistence integrations. The factories integrate with ORMs like Prisma to persist the generated mock data directly into your database for development and testing scenarios.

How do I apply specific predefined attributes to mock data for different test scenarios?

You apply specific predefined attributes to mock data by using traits within the factory pattern. Traits allow you to apply predefined sets of attributes to objects for specific scenarios, such as marking a user as 'verified' or 'suspended' for targeted testing.

When should I use the builder pattern instead of the factory pattern for test data generation?

You should use the builder pattern instead of the factory pattern when constructing complex objects step-by-step, ideal for scenarios with many optional configurations. The factory pattern is better suited for defining reusable objects with default and overridden properties.

Does test data generation with factory patterns require specific ORM integrations?

Test data generation with factory patterns does not strictly require ORM integrations, but they are necessary for database persistence. Integrating with ORMs like Prisma enables direct database seeding, while libraries like Faker are required to generate realistic values for the data fields.