ln-723-seed-data-generator

Universal seed data generator: MIGRATE from ORM schemas or GENERATE from entity definitions to any target format

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "ln-723-seed-data-generator" with this command: npx skills add levnikolaevich/claude-code-skills/levnikolaevich-claude-code-skills-ln-723-seed-data-generator

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.

ln-723-seed-data-generator

Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-720-structure-migrator

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

AspectDescription
InputORM schema files (MIGRATE) or entity list (GENERATE)
OutputSeed data files in target format
ModesMIGRATE: 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

ModeWhenInputSource
MIGRATETRANSFORM pipeline — existing ORM schemas foundORM schema filesDrizzle, Prisma, TypeORM, EF Core, SQLAlchemy, Django ORM
GENERATECREATE pipeline — no existing schemasEntity list from ln-700 Phase 0User-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

FormatOutput FileFaker LibraryUse Case
C# MockDataMockData.csBogus.NET projects
TypeScript fixturesseed.tsFaker.jsNode/React projects
Python factoriesfactories.pyFaker (Python)Django/Flask projects
JSONseed.jsonAPI testing, import scripts
SQLseed.sqlDirect DB seeding

Workflow

PhaseNameActionsOutput
1Parse/Define1A: Parse ORM schema (MIGRATE) or 1B: Accept entity list (GENERATE)Entity model
2Map TypesApply universal type mapping to target formatTarget type definitions
3Generate Seed DataCreate seed files with faker-based realistic dataSeed data files
4VerifyValidate relationships, check syntaxValid seed files

Phase 1: Parse/Define

1A: MIGRATE Mode — Parse ORM Schema

StepActionReference
1A.1Locate schema file(s)
1A.2Auto-detect ORM typeorm_patterns.md — ORM Auto-Detection table
1A.3Extract table/model definitionsorm_patterns.md — per-ORM parsing section
1A.4Extract column definitions with typesorm_patterns.md
1A.5Identify constraints (PK, FK, nullable, unique)orm_patterns.md
1A.6Extract enum definitionsorm_patterns.md

1B: GENERATE Mode — Accept Entity Definitions

StepActionReference
1B.1Receive entity list from orchestrator (or use starter template)
1B.2Parse entity definitions (name, fields, types)
1B.3Infer relationships from field names (userId → FK to User)relationship_mapping.md
1B.4Apply 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.

StepActionReference
2.1Select target format (from orchestrator params)
2.2Map column types to target formattype_mapping.md — Universal Type Mapping table
2.3Determine nullable status per targettype_mapping.md
2.4Map foreign keys and relationshipsrelationship_mapping.md
2.5Transform names to target conventionSee Name Conventions table below

Name Conventions by Target:

TargetClass/ModelProperty/FieldFile
C#PascalCase singularPascalCasePascalCase.cs
TypeScriptPascalCase singularcamelCasecamelCase.ts
PythonPascalCase singularsnake_casesnake_case.py
JSONcamelCasecamelCasekebab-case.json
SQLsnake_case pluralsnake_casesnake_case.sql

Phase 3: Generate Seed Data

Create seed files with realistic data using faker libraries.

StepActionReference
3.1Determine generation order (parents → children)relationship_mapping.md
3.2Generate IDs (GUIDs/UUIDs) for all entitiesdata_generation.md
3.3Generate field values using fakerdata_generation.md, type_mapping.md — Faker Integration
3.4Ensure FK relationships valid (child references existing parent ID)relationship_mapping.md
3.5Write 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).

TargetFaker Setup
C#var faker = new Bogus.Faker(); Randomizer.Seed = new Random(42);
TypeScriptimport { faker } from '@faker-js/faker'; faker.seed(42);
Pythonfrom faker import Faker; fake = Faker(); Faker.seed(42)

Generation order by dependency:

OrderEntity TypeGenerate After
1Root entities (no FK)First
2First-level childrenParents exist
3Second-level childrenGrandparents exist
NDeepest childrenAll ancestors exist

Phase 4: Verify

CheckMethodExpected
Syntax validLanguage-specific checkNo syntax errors
FKs validCross-referenceAll FKs point to existing IDs
Types correctType analysisProper types for target format
Names follow conventionPattern checkPer-target naming convention
Faker deterministicRe-run with same seedIdentical output

Supported ORM Detection

ORMDetection PatternEcosystem
DrizzlepgTable(), mysqlTable(), sqliteTable()Node.js
Prismamodel X { syntax in .prisma filesNode.js
TypeORM@Entity(), @Column() decoratorsNode.js
EF CoreDbContext, DbSet<>, [Table] attributes.NET
SQLAlchemyBase = declarative_base(), Column()Python
Django ORMmodels.Model, models.CharField()Python

Entity Transformation Rules

SourceTargetTransformation
Table name (plural, snake)Class name (singular, Pascal)user_profilesUserProfile
Column name (snake)Property name (target convention)created_atCreatedAt / createdAt / created_at
Enum nameEnum type (Pascal)status_enumStatusEnum
FK columnNavigation propertyuser_idUserId / userId

Sample Data Guidelines

Field TypeSample CountDistribution
Root entities3-5 itemsVaried status/priority
Child entities5-10 itemsDistributed across parents
Leaf entities10-20 itemsRealistic 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

  • Mode determined (MIGRATE or GENERATE)
  • Entity model extracted/defined with all fields and constraints
  • Target format selected and type mappings applied
  • Seed data files generated with faker-based realistic values
  • Deterministic seeding verified (re-run produces identical output)
  • Foreign keys reference valid parent IDs
  • Names follow target format conventions
  • Sample data includes 5-10 items per entity

Risk Mitigation

RiskDetectionMitigation
Unknown ORM typeAuto-detection failsLog warning, ask orchestrator for ORM hint
Invalid type mappingUnknown column typeUse string as fallback, log warning
FK mismatchFK references non-existent IDGenerate parents first, validate after
No entity list in GENERATEEmpty inputUse starter template (User, Role)
Name collisionDuplicate class/table namesPrefix with feature name
Circular referencesSelf-referencing with cyclesLimit depth, validate graph

Reference Files

FilePurpose
references/orm_patterns.mdORM auto-detection and schema parsing patterns (Drizzle, Prisma, TypeORM, EF Core, SQLAlchemy, Django)
references/type_mapping.mdUniversal type mapping (ORM-agnostic → C#, TypeScript, Python) + Faker integration
references/data_generation.mdRealistic sample data patterns and generation rules
references/relationship_mapping.mdFK handling, generation order, relationship inference

Version: 3.0.0 Last Updated: 2026-02-07

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

ln-624-code-quality-auditor

No summary provided by upstream source.

Repository SourceNeeds Review
Security

ln-626-dead-code-auditor

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

ln-782-test-runner

No summary provided by upstream source.

Repository SourceNeeds Review