From spark
Resolves rebase conflicts in Ent generated code and Atlas migrations using repository scripts (mise fix-atlas-conflicts, mise fix-ent-conflicts).
How this skill is triggered — by the user, by Claude, or both
Slash command
/spark:resolving-rebase-conflictsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Activate this skill when any of these conditions are detected:
Activate this skill when any of these conditions are detected:
git rebase or gt restack and atlas.sum has conflict markersatlas.sum conflictsgit status shows atlas.sum as "both modified" or migration .sql files with conflictsspark/so/ent/ have conflict markers after rebasego build or go generate fails due to conflict markers in ent-generated codeSymptom: atlas.sum has conflict markers, but ent-generated .go files are fine. The base branch added migrations for schemas unrelated to yours - only ordering conflicts.
Fix: mise fix-atlas-conflicts
Symptom: Generated ent .go files in spark/so/ent/ have conflict markers (<<<<<<</>>>>>>>). Go compilation fails, so go generate can't run. If this commit also added atlas migrations, those migrations are invalid (generated against pre-rebase schema state).
Fix: mise fix-ent-conflicts
The repository includes scripts/fix-atlas-conflicts.sh (also available as mise fix-atlas-conflicts) which automates the fix:
.sql files added by the rebasing commit (via REBASE_HEAD)atlas.sum from scratch using atlas migrate hashPreview the fix (always do this first):
mise fix-atlas-conflicts -- --dry-run
This shows which files will be renamed and to what timestamps, without making changes.
Apply the fix:
mise fix-atlas-conflicts
Continue the rebase. The script will suggest the correct command:
gt on PATH and .graphite/ exists): gt continuegit rebase --continuemise fix-atlas-conflicts -- --commit <SHA> to specify the commit manuallyThe repository includes scripts/fix-ent-conflicts.sh (also available as mise fix-ent-conflicts) which automates the fix:
.go files for conflict markers in hand-written files (any file without the Code generated by ent header).go files by scanning for the // Code generated by ent, DO NOT EDIT. header--ours) version via git checkout --ours. This removes conflict markers while keeping valid, type-checkable Go - necessary because ent's codegen parses schemas that import from generated packagesgo generate ./so/ent/... to regenerate from the merged schemas.sql files, deletes them (they're stale) and rehashes atlas.sumResolve conflicts in hand-written files first. The script will abort if it finds conflict markers in any .go file that lacks the Code generated by ent header (schemas, extensions, tests, config files, etc.).
Preview the fix:
mise fix-ent-conflicts -- --dry-run
Apply the fix:
mise fix-ent-conflicts
If the script deleted stale migrations, regenerate them:
./scripts/gen-migration.sh <migration-name>
Continue the rebase. The script will suggest the correct command.
--dry-run - Preview which files would be reset, without making changes--force - Skip generated-file conflict-marker check (useful outside a rebase, e.g. after manual schema merge)-h/--help - Usage informationThe script detects generated files by their // Code generated by ent, DO NOT EDIT. header. Any .go file without this header is treated as hand-written and left untouched. Examples:
| File | Why |
|---|---|
ent/schema/** | Schema definitions, mixins, schematype/ |
ent/*_extension.go | Hand-written extension files |
ent/*_ext.go | Hand-written predicate extensions |
ent/*_test.go | Test files |
ent/entc.go | Codegen driver config |
ent/generate.go | //go:generate directive |
ent/interceptor.go | Custom OpenTelemetry interceptors |
ent/telemetry.go | Custom tracer init |
ent/migrate/dump_schema.go | Hand-written schema dump utility |
ent/migrate/migrations/** | Migration SQL files + atlas.sum |
atlas.sum conflict markers - the hash file is regenerated from scratchatlas.sumgit checkout --theirs atlas.sum - this loses the entry for our migration filesfix-ent-conflicts for atlas-only conflicts - use fix-atlas-conflicts insteadnpx claudepluginhub buildonspark/sparkResolves git merge, rebase, or cherry-pick conflicts via a structural cascade: mergiraf (AST-aware auto-resolve), then git rerere, then kdiff3 as manual fallback. Includes squash-merge residue detection and helper scripts for batch resolution.
Resolves in-progress git merge or rebase conflicts by understanding intent, preserving both sides where possible, and running automated checks.
Resolves Git merge and rebase conflicts efficiently using bulk strategies like `git checkout --theirs/--ours` over manual conflict marker editing. Activates on merge/rebase conflicts.