format-migration

Formats TypeScript TypeORM migrations into standardized, readable SQL with inline rules and multi-line blocks.

466|119|Updated Nov 2, 2017
One-click install
npx skills add https://github.com/dailydotdev/daily-api --skill format-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: format-migration
Source: https://github.com/dailydotdev/daily-api/tree/main/.claude/skills/format-migration
Command: npx skills add https://github.com/dailydotdev/daily-api --skill format-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeORM migrations are easy to generate but often result in inconsistent SQL formatting, making maintenance and code reviews harder. This skill enforces a single, readable style for migration SQL and keeps migration files clean and predictable.

Core Features & Use Cases

  • Uniform, readable multi-line SQL blocks within MigrationInterface.up and MigrationInterface.down.
  • Inline SQL formatting rules that ensure consistency across teams and environments.
  • Useful after generating migrations to guarantee consistency and reduce review effort in CI pipelines.

Quick Start

Run the formatter on your newly generated migration to apply the standardized SQL style.

Frequently Asked Questions about format-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format TypeORM migration files for consistent SQL?

To format TypeORM migration files for consistent SQL, apply standardized inline formatting rules to multi-line query blocks within MigrationInterface.up and MigrationInterface.down methods. This enforces a single, readable style across team environments.

Why does my TypeORM generated SQL look inconsistent across migration files?

Generated TypeORM SQL often looks inconsistent because the ORM does not enforce a uniform output style. Applying deterministic SQL formatting rules to the migration files standardizes constraint definitions and multi-line query blocks.

What's the best way to standardize SQL constraints in TypeORM migrations?

The best way to standardize SQL constraints in TypeORM migrations is to enforce inline SQL formatting rules that clearly represent all constraints within multi-line query blocks, ensuring predictable and readable output.

Can I use this migration formatter in a Node.js CI pipeline?

Yes, you can use this migration formatter in a Node.js CI pipeline. Running it after generating migrations guarantees consistent SQL formatting, reduces manual code review effort, and ensures deterministic output across environments.

Does this tool format both the up and down methods in TypeORM migrations?

Yes, this tool formats both methods. It enforces uniform, readable multi-line SQL blocks and standardized constraint definitions within both MigrationInterface.up and MigrationInterface.down functions.

When do I need to format TypeORM migration SQL?

You need to format TypeORM migration SQL after generating new migrations. This ensures consistency and readability before code review, preventing inconsistent formatting from making maintenance harder.