Muse github-pr-review
Handles PR review comments and feedback resolution. Use when user wants to resolve PR comments, handle review feedback, fix review comments, address PR review, check review status, respond to reviewer, or verify PR readiness. Fetches comments via GitHub CLI, classifies by severity, applies fixes with user confirmation, commits with proper format, replies to threads.
git clone https://github.com/myths-labs/muse
T=$(mktemp -d) && git clone --depth=1 https://github.com/myths-labs/muse "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/toolkit/github-pr-review" ~/.claude/skills/myths-labs-muse-github-pr-review && rm -rf "$T"
skills/toolkit/github-pr-review/SKILL.mdGitHub PR Review
Resolves Pull Request review comments with severity-based prioritization, fix application, and thread replies.
Quick Start
# 1. Check project-specific instructions cat .claude/CLAUDE.md 2>/dev/null | head -50 # Review project conventions # 2. Get PR and repo info PR=$(gh pr view --json number -q '.number') REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner') # 3. Fetch and list comments by severity gh api repos/$REPO/pulls/$PR/comments | python3 -c " import json, sys comments = [c for c in json.load(sys.stdin) if not c.get('in_reply_to_id')] def sev(b): return 'CRITICAL' if 'critical' in b.lower() else 'HIGH' if 'high' in b.lower() else 'MEDIUM' if 'medium' in b.lower() else 'LOW' for s in ['CRITICAL','HIGH','MEDIUM','LOW']: cs = [c for c in comments if sev(c['body'])==s] if cs: print(f'{s} ({len(cs)}): ' + ', '.join(f\"#{c['id]}\" for c in cs)) " # 4. For each comment: read -> analyze -> fix -> verify -> commit -> reply # 5. Run tests: make test (or project-specific command) # 6. Push when all fixes verified
Pre-Review Checklist
Before processing comments, verify:
- Project conventions: Read
,.claude/CLAUDE.md
, or similar.kiro/steering/ - Commit format: Check
for project stylegit log --oneline -5 - Test command: Identify test runner (
,make test
,pytest
)npm test - Branch status:
to ensure clean working treegit status
Core Workflow
1. Fetch PR Comments
PR=$(gh pr view --json number -q '.number') REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner') gh api repos/$REPO/pulls/$PR/comments > /tmp/pr_comments.json
2. Classify by Severity
Process in order: CRITICAL > HIGH > MEDIUM > LOW
| Severity | Indicators | Action |
|---|---|---|
| CRITICAL | , "security", "vulnerability" | Must fix |
| HIGH | , "High Severity" | Should fix |
| MEDIUM | , "Medium Severity" | Recommended |
| LOW | , "style", "nit" | Optional |
3. Process Each Comment
For each comment:
a. Show context
Comment #123456789 (HIGH) - app/auth.py:45 "The validation logic should use constant-time comparison..."
b. Read affected code and propose fix
c. Confirm with user before applying
d. Apply fix if approved
e. Verify fix addresses ALL issues in the comment
4. Commit Changes
Use git-commit skill format for review fixes:
git add <files> git commit -m "fix(scope): address review comment #ID Brief explanation of what was wrong and how it's fixed. Addresses review comment #123456789."
Review fix commit rules (see git-commit skill for full details):
- First line:
(max 50 chars)type(scope): subject - Types:
,fix
,refactor
,security
,test
,styleperf - Reference the comment ID in body
- Explain what was wrong and how it's fixed
5. Reply to Thread
COMMIT=$(git rev-parse --short HEAD) gh api repos/$REPO/pulls/$PR/comments \ --input - <<< '{"body": "Fixed in '"$COMMIT"'. Replaced set lookup with hmac.compare_digest.", "in_reply_to": 123456789}'
Standard Reply Templates:
| Situation | Template |
|---|---|
| Fixed | |
| Won't fix | |
| By design | |
| Deferred | |
| Acknowledged | |
No emojis. Keep it minimal and professional.
6. Run Tests
make test # or project-specific command
All tests must pass before pushing.
7. Push
git push
8. Submit Review (Optional)
After addressing all comments, formally submit a review:
# Approve the PR (use after all comments resolved) gh pr review $PR --approve --body "All review comments addressed. Ready to merge." # Or request changes if issues remain gh pr review $PR --request-changes --body "Addressed X comments, Y issues remain." # Or just comment without approval decision gh pr review $PR --comment --body "Partial progress: fixed A and B, working on C."
When to use each:
: All comments addressed, PR is ready--approve
: Critical issues remain unresolved--request-changes
: Progress update, no approval decision yet--comment
Batch Commit Strategy
Organize commits by impact when addressing multiple comments:
| Change Type | Strategy |
|---|---|
| Functional (CRITICAL/HIGH) | Separate commit per fix |
| Cosmetic (MEDIUM/LOW) | Single batch commit |
Workflow:
- Fix CRITICAL/HIGH → separate commits each
- Collect all cosmetic fixes
- Apply cosmetics → single
commitstyle: - Run tests once
- Push all together
Pre-Merge Checklist
Before closing/merging PR, verify (or use github-pr-merge skill for automated validation):
- All CRITICAL and HIGH comments addressed
- All MEDIUM comments addressed or justified skip
- Replies posted to all resolved threads
- Tests passing (
or equivalent)make test - Linting passing (
or equivalent)make lint - CI checks green (
)gh pr checks - No unresolved conversations
TIP: After resolving all comments, use the
github-pr-merge skill to execute the merge with full pre-merge validation.
Reply to Threads API
Important: Use
--input - with JSON for in_reply_to:
# Correct syntax gh api repos/$REPO/pulls/$PR/comments \ --input - <<< '{"body": "Fixed in abc123. Brief explanation.", "in_reply_to": 123456789}'
Do NOT use:
-f in_reply_to=... (doesn't work)
Avoiding Review Loops
When bots review every push:
- Batch fixes: Accumulate all fixes, push once
- Draft PR: Convert to draft during fixes
- Commit keywords: Some bots respect
or[skip ci][skip review]
Severity Detection
Gemini badges:
-> CRITICALcritical.svg
-> HIGHhigh-priority.svg
-> MEDIUMmedium-priority.svg
-> LOWlow-priority.svg
Cursor comments:
-> HIGH<!-- **High Severity** -->
-> MEDIUM<!-- **Medium Severity** -->
Fallback keywords: "security", "vulnerability", "injection" -> CRITICAL
Important Rules
- ALWAYS read project conventions (CLAUDE.md, etc.) before starting
- ALWAYS confirm before modifying files
- ALWAYS verify ALL issues in multi-issue comments are fixed
- ALWAYS run tests before pushing
- ALWAYS reply to resolved threads using standard templates
- ALWAYS submit formal review (
) after addressing all commentsgh pr review - NEVER use emojis in commit messages or thread replies
- NEVER skip HIGH/CRITICAL comments without explicit user approval
- Functional fixes -> separate commits (one per fix)
- Cosmetic fixes -> batch into single
commitstyle:
Related Skills
- git-commit - Commit message format and conventions (use for review fix commits)
- github-pr-merge - Execute merge after review is complete (use after fixing all comments)