What problem does it solve? Writing tests requires realistic, validation-passing mock data, but hand-crafting fixtures for every Pydantic model, dataclass, msgspec Struct, or SQLAlchemy entity is repetitive and drifts out of sync as models evolve. This Skill guides the creation of polyfactory-based factories that introspect model annotations and constraints to produce fully-populated, valid instances automatically. ## Core Features & Use Cases - Backend-matched factory bases: Pick the correct factory base per model type — ModelFactory for Pydantic, DataclassFactory for dataclasses, MsgspecFactory for msgspec Structs, AttrsFactory for attrs, TypedDictFactory, and SQLAlchemyFactory for ORM models — so generated data respects field constraints and validators. - Field customization and determinism: Pin literal values, re-evaluate callables per build with Use, derive fields with PostGenerated, and control randomness via random_seed, faker, and allow_none_optionals. - Pytest integration: Turn factories into fixtures with @register_fixture, wire cross-model relationships with Fixture(...) or set_as_default_factory_for_type, and fan out parametrized tests over union branches with coverage(). - Use Case: In a Litestar project, register a MsgspecFactory for a request DTO, inject the fixture into an AsyncTestClient handler test, and POST a validation-passing payload without writing any inline fake data. ## Quick Start Create a polyfactory factory for my Order dataclass and register it as a pytest fixture for my test suite.