home / skills / jeremylongshore / claude-code-plugins-plus-skills / factory-pattern-creator

factory-pattern-creator skill

/skills/09-test-automation/factory-pattern-creator

This skill helps you create and validate factory pattern implementations for test automation, providing production-ready code and best-practice configurations.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill factory-pattern-creator

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: "factory-pattern-creator"
description: |
  Create factory pattern creator operations. Auto-activating skill for Test Automation.
  Triggers on: factory pattern creator, factory pattern creator
  Part of the Test Automation skill category. Use when working with factory pattern creator functionality. Trigger with phrases like "factory pattern creator", "factory creator", "factory".
allowed-tools: "Read, Write, Edit, Bash(cmd:*), Grep"
version: 1.0.0
license: MIT
author: "Jeremy Longshore <[email protected]>"
---

# Factory Pattern Creator

## Overview

This skill provides automated assistance for factory pattern creator tasks within the Test Automation domain.

## When to Use

This skill activates automatically when you:
- Mention "factory pattern creator" in your request
- Ask about factory pattern creator patterns or best practices
- Need help with test automation skills covering unit testing, integration testing, mocking, and test framework configuration.

## Instructions

1. Provides step-by-step guidance for factory pattern creator
2. Follows industry best practices and patterns
3. Generates production-ready code and configurations
4. Validates outputs against common standards

## Examples

**Example: Basic Usage**
Request: "Help me with factory pattern creator"
Result: Provides step-by-step guidance and generates appropriate configurations


## Prerequisites

- Relevant development environment configured
- Access to necessary tools and services
- Basic understanding of test automation concepts


## Output

- Generated configurations and code
- Best practice recommendations
- Validation results


## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Configuration invalid | Missing required fields | Check documentation for required parameters |
| Tool not found | Dependency not installed | Install required tools per prerequisites |
| Permission denied | Insufficient access | Verify credentials and permissions |


## Resources

- Official documentation for related tools
- Best practices guides
- Community examples and tutorials

## Related Skills

Part of the **Test Automation** skill category.
Tags: testing, jest, pytest, mocking, tdd

Overview

This skill automates creation and guidance for factory pattern creator operations within Test Automation. It produces step-by-step guidance, production-ready code snippets, and validation checks for factory-based test fixtures. Use it to standardize object creation, manage test data, and streamline mocking and dependency injection in unit and integration tests.

How this skill works

When triggered, the skill analyzes the requested factory pattern scenario and generates concrete factory implementations, configuration snippets, and usage examples for common test frameworks. It follows industry best practices for test data creation, offers validation checks against common standards, and suggests improvements for maintainability and reuse. Outputs include code, configuration, and suggested tests to verify the factory behavior.

When to use it

  • You need reusable test data builders or factories for unit or integration tests
  • You want consistent, maintainable object creation and mocking strategies
  • Setting up dependency injection or fixture factories for test suites
  • Automating factory code generation for languages like Python and frameworks like pytest
  • Validating factory configurations and test data for CI pipelines

Best practices

  • Keep factories small and focused: one factory per domain concept
  • Support sensible defaults and allow overrides for test-specific data
  • Avoid side effects in factory constructors; separate creation from persistence
  • Provide explicit helpers for common variants to improve readability
  • Include validation tests that assert factory output shape and invariants

Example use cases

  • Generate a pytest factory for creating authenticated user objects with default roles and override options
  • Create a set of factories for service-layer domain objects and corresponding mocks for integration tests
  • Produce configuration and examples for wiring factories into CI test runs
  • Refactor ad-hoc test data creation into centralized factory modules for a large test suite
  • Validate factory outputs to prevent flaky tests caused by inconsistent test data

FAQ

What languages and frameworks does this support?

The skill focuses on common test automation patterns and provides examples primarily for Python and pytest but can be adapted to other languages and frameworks upon request.

Can it generate production-ready code?

Yes. It generates production-ready factory code and configuration while following best practices, and includes validation steps you should run in your environment.