From ai-tools
Complete PR health check - track workflows, fix failures, and address review comments
npx claudepluginhub waynebrantley/aitools --plugin ai-toolsThis skill uses the workspace's default tool permissions.
Complete pull request health check that ensures your PR is ready to merge by:
Retrieves texts, DMs, one-time codes, and inspects threads in ECC workflows. Provides evidence of exact sources checked for verification before replies.
Delivers expertise for HS tariff classification, customs documentation, duty optimization, restricted party screening, and trade compliance across jurisdictions.
Process documents with Nutrient API: convert formats (PDF, DOCX, XLSX, images), OCR scans (100+ languages), extract text/tables, redact PII, sign, fill forms.
Complete pull request health check that ensures your PR is ready to merge by:
gh CLI installed and authenticatedIMPORTANT: Use TodoWrite throughout to track progress.
TodoWrite:
1. Get PR information (pending)
2. Check workflow status (pending)
3. Fix workflow failures if any (pending)
4. Check review comments (pending)
5. Address unresolved comments (pending)
6. Final verification (pending)
node ${CLAUDE_PLUGIN_ROOT}/skills/pr-doctor/scripts/get-pr-status.mjs [pr_number]
This returns comprehensive PR status:
If no PR found: Prompt user to create one with gh pr create.
Present a health summary:
## PR #142 Health Check
### Basic Info
- Title: Add form validation
- Branch: feature/validation → main
- URL: https://github.com/org/repo/pull/142
### Status
| Check | Status |
|-------|--------|
| Workflows | ⏳ Running (2/3 complete) |
| Reviews | ✅ Approved (2 approvals) |
| Comments | ⚠️ 3 unresolved |
| Conflicts | ✅ None |
### Recommendation
Wait for workflows, then address 3 unresolved comments.
If workflows are running: "Workflows are still running. What would you like to do?" Options:
If workflows failed: "Workflow failures detected. Would you like to fix them?" Options:
Invoke workflow-doctor:
Invoke: github-workflow-doctor
Args: run_id=<failed_run_id>
Wait for workflow-doctor to complete, then continue.
node ${CLAUDE_PLUGIN_ROOT}/skills/address-pr-comments/scripts/fetch-pr-comments.mjs --open-only
If unresolved comments exist: "Found {N} unresolved review comments. Would you like to address them?" Options:
Invoke address-pr-comments:
Invoke: address-pr-comments
Args: selection=<user_selection>
If any changes were made (workflow fixes or comment fixes):
git status
"Changes ready to commit. How would you like to proceed?"
Options:
- "Commit all changes together" - Single commit with summary
- "Review changes first" - Show diff before committing
- "I'll commit manually" - Leave changes staged
If committing:
git add -A
git commit -m "fix: address PR feedback
- Fixed workflow failures
- Addressed review comments"
git push
Wait for new workflows to start:
node ${CLAUDE_PLUGIN_ROOT}/skills/github-workflow-doctor/scripts/list-running-workflows.mjs
Present final status:
## Final PR Status
| Check | Before | After |
|-------|--------|-------|
| Workflows | ❌ Failed | ⏳ Running |
| Comments | ⚠️ 3 unresolved | ✅ All addressed |
Next steps:
- Workflows are running, track with `/ai-tools:github-workflow-doctor`
- Request re-review when workflows pass
For a fast check without prompts:
/ai-tools:pr-doctor --quick
Quick mode:
get-pr-status.mjsGets comprehensive PR status:
node scripts/get-pr-status.mjs [pr_number]
Output (JSON):
{
"pr": {
"number": 142,
"title": "Add form validation",
"state": "open",
"mergeable": true
},
"workflows": {
"status": "failing",
"runs": [
{ "id": 123, "name": "CI", "conclusion": "failure" }
]
},
"reviews": {
"status": "approved",
"approvals": 2,
"changes_requested": 0
},
"comments": {
"total": 5,
"unresolved": 3
},
"health": {
"score": 60,
"issues": ["workflow_failure", "unresolved_comments"],
"recommendation": "Fix CI failure, then address comments"
}
}
check-merge-readiness.mjsQuick merge readiness check:
node scripts/check-merge-readiness.mjs [pr_number]
Output:
PR #142 Merge Readiness:
- [x] No conflicts
- [x] Reviews approved
- [ ] Workflows passing (1 failed)
- [ ] Comments resolved (3 unresolved)
NOT READY TO MERGE
┌─────────────────┐
│ PR Doctor │
└────────┬────────┘
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Workflow │ │ Address │ │ Test │
│ Doctor │ │ PR Cmts │ │ Doctor │
└───────────┘ └───────────┘ └───────────┘
│ │ │
└──────────────┼──────────────┘
│
▼
┌─────────────────┐
│ Ready to Merge │
└─────────────────┘
CRITICAL: Do NOT work around script failures.
If any script in this skill produces no output, fails, or returns unexpected results:
If a script fails, ask the user how to proceed before continuing.
Common Errors:
| Error | Resolution |
|---|---|
| No PR found | Create with gh pr create |
| Auth failed | Run gh auth login |
| Merge conflicts | Resolve conflicts first |
| Required reviews missing | Request reviews |
| Protected branch rules | Check branch protection settings |