$npx -y skills add dsifry/metaswarm --skill handling-pr-commentsAddress PR review feedback systematically — fetch inline comments, review bodies, handle outside-diff-range comments, resolve threads with proper attribution
| 1 | # handling-pr-comments |
| 2 | |
| 3 | Use when addressing PR review feedback, after receiving review comments from CodeRabbit, Cursor, or human reviewers - ensures systematic responses to each comment thread with proper attribution and thread resolution. |
| 4 | |
| 5 | ## When to Activate |
| 6 | |
| 7 | Activate this skill when ANY of these conditions are true: |
| 8 | |
| 9 | - User asks to "address PR comments" or "handle review feedback" |
| 10 | - User mentions CodeRabbit, Cursor bot, or reviewer comments |
| 11 | - User is working on fixes requested in a PR review |
| 12 | - User asks to "check PR comments" or "respond to reviewers" |
| 13 | - After making fixes to address review feedback |
| 14 | |
| 15 | ## CRITICAL: The Complete Workflow |
| 16 | |
| 17 | **Most developers forget steps 4-6. This skill ensures they happen.** |
| 18 | |
| 19 | ### Phase 1: Discover and Filter Comments |
| 20 | |
| 21 | Run the filtering script to identify actionable comments: |
| 22 | |
| 23 | ```bash |
| 24 | # Filter actionable vs non-actionable comments |
| 25 | bin/pr-comments-filter.sh <PR_NUMBER> |
| 26 | ``` |
| 27 | |
| 28 | This script: |
| 29 | |
| 30 | - Filters out non-actionable comments (confirmations, acknowledgments, fingerprinting) |
| 31 | - Categorizes actionable comments by priority (Critical → Low) |
| 32 | - Shows comment IDs and details for processing |
| 33 | |
| 34 | ### Phase 2: Triage Actionable Comments |
| 35 | |
| 36 | The filter script categorizes by priority: |
| 37 | |
| 38 | | Priority | Marker | Action | |
| 39 | | --------------- | -------------------------------------------------------- | ---------------- | |
| 40 | | CRITICAL | `_⚠️ Potential issue_ \| _🔴 Critical_` | Fix immediately | |
| 41 | | HIGH | `_⚠️ Potential issue_ \| _🟠 Major_` | Fix before merge | |
| 42 | | MEDIUM | `_🟡 Minor_` or `_🛠️ Refactor suggestion_ \| _🟠 Major_` | Should fix | |
| 43 | | LOW | `_🔵 Trivial_` / `_🧹 Nitpick_` | Fix if quick | |
| 44 | | HUMAN | Non-bot comments | Always process | |
| 45 | |
| 46 | For each actionable comment, further categorize as: |
| 47 | |
| 48 | 1. **Bug/Issue** - Must fix |
| 49 | 2. **Enhancement** - Should fix |
| 50 | 3. **Nitpick** - Nice to fix |
| 51 | 4. **Question** - Needs clarification |
| 52 | 5. **Intentional** - Decline with explanation |
| 53 | 6. **Out-of-Scope** - See Phase 2b |
| 54 | |
| 55 | ### Phase 2b: Extract "Outside Diff Range" Comments from Review Bodies (CRITICAL) |
| 56 | |
| 57 | **COMMONLY MISSED**: CodeRabbit posts "Outside diff range" comments in the **review body**, not as inline threads. These are actionable feedback that MUST be addressed. |
| 58 | |
| 59 | ```bash |
| 60 | # Extract Outside diff range comments from review bodies |
| 61 | PR_NUMBER=<number> |
| 62 | OWNER=$(gh repo view --json owner -q .owner.login) |
| 63 | REPO_NAME=$(gh repo view --json name -q .name) |
| 64 | |
| 65 | echo "=== OUTSIDE DIFF RANGE COMMENTS ===" |
| 66 | gh api "repos/$OWNER/$REPO_NAME/pulls/$PR_NUMBER/reviews" --paginate | \ |
| 67 | jq -r '.[] | select(.body | test("Outside diff range"; "i")) | |
| 68 | "Review ID: \(.id)\n\(.body)\n---"' |
| 69 | ``` |
| 70 | |
| 71 | **These comments are NOT in threads** - they cannot be replied to inline. You must: |
| 72 | |
| 73 | 1. Parse the file paths and line numbers from the review body |
| 74 | 2. Address the feedback in your code |
| 75 | 3. Commit and push |
| 76 | 4. Leave a general PR comment acknowledging you addressed them |
| 77 | |
| 78 | ### Phase 2c: Handle Other Out-of-Scope Comments |
| 79 | |
| 80 | Run the out-of-scope detection script: |
| 81 | |
| 82 | ```bash |
| 83 | # Detect out-of-scope comments |
| 84 | bin/pr-comments-out-of-scope.sh <PR_NUMBER> |
| 85 | ``` |
| 86 | |
| 87 | This script detects comments that: |
| 88 | |
| 89 | - Reference lines NOT in the PR diff |
| 90 | - Are marked "outdated" by GitHub (GraphQL `isOutdated` flag) |
| 91 | - Are general PR discussion comments |
| 92 | |
| 93 | **IMPORTANT**: Treat out-of-scope comments as **IN SCOPE** by default. |
| 94 | |
| 95 | #### Evaluation Process |
| 96 | |
| 97 | Use **ultrathink** to evaluate each out-of-scope comment: |
| 98 | |
| 99 | ```text |
| 100 | ultrathink: Analyze this out-of-scope review comment: |
| 101 | - What is the reviewer asking for? |
| 102 | - How complex is this change? (lines of code, files affected) |
| 103 | - Does it require refactoring other systems? |
| 104 | - Can I complete this in under 30 minutes? |
| 105 | - Are there any risks or dependencies? |
| 106 | |
| 107 | Recommend: FIX_NOW or CREATE_ISSUE |
| 108 | ``` |
| 109 | |
| 110 | #### Decision Matrix |
| 111 | |
| 112 | | Criteria | Action | |
| 113 | | --------------------------------------------- | ----------------------------------------- | |
| 114 | | Simple fix (< 30 min, < 3 files, no refactor) | **FIX_NOW** - Make the change immediately | |
| 115 | | Medium complexity (unclear scope) | **ASK_USER** - Present options | |
| 116 | | Major refactor (multiple systems, risky) | **CREATE_ISSUE** - Document for follow-up | |
| 117 | |
| 118 | #### For FIX_NOW |
| 119 | |
| 120 | 1. Make the fix |
| 121 | 2. Commit with descriptive message |
| 122 | 3. Push to the PR branch |
| 123 | 4. Reply: "Fixed in commit <hash>. This was outside the original PR scope but straightforward to address." |
| 124 | 5. Resolve the thread |
| 125 | |
| 126 | #### For CREATE_ISSUE |
| 127 | |
| 128 | 1. Create GitHub issue with context |
| 129 | 2. Reply: "Created issue #<number> to track this." |
| 130 | 3. Resolve the thread |
| 131 | |
| 132 | ### Phase 3: Ma |