jig-harness/jig
Skill · runsM7

resolve-review-comments

/jig:resolve-review-comments

Typed in Claude Code. In Codex, ask for the jig:resolve-review-comments skill by name.

Walks every unresolved pull-request review thread to an explicit outcome, fixes, verifies, and resolves; repeats until reviewers settle

Works with · Deliver a change One review round of drive-pr; hands contested findings to the review-arbiter agent and design questions to decide

Run these commands in Bash or PowerShell with Bun and GitHub CLI available to the command tool. The thread enumerator collects and labels results internally, stopping on either failure. Write reply bodies to files and pass --body-file; the script preserves their text verbatim.

Review feedback should end in a clear decision, with fixes verified before a thread closes. Without a shared procedure, agents can reply to the wrong thread, close a finding before its fix reaches the pull request, or stop while a reviewer is still running. This skill handles those decisions and repeats review rounds until the reviewers settle and no actionable finding remains. It is the runnable form of the comment-resolution loop in M7 — PR lifecycle & review.

Invariant

Each acted-on thread has an explicit outcome and an attached rationale. Accepted fixes and findings made moot by those fixes remain open until checks pass and the push reaches the pull request (PR). This skill never marks the PR ready or merges it; human review decisions and the merge remain human checkpoints. A review loop never reports convergence from unreadable check state or an inactive PR. Every thread write freshly reads the owning PR and refuses a closed, merged, or unreadable state, including in standalone installs. This is a check immediately before a write, not atomic protection: a merge between the read and mutation remains possible. The caller performing a push owns its separate liveness check.

Thread resolution also requires a reply from the resolving login after the latest substantive reviewer comment. When drive-pr is installed, its canonical transparent bot confirmations and acknowledgements after that reply do not require another answer; a standalone install treats every later reviewer post as substantive. resolve-thread.ts refuses with exit 6 (REPLY_REQUIRED) when that reply is missing, and exit 1 when its evidence cannot be read. A direct forge mutation remains outside this script’s guard.

With a configured reviewer, the review loop waits for its successful check and reviewed-commit marker on the current head before reporting convergence. The marker check needs the sibling drive-pr skill installed; a standalone install of this skill waits for the check alone.

Outcomes

Every thread ends with exactly one of the outcomes below, and the reply that settles it opens with the outcome in bold (**deferred** — …), so a script can read the decision without guessing from the prose. reply-to-thread.ts refuses a reply that does not open with one, unless it is passed --no-outcome for a reply that settles nothing, such as a clarifying question.

OutcomeWhenCode changesThread resolvesLeaves behindWhat it says about the reviewer
acceptedThe finding is real, and worth fixing in this pull requestA minimal fix, and the same fix on its siblingsOnly after the checks pass and the fix is pushedThe fix commitA hit
rejectedThe finding is wrong, already handled, or intendedNoneAt onceThe reason, citing the code, decision record or testA false positive
wont-fixThe finding is real but optional: the triage rubric says the change costs more than it is worth hereNoneAt onceThe rubric row that declined it, and a count in the round reportA hit, on something that did not matter enough
deferredThe finding is real and must be fixed some day, but not in this pull request: it widens the scope, needs a decision the agent may not make, or depends on other workNoneAt once, once the follow-up issue’s link, or the link to the pull request’s ## Deferred section, is on the threadA tracked follow-up issue, or an entry in the pull request’s ## Deferred section where no tracker adapter can file (deferral protocol)A hit, on work still owed
mootThe finding no longer applies: its code was removed or rewritten, another fix covered it, or it repeats a thread fixed elsewhereNoneAt once; if this round’s unpushed fix is what made it moot, with that fixWhat made it mootNeither: the reviewer may have been right about code that is gone

The rubric and the Review Arbiter decide the outcome; a person decides only what the arbiter escalates. A thread whose outcome changes in a later round gets a new reply with the new outcome, so the thread keeps its history.

