Agent skill · software engineering · jeremylongshore

generating-orm-code

Execute use when you need to work with ORM code generation.

Why this skill is useful

Adds executable scripts for generating ORM models, migrations, and repository patterns that are not commonly found in public documentation.

What it needs

Requires go, mysql, node, psql, python installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

ORM Code Generator Overview Generate 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. Prerequisites Database connection string or credentials for schema introspection psql or mysql CLI for querying informationschema Target ORM framework already installed in the project (prisma, typeorm, sqlalchemy, etc.) Node.js/Python/Go runtime matching the target ORM Existing project structure to place generated models in the correct directory Instructions 1. Introspect the database schema by querying informationschema.COLUMNS, informationschema.TABLECONSTRAINTS, and informationschema.KEYCOLUMNUSAGE to extract all tables, columns, data types, nullable flags, defaults, primary keys, foreign keys, and unique constraints. 2. For PostgreSQL, additionally query pgcatalog.pgtype for custom enum types and pgcatalog.pgindex for index definitions. For MySQL, query informationschema.STATISTICS for index details. 3. Map database column types to ORM field types: varchar/text -> String / @Column('text') integer/bigint -> Int / @Column('int') boolean -> Boolean / @Column('boolean') timestamp/datetime -> DateTime / @Column('timestamp') jsonb/json -> Json / @Column('jsonb') uuid -> String with @default(uuid()) or uuid.uuid4 Custom enums -> Generate enum type definitions 4. Generate model classes with proper decorators/attributes: For Prisma: Generate schema.prisma with model blocks, @id, @unique, @relation, and @default directives. For TypeORM: Generate entity classes with @Entity(), @Column(), @PrimaryGeneratedColumn(), @ManyToOne(), @OneToMany() decorators. For SQLAlchemy: Generate model classes extending Base with Column(), ForeignKey(), relationship(), and tablename. For Drizzle: Generate table definitions with pgTable(), serial(), varchar(), timestamp(), and relations(). 5. Generate relationship mappings from foreign key constraints. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/generating-orm-code--a130f4

View the source on GitHub

Browse the @skills marketplace