AGENT SKILL

pr-review-resolver

Address outstanding review feedback on a GitHub pull request: unresolved review threads, submitted review bodies, and general PR comments. Triages each critically, fixes what it agrees with, and pushes back on the rest. Use whenever the user wants to address, fix, resolve, or work through PR review comments or feedback, even if they just say "handle the PR comments", "fix what the reviewers said", or "go through the PR", or pastes a PR URL and asks you to act on the feedback there.

License 许可
MIT
所属仓库
esond/skills
最近更新
2026-11-07
Stars
★ 0
Forks
0

01 前言 Front Matter

name
pr-review-resolver
description
Address outstanding review feedback on a GitHub pull request: unresolved review threads, submitted review bodies, and general PR comments. Triages each critically, fixes what it agrees with, and pushes back on the rest. Use whenever the user wants to address, fix, resolve, or work through PR review comments or feedback, even if they just say "handle the PR comments", "fix what the reviewers said", or "go through the PR", or pastes a PR URL and asks you to act on the feedback there.
argument-hint
[--ask] [pr-number-or-url]

02 资源文件 3

03 SKILL.md 正文

PR Review Resolver

Assess every piece of outstanding feedback on a PR, fix what the reviewer got right, push back on what they got wrong, and close the loop with them.

Arguments

$ARGUMENTS may carry a PR number or URL and --ask, in any order. "Ask me first" or "let me review" in the request also turns on --ask.

  • Default: act on every Fix and Decline without waiting; stop only for Ask items (Step 3).
  • --ask: show the whole triage for approval before changing code or posting anything.

Step 1: Identify the PR

Get the PR's URL, passing the PR number if one was given; with no argument it comes from the current branch:

gh pr view [PR_NUMBER] --json url

Read OWNER, REPO, and PR_NUMBER from the PR URL, not from gh repo view, which names the local repo and can be a fork. With no PR on the branch and none passed, ask the user for one, in either mode. Substitute the literal values into every later command.

If the current branch is not the PR's head branch, run gh pr checkout PR_NUMBER -R OWNER/REPO before Step 4.

Step 2: Fetch the feedback

sh <this skill's directory>/scripts/fetch-feedback.sh OWNER REPO PR_NUMBER

It prints three JSON Lines sections: ## threads (unresolved review threads), ## reviews (submitted review bodies), and ## comments (general comments). If it exits non-zero, stop and report its error.

Build the worklist:

  • Each thread is one item. Read the whole thread; later replies can narrow or withdraw the first comment.
  • Split each review body and comment into one item per distinct point, nits and non-blocking points included. Drop conversational comments (approvals, thanks, CI and deploy notices) and bot formatting.
  • Drop a review-body item that restates a thread; the thread carries it.

If the worklist is empty, tell the user the PR has no outstanding feedback and stop.

Step 3: Triage

Form your own opinion on each item. The goal is better code, not every comment satisfied. For each, ask:

  • Is the reviewer right about the problem, or did they misread the code?
  • Would the change improve the code, or make it more abstract, verbose, or coupled?
  • Is it in scope for this PR?
  • Is it a style preference that conflicts with the codebase's conventions?
  • Does the reviewer have context you lack: a constraint, downstream impact, or domain knowledge?

Give each item a disposition:

  • Fix — you agree and will change the code.
  • Decline — the reviewer is wrong, out of scope, low-value, or against the codebase's conventions. Write the reply now: concrete reasoning, phrased for the reviewer.
  • Ask — a product or preference call, a question addressed to the user, or a bot finding about security, auth, data, migration, or concurrency.

Decline concretely when you disagree; a fix you don't believe in degrades the code to satisfy one review.

Lay out the triage as one table:

# Source Summary Disposition Why
1 foo.ts:42 use a native button Fix agree, keyboard a11y
2 bar.ts:88 extract a shared helper Decline single caller
3 review (Copilot) reword the error copy Ask product wording

Default: with no Ask rows, continue to Step 4. Otherwise show only the Ask rows, wait for answers, then continue.