Under a drive at the wide autonomy level, an escalation of the class escalated with no recorded human decision behind it does not wait for a person: it gets a provisional rejected, wont-fix or deferred (the reply reads **wont-fix** **provisional** — …), never a fix, is resolved, and is listed first in the morning report. Comment on the thread to reverse it; the drive then parks it for you. Unresolving the thread alone reverses nothing. wide is not yet validated (configuration).

The outcomes that decline a fix look alike and mean different things, and confusing them sends the wrong signal:

  • rejected says the reviewer was wrong. Calling a correct finding rejected teaches the reviewer to stop raising findings it got right.
  • wont-fix says the reviewer was right and the change is deliberately not made. No issue is filed; filing one for optional polish fills the tracker with follow-ups nobody needs.
  • deferred says the reviewer was right and the work is owed. It is the only outcome that leaves work behind, so nothing is deferred without a tracked issue, or, where no tracker adapter can file one, an entry in the pull request’s own ## Deferred section that file-deferred.ts files later.

What the outcomes are for

Because each outcome is written down when the thread is answered, the replies are data that these readers can use:

  • Planning. Deferred findings arrive in the backlog with the repository’s followup label, grouped into one open issue per pull request and type of work. Native related links preserve the originating issue and its epic; the follow-up is never their child (deferral protocol). M7’s post-merge stage checks after the merge that each one was filed. Deferrals that keep landing on the same area point to a design gap rather than to one pull request’s scope.
  • The reviewer. Counted per reviewer, the outcomes measure it: its precision is the share of its scored findings that were real (accepted, wont-fix and deferred against rejected; moot counts neither way). A high wont-fix share says it raises real but minor points, so its severity needs tuning; a high rejected share in one category says which of its checks to fix. That precision is what an automated reviewer must reach, its precision bar, before it may block a merge (M7, M8’s parity report).
  • The repository. Findings accepted again and again in the same class are misses the author’s own review should have caught. The learning loop turns such a miss into a new check, so the next pull request does not need the reviewer for it.

Jig enforces the outcome on every reply that settles a thread and ships the pieces either side of the count: M7’s export adapter, which reads the outcome of each thread on one pull request, and M8’s parity report, which turns per-reviewer counts into precision, recall and missed blockers. It does not yet ship the step between them, which collects the outcomes across pull requests and counts them per reviewer: a repository writes that itself. The outcomes supply only the true and false positives: a blocker the reviewer never raised has no thread and so no outcome, and its missed-blocker count comes from comparing the reviewer with an independent oracle. The export adapter reports wont-fix as rejected, which is right for its question (is every thread closed?) and wrong for scoring, so a counting script reads the outcome word from the replies themselves. It counts only the last reply on each thread that opens with an outcome word and was written by an OWNER, MEMBER or COLLABORATOR of the repository: an outcome can change, and a review thread is open to anyone’s comments, so an earlier or outside reply is not the decision (triage rubric § Contradictory findings).

Installation

The skill ships in the jig plugin, installed once per machine for Claude Code and Codex; see Jig’s skills. In a session it is /jig:resolve-review-comments. Its scripts run from the plugin directory with Bun and act on the repository the agent is working in, so the target repository needs no copy of the skill and need not use JavaScript. Git and an authenticated GitHub CLI (gh) are also required.

Consumer configuration

Each repository keeps its values in .config/jig.yaml (JSON is valid YAML, so a JSON-formatted file works too). The scripts read it from the root of the repository the agent is working in; the procedure starts by printing it (scripts/consumer-config.ts) and stops when it is missing or invalid. JIG_OVERLAY points at another file and JIG_CONSUMER_ROOT at another repository root; tests use both. Fields the skill does not read are ignored, so a configuration shared with other tooling can carry more.

