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
40200 skills

Claude Code

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

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
@outlinedriven
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

Stars on GitHub

Momentum

stars in total
40
Star history of OutlineDriven/odin-claude-plugin on GitHub, a chart by star-history.com

Other skills on odin-claude-plugin.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about commit-push-pr.

Which coding agents can use commit-push-pr?
commit-push-pr installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.