Update main branch, merge into current branch, and resolve conflicts. Use when user types /resolve-merge or asks to merge main/resolve conflicts.
When activated, execute this workflow to update main and merge it into the current branch, resolving any conflicts:
Check current state: Verify there are no uncommitted changes:
git status --porcelain
If there are uncommitted changes, commit them first (do not stash — stash pop after merge can introduce additional conflicts).
Get current branch name:
git branch --show-current
Verify we're NOT on main. If on main, stop and tell the user.
Fetch and merge origin/main (no branch switch needed):
git fetch origin
git merge origin/main
If merge succeeds without conflicts:
just cigit push origin HEADIf conflicts occur, analyze them:
git status
git diff --name-only --diff-filter=U
List all files with conflicts.
For each conflicted file:
<<<<<<<, =======, >>>>>>>)git add <file>Verify resolution:
just test
If tests fail, review and fix the merge resolution.
If snapshot tests fail due to intentional changes from main:
cargo insta accept
Then re-run just test to confirm. Run just ci only once before pushing.
Complete the merge:
git commit # Complete the merge commit
git push origin HEAD
Report summary:
When resolving conflicts, follow these priorities:
<<<<<<< HEAD (feature branch)
pub fn analyse(module: &Module) -> AnalysisResult {
let mut analyser = Analyser::new();
analyser.analyse_module(module);
analyser.result
}
=======
pub fn analyze(module: &Module) -> AnalysisResult {
// TODO: Implement semantic analysis
AnalysisResult::new()
}
>>>>>>> main
// Resolution: Keep feature implementation, preserve any main branch improvements
pub fn analyse(module: &Module) -> AnalysisResult {
let mut analyser = Analyser::new();
analyser.analyse_module(module);
analyser.result
}
git checkout --theirs Cargo.lock && cargo build (cargo will add any missing deps from feature branch)cd runtime && git checkout --theirs rebar.lock && rebar3 upgrade --all to regenerategit rm <file>cargo insta accept if changes from main are intentional, then re-verifyIf merge cannot be resolved automatically:
git merge --abort and report the issue