| name | pr-ci |
| description | Fix failing CI/GitHub Actions checks. Triggers: 'fix CI', 'fix GHA', 'build failing', 'tests failing in CI', 'checks red'. |
| argument-hint | [--auto] |
| user-invocable | true |
| allowed-tools | ["Bash(gh pr view:*)","Bash(gh pr checks:*)","Bash(gh pr list:*)","Bash(gh run view:*)","Bash(gh run list:*)","Bash(gh repo view:*)","Bash(git branch --show-current)","Bash(git add:*)","Bash(git commit:*)","Bash(git push:*)","Skill","Read","Glob","Grep"] |
PR GHA Fixer
Fix failed GitHub Actions checks.
Safety: never rebases. Push requires confirmation (unless --auto).
Steps
-
Detect PR: gh pr view --json number -q '.number' or ask user
-
Verify branch (if PR specified manually)
-
Fetch failed checks:
gh pr checks <PR> --json name,state,bucket,link
--auto → fix all failed checks. Without --auto → display as numbered list, ask "Which to fix?"
-
Fetch logs:
gh run list --branch <BRANCH> --json databaseId,name,conclusion --limit 20
gh run view <RUN_ID> --log-failed
-
Plan fixes: Identify root cause, create concise plan. --auto → proceed. Without --auto → ask "Ready to execute?"
-
Execute: Apply fixes, summarize changes.
-
Commit: Use Skill(commit) to generate message and commit. --auto → commit directly. Without --auto → ask first.
-
Push (optional): --auto → push automatically. Without --auto → ask first. Detect stack tool: gh stack view --json 2>/dev/null succeeds → Skill(gh-stack:submit). Otherwise gt log --stack 2>/dev/null succeeds → Skill(gt:submit). Otherwise git push.
Common Failures & Remediation
- Build — missing imports, type errors, syntax → read error output, fix source directly
- Test — outdated assertions, missing fixtures → update expectations or add missing test data
- Lint — formatting, unused imports/vars → run the project formatter, remove dead code
- Infra — secrets, rate limits, runner issues → can't fix locally; inform user to check repo/org settings