prepare-pr

Apply review fixes, run checks, and update GitHub PR head branches.

30|5|Updated Jul 25, 2025
One-click install
npx skills add https://github.com/phuetz/code-buddy --skill prepare-pr-phuetz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prepare-pr
Source: https://github.com/phuetz/code-buddy/tree/main/.codebuddy/skills/bundled/prepare-pr
Command: npx skills add https://github.com/phuetz/code-buddy --skill prepare-pr-phuetz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the preparation of GitHub pull requests by applying review fixes, validating checks, and updating the PR head branch.

Core Features & Use Cases

  • Automation of PR prep: Apply blockers' fixes, rebase or update the head branch, and ensure CI checks pass before merging.
  • Safety and governance: Enforce safe push targets, avoid merging to main, and maintain traceable commits.
  • Use Case: A maintainer receives a PR with a failing CI; this skill rebases the PR, applies the minimal fixes from the review, validates checks, and pushes updates to the PR branch.

Quick Start

Run the prepare-pr workflow to checkout the PR, rebase onto the latest main, fix blockers, run validations, and push to the PR head branch.

Frequently Asked Questions about prepare-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate GitHub pull request preparation before merging?

To automate GitHub pull request preparation, apply review fixes, rebase the head branch onto main, run CI validations, and push updates. This enforces safe workflows by explicitly targeting the PR branch and validating checks before merge.

Can I automatically apply code review fixes and run checks on a PR branch?

Yes, you can apply code review fixes and run checks on a PR branch by automating the workflow to checkout the PR, apply minimal fixes for blockers, run validations, and push directly to the PR head branch.

What is the safest way to update a pull request branch without pushing to main?

The safest way to update a pull request branch is to enforce explicit targeting of the PR head branch. This prevents pushes to main and maintains traceable commits while rebasing and applying fixes.

How do I rebase a failing PR onto the latest main branch and validate it?

To rebase a failing PR onto the latest main branch and validate it, checkout the PR, rebase it, apply the necessary fixes from the review, run CI checks to ensure they pass, and push the updated state.

Does this PR preparation workflow prevent accidental pushes to main?

Yes, this PR preparation workflow prevents accidental pushes to main by requiring explicit targeting of the PR head branch. It enforces safe push targets and validates changes before allowing a merge.