plugins/gwt/skills/gwt-pr-fix/SKILL.md
Inspect GitHub PR for CI failures, merge conflicts, update-branch requirements, reviewer comments, change requests, and unresolved review threads. Use REST-first transport for CI/reviews/comments, keep GraphQL only for unresolved review thread discovery and reply/resolve, autonomously fix high-confidence blockers, reply to ALL reviewer comments with action taken or reason for not addressing, then resolve threads. Ask the user only for ambiguous conflicts or design decisions.
npx skillsauth add akiojin/gwt gwt-pr-fixInstall 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.
Use gh to inspect PRs for:
REST-first boundary:
Then inspect, fix, reply to every reviewer comment (with action taken or reason for not addressing), resolve all threads, and notify reviewers.
Prereq: ensure gh is authenticated (for example, run gh auth login once), but allow direct GH_TOKEN / GITHUB_TOKEN REST auth when available instead of blocking only on gh auth status.
No reviewer comment may be left unanswered.
--reply-and-resolve argument enforces this by requiring a reply entry for every unresolved thread and rejecting empty bodies.| Prohibited | Required Alternative |
|---|---|
| "We should look into..." | "Edit path/file.ts:42 to..." |
| "There seem to be some issues" | "3 blocking items detected" |
| "This might be causing..." | "Root cause: <error from log>" |
| "Consider fixing..." / "It looks like..." | "Action: Fix <what> in <where>" |
| "Various CI checks are failing" | "2 CI checks failing: build, lint" |
| "Some reviewers have concerns" | "@reviewer1 requested: <quote>" |
| "I'll try to fix this" | "Action: <specific fix>" |
\n.--add-comment or manual gh issue/pr comment), verify the final body does not accidentally include escaped control sequences (\n, \t).When work is tracked in GitHub Issues, progress updates must use this template:
Progress
- ...
Done
- ...
Next
- ...
Next, explicitly state blockers or the immediate next action.repo: path inside the repo (default .)pr: PR number or URL (optional; defaults to current branch PR)mode: inspection mode (checks, conflicts, reviews, all)required-only: limit CI checks to required checks only (uses gh pr checks --required)gh authentication for the repo host# Inspect all (CI, conflicts, reviews) - default mode
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>"
# CI checks only
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --mode checks
# Conflicts only
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --mode conflicts
# Reviews only (Change Requests + Unresolved Threads)
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --mode reviews
# JSON output
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --json
# Required checks only (if gh supports --required)
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --mode checks --required-only
# Reply to all unresolved threads and resolve them
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --reply-and-resolve '[
{"threadId":"PRRT_xxx123","body":"Fixed: refactored the method as suggested."},
{"threadId":"PRRT_xxx456","body":"Not addressed: this is intentional because the API requires this format."}
]'
# Add a comment to notify reviewers
python3 "${CLAUDE_PLUGIN_ROOT}/skills/gwt-pr-fix/scripts/inspect_pr_checks.py" --repo "." --pr "<number>" --add-comment "Fixed all issues. Please re-review."
Verify gh authentication.
gh auth status in the repo with escalated scopes (workflow/repo).Resolve the PR.
Inspect based on mode:
Conflicts Mode (--mode conflicts):
mergeable and mergeStateStatus fields.CONFLICTING or DIRTY, report conflict details.BEHIND, report that the base branch advanced and a base-branch merge is required.git fetch origin <base> && git merge origin/<base>.Reviews Mode (--mode reviews):
CHANGES_REQUESTED state.Checks Mode (--mode checks):
--required-only to limit output when a reliable required-only source is available; otherwise report that all checks are being shown.All Mode (--mode all):
Produce Diagnosis Report (mandatory format).
Output MUST use this exact structure:
## Diagnosis Report: PR #<number>
**Merge Verdict: BLOCKED | CLEAR**
Blocking items: <N>
---
### BLOCKING
#### B1. [CATEGORY] <1-line title>
- **What:** Factual statement (no speculation)
- **Where:** file_path:line_number / check name / branch ref
- **Evidence:** Verbatim quote from script output
- **Action:** Specific fix (file path, command, or code change — at least one required)
- **Auto-fix:** Yes | No (needs confirmation)
#### B2. [CATEGORY] <1-line title>
...
---
### INFORMATIONAL
#### I1. [CATEGORY] <1-line title>
- **What / Note**
---
**Summary:** <N> blocking items to fix, <M> informational items noted.
Classification rules:
Category labels: CONFLICT, BRANCH-BEHIND, CI-FAILURE, CHANGE-REQUEST, UNRESOLVED-THREAD, REVIEW-COMMENT
Auto-fix judgment:
Each CHANGE-REQUEST and each UNRESOLVED-THREAD is a separate B-item. Do not combine multiple threads or requests into one item.
Decide execution path.
Auto-fix: Yes → display Diagnosis Report and proceed directly to step 6.Auto-fix: No → create a concise plan referencing B-item IDs and ask the user only about those ambiguous items before proceeding.Implement fixes.
Reply to ALL reviewer comments and resolve threads (mandatory).
--reply-and-resolve with a JSON array covering ALL unresolved threads.Repository Permissions > Contents: Read and Write.Notify reviewers (mandatory).
--add-comment "message", post a comment to the PR through REST first.gh pr comment.Verify fix (mandatory — do not skip).
--mode all (regardless of initial mode).build) fails 3 consecutive iterations:
build fails → fixed → lint fails is normal progression, not oscillation).git fetch origin <base> && git merge origin/<base> && git pushComprehensive PR inspection tool. Exits non-zero when issues remain.
Arguments:
| Argument | Default | Description |
|----------|---------|-------------|
| --repo | . | Path inside the target Git repository |
| --pr | (current) | PR number or URL |
| --mode | all | Inspection mode: checks, conflicts, reviews, all |
| --max-lines | 160 | Max lines for log snippets |
| --context | 30 | Context lines around failure markers |
| --required-only | false | Limit CI checks to required checks only |
| --json | false | Emit JSON output |
| --reply-and-resolve | (none) | JSON array of {threadId, body} to reply and resolve ALL threads |
| --add-comment | (none) | Add a comment to the PR |
Exit codes:
0: No issues found1: Issues detected or error occurred--reply-and-resolve JSON format:
[
{"threadId": "PRRT_xxx123", "body": "Fixed: refactored the method as suggested."},
{"threadId": "PRRT_xxx456", "body": "Not addressed: this is intentional because ..."}
]
Validation rules:
body.Detects merge conflicts via mergeable and mergeStateStatus fields.
CONFLICTING / DIRTY: Conflict detectedBEHIND: Base branch advanced; Update Branch requiredMERGEABLE / CLEAN: No conflictsFetches reviews with state == "CHANGES_REQUESTED" and displays:
Fetches ALL reviewer feedback without truncation:
Uses GraphQL to fetch threads where isResolved == false:
Use --reply-and-resolve to reply to every unresolved thread and resolve them.
addPullRequestReviewThreadReply to post a reply.resolveReviewThread to mark the thread as resolved.Required permissions:
Pull requests + Contents: Read and Writerepo scopeUse --add-comment "message" to post a summary comment to the PR after fixes.
POST /repos/<owner>/<repo>/issues/<pr_number>/commentsgh pr comment is fallback-only## Diagnosis Report: PR #123
**Merge Verdict: BLOCKED**
Blocking items: 3
---
### BLOCKING
#### B1. [CI-FAILURE] TypeScript build fails
- **What:** `build` check failed with compilation error
- **Where:** `src/utils/parser.ts:42` / check: `build`
- **Evidence:** `error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.`
- **Action:** Edit `src/utils/parser.ts:42` — change `parseInt(value)` to pass the correct type
- **Auto-fix:** Yes
#### B2. [CHANGE-REQUEST] @reviewer1 requests error handling
- **What:** Reviewer requested try-catch around API call
- **Where:** `src/api/client.ts:88`
- **Evidence:** "@reviewer1: Please wrap this fetch call in a try-catch block to handle network errors gracefully."
- **Action:** Add try-catch in `src/api/client.ts:88` around the `fetch()` call
- **Auto-fix:** Yes
#### B3. [CONFLICT] Merge conflict with main
- **What:** 2 files have merge conflicts
- **Where:** `src/config.ts`, `src/index.ts` / branch: `main`
- **Evidence:** `Mergeable: CONFLICTING, Merge State: DIRTY`
- **Action:** Merge `origin/main` and resolve conflicts in listed files
- **Auto-fix:** No (needs confirmation)
---
### INFORMATIONAL
#### I1. [REVIEW-COMMENT] Code style suggestion
- **What / Note:** @reviewer2 suggested extracting a helper function — non-blocking style preference
---
**Summary:** 3 blocking items to fix, 1 informational item noted.
PR #123: Comprehensive Check Results
============================================================
MERGE STATUS
------------------------------------------------------------
Mergeable: CONFLICTING
Merge State: DIRTY
Base: main <- Head: feature/my-branch
Action Required: Resolve conflicts before merging
CHANGE REQUESTS
------------------------------------------------------------
From @reviewer1 (2025-01-15):
"Please fix these issues..."
UNRESOLVED REVIEW THREADS
------------------------------------------------------------
[1] src/main.ts:42
Thread ID: PRRT_xxx123
@reviewer1: This needs refactoring because the current
implementation violates the single responsibility principle.
[2] src/utils.ts:15
Thread ID: PRRT_xxx456
@reviewer2: Consider using a more descriptive variable name here.
CI FAILURES
------------------------------------------------------------
Check: build
Details: https://github.com/...
Failure snippet:
Error: TypeScript compilation failed
...
============================================================
OK: PRRT_xxx123 (src/main.ts:42)
OK: PRRT_xxx456 (src/utils.ts:15)
Result: 2 resolved, 0 failed, 2 total
{
"pr": "123",
"conflicts": {
"hasConflicts": true,
"mergeable": "CONFLICTING",
"mergeStateStatus": "DIRTY",
"baseRefName": "main",
"headRefName": "feature/my-branch"
},
"changeRequests": [
{
"id": 123456,
"reviewer": "reviewer1",
"body": "Please fix these issues...",
"submittedAt": "2025-01-15T12:00:00Z"
}
],
"unresolvedThreads": [
{
"id": "PRRT_xxx123",
"path": "src/main.ts",
"line": 42,
"comments": [
{"author": "reviewer1", "body": "This needs refactoring because..."}
]
}
],
"ciFailures": [
{
"name": "build",
"status": "ok",
"logSnippet": "..."
}
]
}
tools
Create distinctive, production-grade terminal user interfaces. Use when building TUI components with ratatui, CLI output styling, or xterm.js terminal rendering. Triggers: 'design TUI', 'terminal UI', 'TUIデザイン', 'ターミナルUI', 'ratatui widget'
testing
Semantic search over SPEC Issues (GitHub Issue cache at ~/.gwt/cache/issues/) using vector embeddings. Use when searching for existing specs, finding related specs, checking for duplicate specs, or determining which spec owns a scope. Mandatory preflight before gwt-discussion when the work may need a SPEC owner. Use when user says 'search specs', 'find related specs', 'check for duplicate specs', or asks which spec owns a scope.
testing
Mandatory preflight before gwt-discussion, gwt-register-issue, and gwt-fix-issue. Use proactively before creating any SPEC or Issue owner or before reusing an existing one. Searches SPEC Issues, GitHub Issues, and project files via ChromaDB. Triggers: 'search', 'find related', 'check duplicates'.
business
Use when the user wants to register new work from a bug report, idea, or task description and an existing GitHub Issue number is not already known.