skills/fix-pr-comments/SKILL.md
Handle feedback from PR reviewers. For each inline thread: reply on-thread and resolve after user approves. Use when developers left comments on your PR and you need to address them. Triggers on 'address comments', 'fix PR feedback', 'what did the reviewer say', 'handle review', 'resolve comments', 'comments from dev', 'dev feedback'.
npx skillsauth add vltansky/skills fix-pr-commentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Check if the user mentioned a PR number or URL in the conversation.
If yes — use that:
PR_NUM=$(gh pr view <number-or-url> --json number --jq .number)
PR_BRANCH=$(gh pr view <number-or-url> --json headRefName --jq .headRefName)
If no — use the current branch's PR:
PR_NUM=$(gh pr view --json number --jq .number)
PR_BRANCH=$(gh pr view --json headRefName --jq .headRefName)
If gh pr view fails (no PR found): tell user "No PR found" and stop.
REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
CURRENT_BRANCH=$(git branch --show-current)
If CURRENT_BRANCH equals PR_BRANCH — proceed to Step 1.
Check for uncommitted changes:
git status --porcelain
If uncommitted changes exist: Ask the user with the file list. Options:
git stash --include-untracked --message "fix-pr-comments: auto-stash from $CURRENT_BRANCH", then checkoutIf clean: Ask the user:
$CURRENT_BRANCH but PR #$PR_NUM is on $PR_BRANCH. Switch branch?"If switching:
git checkout $PR_BRANCH && git pull
SHA=$(gh pr view $PR_NUM --json commits --jq '.commits[-1].oid')
BUILD_STATE=$(gh api repos/$REPO/commits/$SHA/status --jq '.state')
echo "Build: $BUILD_STATE"
Also check for CI status via checks API:
gh pr checks $PR_NUM
| Build Status | Action | |--------------|--------| | success | Proceed to Step 2 | | failure | Analyze failure (Step 1a), then ask user | | pending | Tell user: "Build still running. Proceed with comments or wait?" | | No status | Proceed to Step 2 |
# Check for CI bot comments with build output
gh pr view $PR_NUM --json comments --jq '.comments[-1].body' | head -50
gh pr view $PR_NUM --json files --jq '.files[].path'
| Error Location | Action | |----------------|--------| | File in PR diff | Fix it — it's your change | | File NOT in PR diff | Likely flaky/external — explain to user |
If caused by PR: Read the failing file, fix, commit: fix: [description]
If external: Present options to user:
# General PR comments
gh pr view $PR_NUM --json comments --jq '.comments[] | {id, body, author: .author.login}'
# Inline code review comments
gh api repos/$REPO/pulls/$PR_NUM/comments --jq '.[] | {id, body, author: .user.login, path, line}'
If no comments: "No PR comments to address."
One TODO per comment. Include file:line for inline comments.
Is this valid feedback?
| Confidence | Action | |------------|--------| | High (agree) | Implement the fix | | Low (disagree/unsure) | Ask the user before implementing |
For low confidence, explain your concern then ask:
Show the comment and your draft reply:
> [original comment text]
Draft reply: [your draft reply]
Why: [brief reasoning]
After posting: resolve this review thread?
Options: "Post reply and resolve" / "Post reply only" / "Edit reply first"
# Reply to inline review comment
gh api repos/$REPO/pulls/$PR_NUM/comments/$COMMENT_ID/replies \
-f body="<reply>"
# Reply to general PR comment
gh pr comment $PR_NUM --body "<reply>" --reply-to $COMMENT_ID
Resolve via GraphQL — find the review thread containing this comment, then resolve it:
OWNER=$(echo "$REPO" | cut -d/ -f1)
NAME=$(echo "$REPO" | cut -d/ -f2)
THREADS_JSON=$(gh api graphql -f query='
query($owner:String!,$name:String!,$pr:Int!) {
repository(owner:$owner,name:$name) {
pullRequest(number:$pr) {
reviewThreads(first:100) {
nodes { id isResolved comments(first:50) { nodes { databaseId } } }
}
}
}
}' -f owner="$OWNER" -f name="$NAME" -f pr="$PR_NUM")
THREAD_ID=$(echo "$THREADS_JSON" | jq -r --argjson cid "$COMMENT_ID" '
.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved == false)
| select([.comments.nodes[].databaseId] | contains([$cid]))
| .id
' | head -1)
if [ -n "$THREAD_ID" ]; then
gh api graphql -f query='mutation($id:ID!){ resolveReviewThread(input:{threadId:$id}) { thread { isResolved } } }' -f id="$THREAD_ID"
fi
If THREAD_ID is empty: tell user the reply was posted and they can resolve manually in the PR UI.
Mark TODO complete, move to next comment.
| Scenario | Response | |----------|----------| | No comments | "No PR comments to address." | | All addressed | "All done! Addressed X comments." | | Some skipped | "Addressed X comments, skipped Y. Let me know if you want to revisit." |
tools
Prepare a Hetzner Cloud VPS for secure Codex remote SSH access. Use when the user wants to create or configure a Hetzner server for Codex remote control, fix "No codex found in PATH" on a remote machine, install agent development tooling on a VPS, harden SSH access to a Hetzner server, or connect the server through Codex Settings, Connections, Add SSH.
data-ai
Summarize your GitHub activity from the last 24 hours across all repos. Use when user says "what did I do", "my activity", "standup", "recap", "summarize my day", "what-i-did", "git activity", "daily summary".
development
Test-driven development loop. Write failing test first, then implement to make it pass. Use when the user says 'tdd', 'test first', 'write the test first', 'failing test', 'red green refactor', or for any bug fix where the fix should be proven by a test. Also use when autopilot or other skills need test-first execution.
development
Review changed code for reuse, quality, and efficiency, then fix any issues found. Use when the user says "simplify", "simplify this", "review changes", "clean up my code", "check for duplicates", "code reuse review", or wants a post-change quality sweep.