skills/resolve-bot-reviews/SKILL.md
Triage, fix, and resolve bot code review comments (CodeRabbit, Gemini Code Assist) on PRs. Use when asked to resolve bot reviews, given a PR URL, or on '/resolve-bot-reviews'.
npx skillsauth add skinnyandbald/fish-skills resolve-bot-reviewsInstall 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.
Fetch bot review comments from a PR, triage by severity, fix source files, commit, push, and resolve threads -- all in one workflow.
/resolve-bot-reviews <PR URL>
/resolve-bot-reviews <PR URL> --auto # skip triage confirmation
| Phase | Action |
|-------|--------|
| 1. Fetch | Pull review threads via GraphQL, filter to bot authors |
| 2. Triage | Present severity table, confirm with user (unless --auto) |
| 3. Fix | Apply bounded fixes to source files, never build outputs |
| 3.5. Commit + Push | Stage, commit, push -- must succeed before resolving |
| 4. Resolve | Resolve each thread via GraphQL mutation, report totals |
Extract owner, repo, and pr number from the URL:
https://github.com/{owner}/{repo}/pull/{pr}
Use gh api graphql to fetch all review threads in a single call:
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: 5) {
nodes {
author { login }
body
path
line
}
}
}
}
}
}
}
' -F owner="$OWNER" -F repo="$REPO" -F pr=$PR_NUM
Only process threads where the first comment's author matches one of these patterns (GraphQL returns the login without [bot] suffix, REST includes it):
coderabbitai or coderabbitai[bot]gemini-code-assist or gemini-code-assist[bot]Match with a prefix check (starts with coderabbitai or gemini-code-assist). Discard all other threads.
For each bot thread, extract:
| Field | Source |
|-------|--------|
| Severity | Parse from bot markup (see Severity Parsing below) |
| File | path field from the comment |
| Line | line field from the comment |
| Type | Classify as one of: banned-word, em-dash, pattern-violation, security, logic-bug, doc-mismatch, structural |
| Source or build output | Detect if file is in a build output directory (e.g., training-playbook-builds/) |
Present a table to the user:
| # | Severity | File | Issue | Action |
|---|----------|------|-------|--------|
| 1 | Major | package-age-guard.cjs:69 | NPM regex allows dot at start | FIX |
| 2 | Minor | HANDOFF.md:22 | Obsidian image embed | SKIP |
| 3 | Major | claude.yml:28 | No actor gating | FIX |
These patterns are always SKIP, no confirmation needed:
| Severity | Default Action | |----------|---------------| | Critical | FIX | | Major | FIX | | Minor | FIX (unless matches a skip rule) | | Unspecified | Requires manual triage before marking FIX or SKIP |
--auto flag is set: proceed immediately without askingFor each comment marked FIX, apply the appropriate fix strategy.
CRITICAL: Never edit build output files directly. If the target file is in a build output directory, trace to the source file first.
See the Source File Tracing section below for the full lookup procedure.
Read the file identified in 3a. If no source could be determined, skip the comment and flag it in the report.
Each type has a bounded strategy:
| Type | Strategy | |------|----------| | banned-word | Deterministic find-and-replace using the style guide's banned word list | | em-dash | Replace lazy connectors with period, comma, colon, or semicolon; enforce em-dash count limits per section | | pattern-violation | Rewrite the flagged pattern, preserving meaning | | doc-mismatch | Update the doc to match the code (or vice versa, based on which is authoritative) | | security | Apply the bot's suggested fix if one is provided; otherwise present to user for decision | | logic-bug | Present to user for confirmation before applying any change | | structural | Present to user for confirmation before applying any change |
security and logic-bug and structural types without a clear automated fix, present to the user and wait for confirmationAfter all fixes are applied:
Stage all changed source files:
git add <list of changed source files>
Commit with a descriptive message:
git commit -m "fix: resolve bot review feedback on PR #$PR_NUM"
Push to the PR branch:
git push
Confirm push succeeded before proceeding to Phase 4. If push fails, stop and report the error -- do NOT resolve threads without a successful push.
For each thread that was fixed or skipped (with a skip rule), resolve it using the thread ID captured in Phase 1.
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}
' -f threadId="$THREAD_ID"
After resolving all threads, run an independent count check:
UNRESOLVED=$(gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
unresolvedThreads: reviewThreads(first: 1, filterBy: {resolved: false}) { totalCount }
}
}
}
' -F owner="$OWNER" -F repo="$REPO" -F pr=$PR_NUM \
--jq '.data.repository.pullRequest.unresolvedThreads.totalCount')
echo "Unresolved threads remaining: $UNRESOLVED"
If UNRESOLVED > 0, retry resolution for any remaining threads. If threads persist after two attempts, list the thread IDs in the report.
Print a summary:
Resolved: 18/20 threads
Skipped: 2 (HANDOFF.md image, PAT-in-URL)
Parse severity from bot comment markup using these rules:
| Markup | Severity |
|--------|----------|
| Critical or _Critical_ (with red circle emoji) | Critical |
| Major or _Major_ (with orange circle emoji) | Major |
| Minor or _Minor_ (with yellow circle emoji) | Minor |
| [nitpick] anywhere in comment | Minor |
| Markup | Severity |
|--------|----------|
|  | Critical |
|  -- use R-number frontmatter lookuptraining-playbook/training-pack/ -- direct source, no tracing needed.md files in week1/, week2/, or assets/):id: field (e.g., id: R22)training-pack/assets/R{number}-*.md| Build output path | Source path |
|---|---|
| training-playbook-builds/{client}/.claude/hooks/* | training-pack/base-claude/hooks/* (check for client override at training-pack/client-overlays/{client}/.claude/hooks/* first) |
| training-playbook-builds/{client}/.claude/settings.json | training-pack/base-claude/settings.json (check for client override at training-pack/client-overlays/{client}/.claude/settings.json first) |
| training-playbook-builds/{client}/workflow-templates/* | training-pack/assets/workflow-templates/* (exact filename match) |
| training-playbook/training-pack/* | Direct source -- no tracing needed |
For hook and settings files, always check for a client-specific override first:
training-pack/client-overlays/{client}/.claude/hooks/{filename} -- if exists, edit thistraining-pack/base-claude/hooks/{filename}development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
tools
Verify worktree plugin patches are intact after plugin updates. Checks compound-engineering and superpowers skills for Claude Code launch instructions.
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Reviews the feature you just built and adds missing test coverage. Focuses on behavior that matters — not coverage metrics. Use after completing a feature to identify untested code paths, edge cases, and risk areas.