Agent skill

How To Write Typeorm Migrations In Packmind

by PackmindHub in PackmindHub/packmind

Write TypeORM migrations in the Packmind monorepo to manage and version database schema changes with consistent logging, reversible rollbacks, and shared helpers.

Apache-2.0Auto-check passedDatabases

Install How To Write Typeorm Migrations In Packmind

skills CLI
$ npx skills add PackmindHub/packmind --skill how-to-write-typeorm-migrations-in-packmind -a claude-code

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

GitHub CLI
$ gh skill install PackmindHub/packmind how-to-write-typeorm-migrations-in-packmind --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/PackmindHub/packmind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/how-to-write-typeorm-migrations-in-packmind .claude/skills/how-to-write-typeorm-migrations-in-packmind && 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
how-to-write-typeorm-migrations-in-packmind
GitHub stars
318
Token cost
~1.7k tokens
SKILL.md length
310 words
Files
1
Skills in repo
35
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write TypeORM migrations in the Packmind monorepo to manage and version database schema changes with consistent logging, reversible rollbacks, and shared helpers.

  • Works in 7 steps: Create Migration File Using TypeORM CLI → Set Up Basic Migration Structure with… → Implement Table Creation Pattern → …
  • Modifying database tables
  • SKILL.md covers When to Use, Context Validation Checkpoints and Recipe Steps
  • Calls npm and npx

What it does

How To Write Typeorm Migrations In Packmind is an agent skill from PackmindHub/packmind. Write TypeORM migrations in the Packmind monorepo to manage and version database schema changes with consistent logging, reversible rollbacks, and shared helpers. Use this skill whenever creating or modifying database tables, columns, or foreign-key relationships — including any time schema changes need to be tracked, versioned, or rolled back. Invoke even if the user just says "add a column", "create a table", or "update the DB schema".

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Database schema design and Monorepo tooling. It works with TypeORM. The repository describes itself as: Packmind seamlessly captures your engineering playbook and turns it into AI context, guardrails, and governance. The licence is Apache-2.0.

When your agent uses it

  • Modifying database tables
  • Foreign-key relationships — including any time schema changes need to be tracked

Example prompts

  • “add a column”
  • “create a table”
  • “update the DB schema”
  • “/how-to-write-typeorm-migrations-in-packmind”

Requirements

  • Node.js
  • Docker

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Create Migration File Using TypeORM CLI
  2. Set Up Basic Migration Structure with Logging
  3. Implement Table Creation Pattern
  4. Implement Column Addition Pattern
  5. Implement Foreign Key Pattern
  6. Run and Test Migrations
  7. Follow Migration Best Practices

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • npx

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

  • Network

    No URLs in SKILL.md. Its commands use npm and npx, which can reach the network depending on how they are called.

    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.

Context cost

How To Write Typeorm Migrations In Packmind loads about 1.7k tokens when it runs. Until then it costs about 121 tokens; SKILL.md has 310 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~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); files beside SKILL.md are not scanned.

SKILL.md

The full file from PackmindHub/packmind at commit 67de8a2, republished under its Apache-2.0 licence (© PackmindHub). 310 words, ~1,670 tokens.

Download SKILL.mdSave it as .claude/skills/how-to-write-typeorm-migrations-in-packmind/SKILL.md (or your agent's skills folder).
name
how-to-write-typeorm-migrations-in-packmind
description
Write TypeORM migrations in the Packmind monorepo to manage and version database schema changes with consistent logging, reversible rollbacks, and shared helpers. Use this skill whenever creating or modifying database tables, columns, or foreign-key relationships — including any time schema changes need to be tracked, versioned, or rolled back. Invoke even if the user just says "add a column", "create a table", or "update the DB schema".

Write TypeORM migrations in the Packmind monorepo to manage database schema changes effectively while ensuring proper logging and rollback capabilities.

When to Use

  • When you need to create new database tables
  • When adding or modifying columns in existing tables
  • When creating or updating foreign key relationships
  • When making any database schema changes that need to be version controlled

Context Validation Checkpoints

  • Have you identified the exact database schema changes needed?
  • Do you know the TypeORM column types for all fields?
  • Have you planned the rollback strategy (down method)?
  • Are you familiar with the shared migration utilities in @packmind/shared?

Recipe Steps

Step 1: Create Migration File Using TypeORM CLI

IMPORTANT: Always create migration files using the TypeORM CLI command. Never create migration files manually. The CLI automatically generates a timestamp prefix and sets up the basic structure.

bash
# Create new migration file (TypeORM will automatically add timestamp)
npx typeorm migration:create packages/migrations/src/migrations/DescriptiveName
Step 2: Set Up Basic Migration Structure with Logging

Implement the migration class with PackmindLogger for comprehensive logging. Include try-catch blocks and log start, progress, completion, and any errors.

typescript
import { MigrationInterface, QueryRunner } from 'typeorm';
import { PackmindLogger, LogLevel } from '@packmind/shared';

export class YourMigrationName1234567890 implements MigrationInterface {
  private readonly logger = new PackmindLogger(
    'YourMigrationName1234567890',
    LogLevel.DEBUG,
  );

  public async up(queryRunner: QueryRunner): Promise<void> {
    this.logger.info('Starting migration: YourMigrationName');
    
    try {
      // Your migration logic here
      this.logger.info('Migration YourMigrationName completed successfully');
    } catch (error) {
      this.logger.error('Migration YourMigrationName failed', {
        error: error.message,
      });
      throw error;
    }
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    this.logger.info('Starting rollback: YourMigrationName');
    
    try {
      // Your rollback logic here
      this.logger.info('Rollback YourMigrationName completed successfully');
    } catch (error) {
      this.logger.error('Rollback YourMigrationName failed', {
        error: error.message,
      });
      throw error;
    }
  }
}
Step 3: Implement Table Creation Pattern

Use TypeORM Table class with shared helper columns (uuidMigrationColumn, timestampsMigrationColumns) from @packmind/shared to create new tables with consistent structure.

typescript
import { MigrationInterface, QueryRunner, Table } from 'typeorm';
import {
  timestampsMigrationColumns,
  uuidMigrationColumn,
} from '@packmind/shared/src/database/migrationColumns';

export class CreateYourTable1234567890 implements MigrationInterface {
  private readonly table = new Table({
    name: 'your_table',
    columns: [
      uuidMigrationColumn, // Standard UUID primary key
      {
        name: 'name',
        type: 'varchar',
      },
      {
        name: 'description',
        type: 'text',
        isNullable: true,
      },
      ...timestampsMigrationColumns, // created_at, updated_at
    ],
  });

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.createTable(this.table);
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.dropTable(this.table);
  }
}
Step 4: Implement Column Addition Pattern

