[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FAP09HZGTZ7FGKQFHWK5TC":3,"skill-same:01M6FAP09HZGTZ7FGKQFHWK5TC":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6FAP09HZGTZ7FGKQFHWK5TC","generating-orm-code",null,"Execute use when you need to work with ORM code generation.\nThis skill provides ORM model and code generation with comprehensive guidance and automation.\nTrigger with phrases like \"generate ORM models\", \"create entity classes\",\nor \"scaffold database models\".","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fgenerating-orm-code\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"code","Generating ORM Code","orm","orm-code","openclaw","you","psql","trigger","io","edit","write","read","work","model","Bash","Code Generation","mysql","database","generate","create","2026-11-10 10:12:30",false,"---\nname: generating-orm-code\ndescription: |\n  Execute use when you need to work with ORM code generation.\n  This skill provides ORM model and code generation with comprehensive guidance and automation.\n  Trigger with phrases like \"generate ORM models\", \"create entity classes\",\n  or \"scaffold database models\".\n\nallowed-tools: Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)\nversion: 1.0.0\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\nlicense: MIT\ncompatible-with: claude-code, codex, openclaw\ntags: [database, orm-code]\n\n---\n# ORM Code Generator\n\n## Overview\n\nGenerate type-safe ORM model classes, migration files, and repository patterns from existing database schemas or domain specifications. Supports Prisma, TypeORM, Sequelize, SQLAlchemy, Django ORM, and Drizzle ORM.\n\n## Prerequisites\n\n- Database connection string or credentials for schema introspection\n- `psql` or `mysql` CLI for querying `information_schema`\n- Target ORM framework already installed in the project (`prisma`, `typeorm`, `sqlalchemy`, etc.)\n- Node.js\u002FPython\u002FGo runtime matching the target ORM\n- Existing project structure to place generated models in the correct directory\n\n## Instructions\n\n1. Introspect the database schema by querying `information_schema.COLUMNS`, `information_schema.TABLE_CONSTRAINTS`, and `information_schema.KEY_COLUMN_USAGE` to extract all tables, columns, data types, nullable flags, defaults, primary keys, foreign keys, and unique constraints.\n\n2. For PostgreSQL, additionally query `pg_catalog.pg_type` for custom enum types and `pg_catalog.pg_index` for index definitions. For MySQL, query `information_schema.STATISTICS` for index details.\n\n3. Map database column types to ORM field types:\n   - `varchar\u002Ftext` -> `String` \u002F `@Column('text')`\n   - `integer\u002Fbigint` -> `Int` \u002F `@Column('int')`\n   - `boolean` -> `Boolean` \u002F `@Column('boolean')`\n   - `timestamp\u002Fdatetime` -> `DateTime` \u002F `@Column('timestamp')`\n   - `jsonb\u002Fjson` -> `Json` \u002F `@Column('jsonb')`\n   - `uuid` -> `String` with `@default(uuid())` or `uuid.uuid4`\n   - Custom enums -> Generate enum type definitions\n\n4. Generate model classes with proper decorators\u002Fattributes:\n   - For **Prisma**: Generate `schema.prisma` with `model` blocks, `@id`, `@unique`, `@relation`, and `@default` directives.\n   - For **TypeORM**: Generate entity classes with `@Entity()`, `@Column()`, `@PrimaryGeneratedColumn()`, `@ManyToOne()`, `@OneToMany()` decorators.\n   - For **SQLAlchemy**: Generate model classes extending `Base` with `Column()`, `ForeignKey()`, `relationship()`, and `__tablename__`.\n   - For **Drizzle**: Generate table definitions with `pgTable()`, `serial()`, `varchar()`, `timestamp()`, and `relations()`.\n\n5. Generate relationship mappings from foreign key constraints. Detect one-to-one (unique FK), one-to-many, and many-to-many (junction table with two FKs) patterns automatically. Add both sides of each relationship with proper cascade options.\n\n6. Create migration files that capture the current schema state. For Prisma: `npx prisma migrate dev --name init`. For TypeORM: generate migration with `typeorm migration:generate`. For Alembic: `alembic revision --autogenerate`.\n\n7. Generate repository\u002Fservice layer with common CRUD operations: `findById`, `findAll` with pagination, `create`, `update`, `delete`, and relationship-aware queries (`findWithRelations`).\n\n8. Add validation decorators or constraints matching database CHECK constraints and NOT NULL columns. Use `class-validator` for TypeORM, Pydantic validators for SQLAlchemy, or Zod schemas for Prisma.\n\n9. Generate TypeScript\u002FPython type definitions or interfaces for API layer consumption, ensuring the ORM models and API types stay synchronized.\n\n10. Validate generated models by running a test migration against a temporary database or by comparing the generated schema against the live database schema with a diff tool.\n\n## Output\n\n- **Model\u002Fentity files** with full type annotations, decorators, and relationship mappings\n- **Migration files** capturing the initial schema state\n- **Enum type definitions** for database enum columns\n- **Repository\u002Fservice classes** with typed CRUD operations\n- **Validation schemas** (Zod, class-validator, Pydantic) matching database constraints\n- **Type definition files** for API layer consumption\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|---------|\n| Circular relationship dependency | Two entities reference each other, causing import cycles | Use lazy loading (`() => RelatedEntity`) in TypeORM; use `ForwardRef` in SQLAlchemy; split into separate files with deferred imports |\n| Unknown column type mapping | Database uses custom types, extensions, or domain types not in the standard mapping | Add custom type mapping in generator config; use `@Column({ type: 'text' })` as fallback; register custom transformers |\n| Migration conflicts with existing data | Generated migration adds NOT NULL columns without defaults | Add default values to new columns; create a two-phase migration (add nullable, backfill, set NOT NULL) |\n| Junction table not detected as many-to-many | Junction table has extra columns beyond the two foreign keys | Model as an explicit entity with two ManyToOne relationships instead of an implicit ManyToMany |\n| Schema drift between ORM models and database | Manual database changes not reflected in ORM code | Run introspection again; use `prisma db pull` or `sqlacodegen` to regenerate; diff against existing models |\n\n## Examples\n\n**Prisma schema from PostgreSQL e-commerce database**: Introspect 15 tables including users, orders, products, and categories. Generate `schema.prisma` with proper `@relation` directives, enum types for order status, and `@default(autoincrement())` for serial columns. Output includes Zod validation schemas for each model.\n\n**TypeORM entities from MySQL SaaS application**: Generate entity classes for a multi-tenant application with tenant isolation. Each entity includes a `tenantId` column with a custom `@TenantAware` decorator. Repository layer includes tenant-scoped query methods.\n\n**SQLAlchemy models from legacy database with naming conventions**: Introspect a database with inconsistent naming (mix of camelCase and snake_case). Generate models with `__tablename__` preserving original names while using Pythonic property names. Alembic migration captures the full schema.\n\n## Resources\n\n- Prisma introspection: https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Fintrospection\n- TypeORM entity documentation: https:\u002F\u002Ftypeorm.io\u002Fentities\n- SQLAlchemy ORM tutorial: https:\u002F\u002Fdocs.sqlalchemy.org\u002Fen\u002F20\u002Form\u002F\n- Drizzle ORM schema: https:\u002F\u002Form.drizzle.team\u002Fdocs\u002Fsql-schema-declaration\n- Django inspectdb command: https:\u002F\u002Fdocs.djangoproject.com\u002Fen\u002F5.0\u002Fhowto\u002Flegacy-databases\u002F\n","# ORM Code Generator\n\n## Overview\n\nGenerate type-safe ORM model classes, migration files, and repository patterns from existing database schemas or domain specifications. Supports Prisma, TypeORM, Sequelize, SQLAlchemy, Django ORM, and Drizzle ORM.\n\n## Prerequisites\n\n- Database connection string or credentials for schema introspection\n- `psql` or `mysql` CLI for querying `information_schema`\n- Target ORM framework already installed in the project (`prisma`, `typeorm`, `sqlalchemy`, etc.)\n- Node.js\u002FPython\u002FGo runtime matching the target ORM\n- Existing project structure to place generated models in the correct directory\n\n## Instructions\n\n1. Introspect the database schema by querying `information_schema.COLUMNS`, `information_schema.TABLE_CONSTRAINTS`, and `information_schema.KEY_COLUMN_USAGE` to extract all tables, columns, data types, nullable flags, defaults, primary keys, foreign keys, and unique constraints.\n\n2. For PostgreSQL, additionally query `pg_catalog.pg_type` for custom enum types and `pg_catalog.pg_index` for index definitions. For MySQL, query `information_schema.STATISTICS` for index details.\n\n3. Map database column types to ORM field types:\n   - `varchar\u002Ftext` -> `String` \u002F `@Column('text')`\n   - `integer\u002Fbigint` -> `Int` \u002F `@Column('int')`\n   - `boolean` -> `Boolean` \u002F `@Column('boolean')`\n   - `timestamp\u002Fdatetime` -> `DateTime` \u002F `@Column('timestamp')`\n   - `jsonb\u002Fjson` -> `Json` \u002F `@Column('jsonb')`\n   - `uuid` -> `String` with `@default(uuid())` or `uuid.uuid4`\n   - Custom enums -> Generate enum type definitions\n\n4. Generate model classes with proper decorators\u002Fattributes:\n   - For **Prisma**: Generate `schema.prisma` with `model` blocks, `@id`, `@unique`, `@relation`, and `@default` directives.\n   - For **TypeORM**: Generate entity classes with `@Entity()`, `@Column()`, `@PrimaryGeneratedColumn()`, `@ManyToOne()`, `@OneToMany()` decorators.\n   - For **SQLAlchemy**: Generate model classes extending `Base` with `Column()`, `ForeignKey()`, `relationship()`, and `__tablename__`.\n   - For **Drizzle**: Generate table definitions with `pgTable()`, `serial()`, `varchar()`, `timestamp()`, and `relations()`.\n\n5. Generate relationship mappings from foreign key constraints. Detect one-to-one (unique FK), one-to-many, and many-to-many (junction table with two FKs) patterns automatically. Add both sides of each relationship with proper cascade options.\n\n6. Create migration files that capture the current schema state. For Prisma: `npx prisma migrate dev --name init`. For TypeORM: generate migration with `typeorm migration:generate`. For Alembic: `alembic revision --autogenerate`.\n\n7. Generate repository\u002Fservice layer with common CRUD operations: `findById`, `findAll` with pagination, `create`, `update`, `delete`, and relationship-aware queries (`findWithRelations`).\n\n8. Add validation decorators or constraints matching database CHECK constraints and NOT NULL columns. Use `class-validator` for TypeORM, Pydantic validators for SQLAlchemy, or Zod schemas for Prisma.\n\n9. Generate TypeScript\u002FPython type definitions or interfaces for API layer consumption, ensuring the ORM models and API types stay synchronized.\n\n10. Validate generated models by running a test migration against a temporary database or by comparing the generated schema against the live database schema with a diff tool.\n\n## Output\n\n- **Model\u002Fentity files** with full type annotations, decorators, and relationship mappings\n- **Migration files** capturing the initial schema state\n- **Enum type definitions** for database enum columns\n- **Repository\u002Fservice classes** with typed CRUD operations\n- **Validation schemas** (Zod, class-validator, Pydantic) matching database constraints\n- **Type definition files** for API layer consumption\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|---------|\n| Circular relationship dependency | Two entities reference each other, causing import cycles | Use lazy loading (`() => RelatedEntity`) in TypeORM; use `ForwardRef` in SQLAlchemy; split into separate files with deferred imports |\n| Unknown column type mapping | Database uses custom types, extensions, or domain types not in the standard mapping | Add custom type mapping in generator config; use `@Column({ type: 'text' })` as fallback; register custom transformers |\n| Migration conflicts with existing data | Generated migration adds NOT NULL columns without defaults | Add default values to new columns; create a two-phase migration (add nullable, backfill, set NOT NULL) |\n| Junction table not detected as many-to-many | Junction table has extra columns beyond the two foreign keys | Model as an explicit entity with two ManyToOne relationships instead of an implicit ManyToMany |\n| Schema drift between ORM models and database | Manual database changes not reflected in ORM code | Run introspection again; use `prisma db pull` or `sqlacodegen` to regenerate; diff against existing models |\n\n## Examples\n\n**Prisma schema from PostgreSQL e-commerce database**: Introspect 15 tables including users, orders, products, and categories. Generate `schema.prisma` with proper `@relation` directives, enum types for order status, and `@default(autoincrement())` for serial columns. Output includes Zod validation schemas for each model.\n\n**TypeORM entities from MySQL SaaS application**: Generate entity classes for a multi-tenant application with tenant isolation. Each entity includes a `tenantId` column with a custom `@TenantAware` decorator. Repository layer includes tenant-scoped query methods.\n\n**SQLAlchemy models from legacy database with naming conventions**: Introspect a database with inconsistent naming (mix of camelCase and snake_case). Generate models with `__tablename__` preserving original names while using Pythonic property names. Alembic migration captures the full schema.\n\n## Resources\n\n- Prisma introspection: https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Fintrospection\n- TypeORM entity documentation: https:\u002F\u002Ftypeorm.io\u002Fentities\n- SQLAlchemy ORM tutorial: https:\u002F\u002Fdocs.sqlalchemy.org\u002Fen\u002F20\u002Form\u002F\n- Drizzle ORM schema: https:\u002F\u002Form.drizzle.team\u002Fdocs\u002Fsql-schema-declaration\n- Django inspectdb command: https:\u002F\u002Fdocs.djangoproject.com\u002Fen\u002F5.0\u002Fhowto\u002Flegacy-databases\u002F\n",{"name":5,"tags":44,"author":45,"license":15,"version":46,"description":47,"allowed-tools":48,"compatible-with":49},[36,22],"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Execute use when you need to work with ORM code generation.\nThis skill provides ORM model and code generation with comprehensive guidance and automation.\nTrigger with phrases like \"generate ORM models\", \"create entity classes\",\nor \"scaffold database models\".\n","Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)","claude-code, codex, openclaw","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fgenerating-orm-code",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill generating-orm-code",{"tool":65,"command":66},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill generating-orm-code",{"tool":68,"command":69},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill generating-orm-code","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fgenerating-orm-code\u002FSKILL.md",true,[],[74,82,91,100,106,112],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[32,80,81],"model hierarchy","model hierarchy skill",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[88,89,90],"MCP","zoom","zoom mcp",{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[97,98,99,89],"sdk","zoom apps sdk","apps",{"skillNo":101,"name":102,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[102],{"skillNo":107,"name":108,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[108],{"skillNo":113,"name":114,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[114]]