Resolve PR
/flow-next:resolve-pr coordinates resolution of unresolved review threads, top-level comments, and review-submission bodies on a GitHub pull request, of unresolved discussions and top-level notes on a GitLab merge request, and of unresolved comments on a Bitbucket Cloud pull request.
The skill fetches the work, triages it, dispatches per-thread resolver agents (in parallel on Claude Code and Codex; serial on Copilot and Droid), then replies and resolves, through GraphQL on GitHub, glab on GitLab and bkt on Bitbucket Cloud.
Invocation
Section titled “Invocation”| Invocation | Behavior |
|---|---|
/flow-next:resolve-pr | Detect PR from the current branch. |
/flow-next:resolve-pr <pr-number> | Full mode on that PR. |
/flow-next:resolve-pr <pr-url> | Same as PR number. |
/flow-next:resolve-pr <comment-url> | Targeted mode - one thread only. |
--dry-run | Fetch and plan without making edits. |
--no-cluster | Skip cross-invocation cluster analysis. |
mode:autonomous | Ask nothing; FLOW_AUTONOMOUS=1 does the same. Land dispatches resolve-pr this way. See Autonomous runs. |
Triage discipline
Section titled “Triage discipline”Threads are separated before any resolver agent runs:
- New - actionable threads with no prior reply.
- Pending - already replied; waiting on the reviewer.
- Non-actionable - review-wrapper boilerplate, approval-only LGTMs, CI summary comments.
Cluster analysis groups related threads when a prior resolved thread on the same surface gives signal - for example, three nits on the same function that the reviewer raised in different threads. One resolver handles the cluster, and every thread in it still gets its own reply and resolution.
Bounded fix-verify loop
Section titled “Bounded fix-verify loop”A resolver gets up to two fix-verify cycles per thread before escalation. If a third cycle is needed on a recurring theme, the skill stops and surfaces a pattern summary instead of looping further. The user decides whether to keep going or rethink at the architecture level.
This bound exists because the third cycle is almost never a small fix; it is usually a hint that the spec needs revisiting.
Safety
Section titled “Safety”- Acts only on the repository you run it from. A PR or comment link for another repository stops before anything is fetched, naming both repositories; run it from a checkout of the linked one.
- Never executes shell from comment bodies. Reviewer text is untrusted.
- Stages only files the resolver agent explicitly reports. No
git add -A. - Never resolves a thread marked
needs-human. - The same safety rules apply in
--dry-run; only the write phase is suppressed.
Verdict spectrum
Section titled “Verdict spectrum”Each resolver returns one verdict per thread, routed differently in the reply + resolve step:
| Verdict | Reply | Resolve |
|---|---|---|
fixed | Cite the fix and commits. | Yes. |
fixed-differently | Explain the chosen approach. | Yes. |
replied | Answer the question or push back. | Yes. |
not-addressing | Explain the deferral or disagreement. | Yes. |
needs-human | Surface to the user. | No. |
Autonomous runs
Section titled “Autonomous runs”Under mode:autonomous every phase runs as in an attended run except the last, where a thread that needs a person would ask you. Instead, each needs-human thread gets one report line and stays open, and no decision is applied:
NEEDS_HUMAN: <path:line | comment id> - <one-line reason>A recurring theme that hits the third fix-verify cycle adds one NEEDS_HUMAN: cycle-budget line. The run then ends with one machine-readable line, always the last line of output:
RESOLVE_PR_VERDICT=<RESOLVED|PENDING|NEEDS_HUMAN> threads=<n> fixed=<n> needs_human=<n>| Verdict | When |
|---|---|
RESOLVED | Everything new was addressed, nothing needs a person, and nothing waits on a reviewer. A run with no open feedback reports RESOLVED with threads=0. |
PENDING | Nothing needs a person, but threads still wait on a reviewer: replies from an earlier run, or replies posted in this run that the reviewer has not re-checked yet. The dispatcher checks again on its next tick. |
NEEDS_HUMAN | At least one NEEDS_HUMAN line was printed. |
threads counts the new items this run handled, fixed counts fixed and fixed-differently verdicts, and needs_human counts the NEEDS_HUMAN lines. An attended run never prints the verdict line; it asks you about each needs-human thread instead and applies your answer.
GitLab merge requests
Section titled “GitLab merge requests”On a GitLab origin, gitlab.com or self-managed, resolve-pr works on the merge request for the current branch, or the one you name by its number (13 for !13) or its URL. It reads every unresolved discussion and every top-level note on the merge request, across all pages, and handles them with the same triage, resolvers, validation and verdicts as a pull request’s review threads and comments.
- A discussion it fixes gets a reply that cites the fix and is resolved once the fix is pushed to the merge request’s source branch. As on GitHub, one it answers or declines gets its reply and is resolved, and one that needs a person stays open.
- A top-level note gets a new note in answer. resolve-pr never replies inside the note’s own discussion, because that would turn it into an unresolved thread, which blocks the merge on a project that requires every thread resolved.
- Targeted mode takes GitHub comment links only. On GitLab, pass the number, the merge request URL or nothing.
- Replying and resolving need a
glablogin withapiscope. A narrower token fails at the first reply, and resolve-pr reports GitLab’s error as it is. - With an SSH origin whose GitLab web port is not the default, export
GITLAB_HOST=<host>:<port>first.
make-pr opens the merge request, and land sends its open discussions here before it merges.
Bitbucket Cloud pull requests
Section titled “Bitbucket Cloud pull requests”On a Bitbucket Cloud origin, resolve-pr works on the current branch’s open pull request, or the one you name by its number or its URL. It reads every unresolved comment on the pull request, inline or general, with its replies, across all pages, and handles each one as a review thread with the same triage, resolvers, validation and verdicts as on GitHub.
- A comment it fixes gets a reply under it that cites the fix, and is resolved once the fix is pushed to the pull request’s source branch. As on GitHub, one it answers or declines gets its reply and is resolved, and one that needs a person stays open.
- An inline comment whose line changed after it was written is marked outdated, so the resolver finds the code by content rather than by the old line number.
- Deleted comments are skipped.
- Targeted mode takes GitHub comment links only. On Bitbucket, pass the number, the pull request URL or nothing.
bktneeds a Bitbucket Cloud login and context, set up as for make-pr. Without them the first fetch stops with the commands that fix it.
make-pr opens the pull request, and land sends its open comments here before it merges.
Worked example
Section titled “Worked example”/flow-next:resolve-prPR #214 detected from branch. Unresolved threads: 3Triage: 2 actionable, 1 decline-with-reason (style preference contradicting repo convention)Dispatching per-thread resolvers... 2 fixes committed (f7c8d9e)Replies posted + threads resolved via GraphQL.Resolved 3 of 3 new items on PR #214:Fixed (2): ...Not addressing (1): style preference contradicts the repo conventionValidation: bun test 893/893 passedEach thread gets an isolated resolver; replies cite the fix commit and file, and threads resolve only after the fix lands. The same run under mode:autonomous ends with RESOLVE_PR_VERDICT=RESOLVED threads=3 fixed=2 needs_human=0 as its last line.
Dynamic usage
Section titled “Dynamic usage”Recipes that compose with resolve-pr in the cookbook:
- Autonomy dial - land dispatches resolve-pr automatically on the pull request you named, before it looks at CI.
- Team patterns - human reviewers comment, the pipeline resolves, the thread record stays honest.
Next step
Section titled “Next step”After the loop closes, push and re-request review. If the same theme returns, run /flow-next:plan-review on the underlying spec instead of looping resolvers.