Use TableColumn class for adding individual columns or raw SQL for multiple columns. Always make new columns nullable initially for backward compatibility.

typescript
// Single column with TableColumn
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';

export class AddColumnsToTable1234567890 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.addColumn(
      'your_table',
      new TableColumn({
        name: 'new_column',
        type: 'varchar',
        isNullable: true,
      }),
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.dropColumn('your_table', 'new_column');
  }
}

// Multiple columns with raw SQL
public async up(queryRunner: QueryRunner): Promise<void> {
  await queryRunner.query(`
    ALTER TABLE "your_table" 
    ADD COLUMN "column1" varchar NULL,
    ADD COLUMN "column2" varchar NULL,
    ADD COLUMN "column3" varchar NULL
  `);
}
Step 5: Implement Foreign Key Pattern

Create foreign key relationships using TableForeignKey class with proper cascade behavior. Always handle foreign keys before dropping related tables.

typescript
import { MigrationInterface, QueryRunner, TableForeignKey } from 'typeorm';

export class AddForeignKey1234567890 implements MigrationInterface {
  private readonly foreignKey = new TableForeignKey({
    columnNames: ['parent_id'],
    referencedColumnNames: ['id'],
    referencedTableName: 'parent_table',
    onDelete: 'CASCADE',
  });

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.createForeignKey('child_table', this.foreignKey);
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.dropForeignKey('child_table', this.foreignKey);
  }
}
Step 6: Run and Test Migrations

Execute migrations using npm scripts for both local development and Docker environments. Test both up and down migrations.

bash
# Local development
npm run typeorm migration:run
npm run typeorm migration:revert
npm run typeorm migration:show

# Docker environment
npm run typeorm migration:run -- -d datasourceDocker.ts
Step 7: Follow Migration Best Practices

Always include comprehensive logging with PackmindLogger, wrap operations in try-catch blocks, write reversible migrations with corresponding down operations, use descriptive names with verbs (Add, Remove, Update, Create, Drop), and handle foreign key dependencies properly when dropping tables.

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

Files

Just SKILL.md in .claude/skills/how-to-write-typeorm-migrations-in-packmind of PackmindHub/packmind.

Open the folder on GitHubat commit 67de8a2

Compare with similar skills

How To Write Typeorm Migrations In Packmind 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.

How To Write Typeorm Migrations In Packmind compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
How To Write Typeorm Migrations In Packmind this skillPackmindHub/packmind318—~1.7kAutomated safety check: PassApache-2.0
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
Databuddy Internaldatabuddy-analytics/Databuddy1.2k—~11kAutomated safety check: NotesAGPL-3.0
Database Migrationdavila7/claude-code-templates33k11 repos~2.8kAutomated safety check: PassMIT
Safe Database Migration Patternsaffaan-m/ECC276k—~3.3kAutomated safety check: PassMIT
Database Schema Designerborghei/Claude-Skills891—~1.7kAutomated safety check: PassMIT

