pr-fix/SKILL.md
Use when the user wants to action external review feedback or fix CI failures on an open pull request. Single-purpose — does not handle merge conflicts (use merge-main) or open PRs (use pr-open). Trigger phrases - "/pr-fix", "fix the pr", "address review comments", "fix ci".
npx skillsauth add paulund/skills 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.
Action external review feedback and CI failures on an existing PR. Single-purpose: focuses on the fixes; does not handle merge conflicts (use merge-main) and does not open new PRs (use pr-open).
When invoked with arguments, the first line of the prompt may carry a context envelope as JSON:
{ "pr": 123, "branch": "agent/issue-582-foo" }
When invoked without context, detect the PR from the current branch:
gh pr view --json number,headRefName,state,reviewDecision,statusCheckRollup
If no PR exists for the current branch, stop and report. (Use pr-open to create one.)
gh pr view <pr> --json mergeStateStatus,reviewDecision,statusCheckRollup
gh pr checks <pr> --json name,state,conclusion
Report a one-line summary: review decision, failing-check count, mergeable state.
If mergeStateStatus == DIRTY: stop and tell the caller to invoke merge-main first. This skill does not resolve merge conflicts.
gh api repos/{owner}/{repo}/pulls/<pr>/comments \
--jq '.[] | select(.in_reply_to_id == null) | {id, path, line, body, diff_hunk}'
Each top-level comment is a review thread. Skip threads where the latest reply is from the agent (already actioned).
For every unresolved thread:
gh api repos/{owner}/{repo}/pulls/<pr>/comments \
-f body="Done in <commit-sha-after-step-5>" \
-F in_reply_to=<comment_id>
For threads you decline (genuinely out of scope), reply with a one-line reason and a tracking-issue link if you create one.
Only touch failing checks that the review comments did not already resolve:
gh run list --branch <branch> --status failure --limit 1 --json databaseId
gh run view <run-id> --log-failed
Diagnose the root cause from the logs. Fix the code. Do not skip the failure or comment-out the check.
Group changes by concern. Commit messages should describe the why:
git add <files>
git commit -m "Address review: <one-line summary>"
git push origin HEAD
After push, post the commit SHA into each thread's reply if it wasn't known when you replied.
{ "pr": <N>, "threadsActioned": <count>, "threadsDeclined": <count>, "ciFixed": <bool> }
mergeStateStatus == DIRTY (caller invokes merge-main).merge-main.pr-open.quality-gate's job.development
Use when implementing any logic, fixing any bug, or changing any behaviour. Use when you need to prove code works, when a bug report arrives, or when modifying existing functionality. Do NOT use for config changes, data migrations, or dependency updates.
development
Use when starting a new feature, when requirements are unclear, when asked to write code without a clear spec, or before any non-trivial implementation. Do NOT use for trivial bug fixes or one-line changes.
development
Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters. Detects the stack from dependency files, fetches official documentation, implements following documented patterns, and cites sources for every framework-specific decision.
development
Use when preparing to ship a feature, release, or deployment. Use before merging to main, creating a release, or deploying to production. Do NOT use for CI-only changes or internal refactors that don't reach production.