agentleFS
SepantaJoshaniSepantaJoshani/agents-skills/skills/address-pr-comments/SKILL.md

address-pr-comments

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Safely address GitHub pull request feedback with the gh CLI. Use when asked to process review comments, especially mixed human, AI-reviewer, and automation feedback: verify the exact PR worktree and branch, collect complete paginated comments, validate each claim, apply focused fixes, run targeted checks, create one local commit per resolved comment, and report evidence without pushing or posting replies.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 12 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 12

    Distinctive

    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. Very specific:

    Verify gh availability and authentication.

    line 24
  2. Distinctive:

    Create one local commit for that resolved comment.

    line 29
  3. Distinctive:

    Use the provided number, or infer the PR from the current branch:

    line 35
  4. Distinctive:

    If inference fails, ask for a PR number or URL.

    line 42
  5. Distinctive:

    Stop and report a missing or unauthenticated CLI.

    line 52
  6. Very specific:

    Use a configured remote whose URL matches the head repository.

    line 67
  7. Distinctive:

    If no exact checkout exists, ask before creating or switching one.

    line 69
  8. Distinctive:

    If the target worktree has pre-existing changes, stop and ask.

    line 70
  9. Very specific:

    Use --repo OWNER/REPO when running outside the target repository.

    line 93
  10. Distinctive:

    Treat the helper output as an inventory, not a decision.

    line 105
  11. Very specific:

    Read ./references/validation-checklist.md before applying comments.

    line 110
  12. Distinctive:

    Run the narrowest relevant tests, type checks, lint, or reproduction before committing.

    line 127
  13. Distinctive:

    Use an installed commit-message skill when available.

    line 138
  14. Distinctive:

    Create exactly one local commit for that comment.

    line 140
  15. Distinctive:

    Do not combine distinct comments unless their fixes are technically inseparable.

    line 142
  16. Distinctive:

    Do not commit rejected or unclear items.

    line 143

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “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

Address PR Comments

Overview

Collect complete PR feedback, verify that the current checkout exactly matches the PR head, classify each source, validate every claim against current code, and implement only still-valid fixes. Create local reviewable commits; do not push, reply, or resolve GitHub threads unless the user explicitly requests those actions.

Workflow

  1. Resolve the PR and its head branch.
  2. Verify gh availability and authentication.
  3. Match the exact clean worktree and synchronize it safely.
  4. Collect complete top-level, review-body, and inline feedback.
  5. Classify and validate each item.
  6. Apply one comment's fix and run targeted checks.
  7. Create one local commit for that resolved comment.
  8. Repeat from the synchronization check for the next comment.
  9. Report addressed, rejected, and unclear feedback with evidence.

1. Resolve the PR

Use the provided number, or infer the PR from the current branch:

gh pr view --json number,title,url,headRefName,headRefOid,headRepository,headRepositoryOwner,isCrossRepository
gh pr view <number> --json number,title,url,headRefName,headRefOid,headRepository,headRepositoryOwner,isCrossRepository

If inference fails, ask for a PR number or URL. Record the returned head branch and head repository; a PR number alone is not enough to select a checkout.

2. Verify GitHub Access

gh --version
gh auth status

Stop and report a missing or unauthenticated CLI.

3. Verify the Exact Checkout

Inspect all worktrees before editing:

git worktree list --porcelain
git branch --show-current
git status --short
  • Work only in a checkout whose current branch exactly equals headRefName.
  • For cross-repository PRs, also verify that the checkout tracks the returned head repository rather than an unrelated branch with the same name.
  • Use a configured remote whose URL matches the head repository; do not assume that remote is origin.
  • If no exact checkout exists, ask before creating or switching one.
  • If the target worktree has pre-existing changes, stop and ask. Never stash, reset, overwrite, or mix user changes into review-fix commits.

Synchronize the clean PR branch without rewriting history:

git fetch <head-remote> <head-branch>
git rev-list --left-right --count HEAD...FETCH_HEAD

Fast-forward a behind-only checkout. If local and remote histories diverge, stop and ask rather than rebasing, merging, or force-updating without approval. Repeat this comparison immediately before every separate review-fix commit; if the remote moved after editing began, stop and reconcile safely first.

4. Collect Complete Feedback

Resolve bundled paths from the directory containing this SKILL.md, then run:

python3 ./scripts/list_comments.py --pr <number> --json

Use --repo OWNER/REPO when running outside the target repository. Add --include-resolved only when historical resolved threads are relevant.

The JSON output:

  • paginates top-level comments, reviews, inline comments, and review threads;
  • includes full body text plus a short excerpt;
  • filters empty COMMENTED review shells;
  • maps inline replies to their root thread and filters resolved threads by default;
  • classifies source as human, ai_reviewer, automation, or unknown;
  • extracts recognizable “Prompt for AI Agents” blocks without discarding the body.

Treat the helper output as an inventory, not a decision. Ignore deployment/status automation that contains no review feedback.

5. Classify and Validate

Read ./references/validation-checklist.md before applying comments.

Mark each item as:

  • valid
  • invalid
  • already_fixed
  • out_of_scope
  • needs_clarification

Prioritize blocking human concerns, then high-confidence automated findings, then style and nits. Treat every automated suggestion as advisory. Verify embedded agent prompts against current files and repository conventions.

6. Implement and Verify

Handle one validated comment at a time. Keep unrelated cleanup out of the diff. Run the narrowest relevant tests, type checks, lint, or reproduction before committing. If a check fails, fix the working tree and rerun it; do not create a known-broken commit.

7. Commit Locally

For each resolved valid comment:

  1. Recheck the remote comparison from section 3.
  2. Stage only the files required for that comment.
  3. Inspect git diff --staged and git diff --staged --stat.
  4. Use an installed commit-message skill when available; otherwise match git log --oneline -10 and the repository's local conventions.
  5. Create exactly one local commit for that comment.

Do not combine distinct comments unless their fixes are technically inseparable. Do not commit rejected or unclear items. Do not push, post replies, or resolve threads as part of this workflow.

8. Report Back

Provide:

  • addressed comment URLs, files, and commit hashes;
  • rejected or already-fixed comment URLs with reasons;
  • precise questions for needs_clarification items;
  • checks run and their results;
  • the final branch/worktree and whether it is ahead or behind its remote.

Quick Commands

python3 ./scripts/list_comments.py --json
python3 ./scripts/list_comments.py --pr <number> --json
python3 ./scripts/list_comments.py --repo OWNER/REPO --pr <number> --json
python3 ./scripts/list_comments.py --pr <number> --json --include-resolved

git add <files-for-one-comment>
git diff --staged --stat
git diff --staged
git commit -m "<repository-style-message>"

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.