From dev-utils
Fix CI failures and address review feedback on the current branch's PR. Use when CI is failing, review comments need addressing, or you need to push fixes for an open PR. Supports --dry-run to preview without changes.
npx claudepluginhub dimagi/dimagi-claude-workflows --plugin dev-utilsThis skill uses the workspace's default tool permissions.
One-shot workflow: gather review feedback, fix CI failures, verify locally, commit, push, and reply to all threads.
Automates GitHub PR iteration: fetches CI failures/logs, categorizes LOGAF review feedback, replies to threads, fixes/pushes until checks pass.
Iterates on GitHub PRs by fetching CI check failures and LOGAF-categorized review feedback, auto-fixing high/medium issues until checks pass. Use for CI blocks and reviewer comments.
Resolves GitHub PR issues including review comments, CI failures via triage-dispatch workflow with code edits, replies, and verification.
Share bugs, ideas, or general feedback.
One-shot workflow: gather review feedback, fix CI failures, verify locally, commit, push, and reply to all threads.
Requires: GitHub CLI (gh) authenticated.
Important: All scripts must be run from the repository root directory (where .git is located), not from the skill directory. Use the full path to the script via ${CLAUDE_SKILL_ROOT}.
If --dry-run is in $ARGUMENTS, print the plan but make no changes (no commits, no pushes, no replies).
scripts/fetch_pr_checks.pyFetches CI check status and extracts failure snippets from logs.
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py [--pr NUMBER]
Returns JSON:
{
"pr": {"number": 123, "branch": "feat/foo"},
"summary": {"total": 5, "passed": 3, "failed": 2, "pending": 0},
"checks": [
{"name": "tests", "status": "fail", "log_snippet": "...", "run_id": 123},
{"name": "lint", "status": "pass"}
]
}
scripts/fetch_pr_feedback.pyFetches and categorizes PR review feedback using the LOGAF scale.
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py [--pr NUMBER]
Returns JSON with feedback categorized as:
high - Must address before merge (h:, blocker, changes requested)medium - Should address (m:, standard feedback)low - Optional (l:, nit, style, suggestion)bot - Informational automated comments (Codecov, Dependabot, etc.)resolved - Already resolved threadsReview bot feedback (from Copilot, Claude, CodeQL, etc.) appears in high/medium/low with review_bot: true — it is NOT placed in the bot bucket.
Each feedback item may include:
thread_id - GraphQL node ID for inline review comments (used for replies)scripts/reply_to_thread.pyReplies to PR review threads. Batches multiple replies into a single GraphQL call.
uv run ${CLAUDE_SKILL_ROOT}/scripts/reply_to_thread.py THREAD_ID "body" [THREAD_ID "body" ...]
gh pr view --json number,url,headRefName
gh repo view --json owner,name -q '"\\(.owner.login)/\\(.name)"'
Store PR number and {owner}/{repo} for use in later steps. Stop if no PR exists for the current branch.
Run uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py to get categorized feedback.
Auto-fix (no prompt):
high - must address (blockers, security, changes requested)medium - should address (standard feedback)When fixing feedback:
This includes review bot feedback (items with review_bot: true). Treat it the same as human feedback:
Prompt user for selection (using AskUserQuestion tool):
low - use the AskUserQuestion tool to present options. Build the question text with a numbered list of all low-priority items, then offer these options:
Example question text:
Found 3 low-priority suggestions:
1. [l] "Consider renaming this variable" - @reviewer in api.py:42
2. [nit] "Could use a list comprehension" - @reviewer in utils.py:18
3. [style] "Add a docstring" - @reviewer in models.py:55
Which would you like to address?
Skip silently:
resolved threadsbot comments (informational only)Track every thread's disposition (fixed, declined, false-positive, skipped) for the reply step.
If --dry-run: print the classification table (including the low-priority numbered list for preview, but do NOT prompt the user for selection). Skip to the Summary step.
Run uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py to get structured failure data.
For each failure:
log_snippet and trace backwards from the error to understand WHY it failedtransaction.on_commit() callbacks in rolled-back test transactions, test ordering dependencies, or shared mutable state. Report findings to the user.Do NOT assume what failed based on check name alone — always read the logs.
Before committing, verify fixes locally:
Detect the test runner from manifest files (pyproject.toml/setup.py → Python, package.json → Node/TS). Check .github/workflows/ for CI commands first.
If local verification fails, fix before proceeding — do not push known-broken code.
git add <changed files>
git commit -m "fix: address PR feedback and CI failures
- <bullet per change: what was changed and why>"
git push
Store the resulting commit SHA for replies.
Inline review threads (items with thread_id): reply using the batch script.
Issue-level comments (items without thread_id): reply via REST API:
gh api -X POST repos/{owner}/{repo}/issues/{pr_number}/comments -f body="$REPLY_BODY"
Use ${CLAUDE_SKILL_ROOT}/scripts/reply_to_thread.py for inline threads. Batch all replies into a single call:
uv run ${CLAUDE_SKILL_ROOT}/scripts/reply_to_thread.py \
PRRT_abc $'Fixed — description of change.\n\n*— Claude Code*' \
PRRT_def $'Not applicable — reason.\n\n*— Claude Code*'
Reply format by disposition:
"Fixed in <SHA>. <description of change>.\n\n*— Claude Code*""Noted — declined by author. <brief reason if given>.\n\n*— Claude Code*""Not applicable — <reason>.\n\n*— Claude Code*"Guards:
*— Claude Code* to avoid duplicates\n\n*— Claude Code*Print a final table:
| # | File | Comment (truncated) | Action | Commit / Note |
|---|---|---|---|---|
| 1 | src/foo.py:42 | "Use Optional instead..." | Fixed | abc1234 |
| 2 | README.md | "Typo in heading" | Fixed | abc1234 |
| 3 | src/bar.py:10 | "Consider splitting..." | Declined | Low priority, user chose "none" |
| 4 | CI: tests | pytest failure in test_api | Fixed | abc1234 |
If scripts fail, use gh CLI directly:
gh pr checks --json name,state,bucket,linkgh run view <run-id> --log-failedgh api repos/{owner}/{repo}/pulls/{number}/comments