Create test builder

From dykyi-roman/awesome-claude-code · View interactive version

Create test builder is an AI agent skill from the GitHub repository dykyi-roman/awesome-claude-code. Generates Test Data Builder and Object Mother patterns for PHP 8.4. Creates fluent builders with sensible defaults and factory methods for test data creation.

How to use this skill

Skill file

Test Data Builder Generator

Generates Test Data Builder and Object Mother patterns for test data creation.

Patterns

Test Data Builder

Fluent interface for constructing test objects with customizable properties.

When to use:

Object Mother

Factory methods returning pre-configured objects for common scenarios.

When to use:

References

Generation Instructions

  1. Analyze the target class:
  1. Determine sensible defaults:
  1. Create Builder with:
  1. Create Mother with:
  1. File placement:

Best Practices

  1. Sensible defaults — Tests should work without customization
  2. Fluent interface — Chain method calls
  3. Immutable builders — Clone in each with* method
  4. Expressive names — pending() not withStatus(pending)
  5. Composition — Builders can use other Mothers/Builders
  6. Single Responsibility — One builder per aggregate/entity
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.