Agent skill

Merge Review

by SethGammon in SethGammon/Citadel

Reviews pending fleet worktree merges before they're accepted.

MITAuto-check passedBusiness, Finance & HR

Install Merge Review

skills CLI
$ npx skills add SethGammon/Citadel --skill merge-review -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel merge-review --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/merge-review .claude/skills/merge-review && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
merge-review
GitHub stars
924
Token cost
~1.7k tokens
SKILL.md length
676 words
Files
2
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

Reviews pending fleet worktree merges before they're accepted.

  • Works in 8 steps: Read the Queue → For Each Branch — Gather Diff Data → Detect Overlapping Files → …
  • Tasks that involve Git worktrees
  • SKILL.md covers Orientation, When to Route Here, Invocation Forms and Protocol, plus 5 more sections
  • Calls git

What it does

Merge Review is an agent skill from SethGammon/Citadel. Reviews pending fleet worktree merges before they're accepted. Reads the merge-check queue, detects file-level conflicts between branches, proposes a safe merge order, and surfaces reconciliation plans for overlapping changes.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `__benchmarks__/empty-queue.md`).

It sits in Business, Finance & HR, covering Git worktrees and Accounting and bookkeeping. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Tasks that involve Git worktrees
  • Tasks that involve Accounting and bookkeeping

Example prompts

  • “Use the merge-review skill to review pending fleet worktree merges before they're accepted”
  • “/merge-review”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Read the Queue
  2. For Each Branch — Gather Diff Data
  3. Detect Overlapping Files
  4. Assess Risk Per Branch
  5. Propose Merge Order
  6. Output the Report
  7. Update the Queue
  8. Cleanup Merged Worktrees

What it can do on your machine

Read from SKILL.md and the folder at commit 2681b89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Merge Review loads about 1.7k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 676 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit 2681b89, republished under its MIT licence (© SethGammon). 676 words, ~1,665 tokens.

Download SKILL.mdSave it as .claude/skills/merge-review/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
merge-review
description
Reviews pending fleet worktree merges before they're accepted. Reads the merge-check queue, detects file-level conflicts between branches, proposes a safe merge order, and surfaces reconciliation plans for overlapping changes.
license
MIT
user-invocable
true
auto-trigger
false
trigger_keywords
merge review, check merges, any conflicts, fleet conflicts, pending branches, safe to merge
last-updated
2026-03-26

/merge-review — Fleet Merge Arbitration

Orientation

Use when: reviewing pending fleet worktree merges before accepting them into the main branch. Don't use when: reviewing general code quality (use /review); checking CI status before merging (use /pr-watch).

When to Route Here

  • "check merges"
  • "any conflicts"
  • "what do the fleet agents want to merge"
  • "review the pending branches"
  • "is it safe to merge fleet output"
  • "arbitrate the worktrees"
  • worktree-remove.js has queued items and the user wants to process them

Invocation Forms

/merge-review              # Process the full queue
/merge-review {branch}     # Review a specific branch only

Protocol

Step 1: Read the Queue

Read .planning/telemetry/merge-check-queue.jsonl. Each line is a JSON object:

json
{"branch": "fleet/task-abc", "worktree": "/path/to/worktree", "queuedAt": "ISO"}

If the file doesn't exist or is empty:

"No pending merge reviews. Fleet agents haven't completed any worktrees recently." Stop here.

If invoked with a specific branch (/merge-review {branch}): filter to that branch only.

Step 2: For Each Branch — Gather Diff Data

Run git diff main..{branch} --name-only, --stat, and git branch --list {branch}.

If the branch no longer exists: mark status: "merged", note "likely already merged. Skipped.", continue.

Step 3: Detect Overlapping Files

Compare changed file sets pairwise. For each pair sharing files, read git diff main..{branch} -- {file} for both and classify:

  • Additive: both add to the file (low risk, likely auto-mergeable)
  • Overlapping edits: both modify the same function/section (medium risk)
  • Contradictory: one adds, the other removes the same code (high risk)
Step 4: Assess Risk Per Branch

