Skip to main content
skill CX Codex

commit-push-pr · dyoshikawa — Claude Code skill: what it does, how to install

This skill commits the current work, pushes the branch, and creates or updates a pull request. Use it when a change is ready to ship through GitHub.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dyoshikawa/rulesync --skill commit-push-pr -a claude-code
Open on GitHub

What commit-push-pr does

The skill inspects the current branch and repository state before preparing a commit. If the branch is main or master, it derives a new branch name and switches with git checkout -b. It then stages pending files with git add . and commits them with a generated message.

Next, it pushes the branch with git push -u origin <branch-name>. The command gh pr view --json number,title,body checks for an existing pull request. A missing PR is created with gh pr create; an existing one can be revised through gh api when its title or description no longer matches the changes. The description includes a change summary and a test plan when relevant. The final output contains the PR URL and an action summary.

The branch handling is significant: work on main or master is moved to a new branch before the commit.

What it helps with

  • create a branch for the current changes
  • stage files and make a meaningful commit
  • push a branch with upstream tracking
  • open a pull request from the current branch
  • refresh an existing PR when its scope changes

Example prompts for the agent

  • Commit the current changes, push the branch, and create a pull request.
  • Check the branch, prepare a commit, then open a PR with a change summary and test plan.
  • Compare the existing pull request with the current diff and update its title or description when needed.

How to install commit-push-pr

1Skills CLI (Vercel)

npx skills add dyoshikawa/rulesync --skill commit-push-pr -a claude-code

2Manually: put the files in place

~/.claude/skills/commit-push-pr/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/commit-push-pr/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about commit-push-pr

How do I install commit-push-pr in Claude Code?

Run npx skills add dyoshikawa/rulesync --skill commit-push-pr -a claude-code. The skill file will be available at ~/.claude/skills/commit-push-pr/SKILL.md.

What does commit-push-pr do?

It takes the current work through branch checks, staging, commit creation, push, and pull request handling. It reports the resulting PR URL and the actions it performed.

What happens when the branch already has a pull request?

The skill compares that PR with the current changes. It uses gh api to revise the title or body when needed, and skips the update when the existing details still fit.

Source text

SKILL.md · MIT
---
name: commit-push-pr
description: >-
  Commit current changes, push to remote, and create or update a pull request.
  Use when the user wants to commit and create a PR, push changes and open a
  pull request, or ship their current work as a PR.
targets:
  - "*"
---

# Commit, Push, and PR Management

## Step 1: Check Current Branch

Run `git branch --show-current` to get the current branch name.

If the current branch is `main` or `master`:

1. Generate a descriptive branch name based on the staged/unstaged changes
2. Create and switch to the new branch: `git checkout -b <new-branch-name>`

## Step 2: Stage and Commit Changes

1. Run `git status` to check for changes
2. If there are unstaged changes, stage them: `git add .`
3. Analyze the changes and create a meaningful commit message
4. Commit with: `git commit -m "<commit-message>"`

## Step 3: Push to Remote

Push the branch to remote with upstream tracking:

```bash
git push -u origin <branch-name>
```

## Step 4: Handle Pull Request

Check if a PR already exists for this branch:

```bash
gh pr view --json number,title,body 2>/dev/null
```

### If PR does NOT exist:

Create a new PR:

```bash
gh pr create --title "<title>" --body "<description>"
```

The PR description should include:

- Summary of changes
- Test plan (if applicable)

### If PR already exists:

1. Compare the current PR title and description with the actual changes
2. If updates are needed (e.g., scope of changes has expanded), update the PR using GitHub API:

```bash
gh api repos/<owner>/<repo>/pulls/<pr-number> -X PATCH -f title="<new-title>" -f body="<new-description>"
```

Note: Use `gh api` instead of `gh pr edit` to avoid GraphQL deprecation warnings. 3. If no updates are needed, skip this step

## Step 5: Report Result

Output the PR URL and a summary of actions taken.

© dyoshikawa · MIT · dyoshikawa/rulesync

Similar skills

All skills for Git and GitHub →

commit-push-pr by other authors comes first.

From the same set36

diff-analyze Fetches origin/main, examines your branch changes, and summarizes current progress. Useful before opening a pull request. CX Codex +1 ★ 1,557repo stars create-scrap-issue This skill turns notes and findings into one GitHub issue with context, details, and next steps. Use it when you want to keep project scraps for later. CX Codex +1 ★ 1,557repo stars create-issue A skill that walks through issue creation step by step: gathers context, checks the codebase, drafts English text, and assigns labels. Handy when you want a tidy issue without doing it manually. CX Codex +1 ★ 1,557repo stars create-issue-with-websearch Turns fuzzy feature concepts into well-researched GitHub issues. It investigates web sources, cross-checks project code, and generates a structured spec. CX Codex +1 ★ 1,557repo stars clean-branches A skill that walks your local git branches, finds merged and orphaned ones, and deletes them one at a time with a closing report. CX Codex +1 ★ 1,557repo stars batch-review-prs-awaiting-maintainer Triages pending pull requests in one batch: posts review notes on blocking flaws and merges clean code while logging minor issues. CX Codex +1 ★ 1,557repo stars batch-all-scrap-issues This skill reviews open maintainer-scrap issues one by one, closes those that need no work, and routes actionable fixes through goal-pr. CX Codex +1 ★ 1,557repo stars batch-all-issues A skill that walks every open issue one at a time: fact-checks each with web research, closes the ones needing no action, and drives the rest to merge. CX Codex +1 ★ 1,557repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor