cpr

Commit changes and create a GitHub pull request using git and gh.

2|Updated Sep 3, 2016
One-click install
npx skills add https://github.com/jpaddison3/dotfiles --skill cpr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpr
Source: https://github.com/jpaddison3/dotfiles/tree/main/claude-skills/cpr
Command: npx skills add https://github.com/jpaddison3/dotfiles --skill cpr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates staging, committing, and creating a GitHub pull request from the current repository, reducing manual git command sequencing and branch-handling friction.

Core Features & Use Cases

  • Automatic Branch Handling: Detects when the current branch is main or master and consults CLAUDE.md for branch policies, creating a new branch if required.
  • Safe, Single-Step Commands: Executes git and gh operations one command at a time to match allowed-tool constraints and avoid shell chaining.
  • Commit and PR Body Management: Writes commit messages and PR bodies to temporary files in project_root/tmp or /tmp and uses them with git commit -F and gh pr create --body-file.
  • Use Case: After making local edits, use this Skill to stage changes, create a branch if needed, push to the remote, and open a PR without manual file edits.

Quick Start

Commit staged changes, create a branch if on main/master per CLAUDE.md, push to the remote, and open a GitHub PR using the gh CLI with commit and PR bodies saved to a temporary file.

Frequently Asked Questions about cpr

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

FAQPage Schema
How do I automate git commit and create a GitHub pull request from the command line?

To automate a git commit and create a GitHub pull request, this Skill stages changes, writes commit messages to a temporary file, pushes the branch, and uses the gh CLI to open a PR automatically.

How do I create a new git branch before committing when I am on main?

When on main or master, this Skill checks CLAUDE.md for branch policies and automatically creates a new branch before staging and committing your changes.

Can I use the gh CLI to open a pull request without manual shell command chaining?

Yes, you can use the gh CLI to open a pull request without manual shell chaining because this Skill executes git and gh operations as single-step commands to respect tool constraints.

How do I handle long commit messages and PR bodies when automating git workflows?

To handle long commit messages and PR bodies in automated git workflows, this Skill writes them to temporary files in the project root or tmp directory and passes them using git commit -F and gh pr create --body-file.

Does this automated pull request tool respect existing branch policies defined in CLAUDE.md?

Yes, this automated pull request tool respects branch policies by reading CLAUDE.md to determine whether a new branch must be created before staging and pushing commits.

What is the best way to stage, commit, and push local git changes for a PR in one step?

The best way to stage, commit, and push local git changes for a PR in one step is using this Skill to sequentially run git staging, commit with a temp file, branch creation if needed, and gh PR creation.