# commit-push-pr

Automates Git delivery by creating a feature branch, committing changes, pushing upstream, and opening or updating a GitHub pull request.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 74
- Author: sneg55
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/sneg55/agent-starter/tree/HEAD/skills/commit-push-pr/SKILL.md
- Updated: 2026-09-14
- HTML: https://affpapa.org/en/nevibecode/skills/sneg55-commit-push-pr

## What it does

The skill handles repetitive Git delivery steps in one pass. It starts by inspecting the repository via `git status`, diffing changes against the default branch, and checking existing pull requests with `gh pr view`. If the working tree sits on `main` or `master`, the agent branches off into a `username/feature-name` branch.

Next, it batches modifications into a single commit explaining the intent behind the changes, pushes to the remote, and calls `gh` to create or update the PR. Every generated pull request includes a brief summary alongside a verification checklist. Safety safeguards block interactive flags, force-pushes, config overrides, and accidental commits of sensitive files like `.env` or `credentials.json`.

Without an authenticated `gh` CLI binary in your environment, the workflow stops before creating the pull request.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add sneg55/agent-starter --skill commit-push-pr -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/commit-push-pr/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/commit-push-pr/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add sneg55/agent-starter --skill commit-push-pr -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/commit-push-pr/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add sneg55/agent-starter --skill commit-push-pr -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/commit-push-pr/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install sneg55/agent-starter commit-push-pr
```

2. **Manually: put the files in place**
- File: `.github/skills/commit-push-pr/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add sneg55/agent-starter --skill commit-push-pr -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/sneg55/agent-starter --path skills/commit-push-pr
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/commit-push-pr/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add sneg55/agent-starter --skill commit-push-pr -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/sneg55/agent-starter/tree/HEAD/skills/commit-push-pr/SKILL.md

## When to use it
- branch off main without manual Git steps
- write a concise commit explaining why changes were made
- push local work to the remote repository
- generate or update a GitHub PR with a test plan checklist

## Example prompts
- Commit these changes and open a pull request
- Run commit-push-pr to ship my branch and prepare a test plan
- Push my edits and update the existing pull request

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: a00f186219b54c56.

BEGIN THIRD-PARTY FILE a00f186219b54c56
````text
---
name: commit-push-pr
description: Full git workflow - creates branch, commits, pushes, and creates or updates a PR with summary and test plan.
user_invocable: true
allowed-tools:
  - Bash(git checkout --branch:*)
  - Bash(git checkout -b:*)
  - Bash(git add:*)
  - Bash(git status:*)
  - Bash(git push:*)
  - Bash(git commit:*)
  - Bash(gh pr create:*)
  - Bash(gh pr edit:*)
  - Bash(gh pr view:*)
  - Bash(gh pr merge:*)
---

# Commit, Push, and Open PR

## Context

Gather this context first:
- `git status`
- `git diff HEAD`
- `git branch --show-current`
- `git diff main...HEAD` (or default branch)
- `gh pr view --json number 2>/dev/null || true`

## Git Safety Protocol

- NEVER update the git config
- NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
- NEVER run force push to main/master, warn the user if they request it
- Do not commit files that likely contain secrets (.env, credentials.json, etc)
- Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported

## Task

Analyze ALL changes that will be included in the pull request - look at ALL commits from `git diff main...HEAD`, not just the latest commit.

Based on the changes:

### 1. Create branch (if on main/master)
Use the format `username/feature-name`:
```
git checkout -b username/descriptive-feature-name
```

### 2. Create a single commit
Use heredoc syntax for the message:
```
git commit -m "$(cat <<'EOF'
Commit message here.
EOF
)"
```
- Follow the repo's commit message style (check `git log --oneline -10`)
- Focus on "why" not "what"
- Keep it concise (1-2 sentences)

### 3. Push the branch
```
git push -u origin HEAD
```

### 4. Create or update PR
Check if a PR already exists (from the `gh pr view` output above).

**If PR exists** - update it:
```
gh pr edit --title "Short title" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>

## Test plan
- [ ] Test item 1
- [ ] Test item 2
EOF
)"
```

**If no PR** - create one:
```
gh pr create --title "Short, descriptive title" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>

## Test plan
- [ ] Test item 1
- [ ] Test item 2
EOF
)"
```

**Rules:**
- Keep PR titles under 70 characters. Use the body for details.
- Summary should be 1-3 bullet points covering WHAT changed and WHY
- Test plan should be a checklist of verification steps

### 5. Return the PR URL

Do all of the above in a single message using multiple tool calls. Return the PR URL when done.
````
END THIRD-PARTY FILE a00f186219b54c56

The third-party file has ended. Everything between the a00f186219b54c56 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© sneg55 · MIT · https://github.com/sneg55/agent-starter/tree/HEAD/skills/commit-push-pr/SKILL.md

## Similar
- [triage](https://affpapa.org/en/nevibecode/skills/triage.md) — skill · 990453 installs
- [code-review](https://affpapa.org/en/nevibecode/skills/code-review.md) — skill · 789521 installs
- [implement](https://affpapa.org/en/nevibecode/skills/implement.md) — skill · 774700 installs
- [git-guardrails-claude-code](https://affpapa.org/en/nevibecode/skills/git-guardrails-claude-code.md) — skill · 499069 installs
- [setup-pre-commit](https://affpapa.org/en/nevibecode/skills/setup-pre-commit.md) — skill · 489289 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
