Skip to content

Add typeorm-migration agent skill#3959

Open
TaprootFreak wants to merge 1 commit into
developfrom
feat/typeorm-migration-skill
Open

Add typeorm-migration agent skill#3959
TaprootFreak wants to merge 1 commit into
developfrom
feat/typeorm-migration-skill

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

What

Adds a typeorm-migration agent skill at skills/typeorm-migration/ (SKILL.md + reference.md) that
documents how to author a database migration in this repo: generate from the entity diff, hand-write
schema migrations with TypeORM's deterministic constraint naming, and follow the post-merge
immutability rule.

Why this is needed

Writing a migration here carries non-obvious, load-bearing knowledge that gets re-derived every time
and is partly CI-enforced:

  • Deterministic constraint naming — hand-written schema migrations must reproduce
    <prefix>_ + sha1(table + '_' + sortedColumns).substring(0, N) with the exact per-prefix N
    (27 for PK/FK/UQ/DF, 26 for REL/IDX/CHK). Get it wrong and the next generated diff fights the
    migration. CONTRIBUTING.md memorializes this table precisely because it is easy to get wrong.
  • Immutability.github/workflows/api-migration-check.yaml blocks any modify/delete/rename of
    an existing migration; the rule is "add a follow-up", not "edit". A skill turns this into a
    runnable procedure instead of tribal knowledge.
  • Generation prerequisitesmigration/dev-data-source.ts is git-ignored and must be created
    locally, and the build + DB must be current or the diff is wrong. New contributors hit this.

This is a per-PR, knowledge-heavy procedure backed by an existing command (npm run migration) — the
same "wrap an existing CLI with curated knowledge" shape as the db-debug skill (#3957). The
skills/ convention and its CONTRIBUTING section are introduced by #3957; this PR only adds the skill
directory and does not touch CONTRIBUTING.

Files

  • skills/typeorm-migration/SKILL.md
  • skills/typeorm-migration/reference.md

PR completeness

  • Migration: N/A (no entity/column changes — docs only)
  • Environment / Infrastructure: N/A
  • Service updates: N/A
  • Frontend synchronization: N/A

Related: #3957 (db-debug skill — establishes the skills/ convention).

@TaprootFreak TaprootFreak marked this pull request as ready for review June 23, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant