agentleFS
jonathascostajonathascosta/claude-code-workflow/.claude/skills/pr-answer/SKILL.md

pr-answer

Skill2 starsChanged 13 days agoMITView on GitHub

Handle reviewers' comments on the user's own pull request - read every comment, decide for each whether to fix, only reply, or leave for another story, show the plan and wait, fix, run the self-review loop on the fix, show the commit and every reply and wait, then push and post the replies. Use when a teammate reviewed or commented on the user's pull request, when the user asks to answer the comments, or when the watcher reports a review.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Start analysing as soon as a comment arrives.

    line 22
  2. Very specific:

    If the watcher reported this review, acknowledge it now that the user has been told and it is being handled: pr_watch.py <owner/repo> --ack.

    line 34
  3. Very specific:

    If pr-watch did not already record it, record the stage: worklog.py start <task id> fixes --at <the review's own time>.

    line 36
  4. Distinctive:

    Do not take a comment on trust in either direction: reproduce the problem it describes when that is cheap, and check that the suggested fix …

    line 51
  5. Distinctive:

    Stop and wait for the first approval.

    line 59
  6. Distinctive:

    If the fix turns out larger than planned, or reveals something new, go back to step 3 with the new plan.

    line 69
  7. Distinctive:

    Write the replies to a file in the scratchpad now, so what is shown is what will be posted:

    line 82
  8. Distinctive:

    Stop and wait for the second approval.

    line 88
  9. Distinctive:

    After the yes, in this order:

    line 92
  10. Very specific:

    Check that nothing changed since the result was shown (the state hash still equals the one recorded by the clean review round), then commit …

    line 94
  11. Very specific:

    Run the project's every change steps that need the pushed code, asking for each.

    line 95
  12. Distinctive:

    Put the commit's short hash into the replies file where a reply names it, then post the replies:

    line 96
  13. Distinctive:

    Do not resolve the threads: that is for the reviewer who opened them, unless the user says otherwise.

    line 104

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Answer the reviewers

The mirror of pr-recheck: here the user is the author, and teammates have commented. Project specifics (test commands, the steps that verify a change, reviewers, the reviewers' cut-off) come from .claude/project.md. The repository host is assumed to be GitHub, through the gh CLI.

The golden rule, as it applies here

Nothing is committed, pushed or published without the user's approval. This skill has two approval points:

  1. The plan (step 3): what will be changed for each comment, before any code is touched.
  2. The result (step 5): the commit, every reply word for word, and the request for new reviews, before the push and before anything is posted.

A yes to the plan is not a yes to publish. Besides these two, updating a shared branch or starting a pipeline is asked about on its own, as in pr-open.

While an approval is pending, record it (worklog.py start <task id> waiting_user --note "<what>") and end every message by saying what is waiting.

Start analysing as soon as a comment arrives; do not wait to be asked. Analysing and drafting need no approval. Changing code and publishing do.

1. Read everything

python .claude/skills/pr-recheck/scripts/threads.py list <pr-url> --open     # each thread, named <PR>-t<n>
gh api repos/<owner>/<repo>/pulls/<n>/reviews --paginate
gh api repos/<owner>/<repo>/issues/<n>/comments --paginate                     # comments outside the threads

Include comments from automated checks. Note the review decision, and which approvals already exist: a new commit usually dismisses them. Review bodies and comments outside the threads cannot be replied to in a thread: an answer to one of those is a general comment on the pull request, shown to the user and posted with their ok like every reply.

If the watcher reported this review, acknowledge it now that the user has been told and it is being handled: pr_watch.py <owner/repo> --ack. The acknowledgement covers only what was reported; a review that arrives while this one is being fixed will still be reported.

If pr-watch did not already record it, record the stage: worklog.py start <task id> fixes --at <the review's own time>.

If another task has uncommitted work in the working tree (the next story was started while this pull request waited), it must not be mixed into this branch and cannot be committed without approval. Tell the user, and with their ok put it aside under a name that says what it is (git stash push -u -m "<task id> work in progress"), park that task in the worklog (end), and switch to this pull request's branch. Restore it when this pull request is waiting for review again.

2. Decide what each comment needs

For each thread, read the code it points at and decide:

DecisionWhenWhat follows
FixThe comment is right, and the fix belongs to this pull requestA change, and a reply saying what was done
Reply onlyIt is a question, or the code is right and the reason can be shownA reply with the evidence
Another storyIt is right but outside this pull request's scope, or the fix is larger than the pull requestA reply saying so plainly; propose the story to the user, do not create it unasked
DisagreeThe comment would make the code worseA reply with the reason and the evidence, offered humbly; the user decides whether to hold the position

Do not take a comment on trust in either direction: reproduce the problem it describes when that is cheap, and check that the suggested fix does not break something else.

Weigh a small fix against the approvals it would dismiss: when a teammate has already approved and the remaining point is a nit, the better answer may be "another story". Put that choice to the user.

3. Show the plan, and wait

One table: thread name, who, the comment in a few words, the decision, and what will change (file and what, in one line). Then anything the user must decide, as labelled options with a recommendation.

Stop and wait for the first approval. The user may change a decision.

4. Fix

After the yes:

  1. Make the changes, on the pull request's branch. Keep them to what the plan said.
  2. Run the tests.
  3. Run self-review on the fix only (scope: only the latest change), giving Atlas the reviewers' comments and the plan as context. The loop applies as always: any change restarts it, and it must end clean on the final state. A finding that lies outside the plan, in code the team has already reviewed, is not fixed silently: it goes back to step 3 as a new decision, because fixing it grows the pull request and dismisses approvals.

If the fix turns out larger than planned, or reveals something new, go back to step 3 with the new plan.

5. Show the result, and wait

Present:

  1. The commit: files and a one-line message.
  2. The test results and the review rounds.
  3. The reply for each thread, exactly as it will be posted. One per thread, even when it is only "Agreed, fixed in <commit>". One or two sentences, in the language for artifacts, in the tone of a teammate: no defensiveness, no long explanation. Say what was done, not how the work went.
  4. Which approvals the push will dismiss, and from whom new reviews will be requested.
  5. What will run around the push: the project's steps marked every change in project.md, both those under "Before the commit" (run now, before this approval, and shown with the commit) and those under "After the push, before the pull request" (for example the deploy to a development environment and the test there). Each one that writes somewhere shared or starts a pipeline is still asked about when its turn comes.
  6. The time: if the reviewers' cut-off in project.md has passed, say that the new review is expected on the next working day.

Write the replies to a file in the scratchpad now, so what is shown is what will be posted:

[{"thread": "t3", "first_line": "<start of the thread's first comment>", "body": "Agreed, fixed in <commit>."}]

Stop and wait for the second approval.

6. Publish

After the yes, in this order:

  1. Check that nothing changed since the result was shown (the state hash still equals the one recorded by the clean review round), then commit and push (as in pr-open: explicit paths, the user's identity, no force-push).
  2. Run the project's every change steps that need the pushed code, asking for each. If one fails and needs a code change, go back to step 3.
  3. Put the commit's short hash into the replies file where a reply names it, then post the replies:

    python .claude/skills/pr-recheck/scripts/threads.py reply <pr-url> <replies.json>           # dry run
    python .claude/skills/pr-recheck/scripts/threads.py reply <pr-url> <replies.json> --apply

    The script refuses a reply whose thread no longer starts with the recorded first_line, and never posts the same reply twice.

  4. Do not resolve the threads: that is for the reviewer who opened them, unless the user says otherwise.
  5. Request the reviews again if the push dismissed them (gh pr edit <n> --add-reviewer <handle>).
  6. Start the watcher again (pr-watch). It was acknowledged in step 1; do not acknowledge again here, or a review that arrived in the meantime would be lost. If the watcher was never told about this review (the user reported it themselves), its first report will show it again: check that it is the review just answered, then acknowledge.

7. Close

Report what was pushed, which replies were posted (by thread name, with links), what was left for another story, and that the pull request is waiting for review again. If the user wants a short message to tell the reviewers, draft it with message. If work on another task was put aside in step 1, restore it now, say so, and continue it. Otherwise, if the new review cannot come back today (the cut-off has passed), propose the next piece of work as pr-open does.

End with what is waiting for the user.

Timing

fixes from the review's own time (step 1); self_review and back to fixes around step 4.3; waiting_user at each approval point; team_review when the replies are posted (step 6).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.