migration-diff skill

## When to use

7 stars

Best use case

migration-diff skill is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

## When to use

Teams using migration-diff skill should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/migration-diff/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/developer-tools/migration-diff-tool/skills/migration-diff/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/migration-diff/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How migration-diff skill Compares

Feature / Agentmigration-diff skillStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

## When to use

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# migration-diff skill

## When to use

Use this skill when the user wants to:

- Understand what schema changes were made across a series of SQL migration files
- Compare the schema state at two different migration versions
- Visualize the full diff timeline of all migrations in a project
- Find when a specific column or table was added, removed, or changed

## Prerequisites

- Node.js 20+
- A directory of `.sql` migration files with a numeric or timestamp prefix

## Quick start

```
npx migration-diff-tool
```

Dashboard: http://127.0.0.1:7703

Or via CLI:

```
migration-diff add ~/projects/my-app/db/migrations --dialect postgres
migration-diff scan ~/projects/my-app/db/migrations
```

## CLI reference

| Command | Description |
|---------|-------------|
| `migration-diff add <dir>` | Add a migration directory as a project |
| `migration-diff list` | List all tracked projects |
| `migration-diff scan <dir>` | Scan and display summary of schema changes |
| `migration-diff diff <dir>` | Show diff between two versions |
| `migration-diff show <dir>` | Show schema state at a specific version |
| `migration-diff serve` | Start the dashboard server |

## Flags - add

| Flag | Default | Description |
|------|---------|-------------|
| `--name` | derived from path | Project display name |
| `--dialect` | `postgres` | SQL dialect: `postgres`, `mysql`, `sqlite` |

## Flags - diff

| Flag | Default | Description |
|------|---------|-------------|
| `--from` | first migration | Source version (migration filename prefix) |
| `--to` | last migration | Target version (migration filename prefix) |
| `--json` | - | Output machine-readable JSON |
| `--table` | all | Filter diff to a specific table name |

## Flags - show

| Flag | Default | Description |
|------|---------|-------------|
| `--version` | last | Migration version to inspect |
| `--table` | all | Filter to a specific table |
| `--json` | - | Machine-readable JSON output |

## Migration file naming

Files are sorted by their prefix. Supported prefix formats:

| Format | Example | Sort key |
|--------|---------|----------|
| Timestamp | `20240115_create_users.sql` | `20240115` |
| Numeric | `001_create_users.sql` | `001` |
| Timestamp+time | `20240115120000_create_users.sql` | `20240115120000` |

Files without a recognized prefix are sorted lexicographically.

## Change types

| Type | Meaning |
|------|---------|
| `table_added` | Table created by this migration |
| `table_removed` | Table dropped by this migration |
| `column_added` | Column added to existing table |
| `column_removed` | Column dropped from table |
| `column_type_changed` | Column type string changed |
| `column_nullable_changed` | NOT NULL constraint added or removed |
| `column_default_changed` | Default value added, removed, or changed |

## Diff output (CLI)

```
$ migration-diff diff ~/projects/my-app/db/migrations --from 20240201 --to 20240701

diff: 20240201_add_user_bio -> 20240701_add_user_timestamps
10 changes: +1 table, +7 columns, 1 type change, -1 table

TABLE CHANGES
  + comments (added)
  - legacy_tokens (removed)

COLUMN CHANGES (users)
  ~ email: VARCHAR(255) -> TEXT (type changed)
  + last_login_at: TIMESTAMP nullable
  + deleted_at: TIMESTAMP nullable

COLUMN CHANGES (posts)
  + status: TEXT NOT NULL DEFAULT 'draft'
  + published_at: TIMESTAMP nullable

COLUMN CHANGES (comments)
  + id: UUID NOT NULL PRIMARY KEY
  + body: TEXT NOT NULL
  + created_at: TIMESTAMP NOT NULL DEFAULT NOW()
```

## Environment variables

