create-or-update-model-and-typeorm-schemas

create-or-update-model-and-typeorm-schemas is a command for Claude Code from PackmindHub/packmind. It costs 8 tokens per session (830 once invoked), scanned A, original, Apache-2.0.

A TypeORM recipe for creating database models and updating their fields or relationships as business needs change. TypeORM is a tool that maps TypeScript objects to database tables.

In plain words
What is it for?
Use it when adding an entity, changing a property or relationship, or updating a schema in a hexagonal TypeScript application.
Why use it?
It gives developers a repeatable way to keep application models and database schemas aligned while considering compatibility and tests.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { MyModel } from '../../domain/entities/MyModel';.

Good fit Use it when adding an entity, changing a property or relationship, or updating a schema in a hexagonal TypeScript application.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/PackmindHub/packmind
agentmods
npx agentmods add commands/packmindhub/packmind/create-or-update-model-and-typeorm-schemas

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create-or-update-model-and-typeorm-schemas

README.md
[![agentmods](https://agentmods.dev/badge/commands/packmindhub/packmind/create-or-update-model-and-typeorm-schemas.svg)](https://agentmods.dev/commands/packmindhub/packmind/create-or-update-model-and-typeorm-schemas)
Your own site
<a href="https://agentmods.dev/commands/packmindhub/packmind/create-or-update-model-and-typeorm-schemas"><img src="https://agentmods.dev/badge/commands/packmindhub/packmind/create-or-update-model-and-typeorm-schemas.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 830 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00008 $0.00830
Opus 5 $0.00004 $0.00415
Sonnet 5 $0.00002 $0.00166
Haiku 4.5 $0.00001 $0.00083

Measured 4d ago against content hash 90e3f5dc78ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

create-or-update-model-and-typeorm-schemas scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/.claude/commands/create-or-update-model-and-typeorm-schemas.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create new models and update existing ones with TypeORM to ensure proper database structure and maintainability when adapting to evolving business requirements.

When to Use

  • When you need to create a new entity in your hexagonal domain
  • When adding new properties to existing models
  • When modifying existing property types or relationships
  • When business logic requirements change and database schema needs updating

Context Validation Checkpoints

  • Have you identified which hexagon package the model belongs to?
  • Do you know the TypeORM column types needed for each property?
  • Have you considered backward compatibility when adding required fields?
  • Is there an existing test factory for similar entities to use as reference?

Recipe Steps

Step 1: Define Business Model

Create the business model in packages//src/domain/entities/.ts and define the corresponding repository interface in packages//src/domain/repositories/IRepository.ts. Export both from the hexagon.

// packages/<hexagon>/src/domain/entities/MyModel.ts
export type MyModel = {
  id: string;
  name: string;
  description?: string;
};

Step 2: Define TypeORM Schema

Create the TypeORM schema in packages//src/infra/schemas/Schema.ts using EntitySchema with proper column definitions, UUID schema, and timestamp schemas from @packmind/node-utils.

import { EntitySchema } from 'typeorm';
import { MyModel } from '../../domain/entities/MyModel';
import { WithTimestamps, uuidSchema, timestampsSchemas } from '@packmind/node-utils';

export const MyModelSchema = new EntitySchema<WithTimestamps<MyModel>>({
  name: 'MyModel',
  tableName: 'mymodels',
  columns: {
    ...uuidSchema,
    name: { type: 'varchar' },
    description: { type: 'text', nullable: true },
    ...timestampsSchemas,
  },
});

Step 3: Make Schema Available to App

Register the new schema in apps/api/src/app/app.module.ts to ensure TypeORM recognizes it during database operations.

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 105 lines · 8 tokens per session scan A 90e3f5dc78ff

Subscribe to this mod's changes

create-or-update-model-and-typeorm-schemas is a command published in the GitHub repository PackmindHub/packmind (309 stars, last pushed today), licensed Apache-2.0. It adds 8 tokens to every session and 830 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.