pr-review-reply
Skill2 starsChanged 8 months agoApache-2.0View on GitHub
Encodes the post-review response loop using scripts/pr_review_reply.py: reply to inline PR comments referencing the fix commit, then resolve threads. USE FOR: responding to GitHub PR review comments after fixing the raised issues; batch-reply-and-resolve in one pass; obtaining comment IDs and thread node IDs from the GitHub API. DO NOT USE FOR: authoring the initial PR description (use the GitHub agent); requesting a new review before replies are posted; re-opening resolved threads.
In this repository27 other files it gives its agents.
- adopt-test-2/AGENTS.mdAGENTS.md
- adopt-test-3/AGENTS.mdAGENTS.md
- adopt-test/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- {{cookiecutter.project_slug}}/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- .github/agents/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-file-authoringSkill
- conventional-commitSkill
- corpus-sweepSkill
- deep-research-sprintSkill
- delegation-routingSkill
- phase-gate-sequenceSkill
- prompt-archaeologySkill
- pr-review-triageSkill
- rate-limit-resilienceSkill
- research-epic-planningSkill
- secondary-research-sprintSkill
- session-managementSkill
- session-retrospectiveSkill
- skill-authoringSkill
- source-cachingSkill
- sprint-planningSkill
- transcript-extractionSkill
- validate-before-commitSkill
- workplan-scaffoldSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
Write a JSON array to a temp file and pass it with --batch:
- Distinctive: line 125
After posting replies, verify the last reply was recorded correctly:
- Distinctive: line 138
After all comments have been addressed and threads resolved:
- Distinctive: line 144
Do not request re-review until all threads are resolved — unresolved threads indicate outstanding feedback.
- Distinctive: line 185
Use batch mode with a JSON file instead — it handles multi-line text and special characters correctly.
- Distinctive: line 194
Do not request re-review until all flagged threads are resolved.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
PR Review Reply
This skill enacts the Algorithms Before Tokens axiom from MANIFESTO.md: repetitive post-review response workflows are encoded as a script and executed deterministically, not performed manually through the UI with repeated token burn per comment. The post-review loop is governed by AGENTS.md § Verify-After-Act for Remote Writes. When this skill and those documents conflict, the primary documents take precedence.
1. Three Modes
The script supports three modes of operation:
| Mode | When to use | Command |
| Single reply | One comment to address | --reply-to <id> --body <text> |
| Single resolve | One thread to close without reply | --resolve <thread-node-id> |
| Batch (preferred) | Multiple comments or resolve-without-reply in one pass | --batch <json-file> |
Always use batch mode when addressing more than one comment. It is more reliable than sequential single calls and produces a single audit trail.
2. Single Reply
uv run python scripts/pr_review_reply.py --pr <num> --reply-to <comment-id> --body "Fixed in <sha>."For multi-line reply bodies, use batch mode with a JSON file instead of --body — shell quoting and backtick interpolation cause gh to misbehave with multi-line text.
3. Single Resolve
uv run python scripts/pr_review_reply.py --pr <num> --resolve <thread-node-id>This resolves the thread without posting a reply. Use only when the comment does not warrant a reply (e.g., a nit that was silently fixed).
4. Batch Mode (Preferred)
Write a JSON array to a temp file and pass it with --batch:
# Write the batch file (use a file tool — never heredoc)
# Example contents: .tmp/<branch>/review-replies.json
uv run python scripts/pr_review_reply.py --pr <num> --batch .tmp/<branch>/review-replies.jsonBatch JSON format — each entry may contain any combination of reply_to, body, and resolve:
[
{
"reply_to": 12345678,
"body": "Fixed in abc1234 — moved validation to the call site.",
"resolve": "PRRT_kwDORfkAR85yvrwz"
},
{
"resolve": "PRRT_kwDORfkAR85yvrwz_another"
},
{
"reply_to": 87654321,
"body": "Agreed — renamed to match the convention."
}
]- Entry with both
reply_toandresolve: posts the reply, then resolves the thread. - Entry with only
resolve: resolves the thread without posting a reply. - Entry with only
reply_to: posts a reply without resolving.
5. Get Comment IDs
To build the batch file, first retrieve comment database IDs:
gh api repos/<owner>/<repo>/pulls/<num>/comments \
--jq '.[] | {id, path, line, body: .body[:80]}'The id field is the integer database ID used for reply_to.
6. Get Thread Node IDs
Thread node IDs (for resolve) require the GraphQL API:
gh api graphql -f query='{
repository(owner:"<owner>", name:"<repo>") {
pullRequest(number: <num>) {
reviewThreads(first: 20) {
nodes {
id
isResolved
comments(first: 1) {
nodes { databaseId body }
}
}
}
}
}
}'The id field in each reviewThreads.nodes entry is the thread node ID (PRRT_kwDO...) used for --resolve.
7. Verify After Posting
After posting replies, verify the last reply was recorded correctly:
gh api repos/<owner>/<repo>/pulls/<num>/comments/<comment-id>/replies \
--jq '.[-1].body[:80]'Zero output or an error means the reply did not post. Re-run the batch entry for that comment.
8. Request Re-Review After All Replies
After all comments have been addressed and threads resolved:
gh pr review <num> --request-review @github-copilotDo not request re-review until all threads are resolved — unresolved threads indicate outstanding feedback.
Anti-Patterns (Common Mistakes)
❌ DO NOT use gh pr comment for inline replies
# WRONG — posts a top-level comment, NOT a threaded reply to the specific comment
gh pr comment 144 --body "Fixed in abc123"This posts at the wrong scope and orphans the reply from its comment thread. Use pr_review_reply.py instead:
# CORRECT — posts as a threaded reply to the specific comment
uv run python scripts/pr_review_reply.py --pr 144 --batch .tmp/replies.jsonTop-level comments cannot be tied to specific review feedback.
❌ DO NOT use gh pr comment with Copilot tags
# WRONG — @github-copilot tag in top-level comment creates unwanted Copilot task lanes
gh pr comment 144 --body "@github-copilot Fixed in abc123 by doing X"This triggers secondary Copilot tasks to "fix" things mentioned in the generic comment, creating noise and forcing manual intervention.
Reply directly via pr_review_reply.py without tags. The PR review reply should cite the commit SHA and the fix — let the code speak for itself.
❌ DO NOT use --body "..." with multi-line text
# WRONG — shell quoting breaks multi-line text and backticks corrupt output
uv run python scripts/pr_review_reply.py --pr 144 --reply-to 12345 --body "Fixed in abc123.
Also updated the docs."Use batch mode with a JSON file instead — it handles multi-line text and special characters correctly.
Guardrails
- Never pass multi-line reply bodies via
--body "..."on the command line — use--batchwith a JSON file. - Never use heredoc writes to create the JSON batch file — use
create_fileorreplace_string_in_filetools. - Always verify after posting — zero exit from the script is not confirmation that the reply posted successfully.
- Do not request re-review until all flagged threads are resolved.
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
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.