For each branch:

  • low — no overlapping files with other branches
  • medium — overlaps exist but changes appear additive or in different sections
  • high — overlaps in the same function, class, or closely coupled section
Step 5: Propose Merge Order

Order branches: fewest conflicts first, most conflicts last.

If circular dependencies exist (A conflicts with B, B conflicts with C, C conflicts with A): escalate to the user — do not propose an impossible order.

Step 6: Output the Report
## Merge Review: {N} branch(es) pending

### Branch: {name}
Files changed: {N}
Overlap with other branches: {branch-X} ({file-list}) | none
Risk: low | medium | high
Recommendation: merge | review-first | resolve-conflict

---
[repeat for each branch]
---

### Conflicts Detected

{branch-A} and {branch-B} both modified:
  - {file}: {brief description — e.g., "A adds export, B removes same export"}
Recommended resolution: {which change to keep, or how to combine them}

[repeat for each conflict pair]

### Proposed Merge Order

1. {branch} — no conflicts, safe to merge first
2. {branch} — depends on #1; review {file} after merging #1
3. {branch} — manual conflict resolution needed in {file} before merging

### Summary
Branches ready to merge: {N}
Branches needing review: {N}
Branches with hard conflicts: {N}

If all branches are conflict-free:

## Merge Review: {N} branch(es) pending — No conflicts detected

All branches can be merged in any order. Recommended order (by change size, smallest first):
1. {branch} — {N} files
2. {branch} — {N} files
Step 7: Update the Queue

After producing the report, mark reviewed items in the queue:

  • Branches still needing work: status: "reviewed", add reviewedAt timestamp
  • Branches no longer existing: status: "merged" (already handled in Step 2)

Write the updated queue back to .planning/telemetry/merge-check-queue.jsonl.

Step 8: Cleanup Merged Worktrees

Run git worktree list --porcelain. For each non-main worktree: check git branch --merged HEAD. If merged and clean: run git worktree remove "{path}" --force and git branch -d "{branch}". No user confirmation needed. Report count: "Cleaned up {N} merged worktree(s): {branch-names}".


Show full SKILL.md (287 more words)Show less

Fringe Cases

Queue empty: Output "No pending merge reviews." and stop.

Branch no longer exists: Remove from queue, note, continue.

Branch not in queue: Note "not in the merge queue" and suggest /merge-review to see all.

All branches conflict (circular): List all conflicts; do not propose an order; escalate to user.

One branch pending: Skip conflict detection; output single-branch review (files, stat, recommendation).

Large diff (>500 lines): Summarize changed areas; link to git diff command for details.

Worktree path missing but branch exists: Proceed with git diff using branch name; worktree existence not required.


Integration Points

  • worktree-remove.js — queues items to .planning/telemetry/merge-check-queue.jsonl when a fleet worktree completes
  • fleet skill — run /merge-review after fleet agents complete, before merging to main
  • session-end.js — may surface a reminder if the merge queue has items at session end

Contextual Gates

Disclosure: "Reviewing pending fleet worktree merges. Read-only — no changes applied." Reversibility: green — read-only review; no files merged or modified Trust gates:

  • Any: view merge review report and recommendations

Quality Gates

  • Never merge branches — only analyze and recommend
  • Always update the queue after processing (mark reviewed/merged)
  • Always provide a concrete recommendation for each branch (merge / review-first / resolve-conflict)
  • If a branch was already merged, clean it from the queue without error
  • If all conflicts are circular/unresolvable, escalate clearly rather than proposing an impossible order

Exit Protocol

/merge-review does not produce a HANDOFF block. It outputs the merge report (Step 6) and then waits for the next user command.

After the report, suggest next actions based on what was found:

  • If all branches are safe: "All clear. Merge in the order above."
  • If conflicts exist: "Resolve the flagged conflicts before merging. Run /merge-review again after resolving."
  • If queue is empty: "Queue is empty. Nothing to review."

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/merge-review of SethGammon/Citadel.

  • SKILL.md
  • __benchmarks__/empty-queue.md

Open the folder on GitHubat commit 2681b89

Compare with similar skills

