test-data-factory

Generate Swift test data factories for identifiable and codable models.

603|51|Updated Oct 29, 2025
One-click install
npx skills add https://github.com/rshankras/claude-code-apple-skills --skill test-data-factory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-data-factory
Source: https://github.com/rshankras/claude-code-apple-skills/tree/main/skills/testing/test-data-factory
Command: npx skills add https://github.com/rshankras/claude-code-apple-skills --skill test-data-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill eliminates the boilerplate and friction associated with setting up test data in your projects, making your tests cleaner and faster to write.

Core Features & Use Cases

  • Automated Factory Generation: Creates static factory methods or builder patterns for your Swift models.
  • Reduced Boilerplate: Significantly cuts down on repetitive test setup code.
  • Use Case: When writing unit tests, instead of manually constructing complex objects with dozens of properties, you can generate them with a single line like Item.fixture(isFavorite: true).

Quick Start

Generate test data factories for all identifiable Swift models in the project.

Frequently Asked Questions about test-data-factory

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

FAQPage Schema
How do I generate Swift test data factories for my codable models?

Generating test data factories involves creating static factory methods or builder patterns for identifiable and codable Swift models. This skill automates that creation process to support common data types, nested models, and API response structures.

How do I reduce boilerplate code when setting up unit test fixtures in Swift?

You can reduce boilerplate code by generating static factory methods or builder patterns for your Swift models. This allows you to construct complex objects with a single line of code, such as Item.fixture(isFavorite: true), instead of manually setting up dozens of properties.

Can I use the factory pattern for nested models and API response structures in Swift?

Yes, the factory pattern generation supports nested models and API response structures. It creates static factory methods and builder patterns for identifiable and codable Swift models to handle these complex data structures.

What is the best way to create test fixtures for identifiable Swift models?

The best way to create test fixtures for identifiable Swift models is to use automated factory generation. This creates static factory methods or builder patterns, allowing you to generate test data with a single line of code and significantly reduce repetitive setup boilerplate.

Does generated test data factory code work with both factory methods and builder patterns?

Yes, the generated test data factory code works with both static factory methods and builder patterns. You can use either approach to construct complex objects for your unit tests, reducing the friction associated with manual test setup.