generating-orm-code

Installation
SKILL.md

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 information_schema
  • 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 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.

  2. 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.

Related skills
Installs
26
GitHub Stars
2.2K
First Seen
Jan 20, 2026