merge-council
Installation
SKILL.md
Merge Council
Run only on an explicit request for a merge council. A general request to review a PR belongs to other review skills.
A merge council is the council skill applied to one pull request, with two additions: a verdict tied to the reviewed commits, and fixes the members agree on. Requires the council skill; if it is missing, stop and say so. Use its member lineup and its Convene section to launch members.
The members decide. You coordinate: you freeze the subject, brief the members, pool their answers, and apply the rules below exactly. You never settle a finding, a remedy, or a vote yourself. Council's Synthesize step does not apply; this skill's verdict rules replace it.
1. Prepare
- Resolve the PR URL: the argument, or
gh pr view --json urlfor the current branch. If there is no PR, stop and say so. Pass the full URL to everyghcommand. - Use a checkout whose remotes include the PR's base repository: one the user named, the current checkout, or a clone at
${TMPDIR:-/tmp}/merge-council/clones/<owner>-<repo>. - Choose the mode. Fix mode applies when the PR author is
gh api user --jq .login, the PR is open, andgh api repos/<head owner>/<head repo> --jq .permissions.pushis true. Every other case is read-only; record the reason. - Freeze the subject: fetch the PR head and base, and record the repository, PR number, head ref, head SHA, base ref, base SHA, and merge base. The head SHA must equal the PR's
headRefOid. For an open PR, the base SHA is the fetched base ref's tip. For a merged PR, it is the first parent of the PR's merge commit; without a merge commit, the run is incomplete. - Create the run directory
${TMPDIR:-/tmp}/merge-council/<runId>/, whererunIdismc-<pr>-<short head SHA>-<UTC timestamp>, and a detached review worktree at the head SHA inside it. Install dependencies there with the repository's frozen-lockfile install; record a failure as a limitation. Afterwards,git status --porcelain --untracked-files=noin the worktree must print nothing; if the install changed tracked files, the run is incomplete. - List changed instruction files: names in
git diff --name-only <mergeBase> <headSha>that areAGENTS.md,CLAUDE.md, orCLAUDE.local.mdat any depth, or under.claude/or.codex/. A PR that changes one can steer its own reviewers. - Find a prior run: a record path the user names, otherwise the newest
${TMPDIR:-/tmp}/merge-council/*/record.jsonfor this repository and PR whose verdict is notAPPROVE. Carry every finding it did not reject into the briefs, with its resolution and each ID prefixedP-, and record the user's decisions on them in the user's own words, keyed by the prefixed ID.