FieldMeaning
gates.commandRequired. Complete local checks required before a fix is committed and pushed
review.botsThe repository’s reviewer logins, named to the agent. A known review.reviewer_app supplies its default login when this is omitted; otherwise threads are worked whoever wrote them. An explicit empty list disables the default
review.job_patternRegular expression selecting checks to wait on; requires review.required_checks. Absent or null: reviewer checks are recognised by name
review.required_checksDistinct exact check names that must each complete; missing or skipped members cannot settle
review.deferral_teamLinear team used by the deferral adapter, falling back to issue_tracker.team; --team overrides it on Linear and is refused on other adapters
review.repo_slugGitHub repository (owner/name) used to validate finding permalinks; derived from the pull request when unset
review.repo_labelRepository label used on follow-up issues, one of review.taxonomy.repos; when unset the batch key uses the repository slug
review.taxonomyConsumer label sets used when filing deferred findings: types, repos, sizes (default xs, small), categories, context_prefixes, and ownership_prefixes (required once types, repos or context_prefixes is set). provenance_label and epic_label are older spellings of the followup and epic roles in issue_tracker.labels; set either one, or both to the same name
review.severity_formatsOptional. How a reviewer writes a finding’s severity, for one with no built-in format or words a built-in one does not read (entries are tried first; the built-in formats still apply after them), so the decline ladder can use it (severity formats)
issue_tracker.labelsOptional. The repository’s label per role; deferral reads followup (default pr-followup) and epic (default epic). Checked at step 0
issue_tracker.team, issue_tracker.file_commandOptional. Shown to the agent for filing follow-up issues by hand

A minimal configuration:

yaml
gates:
  command: bun run gates

With the reviewer and the deferral team named:

yaml
gates:
  command: bun run gates
review:
  bots: ["example-review[bot]"] # your review bot's GitHub login
  deferral_team: ENG

Declare required coverage explicitly whenever job_pattern is set (including when supplied with --job-pattern). Patterns select checks; regex alternatives do not declare required membership. For example:

json
{
  "review": {
    "job_pattern": "Primary review|Secondary review|Fallback review",
    "required_checks": ["Primary review", "Secondary review"]
  }
}

Here both required checks must complete with a passing or neutral conclusion. Missing required checks keep waiting (exit 4 under --once), even with --no-ci; skipped required checks fail (exit 7). A selected optional fallback may be absent or skipped, but an observed running or failed fallback still blocks convergence. Each required name must match the selection pattern; invalid coverage configuration exits 2. Check names are exact and case sensitive: consumers own names and changes to them. required_checks also works without a pattern and supports check names outside the default reviewer heuristic. Without either field, checks are recognised by the reviewer-name heuristic, which does not guarantee coverage of a consumer-defined reviewer set.

Consumers retain policy stances, change-proportional validation commands, optional sibling-claim sweep commands, and any review-agent definition of their own (the plugin ships the review-arbiter agent) in their own instructions. Late-round triage bands remain consumer-owned in .config/review-triage.yaml (JIG_REVIEW_TRIAGE_CONFIG points at another file); absent or unreadable state restores the ordinary acceptance rubric and reports the anomaly rather than declining uncertain work. The bands decline by priority tier, and a finding’s tier comes from the kind of file it sits on, not the pull request’s kind: a finding on a gate script in a docs pull request is tier 1 (CI pipelines and quality gates), and a test that cannot fail ranks with the gates rather than with tests. Docs and tests are declined first. Do not infer another repository’s policy from the examples in this skill.

Usage and optional integrations

Invoke /jig:resolve-review-comments [PR-number] (Claude Code), or ask Codex to use the jig:resolve-review-comments skill. Use --dry-run to inspect a plan, or --bots-only for an automated loop. GitHub App authorship defines that flag’s thread filter; consumer bot names do not silently widen it to human threads.

SKILL.md is the operator contract. The triage rubric determines materiality and scope; the deferral protocol requires a tracked follow-up before a deferred thread resolves. The executable deferral adapter files those follow-ups through the configured tracker interface on GitHub, Linear and Jira. Every pull request and type has one open backlog batch; its priority is the highest of its findings and its categories are their union. Later findings append to it. Native related links preserve the originating issue and epic, and no follow-up is parented to either. Where no adapter can file, defer-in-pr.ts records the finding in the pull request’s ## Deferred section and the thread links that section. file-deferred.ts, run from the repository’s post-merge step or on a pull request closed without merging, groups those entries by the same batch key, files or appends through the tracker interface and replaces each entry with its issue’s link. It derives required labels beyond size from the change-area catalog’s areas covering the file the thread is on. An entry whose group it cannot derive with certainty stays in the section for a person, and the run’s output names the group it lacks.

