From ivuorinen-skills
Fetches GitHub PR review comments, evaluates validity, and implements valid ones one at a time with test verification. Use when implementing unresolved GitHub PR review comments, when told "fix the cr comments", "implement review feedback", "address pr comments", or when a PR has unresolved reviewer comments that need addressing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ivuorinen-skills:cr-implementerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Tool-driven implementation of unresolved GitHub PR review comments. Fetches every comment thread using whatever GitHub API access is available, evaluates each for technical validity and current applicability, implements valid ones one at a time with a full validation pass after each, and scans for structurally identical issues elsewhere in the codebase. Every comment receives an explicit verdic...
Tool-driven implementation of unresolved GitHub PR review comments. Fetches every comment thread using whatever GitHub API access is available, evaluates each for technical validity and current applicability, implements valid ones one at a time with a full validation pass after each, and scans for structurally identical issues elsewhere in the codebase. Every comment receives an explicit verdict: Implemented, Pushed Back, or Skipped. Nothing is silently ignored. Replies are drafted locally and posted only after the fixes are pushed and the user confirms — so the reviewer can see the change before reading "Fixed in …".
Run these before touching any code:
1. Detect GitHub API access method. Try each in order and stop at the first that works:
Method A — gh CLI:
which gh && gh auth status
If this succeeds, use gh api for all GitHub API calls and gh pr view for PR detection.
Method B — GITHUB_TOKEN + available HTTP client:
[ -n "$GITHUB_TOKEN" ]
If the token is present (non-empty), use curl, context-mode ctx_execute JavaScript fetch, or any other HTTP tool for all subsequent API calls. Do not validate with GET /user — GitHub Actions tokens and App installation tokens return 403 on that endpoint even when valid. The Step 2 API call will surface any auth failure.
Method C — GraphQL via any HTTP client:
All operations in this skill have GraphQL equivalents (see steps below). Use https://api.github.com/graphql with Authorization: Bearer $GITHUB_TOKEN. Requires GITHUB_TOKEN — not an independent fallback when no token is available.
If none yield an authenticated GitHub API connection, stop and report: "GitHub API access requires one of: gh CLI, GITHUB_TOKEN + an HTTP client, or context-mode MCP with GITHUB_TOKEN."
Note the method chosen. Use the same method for fetching and replying — do not mix methods between steps.
2. Resolve owner, repo, and PR number.
Get owner and repo from the git remote:
git remote get-url origin
# parse: [email protected]:owner/repo.git OR https://github.com/owner/repo
If the PR number is not supplied by the user, detect it:
gh pr view --json number,url,headRefNamegit branch --show-current, then call:
GET /repos/{owner}/{repo}/pulls?head={owner}:{branch}&state=openConfirm the PR is correct before proceeding. If ambiguous, ask the user.
3. Identify the project's canonical check command by inspecting in order:
Makefile — look for a check, test, or lint targetpackage.json scripts fieldpyproject.toml — identify configured tools (ruff, pytest, mypy, etc.) and construct their default invocationsREADME or CONTRIBUTING for documented test commandsIf the check command cannot be determined, ask the user before continuing.
4. Confirm the commit message convention:
git log --oneline -10
Note the prefix convention in use (e.g. fix:, feat:, chore:).
Fetch all inline review comments from the PR using the method chosen in Step 1:
Method A: gh api --paginate repos/{owner}/{repo}/pulls/{pr_number}/comments
Method B: GET https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}/comments?per_page=100 — paginated; follow Link: <url>; rel="next" response headers until no next link remains.
Method C (GraphQL):
query {
repository(owner: "{owner}", name: "{repo}") {
pullRequest(number: {pr_number}) {
reviewThreads(first: 100) {
pageInfo { hasNextPage endCursor }
nodes {
id
isResolved
comments(first: 50) {
nodes { id body path diffHunk createdAt author { login } }
}
}
}
}
}
}
If pageInfo.hasNextPage is true, re-query with reviewThreads(first: 100, after: "{endCursor}") until hasNextPage is false.
Note: comments(first: 50) is not paginated — threads with more than 50 comments are truncated to the first 50. This is an accepted limitation; PR review threads with >50 comments are outside the normal use case for this tool.
GraphQL reviewThreads exposes isResolved — use it to skip already-resolved threads.
The GitHub REST API (Methods A and B) does not expose a resolved/unresolved state on individual comments. When using Method A or B, process every comment — Step 3 assigns the Skipped verdict when the flagged code no longer exists.
For every comment, before touching any code:
diff_hunk (REST) or diffHunk (GraphQL) to understand what file and line are flagged.Do not implement without evaluating first. Do not assign Pushed Back without technical reasoning. Do not assign Skipped without confirming the code is actually gone.
For each Implement verdict, in order:
rg '<pattern>'
Fix every instance found. Run the check again — must be clean before moving on.After each verdict, draft the reply text locally. Do not post to GitHub.
Reply content by verdict:
Hold all drafts until Step 6.
After all comments are processed, emit a summary including the drafted reply for each comment:
Implemented: N
Pushed Back: N
Skipped: N
Drafted replies:
<comment_id or thread_id> — <one-line preview of reply>
...
If there are Implemented verdicts (code was changed):
What next?
1. Leave it (no commit, no replies posted)
2. Commit only (no push, no replies posted)
3. Commit and push
--no-verify; push to the current branch's remote tracking branch (never directly to main or master). If the push fails, stop, report the error, and do not post any replies — ask the user to resolve the push failure and re-run this step. After the push succeeds, ask: "Post replies to GitHub now? (y/n)" If yes, post all drafted replies. If no, inform the user.If there are no Implemented verdicts (only Pushed Back and Skipped — no code was changed):
Post replies now? (y/n)
Post replies immediately on confirmation — no push is needed because no code changed.
Posting replies (using the method chosen in Step 1):
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies -f body="<reply>"POST https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies with body {"body": "<reply>"}id from the Step 2 query:
mutation {
addPullRequestReviewThreadReply(input: {
pullRequestReviewThreadId: "{thread_id}",
body: "<reply>"
}) { comment { id } }
}
Results are presented inline to the user. No findings file is written. Replies are drafted locally and posted to GitHub PR threads only after the user confirms in Step 6.
fetch-pr-comments.py: Fetch unresolved review threads from a GitHub PR.
uv run --quiet skills/cr-implementer/fetch-pr-comments.py <owner>/<repo> <pr_number>
Outputs a JSON array of thread objects. Use this in Step 2 instead of running gh commands manually. GraphQL is attempted first (gives isResolved); falls back to REST via gh CLI or GITHUB_TOKEN.
--no-verify.gh is available: detect the GitHub API method in Step 1 and use it consistently. Never call gh without confirming it exists.thread_id that is only available if GraphQL was used to fetch.Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub ivuorinen/skills --plugin ivuorinen-skills