Commit and push the current branch
SkillDev toolsUse 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.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Commit and push the current branch skill
What this skill tells your AI
The instructions your AI receives, as published by outlinedriven/outline-driven-development in .devin/skills/commit-push-current/SKILL.md and read by ahel’s review.
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_BRANCHmeans the local tracking ref is absent; step 5 observes the remote withgit ls-remote --heads origin <current-branch>to decide whether the branch is new. - Default branch (
git rev-parse --abbrev-ref origin/HEAD, thengit ls-remote --symref origin HEAD, thengh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'verified againstgit ls-remote --heads origin <default>): required as the preview base for a branch new toorigin. When every resolver fails, the skill stops; a default branch is never guessed. - Mode (
currentorcommit-push-main): required, chosen by the invocation.commit-push-mainis set when the human names the default branch as the push target; otherwisecurrent.
Procedure
- 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, andgit rev-parse --abbrev-ref origin/HEAD 2>/dev/null || echo DEFAULT_BRANCH_UNRESOLVED. Whengit remotelists noorigin, skip the resolution below; step 4 reports local-only. Otherwise, strip theorigin/prefix from the default branch; treatDEFAULT_BRANCH_UNRESOLVEDor bareHEADas unresolved. When unresolved, rungit ls-remote --symref origin HEADand take the branch named by the firstref: refs/heads/<name>line. When that fails too, rungh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'and accept its name only whengit ls-remote --heads origin <name>lists it. When every resolver fails, reportDEFAULT_BRANCH_UNRESOLVEDand stop; never guess. Done when: tree state, branch, recent history, push-target counts, and default branch are known, or the skill has stopped. - Classify the branch state. Done when: the state is classified and the skill continues or stops.
commit-push-mainmode 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-prin no-PR mode creates a feature branch when one is wanted. commit-push-mainmode preflight, before any routing below: onNO_REMOTE_BRANCH, verify withgit ls-remote --heads origin <default>— empty output means report thatorigin/<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 withgit 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. Withoutorigin, 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
currentmode a clean tree withNO_REMOTE_BRANCHalso skips to step 5 as a branch new toorigin. Otherwise continue, including a dirty tree: with noorigin, step 4 reports local-only; otherwise step 3 authors the commits. Only a clean tree skips the commit step.
- Author the commits with
commit. Its message conventions, atomicity rules, and staging discipline apply. Do not restate them here. Its default-branch auto-branching does not apply: invocation on the checked-out branch is explicit authorization to commit on it. Done when:commitreports the working tree committed, or reports nothing to commit. - Detect the remote with
git remote. If nooriginremote exists (empty output, or other remotes but none namedorigin), do not push and do not add or guess a remote. Report local-only and stop. Done when:originis confirmed present, or the local-only result is reported. - Preview the push and wait for explicit human approval. Name the target
origin/<current-branch>and observe the remote:git ls-remote --heads origin <current-branch>. Non-empty output (branch exists onorigin): refresh the tracking tip withgit fetch --no-tags origin refs/heads/<current-branch>:refs/remotes/origin/<current-branch>; when the fetch fails, report and stop without pushing. Listgit log --oneline origin/<current-branch>..HEAD. When the left count is non-zero, the remote holds commits HEAD lacks; name them in the preview, because the push will be rejected until they are integrated. Empty output (branch new toorigin): incommit-push-mainmode this means the remote default branch does not exist: report and stop without pushing, even when a stale local tracking ref exists, because this mode never creates the remote default branch. Otherwise say so, then list the full commit rangegit log --oneline origin/<default>..HEAD, materializing the base first withgit fetch --no-tags origin refs/heads/<default>:refs/remotes/origin/<default>; when that fetch fails and no localorigin/<default>exists, report and stop without pushing, never falling back to an unanchored or truncated listing. A failedls-remotecall means the remote cannot be observed: report and stop without pushing. The push always targetsorigin, even when the configured upstream points elsewhere. Show the target and the commit list, then wait for the human to approve the exact mutation set (platform blocking question tool, chat fallback). On no answer or refusal, stop with nothing pushed. On approval, push withgit push -u origin HEAD. Never force-push. Done when: the push is accepted, or the rejection or a stop is reported. - Verify:
git status --porcelainis empty andgit rev-list --left-right --count origin/<current-branch>...HEADprints0 0. Done when: both read clean, or the residue is reported.
Failure and recovery
- Detached HEAD: report and stop. No commit is created. Suggest
commit-push-prin no-PR mode for a feature branch. commit-push-mainmode with a mismatch (checked-out branch is not the resolved default branch, or HEAD is detached): report the mismatch and stop. No commit is created.- Nothing to do: report and stop. No mutation occurs.
commit-push-mainmode with the remote default branch found absent — at the step 2 preflight (NO_REMOTE_BRANCHandgit ls-remote --heads origin <default>is empty) or at the step 5 preview (git ls-remote --heads origin <current-branch>returns empty despite a local tracking ref): report thatorigin/<default>does not exist and stop. This mode never creates the remote default branch.- No
originremote: report local-only; incurrentmode name the unpushed commits. Never add, invent, or guess a remote. Incommit-push-mainmode this stops before any commit is created. - Default branch unresolved after
origin/HEAD,git ls-remote --symref origin HEAD, and verifiedgh: report and stop. A branch new tooriginhas no honest preview base without it. Never guess a default branch. - No fetched base for a new-branch preview (fetch of
<default>failed andorigin/<default>is absent): report and stop before the push. The commit set is never previewed from HEAD alone or truncated. - Tracking-tip refresh fails before an existing-branch preview: report and stop without pushing.
- Push rejected on a diverged remote branch: report the rejection and the counts from
git rev-list --left-right --count origin/<current-branch>...HEAD. Leave resolution to the user. Never force-push. - Verification residue (non-empty
git status --porcelain, or counts other than0 0): report the uncommitted files or unpushed commits. Do not claim done.
Output
The committed working tree on the checked-out branch, one push to origin/<current-branch> (the verified origin/<default> in commit-push-main mode), and a report naming the branch, the pushed commit hashes and subjects, and the verification result. When no origin remote exists, a local-only report naming the commits left unpushed.
Signals
- GitHub stars
- 52
- Forks
- 9
- Last commit
- Sep 2026
ahel recommends instead
Advanced
- Catalog kind
- skill
- Gateway key
commit-push-current-outlinedriven- Source
- github.com/outlinedriven/outline-driven-development