--ask: show the full table, and below it the full reply text for each Decline. The user overrides by exception: Fix and Decline rows they don't mention stand. Each Ask row needs an explicit answer; re-ask any left open.

If fixing shows a disposition was wrong, change it. In default mode, record the change and the reason for Step 7. With --ask, put it to the user first.

Step 4: Fix the code

If nothing is Fix, skip to Step 6.

Check whether the PR conflicts with its base:

gh pr view PR_NUMBER -R OWNER/REPO --json mergeStateStatus,baseRefName

If it reads UNKNOWN, GitHub is still computing it; wait about 30 seconds and retry, twice. If it is DIRTY, run git fetch origin, rebase onto origin/<baseRefName>, and resolve the conflicts before editing.

For a thread, start from its path and line. When line is null or isOutdated is true, locate the code from the path and the comment text; if the concern no longer applies, Decline with a reply saying where it was addressed. For review bodies and comments, find the relevant code yourself.

Step 5: Commit, push, and watch CI

Group small related fixes into one commit and give separate changes their own. For fixes to review bodies or general comments, name what was addressed in the commit message. Right after each commit, record git rev-parse --short HEAD against the items it covers.

Push with git push, or git push --force-with-lease --force-if-includes if you rebased in Step 4; the second flag keeps a commit pushed from GitHub (an applied suggestion) from being overwritten. If the push fails, stop and report it; post no replies.

Watch CI:

gh pr checks PR_NUMBER -R OWNER/REPO --watch | tail -n 20

If a check fails because of your commits, fix the root cause, commit, push, and watch again, up to three rounds. Change a test's expected values only when the behavior it pins genuinely changed. If checks still fail after three rounds, stop and report before posting replies. Note failures your commits didn't cause for Step 7 and continue. If gh pr checks reports no checks, wait about 30 seconds and retry, twice, before treating the PR as having none; checks take a moment to register after a push.

Step 6: Reply, resolve, and re-request review

commentId is the numeric ID for REST replies; threadId (PRRT_…) is for the resolve mutation. For a thread fixed across several commits, cite the last.

Thread, Fix: reply with the hash and a few words of context if they help, then resolve:

gh api repos/OWNER/REPO/pulls/PR_NUMBER/comments/COMMENT_ID/replies -f body="Fixed in abc1234"
sh <this skill's directory>/scripts/resolve-thread.sh THREAD_ID

Thread, Decline: reply with the justification through the same replies endpoint, with no hash, and leave the thread unresolved for the reviewer.

Review body or comment, Fix: no reply; the commit message is the record.

Fix with no commit (a PR description edit, say): make the change, reply saying what changed, and resolve the thread if it was one.

Review body or comment, Decline: post one top-level comment per source:

gh api repos/OWNER/REPO/issues/PR_NUMBER/comments -f body="..."

Open by quoting the point it answers. When the same source also had fixed items, cover them in that comment too ("items 1 and 3 fixed in abc1234; on item 2: …").

Then re-request review from each human (type User, not the PR author) whose items you fixed or declined:

gh api -X POST repos/OWNER/REPO/pulls/PR_NUMBER/requested_reviewers -f 'reviewers[]=LOGIN'

If the call returns 422 (no repo access), note it for Step 7 and continue.

Step 7: Summarize

One line per item: its disposition, the commit hash for a Fix, a one-sentence gist of any reply you posted, and the reply's URL (html_url in the response). Flag any disposition changed mid-run with the reason, CI failures your commits didn't cause, and the reviewers you re-requested.

Guardrails

  • Resolve a thread only when a pushed commit or a no-commit fix backs it.
  • Add new commits on top; the conflict rebase in Step 4 is the only history rewrite.

04 同仓库更多 Skills

esond
esond/skills

work-item-voice

