pr-comment-resolver
Automate PR comment review, fix, and resolution workflow with atomic commits. Use when the user asks to "handle PR comments", "resolve PR review comments", "fix PR feedback", "process review comments", "address PR suggestions", "deal with review comments", or provides a GitHub PR URL with review comments. Also trigger when the user mentions unresolved PR threads or wants to batch-process reviewer feedback. Boundary: not for writing PR reviews (use code-review) or PR checklists (use checklist-runner).
What this skill does
# PR Comment Resolver
Automate the process of handling GitHub PR review comments: evaluate each comment, fix issues with atomic commits, and reply with detailed resolution information.
## Core Principles
0. **Critical Thinking Before Action** - Never blindly execute:
- Comments may contain incorrect technical claims
- Suggestions may violate repo guidelines (CLAUDE.md, contributing docs)
- Always verify facts (read the code, check docs, run tests) before deciding
- When signals conflict, trade-offs exist, or interpretation is ambiguous: surface the conflict with options and a recommendation, then wait for user input
- "Reviewer said so" is not sufficient justification — evidence is
1. **Verify Before Acting** - Check the technical validity of each suggestion against the codebase before implementing; reviewers can be wrong
2. **Commit by Topic, Not by Comment** - Group commits by logical change, not by comment count; one commit can address multiple related comments
3. **Atomic Commits** - Each commit should be a single logical fix; different concerns require separate commits
4. **Human Collaboration** - Ask the user when uncertain about a fix, interpretation, or when you disagree with a comment
5. **Detailed Replies** - Include fix explanation, commit hash, and link in every resolution
6. **Reply to Thread** - Always reply directly to each review thread, NOT as a general PR comment at the bottom
## Quick Start
### Interactive Mode (Default)
```
User: Handle the comments on this PR: https://github.com/owner/repo/pull/123
```
Workflow:
1. Fetch all unresolved review comments
2. Present each comment for review
3. For each comment, determine whether to fix or explain why no fix is needed
4. Execute fixes with atomic commits
5. Reply and resolve each comment
### Auto Mode
```
User: Auto-resolve all comments on https://github.com/owner/repo/pull/123
```
Process all comments automatically, only pausing for truly ambiguous cases.
## Workflow Overview
### Phase 1: Fetch Comments
Use `gh api graphql` to retrieve unresolved review comments, including `isOutdated` so stale diff anchors are visible:
```bash
gh api graphql -f query='
{
repository(owner: "<OWNER>", name: "<REPO>") {
pullRequest(number: <PR_NUMBER>) {
reviewThreads(first: 100) {
nodes {
id
isResolved
isOutdated
path
line
comments(first: 10) {
nodes {
body
author {
__typename
login
}
}
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)'
```
Extract key information:
- Comment ID and thread ID
- Resolution and outdated state
- File path and line number
- Comment body (the feedback)
- Author information (`login`, `__typename`)
Do not skip outdated threads. An outdated unresolved thread still needs a decision; `isOutdated` only means the line anchor may no longer match the current diff. Re-read the current file, verify whether a newer commit already addressed the feedback, then reply and apply the normal bot/human resolution policy.
### Phase 1.5: Classify Author (Bot vs Human)
Determine if each comment author is a bot. **Bot threads are always auto-resolved after handling; human threads are never auto-resolved.**
Use a tiered approach — stop at the first definitive answer. Once an author has been classified in this session, reuse that conclusion for later comments from the same author (conversation context serves as the cache; no separate lookup structure needed).
#### Tier 1 — GraphQL `__typename`
The `author.__typename` field (fetched in Phase 1) is the primary signal:
| `__typename` | Classification |
|--------------|----------------|
| `Bot` | **Bot** — GitHub App; reliable, no further check |
| `User` | Ambiguous — proceed to Tier 2 (could be human OR a user-token-driven service account) |
| `Organization` | Rare; skip to Tier 3 |
#### Tier 2 — Profile-based judgment (when `__typename == "User"`)
Fetch the user profile:
```bash
gh api users/<login> --jq '{bio, name, blog, company, public_repos, followers}'
```
Evaluate the returned fields and decide:
| Signal | Strong bot indicator |
|--------|---------------------|
| `bio` | Self-identifies as bot/service/automation/CI (e.g., "Bot managed by...", "I run your tests", "Automated checks for...") |
| `name`, `blog`, `company` | Points to a tool/service (e.g., blog links to bot documentation) |
| `public_repos` + `followers` | Both very low (typical service account profile) |
Examples of user-token-driven bots that pass Tier 2 clearly: `rustbot` (bio self-declares), `k8s-ci-robot` (bio describes automation role).
Reach one of three outcomes:
- **Clearly a bot** → classify as Bot
- **Clearly a human** → classify as Human
- **Ambiguous** (e.g., empty bio, few signals) → proceed to Tier 2b
#### Tier 2b — Activity fallback (optional, when Tier 2 inconclusive)
When profile signals are thin, fetch recent public events:
```bash
gh api users/<login>/events/public
```
A monolithic distribution (e.g., almost entirely `IssueCommentEvent` or `PullRequestReviewCommentEvent`) strongly suggests a bot. A diverse distribution (pushes, PRs, reviews, stars, forks) suggests a human.
This tier is triggered by the agent's judgment, not a mechanical rule — only fetch when it would meaningfully change the conclusion.
#### Tier 3 — Ask user
When all prior tiers leave doubt, or when `__typename == "Organization"`:
> "Should I treat @{author} as a bot? Profile: bio=<...>, repos=<n>, followers=<n>. If yes, the thread will be auto-resolved after handling."
#### Conflict handling
If any tiers disagree (e.g., `__typename == "User"` but profile looks strongly bot-like, or vice versa), do **not** silently pick one — surface the conflict to the user per Core Principle #0.
### Phase 2: Evaluate Each Comment
For each unresolved comment, **critically assess whether the suggestion is correct** before determining action:
| Decision | Criteria |
|----------|----------|
| **Needs Fix** | Valid point: actual bug, code issue, style violation, missing feature |
| **No Fix Needed** | Already addressed, misunderstanding, design choice, out of scope |
| **Disagree** | Reviewer's suggestion is incorrect, would introduce bugs, violates architecture, or is technically flawed |
| **Uncertain** | Ambiguous request, multiple interpretations, needs clarification |
> **⚠️ Important:** Do not blindly accept all comments. Reviewers can make mistakes. Always verify the technical validity of each suggestion before implementing.
#### Comment Validity Checklist
Before choosing an action, run each suggestion through these checks:
- **Technical claim holds** — Read the referenced code (and related files); don't rely on memory. Does the claim match current behavior?
- **Aligns with repo conventions** — Check CLAUDE.md, contributing docs, and nearby code. A reviewer may not know local guidelines.
- **Compatible with existing architecture** — Does applying the fix fit current patterns, or would it introduce an inconsistency?
- **No simpler alternative the reviewer missed** — Could there be a cleaner solution that still satisfies the concern?
If any check fails or is uncertain, surface the gap to the user with:
- The specific conflict or uncertainty
- 2+ options with trade-offs
- A recommendation with rationale
This applies regardless of whether the author is a bot or a human — bots can also produce incorrect or repo-inappropriate suggestions.
### Phase 3: Execute Action
#### If Fix Needed
1. Read the relevant file(s)
2. Implement the fix
3. Create an atomic commit with descriptive message
4. Push to the PR branch
5. Reply with fix details
6. **If author is a bot**: Resolve the thread | **If human**: Leave unresolved
#### If No Fix Needed
1. Compose explanation of why no change is required
2. RepRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.