Similar skills

  • 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 18 days ago
    DatabasesAuto-check passed
  • Databuddy Internal

    databuddy-analytics/Databuddy

    Work inside the Databuddy monorepo for internal implementation, debugging, review, and refactoring.

    1.2k GitHub stars~11k tokensUpdated today
    DevelopmentAuto-check: notes
  • Database Migration

    davila7/claude-code-templates

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

    33k GitHub starsUsed in 11 repos~2.8k tokens
    DatabasesAuto-check passed
  • Rules and examples for safe, reversible schema changes in production: zero-downtime column and index changes, large data backfills and ORM migration workflows.

    276k GitHub stars~3.3k tokensUpdated today
    DatabasesAuto-check passed
  • Database Schema Designer

    borghei/Claude-Skills

    Design relational schemas from requirements with normalization, migrations, ERDs, RLS policies, and indexes for PostgreSQL, MySQL, and SQLite.

    891 GitHub stars~1.7k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Grow Panache's CommonMark spec conformance under Flavor::CommonMark by running every spec.txt example through the shared parser, comparing rendered HTML against the spec's expected HTML…

    237 GitHub stars~1.1k tokensUpdated yesterday
    DatabasesAuto-check passed

More from PackmindHub/packmind

All 35 skills in this repo
  • Michel CLI Demo Recorder

    PackmindHub/packmind

    Produce proof-of-execution demos of the Packmind CLI (packmind-cli) as terminal-styled images (colors and formatting preserved exactly), for embedding in a GitHub PR.

    318 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Michel UI Demo Recorder

    PackmindHub/packmind

    Record polished UI demo videos and screenshots of a running web app using Playwright MCP — for client deliverables, release notes, feature walkthroughs, or bug repros.

    318 GitHub stars~6.4k tokensUpdated yesterday
    Auto-check passed
  • Packmind Create Skill

    PackmindHub/packmind

    Guide for creating effective skills. An agent skill from PackmindHub/packmind.

    318 GitHub stars~3.5k tokensUpdated yesterday
    Auto-check: notes
  • Doc Audit

    PackmindHub/packmind

    Audit Packmind end-user documentation (apps/doc/) for broken links, outdated CLI references, non-existent concepts, misleading information, and missing coverage.

    318 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Feature Sprint

    PackmindHub/packmind

    Execute the implementation plan produced by /feature-spec. An agent skill from PackmindHub/packmind.

    318 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Review an implemented GitHub issue the way a senior Packmind engineer would — the human-judgment checks that ESLint, the TypeScript compiler, and e2e tests cannot catch (authorization scoping…

    318 GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about How To Write Typeorm Migrations In Packmind

What does How To Write Typeorm Migrations In Packmind do?

Write TypeORM migrations in the Packmind monorepo to manage and version database schema changes with consistent logging, reversible rollbacks, and shared helpers. How To Write Typeorm Migrations In Packmind is an agent skill from PackmindHub/packmind. Write TypeORM migrations in the Packmind monorepo to manage and version database schema changes with consistent logging, reversible rollbacks, and shared helpers.

When should I use How To Write Typeorm Migrations In Packmind?

How To Write Typeorm Migrations In Packmind fits situations like: modifying database tables; foreign-key relationships — including any time schema changes need to be tracked.

How do I install How To Write Typeorm Migrations In Packmind in Claude Code?

Run `npx skills add PackmindHub/packmind --skill how-to-write-typeorm-migrations-in-packmind -a claude-code`. Or copy the skill folder (.claude/skills/how-to-write-typeorm-migrations-in-packmind in PackmindHub/packmind) into .claude/skills/how-to-write-typeorm-migrations-in-packmind in your project. Claude Code loads it when a task matches its description.

How do I install How To Write Typeorm Migrations In Packmind in Codex?

Run `npx skills add PackmindHub/packmind --skill how-to-write-typeorm-migrations-in-packmind -a codex`. Or copy the skill folder (.claude/skills/how-to-write-typeorm-migrations-in-packmind in PackmindHub/packmind) into .agents/skills/how-to-write-typeorm-migrations-in-packmind in your project. Codex loads it when a task matches its description.

Can I use How To Write Typeorm Migrations In Packmind 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 PackmindHub/packmind --skill how-to-write-typeorm-migrations-in-packmind -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/how-to-write-typeorm-migrations-in-packmind, .gemini/skills/how-to-write-typeorm-migrations-in-packmind, .github/skills/how-to-write-typeorm-migrations-in-packmind and .opencode/skills/how-to-write-typeorm-migrations-in-packmind in your project.

What does How To Write Typeorm Migrations In Packmind need to run?

Going by SKILL.md and its folder, How To Write Typeorm Migrations In Packmind needs the command-line tools its instructions call (npm and npx). Our summary lists: Node.js; Docker.

Does How To Write Typeorm Migrations In Packmind access the network?

SKILL.md contains no URLs. Its commands use npm and npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is How To Write Typeorm Migrations In Packmind 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. Review the folder before installing.

What licence does How To Write Typeorm Migrations In Packmind use?

How To Write Typeorm Migrations In Packmind is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does How To Write Typeorm Migrations In Packmind use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to How To Write Typeorm Migrations In Packmind?

Skills that share tags, products or a category with How To Write Typeorm Migrations In Packmind: Database Expert (cin12211/orca-q, 224 stars), Databuddy Internal (databuddy-analytics/Databuddy, 1.2k stars), Database Migration (davila7/claude-code-templates, 33k stars) and Safe Database Migration Patterns (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains How To Write Typeorm Migrations In Packmind?

PackmindHub (a GitHub organization) maintains it in PackmindHub/packmind, which has 318 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 9, 2026.

Source: PackmindHub/packmind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.