refactor(skills): rename autofix to review-pr with expanded scope - #231
Conversation
Replace CodeRabbit-only autofix skill with generic review-pr skill that: - Collects feedback from all GitHub PR surfaces (threads, reviews, comments, issue comments) - Handles bot and human reviewers, nitpicks, internal notes - Paginates all API endpoints (GraphQL cursors + REST Link headers) - Fetches full thread replies (first:100) not just root comments - Asks commit strategy preference (single vs per-fix) - Replies to review threads/comments after push - Posts PR summary comment after push
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughSkills Systemrefactor(skills): Rename
Cross-Package ImpactThis skill refactor affects any agents or workflows in WalkthroughRemoves the Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Agent as review-pr Agent
participant Git as Local Git
participant GitHub as GitHub API
User->>Agent: Trigger review-pr
Agent->>Git: Check git status (uncommitted/unpushed)
Agent->>GitHub: Locate open PR for branch
Agent->>GitHub: Fetch unresolved review threads
Agent->>GitHub: Fetch PR reviews and review comments
Agent->>GitHub: Fetch PR issue comments
Agent->>Agent: Normalize, dedupe & prioritize feedback
Agent->>User: Present findings & request mode/commit prefs
alt Manual per-item
loop For each item
User->>Agent: Approve/Modify/Skip
Agent->>Git: Apply change & create commit (per prefs)
end
else Auto-fix
Agent->>Agent: Apply automated fixes
Agent->>Git: Create consolidated commit
end
Agent->>Git: Optional build/lint/test validation
Agent->>Git: Push commits
Agent->>GitHub: Post consolidated PR summary comment
Agent->>GitHub: Reply to/resolve review threads and post follow-ups
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR renames the existing autofix skill to a broader review-pr skill, expanding the workflow to collect and act on PR feedback across multiple GitHub comment/review surfaces with pagination and post-fix follow-ups.
Changes:
- Replace
.agents/skills/autofix/with new.agents/skills/review-pr/documentation defining the expanded workflow. - Add GitHub CLI/GraphQL/REST command guidance for collecting threads, reviews, and comments (including pagination).
- Remove the
autofixentry fromskills-lock.json.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| skills-lock.json | Removes the autofix skill lock entry. |
| .agents/skills/review-pr/github.md | Adds GitHub CLI/GraphQL/REST command reference for the new skill workflow. |
| .agents/skills/review-pr/SKILL.md | Defines the new review-pr skill behavior, triggers, and end-to-end workflow. |
| .agents/skills/autofix/github.md | Deletes the old autofix GitHub command reference. |
| .agents/skills/autofix/SKILL.md | Deletes the old autofix skill definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Subsequent pages: append after:$endCursor from previous response | ||
| gh api graphql \ | ||
| -F owner='{owner}' \ | ||
| -F repo='{repo}' \ | ||
| -F pr=<pr-number> \ | ||
| -f query='query($owner:String!, $repo:String!, $pr:Int!) { | ||
| repository(owner:$owner, name:$repo) { | ||
| pullRequest(number:$pr) { | ||
| reviewThreads(first:100 after:"<endCursor>") { | ||
| pageInfo { hasNextPage endCursor } |
There was a problem hiding this comment.
The pagination example for subsequent GraphQL pages hard-codes after:"<endCursor>" inside the query string while the comment says to "append after:$endCursor". This is error-prone with shell quoting and can’t be automated cleanly; prefer a $cursor GraphQL variable (nullable) passed via -F cursor=... and use reviewThreads(first:100, after:$cursor).
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
.agents/skills/review-pr/SKILL.md (1)
78-90: Add API rate-limit/backoff guidance for scalabilityGiven multi-surface full pagination + post-push replies, include a small retry/backoff + secondary-rate-limit handling note to keep runs stable on large PRs.
Also applies to: 243-271
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/skills/review-pr/SKILL.md around lines 78 - 90, Update the "Step 3: Collect All Open Review Feedback" section to include explicit API rate-limit and backoff guidance: add a short paragraph after the pagination guidance recommending exponential backoff with jitter, limited retries, handling secondary rate limits (HTTP 429 with Retry-After), and honoring GitHub's rate-limit headers for all four sources (pullRequest.reviewThreads, gh api repos/{owner}/{repo}/pulls/{pr}/reviews, gh api repos/{owner}/{repo}/pulls/{pr}/comments, gh api repos/{owner}/{repo}/issues/{pr}/comments); mention applying backoff across the full pagination loop and suggest a configurable max-retries and sleep strategy to keep runs stable on large PRs..agents/skills/review-pr/github.md (1)
57-66: Use a query variable for the cursor parameterLine 65 embeds
"<endCursor>"directly in the query, which deviates from GitHub's official pagination best practices. Dynamic cursor values should be passed as query variables to avoid potential parsing issues and enable efficient pagination loops.Proposed doc fix
-gh api graphql \ - -F owner='{owner}' \ - -F repo='{repo}' \ - -F pr=<pr-number> \ - -f query='query($owner:String!, $repo:String!, $pr:Int!) { +gh api graphql \ + -F owner='{owner}' \ + -F repo='{repo}' \ + -F pr=<pr-number> \ + -F cursor='<endCursor>' \ + -f query='query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) { repository(owner:$owner, name:$repo) { pullRequest(number:$pr) { - reviewThreads(first:100 after:"<endCursor>") { + reviewThreads(first:100, after:$cursor) { pageInfo { hasNextPage endCursor }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/skills/review-pr/github.md around lines 57 - 66, The GraphQL query embeds the cursor literal "<endCursor>" instead of using a variable; update the query to accept a cursor variable and pass it via gh api flags: add a cursor variable to the signature (e.g. query($owner:String!, $repo:String!, $pr:Int!, $cursor:String)) replace reviewThreads(first:100 after:"<endCursor>") with reviewThreads(first:100, after:$cursor) and when invoking gh api include -F cursor='{endCursor}' (or set cursor to null/empty for the first page) so pagination uses a proper $cursor variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/skills/review-pr/github.md:
- Around line 40-49: The GraphQL query currently selects databaseId integers but
the mutations (operating on review thread/comment nodes) require global Node
IDs; update the query used where reviewThreads is fetched (the reviewThreads {
nodes { ... } } selection) to include id on each reviewThreads.nodes and also
add id inside the nested comments.nodes selection so mutations that use Node ID
(ID!) can execute (i.e., add id to the selections alongside databaseId/other
fields in the reviewThreads and comments nodes).
In @.agents/skills/review-pr/SKILL.md:
- Around line 120-137: The documentation currently references generic "links or
IDs" in Step 4 and requires "resolvable identifiers" in Step 12; update the
SKILL.md text (referencing Step 4 and Step 12) to explicitly list and persist
the exact identifier fields to store per source: reviewThread.id,
review-comment.id, issue-comment.id, and review.id (and ensure the instructions
note which field applies to which source), and update the deduplication note to
rely on these concrete IDs so reply/resolve workflows can reliably locate and
resolve comments.
- Around line 144-152: The fenced code block that begins with ``` immediately
before the table titled "PR Review Items for PR `#123`: [PR Title]" needs a
language tag to satisfy markdown linting; change the opening fence from ``` to
```text (or another appropriate language) and keep the closing ``` unchanged so
the block becomes ```text ... ```; update the SKILL.md example block
accordingly.
---
Nitpick comments:
In @.agents/skills/review-pr/github.md:
- Around line 57-66: The GraphQL query embeds the cursor literal "<endCursor>"
instead of using a variable; update the query to accept a cursor variable and
pass it via gh api flags: add a cursor variable to the signature (e.g.
query($owner:String!, $repo:String!, $pr:Int!, $cursor:String)) replace
reviewThreads(first:100 after:"<endCursor>") with reviewThreads(first:100,
after:$cursor) and when invoking gh api include -F cursor='{endCursor}' (or set
cursor to null/empty for the first page) so pagination uses a proper $cursor
variable.
In @.agents/skills/review-pr/SKILL.md:
- Around line 78-90: Update the "Step 3: Collect All Open Review Feedback"
section to include explicit API rate-limit and backoff guidance: add a short
paragraph after the pagination guidance recommending exponential backoff with
jitter, limited retries, handling secondary rate limits (HTTP 429 with
Retry-After), and honoring GitHub's rate-limit headers for all four sources
(pullRequest.reviewThreads, gh api repos/{owner}/{repo}/pulls/{pr}/reviews, gh
api repos/{owner}/{repo}/pulls/{pr}/comments, gh api
repos/{owner}/{repo}/issues/{pr}/comments); mention applying backoff across the
full pagination loop and suggest a configurable max-retries and sleep strategy
to keep runs stable on large PRs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 844bbafb-cb48-46ac-95bb-fbc83af1629b
📒 Files selected for processing (5)
.agents/skills/autofix/SKILL.md.agents/skills/autofix/github.md.agents/skills/review-pr/SKILL.md.agents/skills/review-pr/github.mdskills-lock.json
💤 Files with no reviewable changes (3)
- .agents/skills/autofix/github.md
- skills-lock.json
- .agents/skills/autofix/SKILL.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Upload results
- GitHub Check: build
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-10T13:32:53.546Z
Learnt from: CR
Repo: auravibes-apps/auravibes PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T13:32:53.546Z
Learning: Applies to **/*.md : Document agent responsibilities and interactions in markdown files
Applied to files:
.agents/skills/review-pr/github.md
🪛 LanguageTool
.agents/skills/review-pr/github.md
[uncategorized] ~9-~9: The official name of this software platform is spelled with a capital “H”.
Context: ...* - Install: brew install gh or cli.github.com - Authent...
(GITHUB)
.agents/skills/review-pr/SKILL.md
[uncategorized] ~76-~76: The official name of this software platform is spelled with a capital “H”.
Context: ... to create one. If yes, create PR (see [github.md § 9](./github.md#9-create-pr-if-need...
(GITHUB)
[uncategorized] ~76-~76: The official name of this software platform is spelled with a capital “H”.
Context: ...e. If yes, create PR (see github.md § 9), then inform...
(GITHUB)
[uncategorized] ~82-~82: The official name of this software platform is spelled with a capital “H”.
Context: ...ormalizing — never stop at page 1. See [github.md § 2–5](./github.md#2-fetch-unresolve...
(GITHUB)
[uncategorized] ~82-~82: The official name of this software platform is spelled with a capital “H”.
Context: ...ver stop at page 1. See github.md § 2–5 f...
(GITHUB)
[uncategorized] ~271-~271: The official name of this software platform is spelled with a capital “H”.
Context: ...ow-ups were posted where possible See [github.md § 6](./github.md#6-post-summary-comm...
(GITHUB)
[uncategorized] ~271-~271: The official name of this software platform is spelled with a capital “H”.
Context: ...osted where possible See github.md § 6 for template...
(GITHUB)
🪛 markdownlint-cli2 (0.22.0)
.agents/skills/review-pr/SKILL.md
[warning] 144-144: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
GraphQL reviewThreads query was missing: - thread id: required for addPullRequestReviewThreadReply and resolveReviewThread - path on thread nodes: file location for review items - path + position on comment nodes: line-level location data
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.agents/skills/review-pr/github.md (1)
66-70: Use GraphQL cursor variables instead of placeholder strings for safer, automatable pagination.Line 69's
after:"<endCursor>"is brittle and doesn't reflect real usage. Use$after: Stringwith the-F after='<cursor>'flag to bind variables directly—this is GitHub's recommended pattern and enables robust automation of pagination examples.Suggested refactor
--f query='query($owner:String!, $repo:String!, $pr:Int!) { +-f query='query($owner:String!, $repo:String!, $pr:Int!, $after:String) { repository(owner:$owner, name:$repo) { pullRequest(number:$pr) { - reviewThreads(first:100 after:"<endCursor>") { + reviewThreads(first:100, after:$after) {+ -F after='<endCursor>' \🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/skills/review-pr/github.md around lines 66 - 70, The GraphQL query uses a brittle placeholder after:"<endCursor>"—update the operation definition query($owner:String!, $repo:String!, $pr:Int!) to accept an optional cursor variable (e.g., add $after:String) and change reviewThreads(first:100 after:"<endCursor>") to reviewThreads(first:100 after:$after); in docs or examples show binding the variable with the CLI flag (-F after='<cursor>') so callers can pass the endCursor value programmatically for safe pagination.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/skills/review-pr/github.md:
- Around line 101-102: The REST API command strings containing an unquoted
ampersand (e.g., gh api
repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100 and the other
occurrences with ?page=...&per_page=100) should be wrapped in quotes to prevent
the shell from treating & as a background operator; update all instances in
.agents/skills/review-pr/github.md to quote the full URL argument (single or
double quotes) so the entire query string remains intact when executed.
---
Nitpick comments:
In @.agents/skills/review-pr/github.md:
- Around line 66-70: The GraphQL query uses a brittle placeholder
after:"<endCursor>"—update the operation definition query($owner:String!,
$repo:String!, $pr:Int!) to accept an optional cursor variable (e.g., add
$after:String) and change reviewThreads(first:100 after:"<endCursor>") to
reviewThreads(first:100 after:$after); in docs or examples show binding the
variable with the CLI flag (-F after='<cursor>') so callers can pass the
endCursor value programmatically for safe pagination.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b2f997c0-8995-49e5-be3c-71c6fbf1861e
📒 Files selected for processing (1)
.agents/skills/review-pr/github.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-10T13:32:53.546Z
Learnt from: CR
Repo: auravibes-apps/auravibes PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T13:32:53.546Z
Learning: Applies to **/*.md : Document agent responsibilities and interactions in markdown files
Applied to files:
.agents/skills/review-pr/github.md
🪛 LanguageTool
.agents/skills/review-pr/github.md
[uncategorized] ~9-~9: The official name of this software platform is spelled with a capital “H”.
Context: ...* - Install: brew install gh or cli.github.com - Authent...
(GITHUB)
🔇 Additional comments (1)
.agents/skills/review-pr/github.md (1)
25-30: Strong workflow coverage and pagination guidance.Nice expansion here: multi-surface feedback collection plus explicit pagination and thread metadata makes the skill behavior much more predictable.
Also applies to: 40-53, 69-82, 104-109, 125-127, 144-147
| gh api repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100 | ||
| ``` |
There was a problem hiding this comment.
Quote REST paths containing & to prevent shell splitting.
At Line 101, Line 122, and Line 141, & is currently unquoted, so shell users can accidentally background the command and drop per_page=100.
Proposed fix
-gh api repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100
+gh api 'repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100'-gh api repos/{owner}/{repo}/pulls/<pr-number>/comments?page=1&per_page=100
+gh api 'repos/{owner}/{repo}/pulls/<pr-number>/comments?page=1&per_page=100'-gh api repos/{owner}/{repo}/issues/<pr-number>/comments?page=1&per_page=100
+gh api 'repos/{owner}/{repo}/issues/<pr-number>/comments?page=1&per_page=100'Also applies to: 122-123, 141-142
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/skills/review-pr/github.md around lines 101 - 102, The REST API
command strings containing an unquoted ampersand (e.g., gh api
repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100 and the other
occurrences with ?page=...&per_page=100) should be wrapped in quotes to prevent
the shell from treating & as a background operator; update all instances in
.agents/skills/review-pr/github.md to quote the full URL argument (single or
double quotes) so the entire query string remains intact when executed.
There was a problem hiding this comment.
Valid catch — the unquoted & in REST URLs would break in bare shells. Will fix in a follow-up commit by quoting all REST paths containing query parameters.
There was a problem hiding this comment.
@davidlondono — sounds good! To keep it complete, all three REST paths that need quoting are:
-gh api repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100
+gh api 'repos/{owner}/{repo}/pulls/<pr-number>/reviews?page=1&per_page=100'
-gh api repos/{owner}/{repo}/pulls/<pr-number>/comments?page=1&per_page=100
+gh api 'repos/{owner}/{repo}/pulls/<pr-number>/comments?page=1&per_page=100'
-gh api repos/{owner}/{repo}/issues/<pr-number>/comments?page=1&per_page=100
+gh api 'repos/{owner}/{repo}/issues/<pr-number>/comments?page=1&per_page=100'Single quotes are preferable here since these strings contain {owner}, {repo}, and <pr-number> as literal placeholders — no variable expansion needed at this level.
🧠 Learnings used
Learnt from: CR
Repo: auravibes-apps/auravibes PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T13:32:53.546Z
Learning: Applies to **/*.md : Document agent responsibilities and interactions in markdown files
- Add id field to comment nodes in GraphQL query (needed for mutations) - Fix reaction endpoint: /issues/comments/ -> /pulls/comments/ for PR review comments - Specify exact ID fields per source in SKILL.md Step 4 - Add language tag to fenced code block in SKILL.md
- Add actual GraphQL mutation commands for addPullRequestReviewThreadReply and resolveReviewThread - Add REST command for replying to standalone review comments (in_reply_to) - Add REST command for replying to issue/PR comments - Expand SKILL.md Step 12 with concrete per-item reply loop per source type - Fix section cross-references after new sections were added
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
autofixskill toreview-prwith broader PR feedback handlingfirst:100) instead of only root commentsChanges
.agents/skills/autofix/(SKILL.md, github.md).agents/skills/review-pr/(SKILL.md, github.md)skills-lock.jsonremovedautofixentry (local override, no lock needed)Test plan
review-prcoderabbit autofix,cr fix, etc.)review pr,fix pr review,resolve pr comments, etc.)