| Variable | Default | Description |
|----------|---------|-------------|
| `MIGDIFF_PORT` | `7703` | Dashboard server port |
| `MIGDIFF_DATA_DIR` | `~/.migration-diff` | Directory for SQLite cache |
| `MIGDIFF_LOG_LEVEL` | `info` | Log level |
| `MIGDIFF_MAX_FILES` | `2000` | Maximum migration files per project |

## Limitations

- Only DDL is tracked: CREATE TABLE, ALTER TABLE, DROP TABLE.
- DML statements (INSERT, UPDATE, DELETE) are skipped.
- Indexes, triggers, views, functions, and stored procedures are not tracked.
- The parser uses regex matching, not a full SQL grammar. Complex inline expressions (subqueries in DEFAULT clauses, computed columns) may not parse correctly.
- RENAME TABLE is not supported. Use DROP + CREATE as a workaround.

## Troubleshooting

| Symptom | Resolution |
|---------|------------|
| Table shows as "never created" | A migration file may be missing, or the CREATE TABLE is in a file outside the scanned directory |
| Column type shows incorrectly | Complex type expressions (e.g. `VARCHAR(255) COLLATE utf8_bin`) may be partially parsed. View the SQL source to verify |
| Migrations out of order | Ensure filenames have a consistent numeric or timestamp prefix. Check with `migration-diff list` |
| Too many parse warnings | Triggers, indexes, and DML generate warnings. This is expected - only DDL is tracked |
| Cache stale after file changes | Run `migration-diff scan <dir>` or click Rescan in the dashboard |

Related Skills

api-diff

7
from heldernoid/agentic-build-templates

Compare two OpenAPI spec files and produce a structured diff report. Use when you need to know what changed between two versions of an API spec, detect breaking changes before releasing a new API version, or check a PR's API spec changes in CI. Triggers include "diff API specs", "compare OpenAPI", "what changed in the API", "check API changes", "API spec diff", "compare swagger files", or any task involving comparing two versions of an OpenAPI or REST API specification.

json-differ

7
from heldernoid/agentic-build-templates

Compare two JSON blobs and view structural and value differences. Use when you need to compare API responses, config files, database records, or any two JSON objects. Triggers include "compare JSON", "JSON diff", "what changed", "JSON differences", "diff two objects", or any task involving comparing JSON data.

deep-diff

7
from heldernoid/agentic-build-templates

Compute structural differences between two JSON-compatible JavaScript values. Use this skill when you need to programmatically diff objects, check if two data structures are equivalent, or find what paths changed. Triggers include "diff two objects in code", "find changed keys", "compute JSON diff", "deep equality check with diff output".

file-tree-diff

7
from heldernoid/agentic-build-templates

Compare two directory trees and show added, removed, and changed files with color output. Use when you need to compare two versions of a directory, find what changed between releases, audit differences between staging and production file sets, or verify a deployment. Triggers include "compare directories", "directory diff", "what changed in", "file differences between", "ftd", "tree diff".

diff-ignore

7
from heldernoid/agentic-build-templates

Configure ignore patterns for file-tree-diff using .ftdignore files or CLI flags. Use when setting up ignore rules for directory comparisons, excluding build artifacts, or creating project-specific ignore configurations. Triggers include "ignore node_modules in diff", ".ftdignore", "exclude files from diff", "diff ignore patterns".

Skill: Uptime Monitoring

7
from heldernoid/agentic-build-templates

## Overview

Skill: Status Page

7
from heldernoid/agentic-build-templates

## Overview

Skill: unit-conversion

7
from heldernoid/agentic-build-templates

## Overview

Skill: recipe-scaler

7
from heldernoid/agentic-build-templates

## Overview

reading-list

7
from heldernoid/agentic-build-templates

Operate the reading-list API to save, manage, tag, search, and export articles.

email-digest

7
from heldernoid/agentic-build-templates

Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.

websocket-realtime

7
from heldernoid/agentic-build-templates

Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".