godmode:merge
Skill1 starsChanged 58 days agoMITView on GitHub
Use when the user wants to merge a branch, integrate changes, resolve conflicts, create a PR, squash-merge a feature branch, or clean up a worktree after work is done. Handles single-branch merges, PR creation and merge via gh, squash workflows, worktree cleanup, push rejection recovery, and godmode task state sync. Trigger on "merge", "merge this", "open a PR", "squash and merge", "clean up worktree", "/merge", or any variant of integrating a branch into main.
- Commits and pushes
In this repository78 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- godmode:agent-governanceSkill
- godmode:agent-improvement-loopSkill
- agents-skill-saveSkill
- baml-add-typesSkill
- godmode:brainstormSkill
- godmode:capSkill
- godmode:changelogSkill
- godmode:ci-fixSkill
- godmode:code-reviewSkill
- godmode:context-mapSkill
- godmode:cross-issueSkill
- godmode:crs-discoverSkill
- godmode:crs-hook-testingSkill
- godmode:crs-installSkill
- godmode:crs-ledger-applySkill
- godmode:crs-ledger-diffSkill
- godmode:crs-propose-rulesSkill
- godmode:crs-validateSkill
- godmode:dead-codeSkill
- godmode:decomposeSkill
- godmode:dep-auditSkill
- godmode:dep-bumpSkill
- godmode:designSkill
- devloop-session-primerSkill
- godmode:dialecticSkill
- godmode:doc-maintainerSkill
- godmode:doc-reviewSkill
- godmode:doc-syncSkill
- godmode:doc-writerSkill
- doob-db-inspectorSkill
- doob-release-managerSkill
- godmode:doublecheckSkill
- dual-forge-pr-mergeSkill
- gh-bulk-issuesSkill
- godmode:health-scoreSkill
- godmode:ingestSkill
- godmode:introspectionSkill
- godmode:issue-triageSkill
- godmode:memory-bankingSkill
- godmode:mini-context-graphSkill
- godmode:mistake-trackerSkill
- godmode:moaSkill
- notfiles-release-workflowSkill
- godmode:observability-as-infrastructureSkill
- godmode:parallel-agentsSkill
- godmode:pattern-learnerSkill
- planning-with-cruxSkill
- godmode:pr-authorSkill
- godmode:receiving-reviewSkill
- godmode:refactoringSkill
- godmode:release-notesSkill
- release-readiness-checkSkill
- remote-upstream-triageSkill
- repo-gap-backlogSkill
- godmode:rust-conventionsSkill
- rustqualSkill
- rustqual-workspaceSkill
- rust-release-workflow-authorSkill
- godmode:self-reflectSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 22
Read the file named in a row before doing the task in its right column.
- Distinctive: line 36
Before doing anything, gather state:
- Distinctive: line 69
If a PR was created instead of merged, print the PR URL.
- Distinctive: line 70
If escalating to the user, state exactly what is blocked and what decision is needed.
- Very specific: line 81
If main..<branch> is non-empty, the merge did not complete.
- Very specific: line 86
Never --no-verify. Let hooks run.
- Distinctive: line 87
Never force-push main. Feature branches only, explicit user instruction required.
- Distinctive: line 88
Never abort a merge without showing git diff HEAD first.
- Distinctive: line 89
Never rebase branches with merge commits.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
godmode:merge — Branch Integration Agent
General-purpose merge agent. Covers single-branch merges, PR-based workflows, squash mode,
worktree cleanup, and godmode task state sync. For merging multiple parallel agent branches
produced by a wave, use godmode:wave-integration instead.
Reference files
Read the file named in a row before doing the task in its right column. These files are not loaded automatically.
| File | Read before |
references/mode-rejection-recovery.md | recovering from a rejected git push (non-fast-forward, stale info, permission denied) |
references/mode-direct-merge.md | merging a feature branch into main locally with no PR, or choosing a merge strategy |
references/mode-direct-merge-conflicts-test-push.md | resolving conflicts during a direct merge, running tests after it, or pushing the merged main |
references/mode-squash.md | squash-merging a branch, or deciding whether to collapse its commits |
references/mode-pr.md | opening a PR for the current branch, or merging an open PR via gh |
references/worktree-and-task-sync.md | removing a worktree after a merge, or marking a godmode task done |
Step 0 — Assess the situation
Before doing anything, gather state:
git branch --show-current
git status --short
git log --oneline -5
git worktree listThen determine the mode (see decision table below). If the user gave explicit instructions, follow them. If ambiguous, pick the most conservative option and state your choice.
Mode decision table
| Situation | Mode |
| User said "open a PR" or "create PR" | PR-create |
| PR already open on this branch | PR-merge |
| User said "squash" or "squash and merge" | Squash |
| Multiple branches to integrate (wave) | → defer to godmode:wave-integration |
| Single feature branch, no PR | Direct-merge |
| Push was rejected | Rejection-recovery → then re-run appropriate mode |
Each mode's steps are in the reference file for it, listed above.
Report
One-line summary when complete:
merged: <branch> -> main | <sha> | [conflicts: N files] [worktree: removed] [task: <id> done]If a PR was created instead of merged, print the PR URL. If escalating to the user, state exactly what is blocked and what decision is needed.
Verification
After any merge:
git log --oneline main..<branch> # must be empty — branch fully merged
git log --oneline -3 # shows merge commit at tipIf main..<branch> is non-empty, the merge did not complete. Investigate before reporting done.
Key rules
git branch --show-currentbefore every commit — stop if onmainunexpectedly.- Never
--no-verify. Let hooks run. Identify and fix failures; do not bypass. - Never force-push
main. Feature branches only, explicit user instruction required. - Never abort a merge without showing
git diff HEADfirst. - Never rebase branches with merge commits.
- Worktree cleanup only after verifying
git log --oneline main..<branch>is empty. - For multi-branch wave integration, use
godmode:wave-integration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

