test-data-factory

Generate realistic fake healthcare test data using factory_boy scenario factories.

Updated May 11, 2026
One-click install
npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill test-data-factory-thachrocky12345
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-data-factory
Source: https://github.com/thachrocky12345/local-agent-train-workstation/tree/main/.claude/skills/test-data-factory
Command: npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill test-data-factory-thachrocky12345

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires factory_boy, faker, pytz.

What problem does it solve? Writing tests and seeding dev environments for a healthcare platform requires realistic, safe, and relationally consistent fake data across users, providers, appointments, payments, and risk screenings, which is tedious and error-prone to build by hand. ## Core Features & Use Cases - Healthcare Faker Providers: Generate Luhn-valid NPI numbers, state-format license numbers, ICD-10 codes, SOAP-style clinical notes, and PHQ-9 risk screening keywords. - Composite Scenario Factories: Pre-built scenarios including CompletedSession, CrisisScreening, NewProviderOnboarding, BookingFunnel, MinorClient, cancellations, no-shows, reschedules, and cross-timezone bookings. - Safety-First Data: Uses .example emails, 555 phone prefixes, ocean coordinates, and fake addresses so test data can never leak into real communications. - Use Case: When writing a test for the crisis screening flow, invoke the CrisisScreening scenario to create a user with a PHQ-9 score of 27 and nine ResponseDetail records, with item 9 flagged severe. ## Quick Start Ask the AI to generate a CrisisScreening test scenario with a count of 3 using the test data factory skill.

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 fake healthcare test data with factory_boy?

Register a custom Faker provider for healthcare fields like NPI numbers and clinical notes, then build factories that extend existing model factories. Composite scenario classes chain providers, clients, appointments, and payments into complete test fixtures.

How to create test fixtures for a Django healthcare app?

Import existing factories from each app's tests conftest module and extend them rather than duplicating definitions. Use scenario classes like CompletedSessionScenario or BookingFunnelScenario to create full relationship chains in one call.

Can factory_boy generate valid NPI numbers for testing?

Yes, a custom Faker BaseProvider can generate NPI numbers that pass Luhn validation using the 80840 prefix per the CMS standard. Type 1 covers individual providers and type 2 covers organizational providers.

Why does the PaymentMethodFactory raise a TypeError?

The PaymentMethodFactory is broken because it targets a TextChoices enum instead of a database model and references fields that do not exist on it. Do not use it; create StripeUserFactory records instead for payment-related test data.

How do I keep test data from using real emails or phone numbers?

Use safe provider methods that generate only @example.com emails, 555-prefix phone numbers, ocean coordinates, and clearly fake addresses. Run the seed data safety validation afterward to assert no real-looking values exist in the database.