Skip to content
Development
Skill

/commit-push-pr

Use when asked to commit and push a feature branch, with or without a pull request. Its no-PR mode publishes without a PR. Not for a PR body alone: use create-pull-request.

From plugin
odin-claude-plugin
36200 skills
Install
$ npx -y skills add OutlineDriven/odin-claude-plugin --skill commit-push-pr --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/commit-push-pr

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use when asked to commit and push a feature branch, with or without a pull request. Its no-PR mode publishes without a PR. Not for a PR body alone: use create-pull-request.

SKILL.md

commit-push-pr.SKILL.md
name: commit-push-pr
description: 'Use when asked to commit and push a feature branch, with or without a pull request. Its no-PR mode publishes without a PR. Not for a PR body alone: use create-pull-request.'

Commit, push, and optionally open a pull request

Commit the working tree and push the feature branch to `origin`. In pull-request mode, open or update the pull request with `gh`; in no-PR mode, stop after the push. Commit authoring belongs to `commit`. Title and body authoring belongs to `create-pull-request`. This skill adds branch placement, the PR target resolution when a PR is requested, the push, and the `gh` call when a PR is requested.

Contract

| Field | Bound contract | |---|---| | Trigger | User asks to commit and push a feature branch, either with a pull request or without one. | | Authority | Human-gated: both modes write local commits, at most one local feature branch, and one push to `origin/<branch>`. Pull-request mode also creates or edits one pull request through `gh`; no-PR mode creates no pull request. The skill states the mutation set before each remote mutation. Rollback is `git reset --hard <prior-HEAD>` for new commits, `git branch -D <branch>` for a branch this skill created, and, in pull-request mode, `gh pr close` or `gh pr edit` restoring the prior body for the PR. No remote mutation without the gate. | | Side effect | Local commits, at most one local feature branch, and one `git push` to `origin`. Pull-request mode also creates or edits one PR on GitHub; no-PR mode does not create or edit a PR. No force push. | | Done | No-PR mode: the branch is pushed with `git status --porcelain` empty and `git rev-list --left-right --count origin/<branch>...HEAD` printing `0 0`. Pull-request mode: those checks pass and `gh pr view --json url,title,state` returns the PR as `OPEN`. |

Inputs

  • Mode: optional; defaults to `pull-request`. Use `pull-request` to open or update a PR, or `no-pull-request` to push the feature branch only. This selects whether PR-target resolution, title/body composition, and the PR call occur.
  • Working-tree state (`git status`, `git diff HEAD`): required, gathered by the skill.
  • Current branch and recent history (`git branch --show-current`, `git log --oneline -10`): required, gathered by the skill.
  • Remote default branch (`git rev-parse --abbrev-ref origin/HEAD`, then `git ls-remote --symref origin HEAD`, then `gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'` verified against `git ls-remote --heads origin <default>`): required for branch placement in either mode. When every resolver fails, the skill stops; a default branch is never guessed.
  • Existing PR for the branch (`gh pr view --json url,title,state`): required only in pull-request mode, gathered by the skill. `NO_OPEN_PR` when none exists.
  • Remotes (`git remote -v`) and fork relationship (`gh repo view <origin-slug> --json nameWithOwner,parent,defaultBranchRef`): required for the PR target in pull-request mode; remotes are still gathered for the push in no-PR mode.
  • `gh` installed and authenticated (`gh auth status`): required for pull-request mode. The default-branch fallback may still use `gh repo view` in either mode.
  • Evidence supplied by the user (URL, image embed, artifact path): optional in pull-request mode, placed in the PR body as given.
  • User decisions: detached HEAD, unpushed local default-branch commits, an ambiguous PR target, and whether to rewrite an existing PR's description.

Procedure

1. Gather context: run `git status`, `git diff HEAD`, `git branch --show-current`, `git log --oneline -10`, `git remote`, and `git rev-parse --abbrev-ref origin/HEAD 2>/dev/null || echo DEFAULT_BRANCH_UNRESOLVED`. In pull-request mode, also run `gh pr view --json url,title,state 2>/dev/null || echo NO_OPEN_PR` and `gh auth status >/dev/null 2>&1 || echo GH_NOT_AUTHENTICATED`. In no-PR mode, omit those PR-only probes. When `git remote` lists no `origin`, skip remote default and PR-target resolution: nothing will be pushed and no PR can be filed. Do not classify against a default; if HEAD is detached, still run the step 3 detached-HEAD decision, then commit on the current branch and end at the local-only report. Otherwise, strip the `origin/` prefix from the default branch; treat `DEFAULT_BRANCH_UNRESOLVED` or bare `HEAD` as unresolved. When unresolved, run `git ls-remote --symref origin HEAD` and take the branch named by the first `ref: refs/heads/<name>` line. When that fails too, run `gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'` and accept its name only when `git ls-remote --heads origin <name>` lists it. When every resolver fails, report `DEFAULT_BRANCH_UNRESOLVED` and stop; never guess `main` or any other default. Done when: tree state, branch, recent history, and the required default branch and PR state for the selected mode are known, or the skill has stopped. 2. In pull-request mode, resolve the PR target. The branch always pushes to `origin`; this step decides only where the PR is filed. Read `git remote -v`. With an `upstream` remote, the PR target is `upstream`. Otherwise run `gh repo view <origin-slug> --json nameWithOwner,parent,defaultBranchRef`. A non-null `parent` makes `parent.nameWithOwner` the target candidate. Ask the user, with the platform blocking question tool (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_question` in Antigravity, `ask_user` in Pi), only when no single target is clear: no `upstream` remote and two or more non-origin candidates, `gh`'s `parent` disagrees with the `upstream` remote, or `origin` shares no merge-base with the target. A fork that is only behind its parent is not ambiguous. When `upstream` is the target, read the fork owner with `gh repo view <origin-slug> --json owner --jq .owner.login`. The head is `<fork-owner>:<branch>` and the base is the target's default branch. `gh pr create --head <owner>:<branch>` supports user-owned forks only. For a

Read more
Ships withodin-claude-plugin

Formerly the ODIN Claude Plugin. The repository URL is unchanged. Outline-Driven Development, nicknamed ODIN, is a highly opinionated code-agent skill library: principles-first engineering, surgical editing, and workflow automation, published as installable

Get the whole plugin
Stats
36
Stars
0
Forks
Active
Maintenance
Python
Language
Apache-2.0
License
3d ago
Last commit
10mo ago
Created

Repo: OutlineDriven/odin-claude-plugin

Other skills on odin-claude-plugin.