skills/pr-comment-analysis/SKILL.md
Extract, consolidate, and prioritize all comments from GitHub Pull Requests for systematic code review. Fetches both inline review comments and general PR conversation, then analyzes and organizes them by priority (critical bugs/security, design improvements, style nitpicks). Use when working with PR reviews, consolidating feedback from multiple reviewers, or creating action plans from review comments.
npx skillsauth add auldsyababua/instructor-workflow pr-comment-analysisInstall 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.
This skill provides comprehensive extraction and analysis of GitHub Pull Request comments, enabling systematic handling of code review feedback. It fetches all comments from a PR (both inline code comments and general conversation), consolidates feedback from multiple reviewers, identifies high-consensus issues, and generates prioritized action plans.
Use pr-comment-analysis when:
Navigate to your repository and run the comment grabber:
cd /path/to/your/repo
python /path/to/pr-comment-analysis/scripts/pr-comment-grabber.py owner/repo PR_NUMBER
Example:
cd ~/Desktop/projects/my-app
python ~/skills/pr-comment-analysis/scripts/pr-comment-grabber.py myorg/my-app 42
This creates pr-code-review-comments/pr42-code-review-comments.json in your repo.
To fetch new comments after initial run:
# Same command - it will merge new comments automatically
python ~/skills/pr-comment-analysis/scripts/pr-comment-grabber.py myorg/my-app 42
# Output: "New comments added: 5" (shows incremental update)
Load the JSON output and provide it to an LLM agent with the enhanced analysis prompt from references/analysis-prompt.md.
Critical: The analysis now includes three phases:
For each comment:
.project-context.md for:
For each proposed fix:
mcp__ref__ref_search_documentation and mcp__exasearch__web_search_exa to validate:
Grep to find similar code patterns in the codebaseExample validation:
Reviewer suggests: "Use async/await instead of callbacks"
VALIDATION:
- Context check: .project-context.md shows Node 12 (async/await supported) ✅
- Research: Exa search confirms async/await best practice ✅
- Pattern search: Found 47 other files using callbacks
- Impact: Converting this one function won't break anything, but creates inconsistency
- Warning: ⚠️ Consider converting all callbacks to async/await in separate PR
The agent will generate a validated, context-aware action plan.
Start with Level 1 (Critical) issues:
Each comment in the extracted JSON has this structure:
Review comment (inline):
{
"comment_type": "review",
"id": 123456789,
"user": "reviewer-username",
"body": "Consider using a constant here instead of magic number",
"path": "src/utils/constants.py",
"line": 42,
"diff_hunk": "@@ -40,6 +40,8 @@ ...",
"created_at": "2025-01-15T14:30:00Z",
"html_url": "https://github.com/owner/repo/pull/42#discussion_r123456789"
}
Issue comment (general PR conversation):
{
"comment_type": "issue",
"id": 987654321,
"user": "qodo-merge",
"body": "## PR Analysis Summary\n\nOverall Score: 85/100...",
"created_at": "2025-01-15T12:00:00Z",
"html_url": "https://github.com/owner/repo/pull/42#issuecomment-987654321",
"path": null,
"line": null
}
🚨 CRITICAL: Bot comments (Qodo, CodeRabbit, etc.) with comment_type: "issue" often contain actionable suggestions buried in HTML tables/markdown. DO NOT dismiss these as "informational summaries". Parse the full body text for:
Example Qodo actionable content in "issue" comment:
## PR Code Suggestions ✨
Category Suggestion Impact
General Fix broken relative link in documentation Low
Possible Validate required input to prevent errors Low
# Consolidated Pull Request Review Action Plan
## 1. High Consensus & Critical Issues
### src/auth/validator.py: SQL Injection Vulnerability
**Consensus:** alice-reviewer, bob-security, charlie-lead
**Severity:** CRITICAL - Security issue
**Original Comments:**
- alice-reviewer (Line 156): "This string concatenation could allow SQL injection"
- bob-security (Line 156): "SQL injection risk here - use parameterized queries"
- charlie-lead (Line 158): "Security: parameterize this database query"
**Recommended Fix:**
Replace string concatenation with parameterized query:
```python
# Before
query = f"SELECT * FROM users WHERE id = {user_id}"
# After
query = "SELECT * FROM users WHERE id = %s"
cursor.execute(query, (user_id,))
Priority: HIGH - Design issue affecting maintainability ...
Priority: LOW - Code style ...
## Comment Tracking
### Marking Comments as Addressed
When you resolve a comment:
1. Make the code change
2. Commit with reference to comment: `git commit -m "fix: address SQL injection in validator.py (review comment #123456789)"`
3. Reply to the comment on GitHub linking the commit
4. Re-run the comment grabber to update your local JSON
### Progress Tracking
Create a tracking file in your repo:
```markdown
# PR #42 Review Progress
## Critical Issues (3/5 complete)
- [x] SQL injection in auth/validator.py
- [x] Race condition in services/cache.py
- [x] Memory leak in workers/processor.py
- [ ] Unhandled exception in api/routes.py
- [ ] Missing input validation in forms/user.py
## Design Improvements (2/8 complete)
- [x] Refactor cache invalidation logic
- [x] Extract magic numbers to constants
- [ ] ...
pip install requests
Option 1: Environment variable
export GITHUB_TOKEN=ghp_your_token_here
Option 2: 1Password (if configured)
export GITHUB_TOKEN=$(op item get "GitHub" --fields label="Personal Access Token")
Option 3: Pass via CLI
python pr-comment-grabber.py owner/repo 42 --token ghp_xxxxx
Token Requirements:
repo (for private repos) or public_repo (for public repos)echo $GITHUB_TOKENowner/repo (no spaces, no .git)pip install requests
This is normal - the script merges new comments with existing ones. Check output for:
Loaded 27 existing comments
New comments added: 3
Total after merge: 30
# Create a script to process all open PRs
for pr in 42 43 44 45; do
python pr-comment-grabber.py owner/repo $pr
done
Add to your PR workflow:
# .github/workflows/pr-comments.yml
name: Extract PR Comments
on: pull_request_review
jobs:
extract-comments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extract comments
run: |
python scripts/pr-comment-grabber.py ${{ github.repository }} ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: pr-comments
path: pr-code-review-comments/
Create a wrapper script that fetches and analyzes:
#!/bin/bash
# analyze-pr.sh
PR_NUM=$1
REPO="owner/repo"
# Fetch comments
python pr-comment-grabber.py $REPO $PR_NUM
# Analyze with Claude (requires claude CLI)
claude analyze-reviews --input pr-code-review-comments/pr${PR_NUM}-code-review-comments.json
Edit references/analysis-prompt.md to adjust prioritization criteria:
Example customizations:
Filter JSON by comment type before analysis:
# Only review comments (inline)
jq '[.[] | select(.comment_type == "review")]' pr42-code-review-comments.json > pr42-inline-only.json
# Only comments from specific reviewers
jq '[.[] | select(.user == "security-team-bot")]' pr42-code-review-comments.json > pr42-security-only.json
# Only comments after a certain date
jq '[.[] | select(.created_at > "2025-01-20")]' pr42-code-review-comments.json > pr42-recent.json
This skill uses the following MCP tools for validation and impact analysis:
mcp__ref__ref_search_documentation: Search documentation for validation (ref.tools MCP)mcp__exasearch__web_search_exa: Web search for best practices validation (Exa MCP)Grep: Search codebase for similar patterns and dependenciesEnsure these MCP servers are configured in your Claude Code settings:
{
"mcpServers": {
"ref": {
"command": "npx",
"args": ["-y", "@reftools/mcp-server-ref"]
},
"exasearch": {
"command": "npx",
"args": ["-y", "@exasearch/mcp-server"],
"env": {
"EXA_API_KEY": "your-exa-api-key"
}
}
}
}
This skill works well with:
references/analysis-prompt.md - Full LLM prompt for comment analysisreferences/example-analysis.md - Sample analyzed PR commentsreferences/github-api.md - API details for comment endpointstools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
testing
Three-step Linear update protocol after job completion - update child issue, check parent completion, update parent if all children done
testing
This skill should be used whenever users need help planning trips, creating travel itineraries, managing travel budgets, or seeking destination advice. On first use, collects comprehensive travel preferences including budget level, travel style, interests, and dietary restrictions. Generates detailed travel plans with day-by-day itineraries, budget breakdowns, packing checklists, cultural do's and don'ts, and region-specific schedules. Maintains database of preferences and past trips for personalized recommendations.
tools
Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.