Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
ln-723-seed-data-generator
Type: L3 Worker
Category: 7XX Project Bootstrap
Universal seed data generator with two modes: MIGRATE (parse existing ORM schemas) or GENERATE (create from entity definitions). Outputs to any target format (C#, TypeScript, Python, JSON, SQL).
Purpose & Scope
| Aspect |
Description |
| Input |
ORM schema files (MIGRATE) or entity list (GENERATE) |
| Output |
Seed data files in target format |
| Modes |
MIGRATE: parse existing ORM → seed data. GENERATE: entity definitions → seed data |
Scope boundaries:
- Parses ORM schema definitions or accepts entity lists
- Generates seed data in requested target format
- Creates realistic sample data using faker libraries
- Does not generate database migrations, EF Core configs, or ORM models
Mode Selection
| Mode |
When |
Input |
Source |
| MIGRATE |
TRANSFORM pipeline — existing ORM schemas found |
ORM schema files |
Drizzle, Prisma, TypeORM, EF Core, SQLAlchemy, Django ORM |
| GENERATE |
CREATE pipeline — no existing schemas |
Entity list from ln-700 Phase 0 |
User-provided or starter template (User, Role) |
If GENERATE mode receives no entity list, generate starter template with User (id, name, email, role, createdAt) and Role (id, name, description).
Target Formats
| Format |
Output File |
Faker Library |
Use Case |
| C# MockData |
MockData.cs |
Bogus |
.NET projects |
| TypeScript fixtures |
seed.ts |
Faker.js |
Node/React projects |
| Python factories |
factories.py |
Faker (Python) |
Django/Flask projects |
| JSON |
seed.json |
— |
API testing, import scripts |
| SQL |
seed.sql |
— |
Direct DB seeding |
Workflow
| Phase |
Name |
Actions |
Output |
| 1 |
Parse/Define |
1A: Parse ORM schema (MIGRATE) or 1B: Accept entity list (GENERATE) |
Entity model |
| 2 |
Map Types |
Apply universal type mapping to target format |
Target type definitions |
| 3 |
Generate Seed Data |
Create seed files with faker-based realistic data |
Seed data files |
| 4 |
Verify |
Validate relationships, check syntax |
Valid seed files |
Phase 1: Parse/Define
1A: MIGRATE Mode — Parse ORM Schema
| Step |
Action |
Reference |
| 1A.1 |
Locate schema file(s) |
— |
| 1A.2 |
Auto-detect ORM type |
orm_patterns.md — ORM Auto-Detection table |
| 1A.3 |
Extract table/model definitions |
orm_patterns.md — per-ORM parsing section |
| 1A.4 |
Extract column definitions with types |
orm_patterns.md |
| 1A.5 |
Identify constraints (PK, FK, nullable, unique) |
orm_patterns.md |
| 1A.6 |
Extract enum definitions |
orm_patterns.md |
1B: GENERATE Mode — Accept Entity Definitions
| Step |
Action |
Reference |
| 1B.1 |
Receive entity list from orchestrator (or use starter template) |
— |
| 1B.2 |
Parse entity definitions (name, fields, types) |
— |
| 1B.3 |
Infer relationships from field names (userId → FK to User) |
relationship_mapping.md |
| 1B.4 |
Apply default constraints (id = PK, *Id = FK) |
— |
Output: Entity model with columns, types, and constraints.
Phase 2: Map Types
Convert entity types to target format types.
| Step |
Action |
Reference |
| 2.1 |
Select target format (from orchestrator params) |
— |
| 2.2 |
Map column types to target format |
type_mapping.md — Universal Type Mapping table |
| 2.3 |
Determine nullable status per target |
type_mapping.md |
| 2.4 |
Map foreign keys and relationships |
relationship_mapping.md |
| 2.5 |
Transform names to target convention |
See Name Conventions table below |
Name Conventions by Target:
| Target |
Class/Model |
Property/Field |
File |
| C# |
PascalCase singular |
PascalCase |
PascalCase.cs |
| TypeScript |
PascalCase singular |
camelCase |
camelCase.ts |
| Python |
PascalCase singular |
snake_case |
snake_case.py |
| JSON |
camelCase |
camelCase |
kebab-case.json |
| SQL |
snake_case plural |
snake_case |
snake_case.sql |
Phase 3: Generate Seed Data
Create seed files with realistic data using faker libraries.
| Step |
Action |
Reference |
| 3.1 |
Determine generation order (parents → children) |
relationship_mapping.md |
| 3.2 |
Generate IDs (GUIDs/UUIDs) for all entities |
data_generation.md |
| 3.3 |
Generate field values using faker |
data_generation.md, type_mapping.md — Faker Integration |
| 3.4 |
Ensure FK relationships valid (child references existing parent ID) |
relationship_mapping.md |
| 3.5 |
Write seed file in target format |
— |
Faker integration rule: All generated seed files MUST use faker libraries for realistic data with deterministic seeding (fixed seed value for reproducibility).
| Target |
Faker Setup |
| C# |
var faker = new Bogus.Faker(); Randomizer.Seed = new Random(42); |
| TypeScript |
import { faker } from '@faker-js/faker'; faker.seed(42); |
| Python |
from faker import Faker; fake = Faker(); Faker.seed(42) |
Generation order by dependency:
| Order |
Entity Type |
Generate After |
| 1 |
Root entities (no FK) |
First |
| 2 |
First-level children |
Parents exist |
| 3 |
Second-level children |
Grandparents exist |
| N |
Deepest children |
All ancestors exist |
Phase 4: Verify
| Check |
Method |
Expected |
| Syntax valid |
Language-specific check |
No syntax errors |
| FKs valid |
Cross-reference |
All FKs point to existing IDs |
| Types correct |
Type analysis |
Proper types for target format |
| Names follow convention |
Pattern check |
Per-target naming convention |
| Faker deterministic |
Re-run with same seed |
Identical output |
Supported ORM Detection
| ORM |
Detection Pattern |
Ecosystem |
| Drizzle |
pgTable(), mysqlTable(), sqliteTable() |
Node.js |
| Prisma |
model X { syntax in .prisma files |
Node.js |
| TypeORM |
@Entity(), @Column() decorators |
Node.js |
| EF Core |
DbContext, DbSet<>, [Table] attributes |
.NET |
| SQLAlchemy |
Base = declarative_base(), Column() |
Python |
| Django ORM |
models.Model, models.CharField() |
Python |
Entity Transformation Rules
| Source |
Target |
Transformation |
| Table name (plural, snake) |
Class name (singular, Pascal) |
user_profiles → UserProfile |
| Column name (snake) |
Property name (target convention) |
created_at → CreatedAt / createdAt / created_at |
| Enum name |
Enum type (Pascal) |
status_enum → StatusEnum |
| FK column |
Navigation property |
user_id → UserId / userId |
Sample Data Guidelines
| Field Type |
Sample Count |
Distribution |
| Root entities |
3-5 items |
Varied status/priority |
| Child entities |
5-10 items |
Distributed across parents |
| Leaf entities |
10-20 items |
Realistic variety |
Critical Rules
- Single Responsibility: Generate only seed data, no ORM models or migrations
- Idempotent: Can re-run with same seed to produce identical output
- Valid Relationships: All FKs must reference existing parent IDs
- Faker Required: Use faker libraries for realistic data, never random strings
- Deterministic Seeding: Fixed seed value (42) for reproducibility across re-runs
- Generation Order: Parents before children, always
- Mode Awareness: MIGRATE parses files; GENERATE accepts definitions — never mix
Definition of Done
Risk Mitigation
| Risk |
Detection |
Mitigation |
| Unknown ORM type |
Auto-detection fails |
Log warning, ask orchestrator for ORM hint |
| Invalid type mapping |
Unknown column type |
Use string as fallback, log warning |
| FK mismatch |
FK references non-existent ID |
Generate parents first, validate after |
| No entity list in GENERATE |
Empty input |
Use starter template (User, Role) |
| Name collision |
Duplicate class/table names |
Prefix with feature name |
| Circular references |
Self-referencing with cycles |
Limit depth, validate graph |
Reference Files
| File |
Purpose |
references/orm_patterns.md |
ORM auto-detection and schema parsing patterns (Drizzle, Prisma, TypeORM, EF Core, SQLAlchemy, Django) |
references/type_mapping.md |
Universal type mapping (ORM-agnostic → C#, TypeScript, Python) + Faker integration |
references/data_generation.md |
Realistic sample data patterns and generation rules |
references/relationship_mapping.md |
FK handling, generation order, relationship inference |
Version: 3.0.0
Last Updated: 2026-02-07
1---2name: ln-723-seed-data-generator3description: Generates seed data from ORM schemas or entity definitions to any target format. Use when populating databases for development.4license: MIT5---67> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If `shared/` is missing, fetch files via WebFetch from `https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}`.89# ln-723-seed-data-generator1011**Type:** L3 Worker12**Category:** 7XX Project Bootstrap1314Universal seed data generator with two modes: MIGRATE (parse existing ORM schemas) or GENERATE (create from entity definitions). Outputs to any target format (C#, TypeScript, Python, JSON, SQL).1516---1718## Purpose & Scope1920| Aspect | Description |21|--------|-------------|22| **Input** | ORM schema files (MIGRATE) or entity list (GENERATE) |23| **Output** | Seed data files in target format |24| **Modes** | MIGRATE: parse existing ORM → seed data. GENERATE: entity definitions → seed data |2526**Scope boundaries:**27- Parses ORM schema definitions or accepts entity lists28- Generates seed data in requested target format29- Creates realistic sample data using faker libraries30- Does not generate database migrations, EF Core configs, or ORM models3132---3334## Mode Selection3536| Mode | When | Input | Source |37|------|------|-------|--------|38| **MIGRATE** | TRANSFORM pipeline — existing ORM schemas found | ORM schema files | Drizzle, Prisma, TypeORM, EF Core, SQLAlchemy, Django ORM |39| **GENERATE** | CREATE pipeline — no existing schemas | Entity list from ln-700 Phase 0 | User-provided or starter template (User, Role) |4041If GENERATE mode receives no entity list, generate starter template with `User` (id, name, email, role, createdAt) and `Role` (id, name, description).4243---4445## Target Formats4647| Format | Output File | Faker Library | Use Case |48|--------|-------------|---------------|----------|49| C# MockData | `MockData.cs` | Bogus | .NET projects |50| TypeScript fixtures | `seed.ts` | Faker.js | Node/React projects |51| Python factories | `factories.py` | Faker (Python) | Django/Flask projects |52| JSON | `seed.json` | — | API testing, import scripts |53| SQL | `seed.sql` | — | Direct DB seeding |5455---5657## Workflow5859| Phase | Name | Actions | Output |60|-------|------|---------|--------|61| 1 | Parse/Define | 1A: Parse ORM schema (MIGRATE) or 1B: Accept entity list (GENERATE) | Entity model |62| 2 | Map Types | Apply universal type mapping to target format | Target type definitions |63| 3 | Generate Seed Data | Create seed files with faker-based realistic data | Seed data files |64| 4 | Verify | Validate relationships, check syntax | Valid seed files |6566---6768## Phase 1: Parse/Define6970### 1A: MIGRATE Mode — Parse ORM Schema7172| Step | Action | Reference |73|------|--------|-----------|74| 1A.1 | Locate schema file(s) | — |75| 1A.2 | Auto-detect ORM type | `orm_patterns.md` — ORM Auto-Detection table |76| 1A.3 | Extract table/model definitions | `orm_patterns.md` — per-ORM parsing section |77| 1A.4 | Extract column definitions with types | `orm_patterns.md` |78| 1A.5 | Identify constraints (PK, FK, nullable, unique) | `orm_patterns.md` |79| 1A.6 | Extract enum definitions | `orm_patterns.md` |8081### 1B: GENERATE Mode — Accept Entity Definitions8283| Step | Action | Reference |84|------|--------|-----------|85| 1B.1 | Receive entity list from orchestrator (or use starter template) | — |86| 1B.2 | Parse entity definitions (name, fields, types) | — |87| 1B.3 | Infer relationships from field names (`userId` → FK to User) | `relationship_mapping.md` |88| 1B.4 | Apply default constraints (id = PK, `*Id` = FK) | — |8990**Output:** Entity model with columns, types, and constraints.9192---9394## Phase 2: Map Types9596Convert entity types to target format types.9798| Step | Action | Reference |99|------|--------|-----------|100| 2.1 | Select target format (from orchestrator params) | — |101| 2.2 | Map column types to target format | `type_mapping.md` — Universal Type Mapping table |102| 2.3 | Determine nullable status per target | `type_mapping.md` |103| 2.4 | Map foreign keys and relationships | `relationship_mapping.md` |104| 2.5 | Transform names to target convention | See Name Conventions table below |105106**Name Conventions by Target:**107108| Target | Class/Model | Property/Field | File |109|--------|-------------|----------------|------|110| C# | PascalCase singular | PascalCase | PascalCase.cs |111| TypeScript | PascalCase singular | camelCase | camelCase.ts |112| Python | PascalCase singular | snake_case | snake_case.py |113| JSON | camelCase | camelCase | kebab-case.json |114| SQL | snake_case plural | snake_case | snake_case.sql |115116---117118## Phase 3: Generate Seed Data119120Create seed files with realistic data using faker libraries.121122| Step | Action | Reference |123|------|--------|-----------|124| 3.1 | Determine generation order (parents → children) | `relationship_mapping.md` |125| 3.2 | Generate IDs (GUIDs/UUIDs) for all entities | `data_generation.md` |126| 3.3 | Generate field values using faker | `data_generation.md`, `type_mapping.md` — Faker Integration |127| 3.4 | Ensure FK relationships valid (child references existing parent ID) | `relationship_mapping.md` |128| 3.5 | Write seed file in target format | — |129130**Faker integration rule:** All generated seed files MUST use faker libraries for realistic data with **deterministic seeding** (fixed seed value for reproducibility).131132| Target | Faker Setup |133|--------|-------------|134| C# | `var faker = new Bogus.Faker(); Randomizer.Seed = new Random(42);` |135| TypeScript | `import { faker } from '@faker-js/faker'; faker.seed(42);` |136| Python | `from faker import Faker; fake = Faker(); Faker.seed(42)` |137138**Generation order by dependency:**139140| Order | Entity Type | Generate After |141|-------|-------------|----------------|142| 1 | Root entities (no FK) | First |143| 2 | First-level children | Parents exist |144| 3 | Second-level children | Grandparents exist |145| N | Deepest children | All ancestors exist |146147---148149## Phase 4: Verify150151| Check | Method | Expected |152|-------|--------|----------|153| Syntax valid | Language-specific check | No syntax errors |154| FKs valid | Cross-reference | All FKs point to existing IDs |155| Types correct | Type analysis | Proper types for target format |156| Names follow convention | Pattern check | Per-target naming convention |157| Faker deterministic | Re-run with same seed | Identical output |158159---160161## Supported ORM Detection162163| ORM | Detection Pattern | Ecosystem |164|-----|-------------------|-----------|165| Drizzle | `pgTable()`, `mysqlTable()`, `sqliteTable()` | Node.js |166| Prisma | `model X {` syntax in `.prisma` files | Node.js |167| TypeORM | `@Entity()`, `@Column()` decorators | Node.js |168| EF Core | `DbContext`, `DbSet<>`, `[Table]` attributes | .NET |169| SQLAlchemy | `Base = declarative_base()`, `Column()` | Python |170| Django ORM | `models.Model`, `models.CharField()` | Python |171172---173174## Entity Transformation Rules175176| Source | Target | Transformation |177|--------|--------|----------------|178| Table name (plural, snake) | Class name (singular, Pascal) | `user_profiles` → `UserProfile` |179| Column name (snake) | Property name (target convention) | `created_at` → `CreatedAt` / `createdAt` / `created_at` |180| Enum name | Enum type (Pascal) | `status_enum` → `StatusEnum` |181| FK column | Navigation property | `user_id` → `UserId` / `userId` |182183---184185## Sample Data Guidelines186187| Field Type | Sample Count | Distribution |188|------------|--------------|--------------|189| Root entities | 3-5 items | Varied status/priority |190| Child entities | 5-10 items | Distributed across parents |191| Leaf entities | 10-20 items | Realistic variety |192193---194195## Critical Rules196197- **Single Responsibility:** Generate only seed data, no ORM models or migrations198- **Idempotent:** Can re-run with same seed to produce identical output199- **Valid Relationships:** All FKs must reference existing parent IDs200- **Faker Required:** Use faker libraries for realistic data, never random strings201- **Deterministic Seeding:** Fixed seed value (42) for reproducibility across re-runs202- **Generation Order:** Parents before children, always203- **Mode Awareness:** MIGRATE parses files; GENERATE accepts definitions — never mix204205---206207## Definition of Done208209- [ ] Mode determined (MIGRATE or GENERATE)210- [ ] Entity model extracted/defined with all fields and constraints211- [ ] Target format selected and type mappings applied212- [ ] Seed data files generated with faker-based realistic values213- [ ] Deterministic seeding verified (re-run produces identical output)214- [ ] Foreign keys reference valid parent IDs215- [ ] Names follow target format conventions216- [ ] Sample data includes 5-10 items per entity217218---219220## Risk Mitigation221222| Risk | Detection | Mitigation |223|------|-----------|------------|224| Unknown ORM type | Auto-detection fails | Log warning, ask orchestrator for ORM hint |225| Invalid type mapping | Unknown column type | Use string as fallback, log warning |226| FK mismatch | FK references non-existent ID | Generate parents first, validate after |227| No entity list in GENERATE | Empty input | Use starter template (User, Role) |228| Name collision | Duplicate class/table names | Prefix with feature name |229| Circular references | Self-referencing with cycles | Limit depth, validate graph |230231---232233## Reference Files234235| File | Purpose |236|------|---------|237| `references/orm_patterns.md` | ORM auto-detection and schema parsing patterns (Drizzle, Prisma, TypeORM, EF Core, SQLAlchemy, Django) |238| `references/type_mapping.md` | Universal type mapping (ORM-agnostic → C#, TypeScript, Python) + Faker integration |239| `references/data_generation.md` | Realistic sample data patterns and generation rules |240| `references/relationship_mapping.md` | FK handling, generation order, relationship inference |241242---243244**Version:** 3.0.0245**Last Updated:** 2026-02-07