Execute use when you need to work with ORM code generation. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedDatabases

Install Generating Orm Code

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill generating-orm-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace generating-orm-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/generating-orm-code .claude/skills/generating-orm-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
generating-orm-code
GitHub stars
2.8k
Token cost
~1.7k tokens
SKILL.md length
707 words
Files
6 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Execute use when you need to work with ORM code generation. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 10 steps: Introspect the database schema by… → For PostgreSQL, additionally query… → Map database column types to ORM field… → …
  • You need to work with ORM code generation
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Runs Python scripts from its folder; calls npx

What it does

Generating Orm Code is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute use when you need to work with ORM code generation. This skill provides ORM model and code generation with comprehensive guidance and automation. Trigger with phrases like "generate ORM models", "create entity classes", or "scaffold database models".

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts, reference files and assets (for example `assets/README.md`, `references/README.md` and `scripts/README.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering ORMs and data access. It works with Prisma, SQLAlchemy and TypeORM. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • You need to work with ORM code generation
  • With phrases like generate ORM models
  • Create entity classes
  • Scaffold database models

Example prompts

  • “generate ORM models”
  • “create entity classes”
  • “scaffold database models”
  • “/generating-orm-code”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Introspect the database schema by querying information_schema.COLUMNS, information_schema.TABLE_CONSTRAINTS, and…
  2. For PostgreSQL, additionally query pg_catalog.pg_type for custom enum types and pg_catalog.pg_index for index definitions. For MySQL…
  3. Map database column types to ORM field types
  4. Generate model classes with proper decorators/attributes
  5. Generate relationship mappings from foreign key constraints. Detect one-to-one (unique FK), one-to-many, and many-to-many (junction table…
  6. Create migration files that capture the current schema state. For Prisma: npx prisma migrate dev --name init. For TypeORM: generate…
  7. Generate repository/service layer with common CRUD operations: findById, findAll with pagination, create, update, delete, and…
  8. Add validation decorators or constraints matching database CHECK constraints and NOT NULL columns. Use class-validator for TypeORM…
  9. Generate TypeScript/Python type definitions or interfaces for API layer consumption, ensuring the ORM models and API types stay…
  10. Validate generated models by running a test migration against a temporary database or by comparing the generated schema against the live…

What it can do on your machine

Read from SKILL.md and the folder at commit 23ea8d4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(psql:*)
    • Bash(mysql:*)
    • Bash(mongosh:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • prisma.io
    • typeorm.io
    • docs.sqlalchemy.org
    • orm.drizzle.team
    • docs.djangoproject.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Generating Orm Code loads about 1.7k tokens when it runs, and up to ~1.7k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 707 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 23ea8d4, republished under its MIT licence (© jeremylongshore). 707 words, ~1,696 tokens.

Download SKILL.mdSave it as .claude/skills/generating-orm-code/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
generating-orm-code
description
Execute use when you need to work with ORM code generation. This skill provides ORM model and code generation with comprehensive guidance and automation. Trigger with phrases like "generate ORM models", "create entity classes", or "scaffold database models".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)
compatibility
Designed for Claude Code
version
1.28.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
database, orm-code

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.

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

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

  7. Generate repository/service layer with common CRUD operations: findById, findAll with pagination, create, update, delete, and relationship-aware queries (findWithRelations).

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

  9. Generate TypeScript/Python type definitions or interfaces for API layer consumption, ensuring the ORM models and API types stay synchronized.

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

Output

  • Model/entity files with full type annotations, decorators, and relationship mappings
  • Migration files capturing the initial schema state
  • Enum type definitions for database enum columns
  • Repository/service classes with typed CRUD operations
  • Validation schemas (Zod, class-validator, Pydantic) matching database constraints
  • Type definition files for API layer consumption
Show full SKILL.md (285 more words)Show less

Error Handling

ErrorCauseSolution
Circular relationship dependencyTwo entities reference each other, causing import cyclesUse lazy loading (() => RelatedEntity) in TypeORM; use ForwardRef in SQLAlchemy; split into separate files with deferred imports
Unknown column type mappingDatabase uses custom types, extensions, or domain types not in the standard mappingAdd custom type mapping in generator config; use @Column({ type: 'text' }) as fallback; register custom transformers
Migration conflicts with existing dataGenerated migration adds NOT NULL columns without defaultsAdd default values to new columns; create a two-phase migration (add nullable, backfill, set NOT NULL)
Junction table not detected as many-to-manyJunction table has extra columns beyond the two foreign keysModel as an explicit entity with two ManyToOne relationships instead of an implicit ManyToMany
Schema drift between ORM models and databaseManual database changes not reflected in ORM codeRun introspection again; use prisma db pull or sqlacodegen to regenerate; diff against existing models

Examples

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.

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.

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.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references, assets) in skills/.curated/generating-orm-code of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • references/README.md
  • scripts/README.md
  • scripts/generate_model.py
  • scripts/generate_schema.py

Open the folder on GitHubat commit 23ea8d4

Compare with similar skills

Generating Orm Code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Generating Orm Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Generating Orm Code this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.7kAutomated safety check: PassMIT
DB Review312362115/claude107—~1.8kAutomated safety check: PassMIT
SQL Database Assistantalirezarezvani/claude-skills28k—~4kAutomated safety check: PassMIT
Drizzle Migrationsbretzel-app/crumbs1271 repos~2.6kAutomated safety check: PassMIT
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
Database Migrationdavila7/claude-code-templates32k11 repos~2.8kAutomated safety check: PassMIT

Similar skills

  • DB Review

    312362115/claude

    数据库代码审查 + Migration 安全检查. An agent skill from 312362115/claude.

    107 GitHub stars~1.8k tokensUpdated 4 mo ago
    DatabasesAuto-check passed
  • SQL Database Assistant

    alirezarezvani/claude-skills

    A skill your agent uses when the user asks to write SQL queries, optimize database performance, generate migrations, explore database schemas, or work with ORMs like Prisma, Drizzle, TypeORM, or…

    28k GitHub stars~4k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Drizzle Migrations

    bretzel-app/crumbs

    Drizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns.

    127 GitHub starsUsed in 1 repo~2.6k tokens
    DatabasesAuto-check passed
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 16 days ago
    DatabasesAuto-check passed
  • Database Migration

    davila7/claude-code-templates

    Master database schema and data migrations across ORMs (Sequelize, TypeORM, Prisma), including rollback strategies and zero-downtime deployments.

    32k GitHub starsUsed in 11 repos~2.8k tokens
    DatabasesAuto-check passed
  • 数据库迁移最佳实践,涵盖模式变更、数据迁移、回滚以及零停机部署,适用于PostgreSQL、MySQL及常用ORM(Prisma、Drizzle、Django、TypeORM、golang-migrate)。

    275k GitHub starsUsed in 3 repos~1.9k tokens
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Analyzing Text With NLP

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to perform natural language processing and text analysis using the nlp-text-analyzer plugin.

    2.8k GitHub starsUsed in 1 repo~819 tokens
    Auto-check passed
  • Building Neural Networks

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill allows AI assistant to construct and configure neural network architectures using the neural-network-builder plugin.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Detecting Data Anomalies

    jeremylongshore/tons-of-skills-marketplace

    Process identify anomalies and outliers in datasets using machine learning algorithms.

    2.8k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Explaining Machine Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill enables AI assistant to provide interpretability and explainability for machine learning models.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Optimizing Prompts

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill optimizes prompts for large language models (llms) to reduce token usage, lower costs, and improve performance.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed

Categories

Questions about Generating Orm Code

What does Generating Orm Code do?

Execute use when you need to work with ORM code generation. An agent skill from jeremylongshore/tons-of-skills-marketplace. Generating Orm Code is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute use when you need to work with ORM code generation.

When should I use Generating Orm Code?

Generating Orm Code fits situations like: you need to work with ORM code generation; with phrases like generate ORM models; create entity classes; scaffold database models.

How do I install Generating Orm Code in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill generating-orm-code -a claude-code`. Or copy the skill folder (skills/.curated/generating-orm-code in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/generating-orm-code in your project. Claude Code loads it when a task matches its description.

How do I install Generating Orm Code in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill generating-orm-code -a codex`. Or copy the skill folder (skills/.curated/generating-orm-code in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/generating-orm-code in your project. Codex loads it when a task matches its description.

Can I use Generating Orm Code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill generating-orm-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/generating-orm-code, .gemini/skills/generating-orm-code, .github/skills/generating-orm-code and .opencode/skills/generating-orm-code in your project.

What does Generating Orm Code need to run?

Going by SKILL.md and its folder, Generating Orm Code needs Python for the scripts in its folder and the command-line tools its instructions call (npx). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Generating Orm Code access the network?

SKILL.md names 5 domains. As links in the text: prisma.io, typeorm.io, docs.sqlalchemy.org, orm.drizzle.team and docs.djangoproject.com. This is read from the text; nothing was executed.

Is Generating Orm Code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Generating Orm Code use?

Generating Orm Code is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Generating Orm Code use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 16 tokens, read only when the agent opens those files.

What are the alternatives to Generating Orm Code?

Skills that share tags, products or a category with Generating Orm Code: DB Review (312362115/claude, 107 stars), SQL Database Assistant (alirezarezvani/claude-skills, 28k stars), Drizzle Migrations (bretzel-app/crumbs, 127 stars) and Database Expert (cin12211/orca-q, 224 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Generating Orm Code?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,821 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 8, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.