一键导入
resolve-pr-comments
Review PR review comments, assess validity, propose or make fixes, create fixup commits, push, and reply with SHA links.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review PR review comments, assess validity, propose or make fixes, create fixup commits, push, and reply with SHA links.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create a GitHub pull request with structured description, split commits, feature branch, assignee, and labels. Triggered by "ship it", "create PR", "/create-pr".
Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this", "debug this", reports a bug, says something is broken or throwing or failing, describes a performance regression, or shares a Grafana/Loki link or asks to search logs for a problem.
Create and edit Phabricator tasks via Curl Conduit API. Triggered only when the user explicitly mentions Phabricator or "phab": "create phab task/ticket/issue", "create Phabricator task/ticket/issue", or "/create-phabricator-task".
Craft-first interface design for dashboards, admin panels, SaaS apps, tools, settings pages, and data interfaces. Use when designing, building, reviewing, or refining product UI where visual hierarchy, component craft, design tokens, states, or design-system consistency matter.
Ultra-compressed communication mode. Cuts token usage by dropping filler, articles, and pleasantries while keeping full technical accuracy. Use when user says "caveman", "caveman mode", "talk like caveman", "be brief", "be terse", "keep it short", "less tokens", "save tokens", or invokes /caveman.
Research available models for any provider, rank them per agent role, and update all model references across agent configs and opencode.json. Works with OpenCode, Claude Code, Codex, and any agentic environment.
| name | resolve-pr-comments |
| description | Review PR review comments, assess validity, propose or make fixes, create fixup commits, push, and reply with SHA links. |
/resolve-pr-comments <pr_url>If the user provides a GitHub PR URL, extract owner, repo, and pr_number:
# From URL: https://github.com/<owner>/<repo>/pull/<number>
If the user provides a branch name, fetch it:
gh pr view <branch> --json number,title,body,headRepository,url
If no URL or branch given, check if the current branch is a PR branch (not master/main):
git branch --show-current
If on master or main, stop and ask the user for a PR URL or branch name.
Otherwise, proceed using the current branch:
gh pr view --json number,title,body,headRepository,url
Store owner/repo/pr_number.
Fetch PR metadata:
gh pr view <pr_number> --repo <owner>/<repo> --json number,headRepository,url,title
Extract owner/repo/pr_number
Fetch review threads:
gh api graphql --method POST -f query='query($owner:String!,$repo:String!,$number:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$number){reviewThreads(first:100){nodes{id,isResolved,comments(first:50){nodes{databaseId,author{login},body,createdAt,path,line,originalCommit{oid}}}}}}}}' -F owner=<owner> -F repo=<repo> -F number=<pr_number>
Fetch standalone PR comments:
gh api repos/<owner>/<repo>/issues/<pr_number>/comments --jq '.[] | {id, user: .user.login, body, created_at, node_id}'
Filter comments:
isResolved == false AND there is no reply from this agent (treat bot authors like any other author for review threads).# Check replies to review comment.
gh api "repos/<owner>/<repo>/pulls/<pr_number>/comments" --jq '.[] | select(.id==<databaseId>) | ._links.self.href' | xargs -I {} gh api "{}/replies" --jq '.[] | select(.user.login=="<user>")'
# Check replies to standalone comment.
gh api "repos/<owner>/<repo>/issues/comments/<id>/replies" --jq '.[] | select(.user.login=="<user>")'
For each comment, present (author, date, file:line, content) and assess:
SHA (the target commit must be within <base>..HEAD).Always map each VALID comment to a target SHA before making code changes. If mapping is unclear, pause and ask the user for clarification.
Group results as follows:
VALID (N):
#1: @author <file>:<line> -> fixup of `SHA`
#2: @author <file>:<line> -> fixup of `SHA`
NOT VALID (N):
#3: @author - <reason>
Get explicit user confirmation before proceeding with code changes.
Add reactions to acknowledge comments:
# Review comments.
echo '{"content":"+1"}' | gh api "repos/<owner>/<repo>/pulls/comments/<id>/reactions" -X POST -H "Accept: application/vnd.github+json" --input -
# Review comments which are not valid.
echo '{"content":"eyes"}' | gh api "repos/<owner>/<repo>/pulls/comments/<id>/reactions" -X POST -H "Accept: application/vnd.github+json" --input -
# Standalone comments.
echo '{"content":"+1"}' | gh api "repos/<owner>/<repo>/issues/comments/<id>/reactions" -X POST -H "Accept: application/vnd.github+json" --input -
Reaction policy:
+1.eyes.+1.eyes.Verification (required before Step 7/8):
# Review comment reaction check.
gh api repos/<owner>/<repo>/pulls/comments/<id>/reactions --jq '.[] | select(.user.login=="<user>") | .content'
# Standalone comment reaction check.
gh api repos/<owner>/<repo>/issues/comments/<id>/reactions --jq '.[] | select(.user.login=="<user>") | .content'
Step 3 reactions must be applied and verified before making any code changes. If reactions are not applied, stop and return to Step 3.
For each VALID comment:
file:line - preview) to the user for review.After all approved, show final fixup plan:
#1: file1.ext -> fixup of abc123
#2: file2.ext -> fixup of def456
Group changes by target SHA and make sure each file goes to the correct fixup commit.
Get user confirmation to commit.
Create fixup commits locally first. Do NOT push until the user explicitly approves.
Resolve target SHAs from the current branch history, and group changes by target SHA.
Never mix different target SHAs in a single fixup commit.
For further details, re-read ~/.config/agentic/instructions/versioning.md in full before committing.
# Example: create fixup commits grouped by target SHA
git add <files_for_sha1> && git commit --fixup <sha1>
git add <files_for_sha2> && git commit --fixup <sha2>
Before each fixup commit, verify staged files belong only to that SHA group:
git diff --cached --name-only
Verify:
git status --short && git log --oneline <base>..HEAD
Get user confirmation to push.
git push origin <branch> --force-with-lease
After push, verify the remote branch contains the fixup commits before posting any PR replies:
# Local latest commits, newest first.
git log --format="%H %s" -n <valid_count>
# Remote head includes latest local commits.
git fetch origin <branch>
git rev-parse HEAD
git rev-parse origin/<branch>
# Optional strict check: each fixup SHA exists on remote branch.
git branch -r --contains <fixup_sha> | grep "origin/<branch>"
Before posting any valid-comment reply, ensure Step 3 reactions were applied and verified, and Step 6 push was completed and verified. If the push has not occurred, stop and ask for push approval.
Collect all new fixup SHAs and verify mapping before replying. Do not assume one comment equals one fixup commit.
git log --format="%H %s" -n <fixup_commit_count>
Reply and resolve review thread comments (for both human and bot authors) by posting the fixup commit URL(s) and then resolving the thread. For standalone comments from non-bot authors, post a quoted reply including fixup SHA(s). Skip bot standalone comments (no reply, no resolve).
echo '{"body":"https://github.com/<owner>/<repo>/commit/<sha>"}' | gh api "repos/<owner>/<repo>/pulls/<pr_number>/comments/<id>/replies" -X POST -H "Accept: application/vnd.github+json" --input -
echo '{"body":"> <original_comment_text>\n\nhttps://github.com/<owner>/<repo>/commit/<sha>"}' | gh api "repos/<owner>/<repo>/issues/comments/<id>/replies" -X POST -H "Accept: application/vnd.github+json" --input -
Resolve review threads, after replying:
gh api graphql -f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{isResolved}}}' -F threadId=<thread_id>
Before posting or resolving any not-valid thread, ensure Step 3 reactions were applied and verified, and Step 6 push was completed and verified. If the push has not happened yet, stop and ask for push approval.
For review thread comments from any author: Reply with concise reason + resolve. For standalone comments from non-bot authors only: Quote reply with reason. Bot standalones are skipped, no reply, no resolve.
# Review thread comment, reply with reason + resolve, for both human and bot review comments.
echo '{"body":"<reason>"}' | gh api "repos/<owner>/<repo>/pulls/<pr_number>/comments/<id>/replies" -X POST -H "Accept: application/vnd.github+json" --input -
gh api graphql -f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{isResolved}}}' -F threadId=<thread_id>
# Standalone comment, non-bot only, quote reply with reason, no resolve.
echo '{"body":"> <original_comment_text>\n\n<reason>"}' | gh api "repos/<owner>/<repo>/issues/comments/<id>/replies" -X POST -H "Accept: application/vnd.github+json" --input -
Re-request reviews (skip reviewers who already approved, and skip bots):
# Get approved reviewers.
gh pr view <pr_number> --json reviews \
--jq '.reviews[] | select(.state=="APPROVED") | .author.login' \
| sort -u > /tmp/approved.txt
# Get all non-bot reviewers who commented (excluding self).
gh api repos/<owner>/<repo>/pulls/<pr_number>/comments \
--jq '.[].user.login' \
| sort -u \
| grep -v <user> \
| while read login; do
type=$(gh api "users/$login" --jq '.type' 2>/dev/null)
if [ "$type" != "Bot" ]; then echo "$login"; fi
done > /tmp/reviewers.txt
# Re-request only non-approved reviewers.
comm -23 /tmp/reviewers.txt /tmp/approved.txt \
| xargs -I {} gh pr edit <pr_number> --add-reviewer {}
rm /tmp/approved.txt /tmp/reviewers.txt
Summary: PR link, resolved SHAs, not-valid reasons
+1 for valid, eyes for not valid, except for bot standalone comments.