Write or edit the user's issues in their own voice, in any work tracker — Jira, Linear, GitHub Issues, Azure DevOps. Covers features (new behavior), tasks (work that needs doing), and bugs (behavior that does not match expectation). Load this whenever the deliverable is an issue body, whether they say "file a bug", "write a ticket", "draft a story", "create an issue for this", "turn this into a Jira", "write this up in Linear", or paste a thread and ask for an issue out of it. Load it too whenever text goes into an issue that already exists — "record this in the issue", "add what we found to the ticket", "note this on the card", "update the one about refunds", or naming an issue by its key and asking for a fact to go in it — and when writing or updating one is a step inside a larger task. Features get behavior-driven framing with no implementation prescribed, and bugs get expected versus actual. Not for a comment on an issue, which is a conversation turn.

★ 0
esond
esond/skills

conversational-voice

Write the user's side of a conversation with another person, in the user's own voice: Slack messages and replies, DMs, email, PR and code-review comments, Linear or Jira comments, and any other turn in an exchange that goes out under the user's name. Load this whenever the deliverable is a message a human will read as written by the user, whether they say "draft a Slack message", "reply to this", "how should I word this", "tell the team", "ask them about X", "send a note to", or just paste a thread and ask what to say back. Load it too when tightening, shortening, or sanity-checking a message they already wrote, and when a message is one step of a larger task. The register is direct and informal, the way they'd talk to a friend or acquaintance, with the answer up front for a reader who skims. Not for something the user authors rather than sends — an issue body, a PR description, a commit message — even though a person reads those too.

★ 0
esond
esond/skills

sync-core-repo-docs

Create or audit a repo's three core doc files — README.md, the agent instructions file (AGENTS.md or CLAUDE.md), and REVIEW.md — in that dependency order. If a file is missing, generate it from the codebase; if it exists, audit it against the current code and apply targeted fixes after confirmation. README.md gets a developer from clone to running the project; AGENTS.md captures coding guidance for the agent (delegating to /init or claude-md-improver); REVIEW.md holds guidance for code reviewers, human or automated, without duplicating AGENTS.md. Target files with --readme, --claude, and --review, or run all three. Use whenever the user wants to set up, bootstrap, scaffold, refresh, audit, update, or sync a repo's docs, or says things like "create a README", "is my README still accurate", "write a CLAUDE.md", "write an AGENTS.md", "audit our docs", or "get this repo ready for contributors" — even when only one file is named. Prefer it over claude-md-improver when README or REVIEW are also in scope.

★ 0
esond
esond/skills

sync-core-docs

Create or audit a repo's README.md, AGENTS.md/CLAUDE.md, and REVIEW.md docs.

★ 0
esond
esond/skills

righting-software-system-design

Opt-in, collaborative system-design workflow based on Juval Löwy's iDesign methodology in *Righting Software*. Conducts a multi-phase interview (framing → use cases → volatility analysis → components → call-chain validation → report) that surfaces unknown-unknowns and produces a written recommendation at `decompositions/{system-name}/report.md`. **Run only when the user explicitly invites this workflow** — not for general architecture questions, lightweight design conversations, or quick "where should X live?" questions. Valid triggers: the user names the skill directly, references *Righting Software* / Juval Löwy / iDesign / "The Method" / volatility-based decomposition and asks to run a full session, asks for a "deep" or "structured" or "Löwy-style" system design session, or accepts a prior suggestion to run it. Wait for an explicit yes before entering Phase 0. The skill is interrogative — a back-and-forth interview that challenges each volatility candidate and proposes ones the user hasn't considered.

★ 0
esond
esond/skills

reorganize-branch-commits

Reorganize the commits on a non-default git branch into a clean, logical history by rewriting the branch — `git reset` + re-commit by default, `git rebase -i` when commit boundaries already align. Propose groupings based on the actual work done (features, refactors, tests, fixes, docs), get explicit user approval, back the branch up, then rewrite history. Use this skill whenever the user wants to tidy up, clean up, reorganize, restructure, squash, or curate commits on a feature branch — even if they phrase it as "my branch is a mess", "squash this down", "combine these commits", "fix up the commit log before I open a PR", or "make the commits presentable for review". Trigger proactively when the user is about to open or push a PR and the branch has scrappy/WIP/"fix" commits to collapse. Refuses to operate on default or release-shaped branches (main, master, develop, trunk, production, release, or the repo default) — a feature-branch-only tool.

★ 0