Agent skill
rebase-pr
Rebase a PR on its base branch, fix conflicts, and verify build
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/rebase-pr
SKILL.md
Rebase PR
Simple workflow to rebase a PR on its base branch, resolve conflicts, and push.
Usage
/rebase-pr 19882
Workflow
Step 1: Validate PR
gh pr view <PR> --repo AztecProtocol/aztec-packages --json state,headRefName,baseRefName
Abort if:
stateis notOPEN→ "PR #<N> is <state>, nothing to rebase."
Note the baseRefName (usually next or merge-train/*).
Step 2: Checkout and Rebase
gh pr checkout <PR>
git fetch origin <base-branch>
git rebase origin/<base-branch>
Step 3: Resolve Conflicts (if any)
If there are conflicts:
-
Identify conflicting files:
bashgit status -
Resolve each conflict: Edit the files to resolve conflicts
-
Stage resolved files:
bashgit add <resolved-file> -
Continue rebase:
bashgit rebase --continue -
Repeat until rebase completes
Important: Always REBASE, never merge.
Step 4: 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 from repo root:
(cd $(git rev-parse --show-toplevel) && BOOTSTRAP_TO=yarn-project ./bootstrap.sh)
Step 5: Verify Build
Run from yarn-project:
yarn build
If there are build errors from the rebase, fix them.
Step 6: Quality Checklist
Format and lint ALL packages:
yarn format
yarn lint
Step 7: Commit and Push
If there are changes from build fixes or conflict resolution, 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: resolve rebase conflicts"
git push --force-with-lease
Key Points
- Rebase, don't merge: Always use
git rebase, nevergit merge - Amend only for PRs targeting
next: Other PRs use normal commits - Bootstrap when needed: Only if there are changes outside yarn-project
- Verify build: Always run
yarn buildafter rebase - Force push with lease: Use
--force-with-leasefor safety
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?