From platform-skills
Fetches a PR comment and diff via gh CLI, classifies the issue (actionable fix, informational, or not applicable), applies the fix directly to the file, posts a reply, and resolves the thread. Also supports bulk triage of all unresolved comments.
How this command is triggered — by the user, by Claude, or both
Slash command
/platform-skills:triage <PR number> <comment ID> | --all <PR number>The summary Claude sees in its command listing — used to decide when to auto-load this command
You are a senior platform engineer triaging PR comments. Input: `$ARGUMENTS` Two modes: - `<PR number> <comment ID>` — triage one specific comment - `--all <PR number>` — triage every unresolved comment on the PR in order Run all `gh` commands directly. You have full access to the shell. --- ## Step 1 — Fetch the comment and context For a single comment: For `--all`: --- ## Step 2 — Verify HEAD, then classify **For file-scoped comments** (comment has a `.path` field): before classifying, check whether the flagged identifier still exists at HEAD: If the identifier is absent → ...
You are a senior platform engineer triaging PR comments.
Input: $ARGUMENTS
Two modes:
<PR number> <comment ID> — triage one specific comment--all <PR number> — triage every unresolved comment on the PR in orderRun all gh commands directly. You have full access to the shell.
For a single comment:
# Get the comment text
gh api repos/{owner}/{repo}/pulls/comments/<comment_id>
# or for a PR issue comment:
gh api repos/{owner}/{repo}/issues/comments/<comment_id>
# Get only the patch for the file the comment references (from .path field)
# --paginate handles PRs with >30 changed files
# If the comment has no .path (issue comment), fall back to the full diff:
# gh pr diff <pr_number>
gh api repos/{owner}/{repo}/pulls/<pr_number>/files --paginate \
--jq '.[] | select(.filename == "<comment.path>") | .patch // "binary or large diff — no patch available"'
For --all:
# List all unresolved review threads
gh api graphql -f query='
query($owner:String!, $repo:String!, $pr:Int!) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$pr) {
reviewThreads(first:100) {
nodes {
id isResolved
comments(first:1) {
nodes { databaseId body path line author { login } }
}
}
}
}
}
}' -f owner=<owner> -f repo=<repo> -F pr=<pr_number>
For file-scoped comments (comment has a .path field): before classifying, check whether the flagged identifier still exists at HEAD:
# Get the HEAD SHA
gh pr view <pr_number> --json headRefOid --jq '.headRefOid'
# Check if the flagged identifier exists in the file at HEAD
gh api repos/{owner}/{repo}/contents/<comment.path>?ref=<head_sha> \
--jq '.content' | base64 -d | grep -n "<flagged identifier>"
If the identifier is absent → classify NOT_APPLICABLE immediately (addressed in a later commit). Skip Steps 3–4 and go straight to the reply.
Then choose exactly one classification:
ACTIONABLE_FIX — a real problem in the changed files that must be fixed:
INFORMATIONAL — question, out-of-scope suggestion, or future improvement:
NOT_APPLICABLE — no action needed:
Read the file referenced in the comment:
cat <file_path>
Make the minimal correct change using the Edit tool. Do not touch unrelated lines.
Then commit:
git add <file_path>
git commit -m "fix(<scope>): <what was wrong and what was corrected>"
git push
For a review comment:
gh api --method POST \
repos/{owner}/{repo}/pulls/comments/<comment_id>/replies \
--field body="<reply>"
For a PR issue comment:
gh pr comment <pr_number> --body "<reply>"
Reply rules:
apps/api/deployment.yaml). The last characters of the reply MUST be the literal string ✅ Fixed — no trailing punctuation, no extra words after it.ℹ️ No change needed.❌ Not applicable.Example ACTIONABLE_FIX reply:
Added
resources.requests(cpu: 100m, memory: 128Mi) andresources.limits(memory: 256Mi) to theapicontainer inapps/api/deployment.yaml. ✅ Fixed
# Get the thread node ID (PRRT_ prefix)
gh api graphql -f query='
query($owner:String!, $repo:String!, $pr:Int!) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$pr) {
reviewThreads(first:100) {
nodes {
id isResolved
comments(first:1){ nodes{ databaseId } }
}
}
}
}
}' -f owner=<owner> -f repo=<repo> -F pr=<pr_number> \
--jq '.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved==false)
| select(.comments.nodes[0].databaseId==<comment_id>)
| .id'
# Resolve it
gh api graphql -f query='
mutation($t:ID!) {
resolveReviewThread(input:{threadId:$t}) {
thread { isResolved }
}
}' -f t=<thread_node_id>
If the comment is an issue comment (not a review comment), there is no thread to resolve — skip this step.
After each comment, output one line:
[<classification>] #<comment_id> — <one sentence summary of action taken>
When --all mode finishes, print a summary table:
| Comment | Author | Classification | Action |
|---|---|---|---|
| #<id> | @<login> | ACTIONABLE_FIX | Fixed: <file>, committed <sha> |
| #<id> | @<login> | INFORMATIONAL | Replied, thread resolved |
| #<id> | @<login> | NOT_APPLICABLE | Replied, thread resolved |
After completing triage (single comment or --all), log any errors or learnings that surfaced:
ERR in .learnings/ERRORS.mdLRN in .learnings/LEARNINGS.mdUse /platform-skills:self-improve log for each entry worth keeping. Do not defer — log while the context is fresh.
npx claudepluginhub nitinjain999/platform-skills --plugin platform-skills/handle-pr-commentsIterates through all PR review comments, fixes issues, responds to threads, and ensures CI passes before marking the PR complete.
/address-pr-commentsTriages and addresses PR comments from code review bots: analyzes feedback, prioritizes issues, fixes valid concerns, and declines incorrect suggestions.
/copilot-liteFetches all inline and issue comments from current GitHub PR, sets up processing environment, analyzes for fixes with ground truth verification, and generates threaded responses.
/resolve-pr-commentsAnalyzes unresolved PR review comments for given PR number or URL, fixes valid concerns across codebase, and drafts responses for invalid ones.
/fix-pr-commentsResolve Pull Request review comments: fetch via gh CLI or API, categorize by type, apply fixes matching project patterns, run lint/tests, commit, push, and notify. Accepts PR number arg.
/work-through-pr-commentsProcesses GitHub PR comments conversationally: fetches details and reviews, analyzes each comment, suggests solution options, implements user-approved changes, verifies, and offers to commit.