merge-council
Run a merge council on a pull request only when the user, a task, or repository guidance explicitly asks for a merge council. Convenes the council skill's members on the PR, returns a merge verdict bound to the reviewed commits, and on the user's own open PRs fixes and pushes the findings every member agreed on.
How do I install this agent skill?
npx skills add https://github.com/filipgutica/filip-stack --skill merge-councilIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill reviews and fixes pull requests by coordinating multiple AI agents. It carries low risk because it automatically escalates to a human reviewer if sensitive instruction files are changed, though it does execute code from the repository being reviewed (e.g., installing dependencies and running tests).
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
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.
2. Review
- Round 1. Launch every member in parallel with the review brief from member brief. Members are read-only and see only their brief.
- Round 2. Pool the findings, group duplicates, and give each group a neutral ID (
F-1,F-2, ...) so no ID reveals its author; keep the mapping to member IDs in the record. Send every member the reconciliation brief. Skip it only when every member raised the same findings with the same remedy, blocking class, and eligibility; then recordagreeon all four questions for every member, and the round 1 votes are the final votes. - A member attempt fails when it errors, reports a different
HEAD, returns malformed JSON, or runs past 20 minutes, after you cancel it and confirm it stopped. Retry once; a successful retry replaces the failed attempt, and a second failure makes that memberABSTAIN. When the host reports that a member ran with a different model or effort than its target, the run is incomplete. - The run limit is 120 minutes. At the limit, cancel active work, start no fix, and finish with an incomplete record.
Give each finding exactly one status from the round 2 answers:
- Agreed: every member answers
agreeon the claim, remedy, and blocking class. - Rejected: every member answers
disagreeon the claim. - Contested: everything else, including a split vote.
3. Fix (fix mode only)
A finding is fixable when it is agreed, its eligibility is eligible, and every member answered agree on that eligibility. Send the fixable findings to the Routine implementer from the user's delegation policy, or the host's general-purpose agent, with the fixer brief.
- Pushed: the new head is a new subject. Keep the run ID, run directory, worktree, and push count. Repeat Prepare steps 4 and 6 for the new head, confirm the worktree's
HEADis that head, carry this run's findings as prior findings, and run the review again on the whole PR. - Not pushed: stop fixing and record why.
Allow at most two pushes per run.
4. Verdict
Fetch the head and base again, then apply the first rule that matches:
NEEDS_HUMANwhen the run is incomplete; a member abstained or did not meet coverage; a blocking finding is contested; an agreed blocking finding needs the user's decision; a fix was not pushed; the head or base moved without a council push; the PR changes an instruction file; or the review diff is empty.CHANGES_REQUESTEDwhen an agreed blocking finding is still open.APPROVEwhen every member's final vote isAPPROVEand no blocking finding is open.NEEDS_HUMANotherwise.
Non-blocking findings never prevent APPROVE.
5. Record and report
Write <run dir>/record.json, then remove the review worktree and leave the run directory:
{
"runId": "mc-182-1a2b3c4-20261109T1830Z",
"previousRunId": null,
"status": "complete | incomplete",
"verdict": "APPROVE | CHANGES_REQUESTED | NEEDS_HUMAN",
"mode": "fix | read-only",
"subject": { "repo": "owner/name", "pr": 182, "headRef": "branch", "headSha": "", "baseRef": "main", "baseSha": "", "mergeBaseSha": "" },
"members": [ { "name": "Astra", "model": "gpt-6-astra", "effort": "high", "vote": "APPROVE", "coverageMet": true } ],
"findings": [ { "id": "F-1", "memberIds": { "Astra": "2" }, "status": "agreed | contested | rejected", "blocking": true, "eligibility": "eligible", "claim": "", "evidence": "path:line", "remedy": "", "dissent": "each member's reason for any disagree answer", "resolution": "fixed:<sha> | resolved | decided | open | needs-decision | closed" } ],
"userDecisions": { "P-F-1": "the user's words" },
"fixCommits": [ { "sha": "", "findings": ["F-1"] } ],
"changedInstructionFiles": [],
"ci": "pass | fail | pending | none",
"limitations": []
}
resolution is resolved for a prior finding every member found resolved, decided for a finding the user decided that no member reopened, needs-decision for an agreed finding that is not fixable and has no such decision, closed for a rejected finding, and open otherwise. status is incomplete when a member abstained after its retry, or the run stopped early; an incomplete record always means NEEDS_HUMAN.
Then report:
**Merge council: <VERDICT>.** <"Ready to merge." or the single main reason it is not>
<repo>#<pr> at `<short head>` · CI <state> · <n>/<members> approve<" · fixes pushed: <short sha>" when any>
**Before merging**
- **<id>** <what is wrong> (`<path:line>`). <the remedy, or the decision the user must make>
**Worth a look**
- **<id>** <non-blocking finding> (`<path:line>`)
Record: `<run dir>/record.json`
Omit Before merging on APPROVE. List at most three items under Worth a look.
6. Act
Before acting on APPROVE, confirm that the PR's head and base SHAs still match the record and CI passes. Where repository guidance allows merging on council approval, merge with gh pr merge <PR URL> --match-head-commit <headSha>. Otherwise report that the PR is ready. On any other verdict, the Before merging items are the hand-off; a later run on this PR continues from this record.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/filipgutica/filip-stack/merge-council">View merge-council on skillZs</a>