agentleFS
89jobrien89jobrien/godmode/skills/merge/SKILL.md

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

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
  1. Distinctive:

    Read the file named in a row before doing the task in its right column.

    line 22
  2. Distinctive:

    Before doing anything, gather state:

    line 36
  3. Distinctive:

    If a PR was created instead of merged, print the PR URL.

    line 69
  4. Distinctive:

    If escalating to the user, state exactly what is blocked and what decision is needed.

    line 70
  5. Very specific:

    If main..<branch> is non-empty, the merge did not complete.

    line 81
  6. Very specific:

    Never --no-verify. Let hooks run.

    line 86
  7. Distinctive:

    Never force-push main. Feature branches only, explicit user instruction required.

    line 87
  8. Distinctive:

    Never abort a merge without showing git diff HEAD first.

    line 88
  9. Distinctive:

    Never rebase branches with merge commits.

    line 89

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

FileRead before
references/mode-rejection-recovery.mdrecovering from a rejected git push (non-fast-forward, stale info, permission denied)
references/mode-direct-merge.mdmerging a feature branch into main locally with no PR, or choosing a merge strategy
references/mode-direct-merge-conflicts-test-push.mdresolving conflicts during a direct merge, running tests after it, or pushing the merged main
references/mode-squash.mdsquash-merging a branch, or deciding whether to collapse its commits
references/mode-pr.mdopening a PR for the current branch, or merging an open PR via gh
references/worktree-and-task-sync.mdremoving 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 list

Then 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

SituationMode
User said "open a PR" or "create PR"PR-create
PR already open on this branchPR-merge
User said "squash" or "squash and merge"Squash
Multiple branches to integrate (wave)→ defer to godmode:wave-integration
Single feature branch, no PRDirect-merge
Push was rejectedRejection-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 tip

If main..<branch> is non-empty, the merge did not complete. Investigate before reporting done.

Key rules

  • git branch --show-current before every commit — stop if on main unexpectedly.
  • 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 HEAD first.
  • 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.