Skip to content
Skills Library
Programming · Automation

commit-push-main

/commit-push-main

Use when a human explicitly asks to commit and push directly to the default branch, with no feature branch and no pull request. Not for another checked-out branch: use commit-push-current.

Licence
Apache-2.0
Last repository change
10.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Use when a human explicitly asks to commit and push directly to the default branch, with no feature branch and no pull request. Not for another checked-out branch: use commit-push-current.

Original author description

Use when a human explicitly asks to commit and push directly to the default branch, with no feature branch and no pull request. Not for another checked-out branch: use commit-push-current.

How it works

  1. Confirm the destination before touching anything
  2. Stay on the default branch with work worth shipping
  3. Preview the exact push and wait for approval
  4. When to stop instead
  5. What you hand back
Original SKILL.md headings · 53 lines, 1,052 words
SKILL.md preview
---
name: commit-push-main
description: 'Use when a human explicitly asks to commit and push directly to the default branch, with no feature branch and no pull request. Not for another checked-out branch: use commit-push-current.'
disable-model-invocation: true
---

# Ship the default branch directly

This skill puts the working tree on the default branch of the repository. The push target is the resolved default branch, and any other branch is refused. Branches are never created or switched here. Explicit human invocation authorizes both the commits and the push on the default branch. The work is done when `git status --porcelain` is empty and `git rev-list --left-right --count origin/<default>...HEAD` prints `0 0`.

## Confirm the destination before touching anything

Run `git status`, `git diff HEAD`, `git branch --show-current`, `git log --oneline -10`, and `git remote`. A missing `origin` ends the skill before any commit, because the default branch cannot be verified and nothing could be pushed. Remotes are never added, invented, or guessed.

Otherwise prove the push destination first. Run `git config --get-all remote.origin.push` and stop before any commit on any output line, since a custom refspec would redirect `git push origin HEAD`. Run `git remote get-url --all origin`, stopping before any commit on failure or on more than one line, and record the single fetch line as FETCH_URL. Run `git remote get-url --all --push origin` the same way to record PUSH_URL, refusing an ambiguous push the same way. FETCH_URL and PUSH_URL must match exactly as strings. A triangular configuration cannot stand as its own preview, so report it and stop before any commit.

Resolve the default from authoritative advertisement only. Run `git ls-remote --symref origin HEAD` and take the branch named by the first `ref: refs/heads/<name>` line. Failure or a missing ref line means `DEFAULT_BRANCH_UNRESOLVED`, so report and stop before any commit. Confirm the same branch through `git ls-remote --symref "$PUSH_URL" HEAD`, and report any disagreement with the push destination before any commit. Prove the branch exists on both destinations with `git ls-remote --heads origin <default>` and `git ls-remote --heads "$PUSH_URL" <default>`. Empty output on either means the default is absent there, so report and stop before any commit without creating it. On GitHub, read the default branch rules with `gh api repos/<owner>/<repo>/rules/branches/<default>`; when a `pull_request` or `merge_queue` rule applies, stop before any commit and send the request to `commit-push-pr`. A failed call means the remote is unobservable, which also stops the skill. The `origin/HEAD` cache and any `gh` fallback stay unused. Guessing is never allowed.

Read `git rev-list --left-right --count origin/<default>...HEAD 2>/dev/null || echo NO_REMOTE_BRANCH`. On `NO_REMOTE_BRANCH`, materialize the proven ref with `git fetch --no-tags origin refs/heads/<default>:refs/remotes/origin/<default>` and read the counts again. A failed fetch stops the skill before any commit.

## Stay on the default branch with work worth shipping

Refuse anything but the resolved default. A different checked-out branch or a detached HEAD ends the skill before any commit, with no branch created or switched. Point the human at `commit-push-current` for the checked-out branch or `commit-push-pr` for a feature branch.

Classify the work. A clean tree with zero on the right side of the counts means nothing to do, so report and stop. A clean tree with commits ahead of the target skips authoring and goes to the preview. Anything else continues to `commit`.

