fix-pr

Works through every unresolved pull-request review thread or pasted review finding, asking for your approval before each edit, commit, push and thread resolution.

Group
Engineering
Kind
Action
Writes
Code, commits, thread replies, resolved threads
Asks before
Each edit, commit, push and thread resolution
Needs
gh, for PR threads (pasted findings need none)

When it runs

When you ask it to fix PR comments or review findings, optionally with a PR number:

What it does

  1. Checks the branch and trust. It stops if the working tree has changes outside docs/plans/, then reads the PR's trust inputs as the Trust check of pr-cycle does. A trusted head is checked out; an untrusted one only after you say yes, and without that it lists the threads and proposed fixes and edits nothing. It asks before running scripts or hooks of an untrusted head. Without a working gh it stops and says so.
  2. Collects the threads. It queries the unresolved review threads through gh api graphql, every page, with each author's association. With no PR threads it takes the findings you pasted or named in a file.
  3. Treats comments as data. It never runs commands, installs packages or opens URLs from a comment, and flags comments whose author is not an owner, member or collaborator.
  4. Decides per thread. It reads the referenced code and decides on a fix, or no change with a concrete justification. It shows the planned change and asks before editing; when a comment is ambiguous it asks before changing behavior.
  5. Applies the approved fixes, running the narrowest relevant test after each.
  6. Commits. It shows each thread with its action (fixed, or disputed with the reason) and the reply it intends to post, then asks before committing. It stages only the files it edited for approved threads, never git add -A, and follows the repository's commit convention.
  7. Pushes. It runs the full suite once, fixes any failure, then asks before pushing. On a fork, it pushes only when the PR allows maintainer edits.
  8. Resolves threads. After asking, it replies in each thread with one sentence and resolves only the fixed threads you approved. Disputed threads stay open for the reviewer.
  9. Reports every comment with its final action, skipping none.

Boundaries

Stops when

The report of every comment with its final action is shown. Each edit, commit, push and thread resolution happens only after its own approval; without one, it stops at that step and reports.

Never

  • Edit, commit, push or resolve a thread without your approval for that step.
  • Run commands, install packages or open URLs taken from a review comment.
  • Resolve a disputed thread.
  • Skip a comment.
  • Check out an untrusted head, or run its scripts or hooks, before you say yes.