php:make-factory

Generate Zenstruck Foundry factory classes for PHP entities.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/atournayre/claude-personas --skill php-make-factory
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: php:make-factory
Source: https://github.com/atournayre/claude-personas/tree/main/php/skills/make-factory
Command: npx skills add https://github.com/atournayre/claude-personas --skill php-make-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of Factory Foundry classes, which are essential for generating test data for your PHP entities, streamlining your testing workflow.

Core Features & Use Cases

  • Automated Factory Generation: Creates EntityNameFactory.php files based on your existing entity definitions.
  • Test Data Setup: Simplifies the process of creating mock entities with realistic data for unit and integration tests.
  • Use Case: When developing a new feature that requires extensive testing of your Product entity, use this skill to quickly generate a ProductFactory to create various product instances for your test suite.

Quick Start

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

Frequently Asked Questions about php:make-factory

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

FAQPage Schema
How do I generate a Zenstruck Foundry factory for my PHP entity tests?▼

To generate a Zenstruck Foundry factory for PHP entity tests, use a factory generation skill to automatically create an EntityNameFactory.php class based on your existing entity definitions. This simplifies setting up mock data for unit and integration testing scenarios.

What do I need to create factory classes for PHP test data?▼

To create factory classes for PHP test data, you need an existing PHP entity definition and the Zenstruck Foundry package installed in your project. The generation process uses these definitions to output a factory file for your test suite.

When should I use a factory foundry class in PHP integration testing?▼

You should use a factory foundry class in PHP integration testing when you need to quickly generate multiple instances of an entity with realistic mock data. It streamlines test data creation for features requiring extensive testing of specific entities like a Product object.

Does factory generation work without an existing PHP entity definition?▼

No, factory generation does not work without an existing PHP entity definition. The skill requires a predefined entity class to accurately map attributes and generate the corresponding EntityNameFactory.php file for your testing workflow.

What is the best way to automate test data creation for PHP entities?▼

The best way to automate test data creation for PHP entities is by generating Zenstruck Foundry factory classes. This approach automatically creates factory files that handle the instantiation and configuration of mock objects for your unit and integration tests.