migration
Skill808 starsChanged 3 months agoMITView on GitHub
Create, review, or verify gocron database migrations across SQLite, MySQL, and PostgreSQL. Use when adding or changing GORM models, columns, indexes, constraints, persisted settings, migration version ids, Install tables, upgradeForNNN functions, or migration tests.
We split this skill into the rules it gives an agent
14 rules. 0 are common, 9 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat migrations as compatibility code.
- Distinctive: line 17
Prefer additive, idempotent changes and compatible defaults on SQLite, MySQL, and PostgreSQL.
- Distinctive: line 20
Do not advance the migration version until all work succeeds.
- Distinctive: line 22
Document downgrade safety and backup/recovery steps.
- Distinctive: line 27
Test against a representative populated database, not only a tiny fixture.
- Distinctive: line 33
Add indexes only for demonstrated query patterns.
- Distinctive: line 35
Prefer resumable/idempotent batches when a single transaction could block startup or exceed reasonable memory or disk.
- Very specific: line 53
Add a new unique id to versionIds in chronological release order.
- Very specific: line 54
Add the matching migration.upgradeForNNN entry at the same index.
- Very specific: line 57
Add new install-time models to the Install table slice.
- Distinctive: line 61
Avoid database-specific SQL.
- Very specific: line 63
Add a focused migration test that builds the N-1 pre-upgrade schema (and older affected schemas), runs the upgrade, proves existing rows …
- Very specific: line 67
Do not rely only on GORM AutoMigrate when data must be renamed, remapped, backfilled, deduplicated, or constrained.
- Distinctive: line 80
If a specific migration was added, pass its id to the structural checker:
“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migrate gocron data
Treat migrations as compatibility code. Preserve existing installations and all three supported databases; do not optimize only for a fresh SQLite database.
Compatibility invariants
- Upgrade existing installations in place; never require recreating the database or discarding tasks, configuration, users, or logs.
- Validate from an
N-1schema/data fixture and every older schema directly affected by the change. A fresh database alone is not evidence. - Prefer additive, idempotent changes and compatible defaults on SQLite, MySQL, and PostgreSQL. Do not drop or reinterpret persisted data in a minor or patch release.
- Do not advance the migration version until all work succeeds. A failed migration must remain diagnosable and safely retryable.
- Document downgrade safety and backup/recovery steps. If downgrade can lose or corrupt data, stop and obtain explicit approval before implementation.
Performance invariants
- Test against a representative populated database, not only a tiny fixture. Record row counts and migration duration for performance-sensitive changes.
- For populated-table changes, assess full scans, lock/transaction duration, temporary disk, and write amplification on SQLite, MySQL, and PostgreSQL.
- On SQLite, keep write transactions short and avoid per-row commits. Use safe bounded batches for large backfills and test busy/lock behavior with readers.
- Add indexes only for demonstrated query patterns; inspect the query plan and account for index build time, disk growth, and write overhead.
- Prefer resumable/idempotent batches when a single transaction could block startup or exceed reasonable memory or disk. State the interruption behavior.
Establish the change
- Inspect
cmd/gocron/gocron.go,internal/models/migration.go, the affected models, and nearby migration tests before editing. - Determine whether the change affects an existing table, creates a new table, or transforms existing data. Do not create an empty migration for a release with no schema or data change.
- Derive the migration id from the target
AppVersionusing the repository's established conversion. Never reuse an id. If the release version is not known and a new id is required, stop and ask for it.
Implement atomically
For a new persisted model or schema change:
- Add a new unique id to
versionIdsin chronological release order. - Add the matching
migration.upgradeForNNNentry at the same index. - Implement
upgradeForNNNwith the transaction passed to it; return every error instead of logging and continuing. - Add new install-time models to the
Installtable slice. Do not add an existing-table column there as a substitute for an upgrade. - Make the upgrade idempotent where practical. Guard data rewrites that would corrupt values on a second run.
- Avoid database-specific SQL. When unavoidable, branch on the GORM dialect and implement SQLite, MySQL, and PostgreSQL behavior explicitly.
- Add a focused migration test that builds the
N-1pre-upgrade schema (and older affected schemas), runs the upgrade, proves existing rows and values survive, and exercises a second run when idempotency is expected.
Do not rely only on GORM AutoMigrate when data must be renamed, remapped,
backfilled, deduplicated, or constrained.
Verify
Run:
python3 .agents/skills/migration/scripts/check_migration.py
go test -race ./internal/models/...
go test -race ./cmd/gocron/...If a specific migration was added, pass its id to the structural checker:
python3 .agents/skills/migration/scripts/check_migration.py 191Then invoke $verify before committing. Report the migration id, affected
tables, upgrade path, downgrade/backup implications, database-specific risks,
exact tests run, and performance evidence when the change has material risk.
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- JuliusBrussee/caveman★ 115ksame name
- kortix-ai/suna★ 20ksame name
- go-vikunja/vikunja★ 5.9ksame name
- langwatch/langwatch★ 5ksame name
- SparkDevNetwork/Rock★ 692same name
- me2resh/apexyard★ 542same name
- DataWithBaraa/claude-code-data-engineering-skills★ 52same name
- zllovesuki/cloudflare-agent-skills★ 9same name
- nomdedev/agent-manager-template★ 2same name
- rcdelfin/agentkit★ 2same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use surgical-patch, verify-and-stop and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JuliusBrusseeSkillsurgical-patch
Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter.
Also in 5 projects that use this
JuliusBrusseeSkillverify-and-stop
Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.
Also in 4 projects that use this
anshul-garg27Skillsafe-refactor
Systematic code refactoring with safety nets - maps usages, ensures tests exist, executes incrementally with verification
Also in 5 projects that use this
- +9 more from JuliusBrussee
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-featureSkill
- dependency-updateSkill
- releaseSkill
- scheduler-changeSkill
- security-checkSkill
- verifySkill
- releaseSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

