agentleFS
ryanportfolioryanportfolio/Harness-Firmware/.claude/skills/merge/SKILL.md

merge

Skill1 starsChanged 2 months agoMITView on GitHub

Merge PRs through a Codex review loop: /codex-fullreview, fix, then /codex-review reruns (3 max) until clean, then CI and squash-merge. Runs only when the user types /merge; from then on, every PR in the session goes through the same loop and merges.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use fix, report and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Google CloudSkill

    fix

    Plan a remediation strategy after a test failure.

    Also in 3 projects that use this

  • MicrosoftSkill

    report

    Turn an exploration (threads, findings, charts) into a single Markdown report — note, blog post, executive summary, KPI dashboard, slide brief, or multi-section analytical report, with embedded charts.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    test

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 5 projects that use this

  • OpenAISkill

    audit

    Audit or critique a product flow, journey, workflow, funnel, onboarding path, checkout path, settings path, screen, or multi-step product experience by capturing screenshots first, then reporting UX, design, and accessibility findings inline from that evidence. Use Figma only when the user explicitly asks for a board. Use when the user asks to audit, review, critique, inspect, assess, analyze, evaluate, or give feedback on a product experience.

    Also in 3 projects that use this

  • DockerSkill

    research

    Research a documentation topic — locate affected files, understand the problem, identify what to change. Use when investigating an issue, a question, or a topic before writing a fix. Triggers on: "research issue 1234", "investigate what needs changing for #500", "what files are affected by #200", "where is X documented", "is our docs page about Y accurate", "look into how we document Z".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 22 edited versions we read keep these.

  • 4

    Distinctive

    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:

    After: every PR session opens/updates → same steps → merge, no further prompt.

    line 18
  2. Distinctive:

    commit finished work, push, open/reuse PR.

    line 27
  3. Very specific:

    Run relevant local checks.

    line 42
  4. Very specific:

    Reruns: /codex-review: After any round that pushed a commit → /codex-review alone, full PR diff at new head, not just fix delta.

    line 53
  5. Distinctive:

    Triage, after round finishes: No edits while review runs: reviewers read working tree too, mid-review fix changes what they see.

    line 55
  6. Distinctive:

    Never reset unrelated work, force-push, or push direct to target.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “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

Merge via Codex review loop

Finished work → merged PR: commit, push, open/reuse PR, Codex loop, CI, squash-merge. Same file at repo .claude/skills/merge/SKILL.md + global ~/.claude/skills/merge/SKILL.md; copies identical.

Merge mode

User-only start: user types /merge. Never self-start, even if PR looks ready.

/merge → merge mode ON for rest of session. Announce in plain prose ("Merge mode is on for this session: every PR goes through the Codex loop and merges when clean") so mode survives summaries. While ON:

  • Immediately: every still-open PR this session opened or pushed to → all steps below, one PR at a time. Finished work w/o PR → Step 1 opens one. PRs session never touched → untouched unless user names them.
  • After: every PR session opens/updates → same steps → merge, no further prompt. Re-read this file before each; post-summary, text may be gone from context.
  • Each PR: own loop, own rerun budget.

Mode OFF when: user says so ("stop merging", "stop merge mode", "don't merge this one"), user switches to /main, or session ends. Hold on one PR → holds that PR only.

Authorization

Per PR, mode authorizes:

  • commit finished work, push, open/reuse PR;
  • 1× /codex-fullreview + ≤3 /codex-review reruns, each billed to user's Codex sub;
  • in-scope fixes for confirmed findings, committed + pushed to PR branch;
  • squash-merge once review loop + CI both pass at same head.

Review skills' "review ≠ fix authority" rule lifted for in-scope fixes only. Still NOT authorized: scope growth, design changes PR didn't make, force-push, admin bypass, direct push to target. Cap hit → that PR blocked; mode stays ON for others.

Requirements

  • codex-review + codex-fullreview skills, in repo .claude/skills/ or ~/.claude/skills/. Either missing → stop, say so.
  • Codex reachable via route review skills accept: codex login status = ChatGPT login, or config.toml in $CODEX_HOME (default ~/.codex) sets model_provider to gateway. Neither → stop before merge, report. Never substitute self-review + call gate passed.

