Skip to content
Agent Orchestration
Skill

/merge-protocol

Use when implementation on a branch is finished and reviewed and the work needs to land, be proposed as a pull request, be parked for later, or be thrown away.

From plugin
godmode
12333 skills1 agent2 hooks

Claude Code

$ npx -y skills add NoobyGains/godmode --skill merge-protocol --agent claude-code

SKILL.md

merge-protocol.SKILL.md
name: merge-protocol
description: "Use when implementation on a branch is finished and reviewed and the work needs to land, be proposed as a pull request, be parked for later, or be thrown away."

Merge Protocol

The last step of a run decides what happens to the branch: merge it locally, open a pull request, keep it as it is, or abandon it. Each path is easy to get slightly wrong (merging into the wrong base, deleting a worktree that held the only copy of a file, force-pushing over someone's commits), and most of those mistakes are expensive to undo.

**Core principle: prove the suite is green on the exact tree you are about to land, let the user choose the path, execute it exactly, and tear down only what this run created.** Integration is the user's decision; your job is to make each option safe.

The Prime Directive

NO LANDING ON A RED SUITE, NO ABANDONING WITHOUT THE TYPED WORD

No exceptions. No workarounds. No shortcuts.

When to Use

**Required:**

  • `godmode:delegated-execution` or `godmode:inline-execution` finished and the final review is clean.
  • `godmode:parallel-execution` or `godmode:team-orchestration` integrated their results.
  • The user says "merge it", "ship it", "open a PR", "drop this branch".

**Skip:**

  • Work is unfinished or the final review has open Critical or Important findings: go back to the executing skill.
  • A deploy or release: that is the project's own release process, after the merge.

The Protocol

1. Validate the suite

Run the project's full test command in the worktree, plus its other machine checks if it has them (lint, type check, build). Read the output.

  • **Red:** stop. Report the failures with their output. The menu comes after a green suite.
  • **Green:** record the command and counts.

Also check `git status --porcelain`. Uncommitted changes are either committed now (they belong to the work) or reported to the user (they do not).

2. Capture the environment

git_dir=$(cd "$(git rev-parse --git-dir)" && pwd -P)
git_common=$(cd "$(git rev-parse --git-common-dir)" && pwd -P)
worktree_path=$(git rev-parse --show-toplevel)     # capture now; later steps change directory
branch=$(git branch --show-current)

| State | Paths offered | Teardown | |---|---|---| | Normal checkout (`git_dir` equals `git_common`) | all four | none needed | | Linked worktree on a named branch | all four | only if this run created it | | Linked worktree, detached HEAD | PR (push as a new branch), keep, abandon | the host manages it; leave it |

3. Identify the trunk

The trunk is the branch this work forked from: named in the plan, the ledger, the branch's upstream, or `git merge-base`. If it is not certain, ask one question: "This branch split from `<best guess>`, correct?" Merging into the wrong base is expensive to undo.

4. Present the paths

Present exactly this, with the real names filled in:

The work on <branch> is complete. Suite: <command> -> <counts>.

1. Merge into <trunk> locally
2. Push <branch> and open a pull request against <trunk>
3. Keep the branch as it is for later
4. Abandon the work (deletes the branch and its commits)

Which path?

Wait for the answer. If the run made rulings or left deferred minors, list them above the menu so the user decides with them in view.

5. Execute the chosen path

**Path 1: Merge locally**

main_root=$(git -C "$git_common/.." rev-parse --show-toplevel)
cd "$main_root"
git switch "$trunk"
git pull --ff-only            # if the trunk has a remote; stop if it cannot fast-forward
git merge --no-ff "$branch"
<full test command>

If the merged result is red, stop. The merge is local and nothing is pushed: leave the branch and worktree in place, report, and investigate. If green: tear down (step 6), then `git branch -d "$branch"`. Do not push the trunk unless the user asked for that too.

**Path 2: Pull request**

git push -u origin "$branch"
# detached HEAD: git push origin HEAD:refs/heads/<new-branch>

Open the pull request against the trunk with the forge's command-line tool if one is installed, or the creation link the push prints. Follow the repository's pull-request template. The body says what changed, how it was verified (commands and counts), the rulings made, and the deferred minors. Report the URL. Keep the worktree: review feedback gets fixed there.

**Path 3: Keep as it is**

Report: `Keeping <branch>. Worktree at <path>. Resume with the ledger at <ledger path>.` Change nothing.

**Path 4: Abandon**

Show exactly what will be lost and require the typed word:

This permanently deletes:
- branch <branch>
- commits: <git log --oneline trunk..branch>
- worktree at <path>, including uncommitted files: <list or "none">

Type "abandon" to confirm.

Only the exact word authorises it. "Yes", "sure" or "get rid of it" do not; ask again. On confirmation: change to the main root, tear down (step 6), then `git branch -D "$branch"`. If the branch was pushed, ask separately before deleting the remote branch.

6. Tear down

Runs after path 1 and confirmed abandonment only.

  • Normal checkout: nothing to remove.
  • Worktree under `.worktrees/` or `worktrees/` that this run created: `git worktree remove "$worktree_path"`, then `git worktree prune`.
  • Harness-managed worktree: leave it to the harness; use its exit action if it has one.
  • **Removal refused** because of modified or untracked files: those files exist nowhere else. Never force it on your own. Show `git -C "$worktree_path" status --porcelain -uall` and offer: commit them to the branch, move them to the main checkout, or delete them. Act on the user's choice.

Delete the run's plan workspace (`.godmode/runs/<plan-slug>/`) after the rulings have been reported.

7. Report

Path: <1-4>  Branch: <name>  Trunk: <name>
Suite: <command> -> <counts> (on the merged tree for path 1)
Result: <merge commit | PR URL | kept at path | deleted>
Teardown: <what was removed, what was lef
Read more
@noobygains
Ships withgodmode

Engineering discipline for AI coding agents: question the request, verify against current docs, plan, build test-first on the cheapest capable model, review with a second model family, prove it before saying done. One repo for Claude Code, Codex, Antigravity, Cursor, Gemini CLI and OpenCode.

12333 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
123
Star history of NoobyGains/godmode on GitHub, a chart by star-history.com

Other skills on godmode.

agent-briefing

agent-briefing

Use when writing a prompt for a subagent or teammate, deciding how much context another agent needs, writing or reading a handoff…

@noobygains@noobygainsInstall Skill
code-review

code-review

Use when a task, feature or bug fix is implemented and before it is committed, merged or handed back to the user, and when the…

@noobygains@noobygainsInstall Skill
codebase-conventions

codebase-conventions

Use when about to add or change code in an existing codebase: a new file, module, route, component, service, test, migration,…

@noobygains@noobygainsInstall Skill
completion-gate

completion-gate

Use when about to say that work is done, fixed, passing, working, deployed or ready, before committing, opening or merging a pull…

@noobygains@noobygainsInstall Skill
cross-model-review

cross-model-review

Use when a reviewed change is about to land on a shared branch, be released or be deployed, and when the user asks for a second…

@noobygains@noobygainsInstall Skill
delegated-execution

delegated-execution

Use when a written implementation plan is ready to execute in the current session and its tasks are mostly independent, so each…

@noobygains@noobygainsInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca1d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip2d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about merge-protocol.

Which coding agents can use merge-protocol?
merge-protocol installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.