Generate Factory

Generate Python factory-boy or TypeScript builder files for models and types.

1|1|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/btabaska/simpler-grants-documentation-automation --skill generate-factory-btabaska
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Generate Factory
Source: https://github.com/btabaska/simpler-grants-documentation-automation/tree/main/.cursor/skills/skill-generate-factory
Command: npx skills add https://github.com/btabaska/simpler-grants-documentation-automation --skill generate-factory-btabaska

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing test-data factories is repetitive and error-prone, leading to slow test setup and inconsistent mocks.

Core Features & Use Cases

  • Generate a factory file for a given model (Python with factory-boy) or a TypeScript frontend builder, ensuring naming and placement beside existing siblings.
  • Infer fields, apply safe defaults, handle foreign keys and enums, and produce synthetic data that avoids real PII.
  • Use cases include adding a new SQLAlchemy model, a Pydantic DTO, or a new TypeScript interface and needing a ready-to-use factory or builder.

Quick Start

Run the skill with a fully-qualified target (e.g., api.src.db.models.OpportunityModel) or a frontend type to generate a matching factory placed next to existing siblings.

Frequently Asked Questions about Generate Factory

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

FAQPage Schema
How do I automatically generate test data factories for SQLAlchemy or Pydantic models?

You can automatically generate test data factories by analyzing a target Python class or symbol to create a factory-boy file with safe defaults, resolved foreign keys, and synthetic data placed next to existing siblings.

Can I generate TypeScript builders for frontend interfaces?

Yes, you can generate TypeScript builders for frontend interfaces by analyzing the target type and writing a matching builder file nearby, ensuring consistent naming and ready-to-use mock data.

How do test data factories handle foreign keys and enums safely?

Test data factories handle foreign keys and enums by automatically inferring fields, resolving relationships, applying safe defaults, and producing synthetic data that avoids real PII.

What is the best way to create mock data factories without writing repetitive boilerplate?

The best way to create mock data factories without repetitive boilerplate is to use an automated generator that analyzes your model symbols and writes a matching factory or builder with safe defaults.

Do I need to manually specify field types when generating factory-boy factories?

No, you do not need to manually specify field types because the generation process analyzes the target model, infers fields, and applies safe defaults automatically.

Does the generated factory avoid using real PII in test data?

Yes, the generated factory avoids real PII by producing synthetic data with safe defaults, ensuring test setups remain consistent and secure.