Skip to content
Development
Skill

/commit-push-current

Use when a human explicitly asks to commit and push to the checked-out branch, including directly to the default branch, with no branch creation and no pull request. Not for a feature branch off the default: use commit-push-pr in its no-PR mode.

From plugin
odin-claude-plugin
40200 skills

Claude Code

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

SKILL.md

commit-push-current.SKILL.md
name: commit-push-current
description: 'Use when a human explicitly asks to commit and push to the checked-out branch, including directly to the default branch, with no branch creation and no pull request. Not for a feature branch off the default: use commit-push-pr in its no-PR mode.'
disable-model-invocation: true

Commit and push the current branch

Ship the working tree on the branch that is checked out. This skill never creates or switches branches. Explicit invocation on a branch, including the default branch, authorizes the push to that branch. For a feature branch off the default, use `commit-push-pr` in its no-PR mode. When the invocation names the default branch as the target, run in `commit-push-main` mode: only the resolved default branch is pushed, the remote default branch is verified before any commit, and any other checked-out branch is refused.

Contract

| Field | Bound contract | |---|---| | Trigger | A human explicitly invokes this skill to commit and push to the checked-out branch, or names the default branch as the push target (`commit-push-main` mode). | | Authority | Human-only: explicit human invocation is the authorization. The skill previews the exact push target and the commit set before the push. The write set is local commits on the checked-out branch and one push to `origin/<current-branch>`; in `commit-push-main` mode that target is `origin/<default>` and any other branch is refused. Rollback is `git reset --hard <prior-HEAD>` for new commits and a revert commit for pushed work. No remote mutation beyond the previewed push. | | Side effect | Local commits on the checked-out branch and one `git push` to `origin/<current-branch>`; in `commit-push-main` mode that target is the verified `origin/<default>` and the commit follows the remote preflight. No branch creation, no branch switch, no pull request, no force push. | | Done | The checked-out branch is committed and pushed: `git status --porcelain` is empty and `git rev-list --left-right --count origin/<current-branch>...HEAD` prints `0 0`. |

Inputs

  • 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.
  • Push-target state (`git rev-list --left-right --count origin/<current-branch>...HEAD`): required, gathered by the skill. `NO_REMOTE_BRANCH` means the local tracking ref is absent; step 5 observes the remote with `git ls-remote --heads origin <current-branch>` to decide whether the branch is new.
  • 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 as the preview base for a branch new to `origin`. When every resolver fails, the skill stops; a default branch is never guessed.
  • Mode (`current` or `commit-push-main`): required, chosen by the invocation. `commit-push-main` is set when the human names the default branch as the push target; otherwise `current`.

Procedure

1. Gather context: run `git status`, `git diff HEAD`, `git branch --show-current`, `git log --oneline -10`, `git remote`, `git rev-list --left-right --count origin/$(git branch --show-current)...HEAD 2>/dev/null || echo NO_REMOTE_BRANCH`, and `git rev-parse --abbrev-ref origin/HEAD 2>/dev/null || echo DEFAULT_BRANCH_UNRESOLVED`. When `git remote` lists no `origin`, skip the resolution below; step 4 reports local-only. 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. Done when: tree state, branch, recent history, push-target counts, and default branch are known, or the skill has stopped. 2. Classify the branch state. Done when: the state is classified and the skill continues or stops.

  • `commit-push-main` mode with a mismatch (checked-out branch is not the resolved default branch, or HEAD is detached): report the mismatch and stop. This mode pushes only the default branch.
  • Detached HEAD (empty branch name): there is no branch ref to push. Report that this skill pushes only the checked-out branch and stop. `commit-push-pr` in no-PR mode creates a feature branch when one is wanted.
  • `commit-push-main` mode preflight, before any routing below: on `NO_REMOTE_BRANCH`, verify with `git ls-remote --heads origin <default>` — empty output means report that `origin/<default>` does not exist and stop, because this mode never creates the remote default branch; a failed call means the remote cannot be observed: report and stop; non-empty means materialize the ref with `git fetch --no-tags origin refs/heads/<default>:refs/remotes/origin/<default>` and read the counts again. With an existing tracking ref, materialize the same refspec first. When either fetch fails, report and stop before any commit. Without `origin`, report local-only and stop, because the default branch cannot be verified without a remote.
  • Nothing to do (clean tree and zero on the right side of the push-target counts): report and stop.
  • Clean tree with commits ahead of the push target: skip to step 5; in `current` mode a clean tree with `NO_REMOTE_BRANCH` also skips to step 5 as a branch new to `origin`. Otherwise continue, including a dirty tree: with no `origin`, step 4 reports local-only; otherwise step 3 authors the commits. Only a clean tree skips the commit step.

3. Author the commits with `commit`. Its message conventions, atomicity rules, and sta

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.

skills11d309k
@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,…

ecc13d293k
@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…

react2d252k
@facebook@facebookInstall Skill

Questions about commit-push-current.

Which coding agents can use commit-push-current?
commit-push-current 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.