pr-comments
Use gh CLI to fetch, reply to, and resolve GitHub PR review comment threads programmatically.
Install
mkdir -p .claude/skills/pr-comments-oysteinamundsen && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10539" && unzip -o skill.zip -d .claude/skills/pr-comments-oysteinamundsen && rm skill.zipInstalls to .claude/skills/pr-comments-oysteinamundsen
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Read, reply to, and resolve review-comment threads on a GitHub pull request using the gh CLI. Use whenever you need to triage PR feedback (fetch all unresolved review threads as structured JSON, post inline replies on specific threads, and mark threads resolved) instead of hand-writing a one-off gh/GraphQL script each time. Prefer this over the generic address-pr-comments skill for bulk thread triage and programmatic gh/GraphQL access.Key capabilities
- →Fetch all unresolved review threads as normalized JSON
- →Fetch all review threads including resolved ones
- →Post inline replies on specific review threads
- →Resolve review comment threads after replying
- →Validate the shape of the JSON replies file
- →Preview API calls with a dry run option
How it works
The skill uses `gh` CLI to fetch review threads as JSON, then posts inline replies and resolves threads based on a provided JSON replies file, validating the input and offering a dry run.
Inputs & outputs
When to use pr-comments
- →Managing PR feedback
- →Resolving review threads
- →Batching PR comments
About this skill
Reading and answering PR review comments
Inline PR review comments live in review threads. Each thread has a GraphQL
node id (PRRT_…) used to resolve it, and its first comment has a numeric
databaseId used to post an inline reply. The GitKraken/MCP git tools only
expose PR-level comments and approvals — they cannot read or reply to inline
threads — so this skill drives the gh CLI directly.
This skill ships two scripts so you never have to recreate the fetch/parse/reply
loop by hand. Both are zero-dependency Bun/Node ESM (they shell out to gh and
parse JSON in-process — no jq required, since jq is not installed here):
| Script | Purpose |
|---|---|
fetch-threads.mjs | Fetch all review threads as normalized JSON (paginated, unresolved-only by default). |
reply-resolve.mjs | Post inline replies from a JSON items file, then resolve those threads. |
Prerequisites
ghauthenticated (gh auth status).bunon PATH (repo runtime).- Run from the repo root. Repo is auto-detected via
gh repo view; override with--repo owner/nameorGH_REPO=owner/name.
1. Fetch the threads
bun .github/skills/pr-comments/fetch-threads.mjs <pr> # unresolved only
bun .github/skills/pr-comments/fetch-threads.mjs <pr> --all # include resolved
bun .github/skills/pr-comments/fetch-threads.mjs <pr> > tmp/pr<pr>-threads.json
Output is a JSON array, one object per thread:
[
{
"threadId": "PRRT_kwDOQtIN_86EKNlu",
"commentId": 3289521091,
"author": "copilot-pull-request-reviewer",
"path": "libs/grid/src/lib/plugins/editing/editing-integration.spec.ts",
"line": 1679,
"isResolved": false,
"isOutdated": false,
"body": "Avoid `as unknown as` casts …"
}
]
commentId is the first comment's databaseId (reply target); threadId is the
node id (resolve target). Read the body to classify each comment, then build a
replies file (next step).
2. Reply and resolve
Write a JSON items file (e.g. tmp/pr<pr>-replies.json) — one entry per thread
you're answering:
[
{
"commentId": 3289521091,
"threadId": "PRRT_kwDOQtIN_86EKNlu",
"body": "Fixed. Typed the option as `HTMLOptionElement` directly (L1679); no `as unknown as`."
}
]
Then run:
bun .github/skills/pr-comments/reply-resolve.mjs <pr> tmp/pr<pr>-replies.json
bun .github/skills/pr-comments/reply-resolve.mjs <pr> tmp/pr<pr>-replies.json --dry-run # preview, no API calls
bun .github/skills/pr-comments/reply-resolve.mjs <pr> tmp/pr<pr>-replies.json --no-resolve # reply but leave open
The script validates the file shape up front, posts each reply via
repos/{repo}/pulls/{pr}/comments/{commentId}/replies, then resolves each thread
via the resolveReviewThread mutation. Use --dry-run first if unsure.
3. Final PR-level summary comment
For /pr-qa, do not post an extra PR-level summary comment. The required output
is per-thread: reply inline and resolve each thread.
Constraints
- Resolving a thread ≠ closing the PR.
resolveReviewThreadonly collapses an individual thread. Never close, merge, approve, push, or force-push — the PR author handles all git operations. - Never push or run remote-mutating git commands without explicit per-turn
user consent. Posting replies / resolving threads is the only mutation this
skill performs; use
--dry-runfirst if unsure. - Put generated
*-threads.json/*-replies.jsonfiles undertmp/(gitignored scratch), not in the repo tree. - This skill only handles GitHub I/O. For the triage policy (classify
valid / partially-valid / wrong, cite
DECIDEDentries, follow the delivery workflow for code changes), see.github/prompts/pr-qa.prompt.md.
When not to use it
- →When the task involves PR-level comments and approvals (use GitKraken/MCP git tools instead)
- →When the user wants to close, merge, approve, push, or force-push the PR
- →When the task is to post an extra PR-level summary comment for `/pr-qa`
Prerequisites
Limitations
- →Cannot read or reply to inline threads using GitKraken/MCP git tools
- →Never closes, merges, approves, pushes, or force-pushes the PR
- →Only handles GitHub I/O; triage policy is separate
How it compares
This skill automates the bulk triage and resolution of inline PR review threads using structured JSON and the `gh` CLI, providing programmatic access that is more efficient than manual interaction or generic PR comment skills.
Compared to similar skills
pr-comments side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pr-comments (this skill) | 0 | 2mo | Review | Intermediate |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| git-advanced-workflows | 11 | 2mo | Review | Advanced |
| nx-workspace | 4 | 6mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by OysteinAmundsen
View all by OysteinAmundsen →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
nx-workspace
nrwl
Explore and understand Nx workspaces. USE WHEN answering any questions about the nx workspace, the projects in it or tasks to run. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What targets can I run?', 'What's affected by my changes?', 'Which projects depend on library Y?', or any questions about Nx workspace structure, project configuration, or available tasks.
fix-github-issue
AgnosticUI
Fix a GitHub issue by number. Use when asked to fix GitHub issues.
rebase-pr
AztecProtocol
Rebase a PR on its base branch, fix conflicts, and verify build
resolve-pr-parallel
EveryInc
Resolve all PR comments using parallel processing. Use when addressing PR review feedback, resolving review threads, or batch-fixing PR comments.