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.
npx skills add dyoshikawa/rulesync --skill commit-push-pr -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/commit-push-pr/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/commit-push-pr/
1Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill commit-push-pr -a codex2Manually: put the files in place
.agents/skills/commit-push-pr/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill commit-push-pr -a cursor2Manually: put the files in place
.cursor/skills/commit-push-pr/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dyoshikawa/rulesync commit-push-pr2Manually: put the files in place
.github/skills/commit-push-pr/SKILL.md1Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill commit-push-pr -a gemini-cli2Platform CLI
gemini skills install https://github.com/dyoshikawa/rulesync --path .rulesync/skills/commit-push-prManually: put the files in place
.devin/skills/commit-push-pr/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill commit-push-pr -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.