An autonomous agent that identifies CI failures in a PR, rebases branches, and implements necessary code fixes.
Install
mkdir -p .claude/skills/fix-pr && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3917" && unzip -o skill.zip -d .claude/skills/fix-pr && rm skill.zipInstalls to .claude/skills/fix-pr
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Fix a failing PR by analyzing CI logs and fixing errors. Autonomous workflow that identifies failures, rebases, fixes issues, and pushes.Key capabilities
- →Validate the state of a pull request
- →Identify CI failures using a subagent
- →Checkout and rebase a pull request branch
- →Fix failures based on type (format, lint, build, unit test)
- →Commit and push fixes to the pull request
How it works
The skill validates a PR, delegates CI failure identification to a subagent, rebases the branch, applies fixes based on failure type, runs a quality checklist, and then commits and pushes the changes.
Inputs & outputs
When to use fix-pr
- →Fix CI build failures in a pull request
- →Rebase stale branches automatically
- →Resolve linting or formatting errors
- →Debug failing unit tests in CI
About this skill
Fix Failing PR
Autonomous workflow to fix CI failures for a PR. Delegates failure identification to subagent, then applies fixes.
Usage
/fix-pr 19882
Workflow
Phase 0: Validate PR
Before doing anything, verify the PR is valid:
gh pr view <PR> --repo AztecProtocol/aztec-packages --json state,baseRefName,headRefName
Abort if:
stateis notOPEN→ "PR #<N> is <state>, nothing to fix."
Phase 1: Identify Failures
Spawn the identify-ci-failures subagent:
Use Task tool with subagent_type: "identify-ci-failures"
Prompt: "Identify CI failures for PR <number>"
This returns:
- Failure type (build/format/lint/unit-test/e2e-test)
- Test names, hashes, error snippets
- Local file paths for logs
If the subagent cannot find CI logs, ask the user for:
- The CI log URL directly
- Or the CI password if authentication is needed
Phase 2: Checkout and Rebase
gh pr checkout <PR>
git fetch origin <base-branch>
git rebase origin/<base-branch>
If there are conflicts:
- Resolve the conflicts
git add <resolved-files>git rebase --continue
Important: Always REBASE, never merge.
Phase 3: Bootstrap (if needed)
Check if changes exist outside yarn-project:
git diff origin/<base-branch>...HEAD --name-only | grep -v '^yarn-project/'
If yes, run bootstrap:
(cd $(git rev-parse --show-toplevel) && ./bootstrap.sh build yarn-project)
Phase 4: Fix Based on Failure Type
Run from yarn-project directory.
| Failure Type | Fix Action |
|---|---|
| FORMAT | yarn format |
| LINT | yarn lint |
| BUILD | yarn build, fix TypeScript errors, repeat |
| UNIT TEST | yarn workspace @aztec/<package> test <file>, fix, repeat |
| E2E TEST | For simple failures, fix. For complex failures, suggest /debug-e2e |
Phase 5: Quality Checklist
Before committing, run from yarn-project:
yarn build
yarn format
yarn lint
Run tests for modified files:
yarn workspace @aztec/<package> test <file>.test.ts
Phase 6: Commit and Push
If the PR targets next, amend to keep it as a single commit:
git add .
git commit --amend --no-edit
git push --force-with-lease
Otherwise, create a normal commit:
git add .
git commit -m "fix: <description of fix>"
git push
Key Points
- Validate first: Only fix PRs that are open
- Delegate identification: Use
identify-ci-failuressubagent, don't analyze logs directly - Rebase, don't merge: Always rebase on the base branch
- Amend only for PRs targeting
next: Other PRs use normal commits - Bootstrap when needed: Only if changes outside yarn-project
- Escalate e2e failures: Complex e2e issues need
/debug-e2e
Reference
- See
CLAUDE.mdfor project conventions - See
/debug-e2eskill for complex e2e failure analysis
When not to use it
- →When the PR state is not OPEN
- →When complex e2e test failures occur, which require a different skill
- →When direct analysis of CI logs is preferred over subagent delegation
Limitations
- →Aborts if the PR state is not OPEN.
- →Complex e2e test failures are escalated to a different skill.
- →Requires the `identify-ci-failures` subagent for failure identification.
How it compares
This skill automates the entire process of fixing a failing PR, from validation and failure identification to rebase, fixing, and pushing, unlike manual debugging and git operations.
Compared to similar skills
fix-pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| fix-pr (this skill) | 1 | 4mo | Review | Intermediate |
| resolve-checks | 1 | 6mo | Review | Intermediate |
| agent-github-pr-manager | 1 | 6mo | Review | Intermediate |
| agent-github-modes | 1 | 6mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by AztecProtocol
View all by AztecProtocol →You might also like
resolve-checks
flowglad
Resolve all failing CI checks and address PR review feedback on the current branch's PR. Runs tests locally, fixes failures, incorporates valid review comments, and resolves addressed feedback. Use when CI is red, after receiving PR feedback, or before merging.
agent-github-pr-manager
ruvnet
Agent skill for github-pr-manager - invoke with $agent-github-pr-manager
agent-github-modes
ruvnet
Agent skill for github-modes - invoke with $agent-github-modes
agent-pr-manager
ruvnet
Agent skill for pr-manager - invoke with $agent-pr-manager
git-pr-workflows-git-workflow
sickn33
Orchestrate a comprehensive git workflow from code review through PR creation, leveraging specialized agents for quality assurance, testing, and deployment readiness. This workflow implements modern g
iterate-pr
davila7
Iterate on a PR until CI passes. Use when you need to fix CI failures, address review feedback, or continuously push fixes until all checks are green. Automates the feedback-fix-push-wait cycle.