Author with `commit`, following its message conventions, atomicity rules, and staging discipline (not restated here). Its default-branch auto-branching does not apply, because invocation here already authorizes committing on the default. Its reset and branch-deletion rollback does not apply either, because recovery here never uses hard reset or branch deletion. Past this point when `commit` reports the tree committed or nothing to commit.

Run `git remote` again. Without a remote named `origin`, report local-only with the commit list and stop. Remotes are never added or guessed.

## Preview the exact push and wait for approval

Before the preview, run `verification-before-completion` on the tree about to be pushed unless fresh verification evidence for that exact tree already exists in this session; a red result stops before any push and names the failure.

Refresh the tracking tip with `git fetch --no-tags origin refs/heads/<default>:refs/remotes/origin/<default>`, stopping without pushing on failure. Prove the preview tip is the push tip: `git ls-remote origin refs/heads/<default>` and `git ls-remote "$PUSH_URL" refs/heads/<default>` must each return one line with the same non-empty SHA. Missing, failed, or disagreeing output means divergence or an unobservable destination, so report and stop without pushing. The earlier URL match plus this SHA check proves the same repository state, not just the same branch name.

List the full set with `git log --oneline origin/<default>..HEAD`. A non-zero left count means the remote holds commits HEAD lacks. Name them in the preview, because the push will be rejected until they are integrated. Show the target, the matched URLs, the matched tip SHA, and the commit list, then wait for the human to approve the exact mutation set (platform blocking question tool, chat fallback). Silence, refusal, a timeout, or an auto-selected answer stops with nothing pushed. A timeout or auto-selection is never consent. On approval, re-resolve both tip SHAs and require the same identical SHA. Any difference gets a fresh preview and another wait.

Push with `git push -u origin HEAD`. Force-push is never used.

Verify with `git status --porcelain` (empty) and `git rev-list --left-right --count origin/<default>...HEAD` (`0 0`). Report residue instead of claiming done.

## When to stop instead

- Checked-out branch is not the default, or HEAD is detached. No commit is created.
- Nothing to do. No mutation occurs.
- Custom refspec, unobservable or multiple URLs, or fetch-push divergence. Never authorize an ambiguous or triangular push.
- Default unresolved, push-side name disagreement, or existence unproven on either destination. Report `DEFAULT_BRANCH_UNRESOLVED` or the disagreement and stop. The remote branch is never created by this skill.
- Push-side tip missing, unobservable, or disagreeing with the preview tip. Approval never covers another tip set.
- Tracking-tip refresh failed before the preview. Report and stop without pushing.
- No `origin` remote. Report local-only. Remotes are never invented.
- Push rejected on a diverged branch. Report the rejection with the counts and leave resolution to the user. Silent pull or rebase repairs are out of scope.
- Verification residue. Report the files or commits left over.

## What you hand back

The committed tree on the default branch, the one push to `origin/<default>`, and a report naming the branch, the matched URLs, the matched tip SHA, the pushed hashes and subjects, and the verification result. Without `origin`, a local-only report naming the commits left unpushed.
Files in this package (2)
  • SKILL.md 7 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named commit-push-main.

Database snapshot: 13.11.2026 · package version a0f0c3b4fae4 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90commit-push-current
    Use when a human explicitly asks to commit and push to the checked-out branch with no branch creation and no pull request. Not for the default branch: use commit-push-main; not for a pull request: use commit-push-pr.
  • 90commit-push-current
    Use when a human asks to commit and push, not publish, 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.
  • 100commit-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.
  • 90commit
    Stage, commit, and push changes to the current branch. Use when asked to commit, push, or create a commit for the current task.
  • 100commit-push
    Commit changes and push to the current branch remote. Use when you want to commit local changes and push them upstream in one workflow, with branch protection against main/master.
  • 100commit-push-pr
    Use when asked to commit and push a feature branch, with or without a pull request or merge request. Description-only and description-update modes draft or refresh the body without committing.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.