adr
Architecture decision records: durable decisions with their date, context, and consequences — supersede, never rewrite.
Finish a PR properly: every check green, every review addressed — human and bot — then merge and clean up.
> /plugin marketplace add azrtydxb/procoder > /plugin install procoder@procoder
How it fires
How this command gets triggered: by you, by Claude, or both.
/mergeContext preview
What this command does when you run it.
Finish a PR properly: every check green, every review addressed — human and bot — then merge and clean up.
description: "Finish a PR properly: every check green, every review addressed — human and bot — then merge and clean up."
The user invoked /procoder:merge with arguments: $ARGUMENTS (The argument is the PR number or branch; with none, use the PR for the current branch: `gh pr view --json number`.)
First read .procoder/github/WORKFLOW.md and follow it — the repo's rules win over the defaults below. If it is missing, get the default via "${CLAUDE_PLUGIN_ROOT}/hooks/launcher.sh" templates, write it, then follow it.
A PR merges when EVERYTHING answers — never before.
0. Don't block on the waiting: spawn a BACKGROUND agent whose only job is to watch and report. The watcher never fixes, never replies, never merges — it gathers information; you act on it. Continue other work while it watches, and pick up the loop below each time it reports. Give the watcher the merge-watching protocol from .procoder/github/WORKFLOW.md verbatim: calibrate against previous runs of the same workflow, poll PER JOB in the foreground (`gh run view <run-id> --json jobs` — never a fire-and-forget monitor), report the FIRST failing job immediately with its `--log-failed` excerpt instead of waiting for the rest, poll dynamically (fast early and near the calibrated finish, never slower than 90s), and report on every state change.
Loop until done:
1. Checks: `gh pr checks <pr>` — every required check must pass. For a failing check, open its run (`gh run view <id> --log-failed`), fix the cause in the code, commit, push, and wait for the re-run. 2. Reviews: `gh pr view <pr> --json reviews,reviewDecision` and the review comments via `gh api repos/{owner}/{repo}/pulls/<pr>/comments`. Treat BOT reviewers (Copilot included) exactly like humans: read every comment and recommendation, and for each one either
BEFORE MERGING: `launcher.sh todo add <title>`, or a backlog story where it belongs. Write the printed template to its named path, fill its criteria, and name the originating PR. Then reply with that id. "Out of scope for this PR" is only true if something now holds it; said on its own it is how a real finding is answered and then lost. No comment is skipped silently. Resolve threads only after fixing or answering (`gh api graphql` resolveReviewThread), never to hide them.
Tracking never waives a failing check, a correctness or security blocker, or a required review change. Fix those before merging. Step 2b still applies now to every real finding, including tracked follow-up work; if the detecting layer cannot be adapted safely in this PR, stop.
How to receive review feedback — bot or human:
Reviewers (Copilot especially) lack full context; a finding can be factually wrong for this codebase. Wrong → push back in the thread with the technical reason, not a fix.
implementing the others — comments are often related, and partial understanding produces the wrong fix.
point", no thanks, no "you're absolutely right" — gratitude is not a verification, and performative agreement erodes the reviewer's trust in real agreements.
answer: show it is uncalled and propose removal instead.
2b. The reflection step — MANDATORY whenever step 2 found anything real (bot or human). An escaped finding is a bug in our gates; fixing only the finding leaves its class open:
BEFORE the PR existed: a linter (lint baseline/config), the pre-PR rubric (.procoder/github/REVIEW.md), a quality controller, a pinning test, or CI itself.
the rubric line, tighten the controller, write the pinning test.
`launcher.sh templates`), with the adaptation named. Then run `launcher.sh lessons` — it flags any entry left unlearned, and an unlearned lesson is not done.
opens ISSUES rather than PR comments, and those escape the reading in step 2 entirely: the finding gets fixed and nothing records that the class happened. The command finds them, strips every trace of the code from them, and asks before it files or records anything. This is the only place a procoder command talks to GitHub about reviews — the gate reads the resulting ledger offline and never queries.
3. Re-run steps 1-2 after every push until: all checks green, reviewDecision is APPROVED (or no reviews are required), and no unaddressed comments remain. 4. Only then merge: `gh pr merge <pr> --squash` (or the repo's configured strategy). The merge commit message follows the commit template and carries no AI-attribution line — run `launcher.sh scrub` on it if you wrote one. 5. Clean up after the confirmed merge: delete the remote branch with `git push origin --delete <branch>` (the merge flag's local step fails when the default branch is checked out in a worktree, silently skipping the remote delete — do it explicitly), delete the local branch, remove the worktree if the work lived in one (`git worktree remove <path>`), run `git fetch --prune`, and return to an updated default branch (`git checkout <default> && git pull`).
N
Senior-developer discipline for AI coding agents. A commit gate that counts unchecked as failing, quality controllers that refuse to call unfinished work done, and a lessons loop that closes each escaped bug's class. One Go binary, no runtime deps, works with 20+ agents.
Architecture decision records: durable decisions with their date, context, and consequences — supersede, never rewrite.
Onboard an existing codebase: every domain's checks over the whole tree, then a triaged plan to bring it in line.
The project layer: milestones, epics, and user stories with refusing controllers — spec-seeded, sprint-ready.
Run the formatting gate over the changed files, as a commit or CI would.
CI/CD hygiene and run health: pinned actions, timeouts, concurrency, tests — plus the latest runs via gh.
Copilot's auto-review escapes: find them since the last look, sanitise them, and turn each one into a lesson.