Step 1: Integrate

  1. Inspect repo, remote, branch, working changes, existing PR. Target = task's or repo default. Keep unrelated work. Detached HEAD / on target → task branch before commit; respect user-chosen branch. Don't touch other checkouts w/o authorization.
  2. Run relevant local checks. Stage explicit paths, inspect staged diff, commit, push. Never bypass hooks. Reuse branch's open PR (gh pr list --head <branch>); else create one, description = final behavior + validation. Multiline bodies via file. Verify PR base, head, remote.
  3. Fetch target, check mergeability. Resolve unambiguous conflicts, keep both sides' intent. Semantic conflicts → investigate; ask only if resolution needs user decision not yet made. Reverify affected behavior, push.

Record PR number, target, head SHA.

Step 2: Review loop

Each round: git fetch origin <target>, scope = full PR branch diff vs origin/<target> at current head SHA. Each review skill's contract applies in full: preflight, background launch, own run dir, its 1 auto-retry, verify every finding.

Round 1: /codex-fullreview. 1 run, full PR diff. Must spawn ≥1 sub-reviewer; 0 = Manager alone = single-context, not full review. Fails after retry, or lacks verified scope identity (per its skill) → doesn't count: keep verified findings, stop, ask.

Reruns: /codex-review. After any round that pushed a commit → /codex-review alone, full PR diff at new head, not just fix delta. Same rule: failed/incomplete → stop loop, ask.

Triage, after round finishes. No edits while review runs: reviewers read working tree too, mid-review fix changes what they see. Then:

  • Confirmed 🔴/🟡 → fix.
  • Kept w/ caveat → fix if residual risk real; else record why it stays.
  • Confirmed 🟢 → fix if small + in scope, only in round already needing rerun. Round w/o 🔴/🟡 → list 🟢 in report, head unchanged; 🟢 never triggers rerun alone.
  • Refuted → drop, list under "checked and fine".
  • Fix needs user decision (behavior change, tradeoff, scope growth) → ask. User may waive; record waiver.

Fix at cause, run relevant local checks, round's fixes = 1 commit naming findings, push. Leave unrelated work alone.

Loop end. Pass = latest round, on current head, confirmed 0 🔴/🟡 (waived excluded). Round 1 passes → no rerun.

  • Cap: 3 /codex-review reruns after round 1. Check budget before any fix/review. After 3rd rerun: no more commits, no more reviews; anything still needing fix (🔴, 🟡, real-risk caveat) or head moved → PR blocked: stop, report open items, leave unmerged. User can hand-fix, waive, or authorize more reruns.
  • Commits loop didn't make (other session, teammate) → reviewed by next round, counts toward cap.
  • Head moves after passing round → verdict void: another /codex-review if budget allows, else blocked.

Step 3: CI

Inspect all PR checks: gh pr checks <number> --json name,bucket,state,workflow,link or current equivalent. Pending → bounded wait. Failed → diagnose, fix in scope; CI fix moves head → back through /codex-review round, same budget. Don't trust branch protection or MERGEABLE alone. Verify expected workflows actually ran. Absent/skipped/unavailable required check ≠ pass: explain, hold merge unless repo's established verification contract allows. No-CI repo → local verification contract, report that limit. Never admin-bypass checks.

Step 4: Merge

  1. Re-read PR head. ≠ head where loop + CI both passed → back to Step 2; verdict covers only head it saw.
  2. Squash unless user/repo says otherwise: gh pr merge <number> --squash --match-head-commit <verified-head>. No head guard available → say so, use guarded API or hold; never merge unreviewed commits.
  3. Confirm PR merged, fetch target, see merge commit. Keep branch unless user asked cleanup. Next change → new task branch from updated target, keep uncommitted work.

Never reset unrelated work, force-push, or push direct to target. Interrupted → inspect real Git + PR state before retry; lost response ≠ failed write. Pause only blocked action, finish independent authorized work, report exact blocker.

Report

Per PR: each round w/ source attribution as review skill presents it, surviving findings, fix commit SHAs, waivers + reasons, CI result. End w/ 1 line: merged <PR URL> at <head SHA>, or blocked + open items.

After merges land (each time no PR in flight is still pending), close w/ ELI5 recap: super-short bullets, plain words a 5-year-old gets, no jargon/SHAs/skill names, not caveman. One bullet per merged PR = what it's for; one bullet = what session did overall. Example:

  • PR #12: the save button works again.
  • PR #13: the page loads faster.
  • Overall: fixed two things people kept tripping on.

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.