Merge Review next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Merge Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Merge Review this skillSethGammon/Citadel924—~1.7kAutomated safety check: PassMIT
Interlinked Spec AuditQuentinCody/interlinked-cli178—~3.3kAutomated safety check: PassMIT
Sandbox Lifecycle Debugvercel-labs/vercel-openclaw-archived117—~809Automated safety check: PassMIT
Full AuditAlexZio00/sovereign-skills140—~6.4kAutomated safety check: PassMIT
Canva Core Workflow Bjeremylongshore/tons-of-skills-marketplace2.8k—~950Automated safety check: PassMIT
Mistral Reference Architecturejeremylongshore/tons-of-skills-marketplace2.8k—~932Automated safety check: PassMIT

Similar skills

  • Interlinked Spec Audit

    QuentinCody/interlinked-cli

    Keep prose specs and design docs honest against the code using Interlinked's spec-audit system.

    178 GitHub stars~3.3k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Sandbox Lifecycle Debug

    vercel-labs/vercel-openclaw-archived

    Official

    Sandbox lifecycle debugging for vercel-openclaw: create, resume, stop, snapshotting, reset, stale-running reconciliation, persistent Sandbox v2 behavior, hot spares, and lifecycle locks.

    117 GitHub stars~809 tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Full Audit

    AlexZio00/sovereign-skills

    Exhaustive, denominator-driven audit of an entire area (codebase, docs, memory, skills, DB, config).

    140 GitHub stars~6.4k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Canva Core Workflow B

    jeremylongshore/tons-of-skills-marketplace

    Operate Canva assets, brand-template autofill, and folders with explicit rights and asynchronous reconciliation.

    2.8k GitHub stars~950 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Mistral Reference Architecture

    jeremylongshore/tons-of-skills-marketplace

    Design a Mistral integration from policy gateway through adapter, queues, state reconciliation, and audited output.

    2.8k GitHub stars~932 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Mistral SDK Patterns

    jeremylongshore/tons-of-skills-marketplace

    Design a pinned Mistral client adapter with typed results, cancellation, retry classification, and usage accounting.

    2.8k GitHub stars~853 tokensUpdated today
    Business, Finance & HRAuto-check passed

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    924 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    924 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    924 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    924 GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Watch

    SethGammon/Citadel

    File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

    924 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    924 GitHub stars~5.5k tokensUpdated yesterday
    Auto-check passed

Questions about Merge Review

What does Merge Review do?

Reviews pending fleet worktree merges before they're accepted. Merge Review is an agent skill from SethGammon/Citadel. Reviews pending fleet worktree merges before they're accepted.

When should I use Merge Review?

Merge Review fits situations like: tasks that involve Git worktrees; tasks that involve Accounting and bookkeeping.

How do I install Merge Review in Claude Code?

Run `npx skills add SethGammon/Citadel --skill merge-review -a claude-code`. Or copy the skill folder (skills/merge-review in SethGammon/Citadel) into .claude/skills/merge-review in your project. Claude Code loads it when a task matches its description.

How do I install Merge Review in Codex?

Run `npx skills add SethGammon/Citadel --skill merge-review -a codex`. Or copy the skill folder (skills/merge-review in SethGammon/Citadel) into .agents/skills/merge-review in your project. Codex loads it when a task matches its description.

Can I use Merge Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill merge-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/merge-review, .gemini/skills/merge-review, .github/skills/merge-review and .opencode/skills/merge-review in your project.

What does Merge Review need to run?

Going by SKILL.md and its folder, Merge Review needs the command-line tools its instructions call (git).

Does Merge Review access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Merge Review safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Merge Review use?

Merge Review is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Merge Review use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Merge Review?

Skills that share tags, products or a category with Merge Review: Interlinked Spec Audit (QuentinCody/interlinked-cli, 178 stars), Sandbox Lifecycle Debug (vercel-labs/vercel-openclaw-archived, 117 stars), Full Audit (AlexZio00/sovereign-skills, 140 stars) and Canva Core Workflow B (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Merge Review?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 924 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 9, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.