xiaohongshu
xiaohongshu
ln-723-mockdata-migrator
Migrates mock data from Drizzle ORM schemas to C# MockData classes
Full skill instructions
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-720-structure-migrator
Migrates mock data from ORM schemas to .NET MockData classes with realistic sample data.
| Aspect | Description |
|---|---|
| Input | ORM schema files (Drizzle, Prisma, TypeORM) |
| Output | C# MockData static classes |
| Primary ORM | Drizzle (others supported) |
Scope boundaries:
| Phase | Name | Actions | Output |
|---|---|---|---|
| 1 | Parse Schema | Read ORM file, extract table definitions | Entity model |
| 2 | Map Types | Apply type mapping rules, detect nullable | C# type definitions |
| 3 | Generate MockData | Create static class, generate sample data | MockData.cs files |
| 4 | Verify | Compile check, relationship validation | Valid C# code |
Extract entity definitions from ORM schema.
| Step | Action | Reference |
|---|---|---|
| 1.1 | Locate schema file(s) | — |
| 1.2 | Identify ORM type (Drizzle/Prisma/TypeORM) | Detect by syntax |
| 1.3 | Extract table definitions | drizzle_patterns.md |
| 1.4 | Extract column definitions | drizzle_patterns.md |
| 1.5 | Identify constraints (PK, FK, nullable) | drizzle_patterns.md |
| 1.6 | Extract enum definitions | drizzle_patterns.md |
Output: Entity model with columns, types, and constraints.
Convert ORM types to C# types.
| Step | Action | Reference |
|---|---|---|
| 2.1 | Map column types to C# | type_mapping.md |
| 2.2 | Determine nullable status | type_mapping.md |
| 2.3 | Identify primary keys | type_mapping.md |
| 2.4 | Map foreign keys | relationship_mapping.md |
| 2.5 | Transform names (snake_case → PascalCase) | drizzle_patterns.md |
Type mapping summary:
| ORM Type | C# Type | Nullable Rule |
|---|---|---|
| uuid | Guid | No (PK), Depends (FK) |
| varchar | string | Check .notNull() |
| integer | int | No |
| boolean | bool | No |
| timestamp | DateTime | Depends |
Create C# MockData class with sample data.
| Step | Action | Reference |
|---|---|---|
| 3.1 | Create MockData class | data_generation.md |
| 3.2 | Generate GUIDs for entities | data_generation.md |
| 3.3 | Generate sample data per field | data_generation.md |
| 3.4 | Ensure FK relationships valid | relationship_mapping.md |
| 3.5 | Create accessor methods | data_generation.md |
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 |
Validate generated code.
| Check | Method | Expected |
|---|---|---|
| Syntax valid | Compile check | No errors |
| FKs valid | Cross-reference | All FKs point to existing IDs |
| Types correct | Type analysis | Proper C# types |
| Names follow convention | Pattern check | PascalCase |
| ORM | Detection Pattern |
|---|---|
| Drizzle | pgTable(), mysqlTable(), sqliteTable() |
| Prisma | model X { syntax |
| TypeORM | @Entity(), @Column() decorators |
| Source | Target | Transformation |
|---|---|---|
| Table name (plural, snake) | Class name (singular, Pascal) | user_profiles → UserProfile |
| Column name (snake) | Property name (Pascal) | created_at → CreatedAt |
| Enum name | Enum type (Pascal) | status_enum → StatusEnum |
| FK column | Navigation property | user_id → UserId |
| Component | Purpose |
|---|---|
| Private static list | Holds immutable mock data |
| GetAll() method | Returns full list as IEnumerable |
| GetById(Guid id) | Finds single entity by ID |
| GetBy{FK}Id(Guid id) | Filters by foreign key |
| 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 |
| Risk | Detection | Mitigation |
|---|---|---|
| Parse failure | Exception during parse | Support multiple schema formats |
| Invalid type mapping | Unknown ORM type | Log warning, use string as fallback |
| FK mismatch | FK references non-existent ID | Generate parents first, validate after |
| Name collision | Duplicate class names | Prefix with feature name |
| Circular references | Self-referencing with cycles | Limit depth, validate graph |
| File | Purpose |
|---|---|
references/type_mapping.md | ORM to C# type conversion rules |
references/drizzle_patterns.md | Drizzle schema parsing patterns |
references/data_generation.md | Realistic sample data patterns |
references/relationship_mapping.md | FK handling and generation order |
Version: 2.0.0 Last Updated: 2026-01-10
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience