agentleFS
daryaKutodaryaKuto/claude-skills/skills/review-before-merge/SKILL.md

review-before-merge

Skill0 starsChanged 16 days agoMITView on GitHub

Use when an agent-produced branch is ready to merge and needs a check from someone other than its author; when the only evidence a change works is "tests passed" with no fresh rerun; when a review might run build or test commands in a shared checkout and move someone else's HEAD (the commit a branch currently points to); when a failing test needs to be told apart from one that was already broken before the change; or when nobody can say, from a stored record rather than a guess, exactly which commit was reviewed and who approved the merge.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    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:

    Use before merging a branch an agent wrote, when the only proof is a green test run, or when review commands might move someone else's HEAD …

    line 14
  2. Very specific:

    Isolate: add a git worktree (a second copy of the repo, own branch) at head SHA: git worktree add <path> <head-sha>.

    line 21
  3. Distinctive:

    Report, then stop: never merge your own review.

    line 27
  4. Distinctive:

    Stop condition: every changed file has a pass/fail verdict with a command behind it, gaps are named, and any merge has a stored record.

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Review before merge

Overview

A branch is not ready to merge until a reviewer with fresh context reruns every check from scratch, in an isolated copy of the repo, against a pinned base and head commit. Merging is a separate step with its own stored record.

When to use (and when NOT)

Use before merging a branch an agent wrote, when the only proof is a green test run, or when review commands might move someone else's HEAD (the commit a branch points to) in a shared checkout.

Skip for docs-only diffs or trivial changes. Not about running several reviewers at once (review-panel) or requesting a review (superpowers's requesting-code-review): this is one review, one branch, before merge.

The pattern

  1. Pin the scope: repo, base SHA (where the branch started), head SHA (last commit). A later rebase or force-push must not change what gets reviewed.
  2. Isolate: add a git worktree (a second copy of the repo, own branch) at head SHA: git worktree add <path> <head-sha>. Never checkout/switch the shared workspace.
  3. Use fresh context: a different session than the author, ideally a different model.
  4. Rerun everything for real: build, lint, typecheck, full test suite, in the worktree, against real dependencies, no mocks. For UI, drive the app: golden path plus one edge case, screenshot or log as evidence.
  5. Classify every failure: signal is touching a changed file; proof is rerunning suite on base SHA in a second worktree. Fails both = pre-existing; fails only head = regression.
  6. Name gaps; back every finding with evidence: file:line plus a reproducing command, or UNVERIFIED. 6b. Read the live system: if the branch has a migration, a deploy or an infrastructure change, read the live system's current state (read-only) and confirm it is what the change expects (the object it alters exists and has the shape the change assumes; a rehearsal, if one ran, applied cleanly). Confirming the change itself landed is the release's read-back, after merge. If you cannot read it, report the change as UNVERIFIED.
  7. Report, then stop: never merge your own review; remove the worktree once saved elsewhere.
  8. Merge separately, later: record head SHA, review, approver, timestamp. Merge command success is not that record.

Stop condition: every changed file has a pass/fail verdict with a command behind it, gaps are named, and any merge has a stored record.

Quick reference

StepRule
ScopeBase + head SHA, pinned
Isolationgit worktree add, never shared HEAD
ReviewerFresh context, no mocks
RegressionFails head, passes base (confirm by rerun)
Evidencefile:line + command, or UNVERIFIED
MergeSeparate step, stored record

Common mistakes

  • Reviewing "the current branch" instead of a pinned SHA: rebase changes what was checked.
  • Calling a test a regression from file overlap alone, without rerunning on base.
  • Running review commands in the shared checkout, moving someone else's HEAD.
  • Skipping "could not verify" instead of naming the gap.
  • Treating a merge command's success as the audit record.

Source

Repo: https://github.com/AnandChowdhary/continuous-claude, commit b9d8ccf9343905d33a1296583114e3326fe102d3, MIT. Read: README.md, continuous_claude.sh (grepped, reviewer prompt near line 74). Adapted: diff-scoped review, real checks, app walkthrough with screenshots, "could not verify" section, reviewer never commits, review on a different model.

Repo: https://github.com/mikeyobrien/ralph-orchestrator, commit edc2b3268c9bd0c08a12c8193a7ace7ab2789261, MIT. Read: ralph.reviewer.yml (413 lines: scoper 30-107, verifier 108-263, synthesizer 337+, plus core.guardrails). Adapted: worktree isolation from scoper; verifier's technique of correlating failing tests against git diff <base> --name-only as a first-pass signal; cleanup from synthesizer; evidence rule from core.guardrails. Own addition, not in source: rerunning the suite on base to confirm pre-existing failures; source never does this.

Repo: https://github.com/BloopAI/vibe-kanban, commit d5cbb5380fa0b32e98ef9b8d987f63decce4be3a, Apache-2.0. Read: crates/executors/src/actions/review.rs, crates/db/src/models/merge.rs. Adapted: review context pinned to repo id plus exact base SHA (one entry per repo, multi-repo changes); persisted, typed merge record (direct or PR, commit/PR, target branch, timestamp) as source of truth for "is this merged".

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.