framework:make:factory

Generate Zenstruck Foundry factories for test entity instances.

9|2|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/atournayre/claude-marketplace --skill framework-make-factory
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: framework:make:factory
Source: https://github.com/atournayre/claude-marketplace/tree/main/framework/skills/make-factory
Command: npx skills add https://github.com/atournayre/claude-marketplace --skill framework-make-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the repetitive manual work of creating test factories for your entities, saving you from writing boilerplate code and ensuring consistent testing patterns.

Core Features & Use Cases

  • Automated Factory Generation: Instantly generates complete Zenstruck Foundry factories with proper Faker data and Elegant Objects patterns.
  • Smart Property Detection: Automatically reads your entity's constructor to detect required properties and generate appropriate defaults.
  • Use Case: Imagine you have 20 entities in your Symfony application. Use this Skill to automatically generate test factories for all of them with consistent patterns, saving hours of manual coding.

Quick Start

Use skill framework:make:factory to generate a factory for the Product entity.

Frequently Asked Questions about framework:make:factory

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

FAQPage Schema
How do I generate test factories for Symfony entities automatically?▼

Generate a Zenstruck Foundry factory instantly using this Skill to create test entity instances with proper Faker data, relationship wiring, and utility modifiers. It reads your entity's constructor, detects required properties, and builds factories following PersistentObjectFactory patterns with consistent conventions.

What is Zenstruck Foundry and why use it for test factories?▼

Zenstruck Foundry is a testing framework that simplifies test entity creation through factory classes. This Skill automates factory generation, eliminating boilerplate code and ensuring your test data follows framework conventions with Faker-based defaults and proper initialization patterns.

Can I use factory generation with entities that have custom constructors?▼

Yes. The Skill reads your entity's constructor to detect required properties and generate appropriate defaults. It supports the create() factory pattern and uses instantiateWith() to handle custom constructor logic while maintaining Elegant Objects principles.

How much time does automated factory generation save on large projects?▼

For projects with 20+ entities, automated factory generation eliminates hours of manual coding by generating complete test factories at once with consistent patterns, proper Faker values, relationship wiring, and utility modifiers like withSpecificId across all entities.

What happens after I generate a factory—can I customize it?▼

Generated factories follow framework conventions and are immediately usable. You can extend them by adding custom modifiers, relationship configurations, or Faker overrides to suit specific test scenarios while maintaining the foundation.

Does this Skill work with any entity or only specific frameworks?▼

This Skill applies to any entity using the create() factory pattern. It's designed for Symfony applications with Zenstruck Foundry and generates factories extending PersistentObjectFactory with proper class declaration and defaults() implementation.