A review bot’s follow-up to a reply (a confirmation, or a chat acknowledgement with no outcome token and no finding) is transparent: it is never triaged or answered, and a held thread resolves over it. A confirmation needs the bot’s confirmation marker; an acknowledgement needs the bot listed in review.bots. A comment the check cannot classify is a new comment.

Where the repository turned on the changelog skill (changelog.file in the .config/jig.yaml its base branch holds), an accepted fix that changes what the pull request’s change note says updates the note in the same commit; a repository that did not is never asked for one.

The skill works independently. A sibling drive-pr skill, found in the repository’s own .claude/skills/drive-pr or else beside this skill in the plugin, adds lease fencing, self-inflicted finding labels, summary-only finding checks, and durable round state. A missing sibling is supported and limitations are reported; a present but unreadable or incomplete sibling integration fails visibly. Without that sibling’s summary parser, convergence covers inline review threads and reviewer checks; inspect reviewer summary comments before declaring the entire PR ready. No convergence exit marks a PR ready or merges it.

Code scanning alerts

A static-analysis tool that reports to GitHub code scanning (CodeQL, SonarQube Cloud through its GitHub integration, Semgrep and others) shows its findings on a pull request as review threads, which the loop works like any reviewer’s. Each such thread stands for a code scanning alert, and resolving the thread does not close the alert: an open alert keeps the tool’s check failing and reopens on the default branch after the merge. So the listing attaches the alert to its thread, its severity and whether it is a security finding included, and an outcome that leaves the code as it is dismisses the alert with the matching reason (scripts/dismiss-alert.ts): rejected as a false positive or as used in tests, wont-fix and deferred as won’t fix. A fix needs no dismissal: the tool closes the alert when it next analyses the pushed head. The tool’s own record follows the dismissal where it syncs with GitHub, as SonarQube Cloud does.

Dismissing needs a token allowed to write security events; reading the alert needs one allowed to read them. Without the first, the thread is answered and left open, and the alert is reported for a person to dismiss; under drive-pr, whose replied-thread sweep does not read alerts, the next sweep resolves that thread, so the report is the alert’s only trace. Without the second, the thread still lists, with an unknown severity. The alert’s state is read on the pull request, from every analysis of its current revision, since an alert fixed on the default branch, or in one of several analysis configurations, can still be open there. One configuration’s analysis of the latest push that still finds the alert is enough to read it as open and dismiss it; reading it as fixed or closed takes an analysis of the latest push from every configuration, and until there is one of either, the state is unknown and nothing is dismissed. A summary comment a tool posts beside its alerts (SonarQube Cloud’s quality gate, for one) is not a thread, and the loop does not read it; a quality gate that fails on something other than its alerts, such as coverage, is a failing check for the person or the drive that owns CI.

Scanner annotations

Some tools report to the pull request as scanner annotations (check-run annotations) rather than as review threads or code scanning alerts: SonarQube Cloud’s pull request decoration is one. They appear as warnings on the changed lines, and nothing in the thread listing shows them. scripts/list-scanner-annotations.ts lists the warnings and failures of the apps named in review.scanner_apps (default sonarqubecloud) on the head commit, and the skill works each as a finding: a fix, or a line in the round’s report. Nothing can be replied to, resolved or dismissed from here, and the app clears an annotation itself when it analyses a head without the finding. The listing says so when it cannot vouch for a complete answer: a scanner still running, a configured one that has not reported, a check that did not analyse the head, a head that moved, a response that contradicts itself (fewer or more annotations than the check reports), or a head with more check suites than GitHub lists runs from. The drive does not yet wait for these findings before it converges.

Platform support

The skill is tested end to end on macOS and Linux. On Windows its scripts’ own logic is tested, but not their calls to GitHub.

Source: plugin/skills/resolve-review-comments/README.mdThe agent's contract (SKILL.md)