Rebase an OpenMeter branch onto another branch and handle repo-specific gotchas like sequential migrations, atlas.sum conflicts, Ent regeneration, and targeted verification.
73
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill when rebasing an OpenMeter branch, especially onto origin/main, and there may be migration, Ent, or generated-code conflicts.
git status --short --branch first.git fetch origin maingit rebase origin/mainGIT_EDITOR=true git rebase --continue in non-interactive shells.When a rebase conflict appears, the first move should usually be regenerating generated artifacts:
make generateTreat this as the default first step before manually resolving conflicted generated files.
Why:
In practice, regenerating first resolves or clarifies most conflicts much faster than hand-merging generated files.
OpenMeter migrations must stay sequential by timestamp.
If a rebased commit introduces a migration that is now older than migrations already on the target branch:
Typical flow:
.up.sql and .down.sql files.make generateatlas migrate --env local diff <migration-name>tools/migrate/migrations/atlas.sum.If tools/migrate/migrations/atlas.sum conflicts or gets out of sync:
atlas migrate --env local hashThen stage atlas.sum. Do not hand-edit checksum entries unless there is no other option.
openmeter/ent/schema/*.go is the source of truth.openmeter/ent/db/.make generate before regenerating migrations.nix develop --impure .#ci -c <command>Prefer direct command execution. Do not wrap commands in sh -lc, bash -lc, or similar helper shells when a direct invocation works. For environment variables, prefer env KEY=value <command> or KEY=value <command>.
Atlas migration diffing uses the local dev environment and may require the direnv shell:
direnv exec . atlas migrate --env local diff <migration-name>Before continuing or finishing the rebase, run the smallest relevant test slice for the touched area.
For ledger work, the usual check is:
POSTGRES_HOST=127.0.0.1 go test -tags=dynamic ./openmeter/ledger/...If there is a known pre-existing failure, call it out explicitly and separate it from any new regression introduced by the rebase.
git rebase --continue.5936703
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.