skills/mine.address-pr-issues/SKILL.md
Use when the user says: "address PR comments", "fix review feedback", "fix failing CI", or "resolve merge conflicts". Triages and resolves PR blockers on GitHub or Azure DevOps.
npx skillsauth add NodeJSmith/Claudefiles mine.address-pr-issuesInstall 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.
Triage and resolve everything blocking a PR from merging: unresolved review comments, merge conflicts, and failing CI checks. Works on both GitHub and Azure DevOps — detects the platform automatically.
/mine.address-pr-issues [PR#]
If no PR number is given, auto-detect from the current branch.
git-platform
Output is github, ado, or unknown. If unknown, tell the user the platform could not be detected from the git remote and stop.
GitHub:
gh pr view {PR} --json number,title,url,baseRefName,headRefName,mergeable,mergeStateStatus,statusCheckRollup,isDraft,reviewDecision
If mergeable is UNKNOWN, retry up to 3 times with backoff (3s, 6s, 12s) — GitHub computes mergeability asynchronously. If still UNKNOWN after retries, warn the user and continue.
ADO:
ado-api pr show {PR} --json
Returns pullRequestId, title, status, sourceRefName, targetRefName, repository.webUrl. URL: repository.webUrl + "/pullrequest/" + pullRequestId. Note: mergeStatus is optional and only present after a merge attempt.
CRITICAL: gh pr view --json does NOT return review threads (inline comments from reviewers or Copilot). You MUST run the thread-fetching command below. Do not conclude "no review comments" based on PR metadata alone — that field doesn't exist in the metadata response.
GitHub:
gh-pr-threads {PR} --json --all
Returns all threads (resolved + unresolved) as JSON with id, isResolved, isOutdated, path, line, startLine, diffSide, and comments including databaseId, body, author.login, author.__typename.
ADO:
ado-api pr threads {PR} --json --all
Returns all threads as JSON. Threads with threadContext are inline comments; threads without are general conversation. ADO has no isOutdated concept.
GitHub: gh pr view {PR} --json comments — extract actionable non-inline comments.
ADO: Already in the thread list — threads without threadContext are general comments.
GitHub: From statusCheckRollup in metadata. Filter for conclusion in FAILURE, TIMED_OUT, ACTION_REQUIRED.
ADO:
az repos pr policy list --id {PR_ID} -o json
Filter for status in rejected, broken.
Check and display as informational warnings (NOT blockers):
Categorize all issues into three groups: review comments, merge conflicts, CI failures.
Prerequisite: This section requires the gh-pr-threads / ado-api pr threads output from Phase 1. If you skipped that step, go back and run it now before triaging.
Exclude resolved threads: GitHub isResolved: true, ADO status != "active".
Triage outdated threads (GitHub only): For each thread with isOutdated: true:
Do NOT blanket-exclude outdated threads. Do NOT confidently dismiss concerns without citing evidence.
General comment assessment: For non-inline comments, determine if actionable vs. discussion/approval/acknowledgment. Include only actionable, unaddressed comments.
Already-addressed detection: For each unresolved thread, read the current code at the referenced location and compare against what the reviewer requested. If already present, categorize as "already addressed."
For each issue, assign a depth based on the comment's nature:
| Comment type | Depth | Description |
|---|---|---|
| Rename, docstring, formatting, typo | light | Skip call-site investigation |
| Logic change, bug fix, error handling | medium | Read call sites, understand usage |
| Architectural concern, design pattern, API contract | deep | Read all callers, tests, adjacent modules |
Group related comments for efficient execution — e.g., all error-handling comments together, all comments on a single feature together.
GitHub: mergeable == "CONFLICTING" or mergeStateStatus == "DIRTY"
ADO: mergeStatus == "conflicts" (if present)
Fetch failure logs and categorize: test failures, lint/type errors, build errors, other.
GitHub: gh run view <run-id> --log-failed
ADO: ado-api logs errors <build-id> — fetches and filters failure logs. Run ado-api logs --help for full usage.
Show a numbered plan with:
AskUserQuestion:
question: "Here's my plan for PR #{N}. Review and skip any items you don't want me to address."
header: "PR Plan"
multiSelect: false
options:
- label: "Looks good — address all"
description: "Proceed with the full plan as shown"
- label: "Skip specific items"
description: "I'll tell you which items to skip"
- label: "Cancel"
description: "Exit without making changes"
If "Skip specific items": follow-up asking which numbered items to skip.
If conflicts exist, ask the user:
AskUserQuestion:
question: "Merge conflicts detected. How should I resolve them?"
header: "Conflicts"
options:
- label: "Merge (Recommended)"
description: "git merge origin/<base> — creates a merge commit, preserves history"
- label: "Rebase"
description: "git rebase origin/<base> — rewrites history, requires force-push"
get-skill-tmpdir mine-address-pr
For each group from the plan, launch a general-purpose subagent with:
light, medium, or deep)<tmpdir>/group-N/result.mdSubagent prompt template:
You are addressing PR review feedback. Your output goes to
{output_path}.Comments to address: {comment_details}
Investigation depth: {depth}
If
light: Read the target file. Apply the fix. Run the project's test suite. If tests fail: fix or escalate. Max 3 retries.If
medium: Read the target file fully. Grep for call sites of the function/class being modified. Read at least one call site to understand usage. Apply the fix. Run the project's test suite (follow the test execution discovery order fromreferences/common/testing.md). If tests fail: fix the code. Max 3 retries, then escalate to user.If
deep: Read the target file fully. Grep for call sites — read ALL callers. Read related test files. Read adjacent modules in the same package/directory. Apply the fix. Run the project's test suite. If tests fail: fix or escalate. Max 3 retries.CRITICAL: Never explain away a test failure or CI error. If tests fail after your fix, the fix is wrong — revise it. Do not suggest the test is outdated, flaky, or testing the wrong thing. Do not suggest skipping or marking the test as expected failure. Fix the code until tests pass, or escalate to the user after 3 attempts.
Write a one-line summary as the first line of your output file, then details below.
Read only the first line of each result file for the summary — do not read full subagent output into main context.
After all subagents complete:
Do NOT commit until both reviewers pass. If CRITICAL/HIGH findings remain after 3 iterations, present them to the user before proceeding.
Commit per logical group with descriptive messages:
fix(auth): use logging instead of print per review
fix(config): add LOGIN_REDIRECT_URL to test settings
Push once after all commits.
After push is confirmed, reply to threads. For each addressed thread:
<!-- addressed-pr-issues -->. If found, skip the reply.<!-- addressed-pr-issues --> marker in the body. Keep replies concise and professional:
| Thread author | Action | |---|---| | Bot | Reply + resolve | | Human reviewer | Reply only — reviewer resolves after verifying | | PR author (self-review) | Reply + resolve |
Bot detection:
author.__typename == "Bot" is the primary signal. Fall back to [bot] suffix check on author.login if __typename is unavailable.[bot] suffix on author.uniqueName. Also check if uniqueName matches service account patterns (no @ domain, or matches the project's build service identity).GitHub resolution: Use gh-pr-reply {PR} {comment-database-id} "{body}" --resolve {thread-id} for combined reply+resolve.
ADO resolution: Two calls: ado-api pr reply {PR} {thread-id} "{body}" then ado-api pr resolve {PR} {thread-id}.
Rate limiting: 1-second delay between mutative API calls.
Present a structured summary:
## Summary
### Review Comments
- Resolved (bot threads): N threads [replied & resolved]
- Replied (human threads): M threads [reply posted, awaiting reviewer]
- Already addressed: K threads [replied]
- Skipped: J threads [reason]
### Merge Conflicts
- Resolved: N files — [merge/rebase] origin/<base> into <head>
### CI Failures
- Fixed: N checks — [brief description of each fix]
- Still pending: CI will re-run on push
### Commits
- [list each commit with its message]
### Needs Manual Review
- [any items that could not be resolved automatically]
IMPORTANT: Use these helper scripts instead of inline commands. They handle authentication, pagination, and output formatting.
gh-pr-threads, gh-pr-reply (with --resolve), git-platform — run --help on each for usageado-api pr (show/list/create/update/threads/reply/resolve/resolve-pattern), ado-api logs (CI failure logs), ado-api work-item — run ado-api --help for usagegit-platform — prints github, ado, or unknowngh auth login (GitHub) or az login (ADO)gh auth refresh -s repodevelopment
Use when the user says: "humanize this", "unslop this", "de-slop this", "fix AI writing", "remove AI tells", "clean up AI prose". Edits prose to remove AI writing patterns and add human voice. Analyzes first, then asks how to fix. Prose complement to mine.clean-code.
development
Use when the user says: "why is this code like this", "why does this exist", "why was this built this way", "decision rationale", "what's the history behind". Decision archaeology — reconstructs historical rationale from evidence, not speculation.
development
Use when the user says: "how does X work", "walk me through", "explain this subsystem", "explain how", "trace the flow". Complexity-adaptive subsystem explanation — builds mental models conversationally, not documentation artifacts.
development
Use when the user says: 'create an issue', 'file an issue', 'open an issue', 'write an issue', 'new issue for this'. Codebase-aware issue creation — investigates the code to produce well-structured issues with acceptance criteria, affected areas, and enough detail for automated triage.