Add typeorm-migration agent skill#3959
Open
TaprootFreak wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
typeorm-migrationagent skill atskills/typeorm-migration/(SKILL.md + reference.md) thatdocuments 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:
<prefix>_ + sha1(table + '_' + sortedColumns).substring(0, N)with the exact per-prefixN(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.
.github/workflows/api-migration-check.yamlblocks any modify/delete/rename ofan existing migration; the rule is "add a follow-up", not "edit". A skill turns this into a
runnable procedure instead of tribal knowledge.
migration/dev-data-source.tsis git-ignored and must be createdlocally, 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) — thesame "wrap an existing CLI with curated knowledge" shape as the
db-debugskill (#3957). Theskills/convention and its CONTRIBUTING section are introduced by #3957; this PR only adds the skilldirectory and does not touch CONTRIBUTING.
Files
skills/typeorm-migration/SKILL.mdskills/typeorm-migration/reference.mdPR completeness
Related: #3957 (db-debug skill — establishes the
skills/convention).