push-to-origin
Skill1 starsChanged 14 days agoMITView on GitHub
Reviews uncommitted changes, excludes files that shouldn't be committed, creates a well-formed commit, and pushes to origin (in its branch, no other branch). Runs git commands directly; no helper agent is required. ALWAYS confirms with the user before pushing — never pushes silently. Triggers on any request to commit, save, check in, or push changes — e.g. "commit my changes", "check this in", "save to git", "push to origin" — even without the word "push" or a commit message.
- Commits and pushes
In this repository9 other files it gives its agents.
- web/AGENTS.mdAGENTS.md
- apply-review-feedbackSkill
- code-changes-reviewSkill
- explain-changesSkill
- prd-generatorSkill
- pr-draftSkill
- project-explanationSkill
- releaseSkill
- skill-nameSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 14 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 22
Before staging or committing anything, perform the following in order:
- Distinctive: line 24
Run git status to identify the current branch, all modified files, and any untracked files.
- Very specific: line 25
Run git remote -v to confirm an origin remote exists.
- Distinctive: line 26
Run git diff --stat to get a summary of the scope of changes.
- Very specific: line 27
Check for a CI/CD configuration file (.github/workflows/, Jenkinsfile, .gitlab-ci.yml, .circleci/config.yml) to determine whether a …
- Distinctive: line 42
If a file on the exclusion list is staged, unstage it immediately and notify the user before continuing.
- Distinctive: line 49
Run git status to get the full list of modified and untracked files.
- Distinctive: line 55
If no commit message was provided, run git diff HEAD to read the changes and draft a message that accurately describes the intent.
- Very specific: line 56
Follow Conventional Commits format if required by the project: <type>(<scope>): <description> (e.g., feat(auth): add email verification …
- Distinctive: line 66
Before pushing, display the following information to the user and ask for explicit confirmation:
- Distinctive: line 73
Do not push under any circumstance until the user explicitly says yes.
- Very specific: line 76
If the branch has no upstream set, run git push -u origin <branch-name>.
- Distinctive: line 77
If an upstream already exists, run git push.
- Distinctive: line 81
If the push succeeds, confirm the result with the remote URL and branch name.
- Distinctive: line 82
If the push fails, report the exact error message and stop.
- Very specific: line 87
Never use --force or --force-with-lease.
- Very specific: line 88
Never amend commits (--amend) or rebase history as part of this skill.
- Distinctive: line 89
Never push directly to main or master without the Step 4 warning being displayed and the user explicitly acknowledging it.
- Distinctive: line 90
Never commit or push any file from the Exclusion List.
- Distinctive: line 91
If a commit message format is required by the project's CI/CD configuration, propose a fix rather than silently rewriting the user's …
- Very specific: line 92
If git remote -v shows no origin remote, stop immediately and tell the user.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
push-to-origin
Purpose
Safely and reliably bundle local code changes into a well-formed commit and push to the appropriate remote branch. This skill enforces a mandatory confirmation step before any push occurs, prevents common dangerous operations, and ensures internal or ignored files are never accidentally committed.
Trigger
Activate this skill when the user:
- Says "commit my changes," "save to git," "check this in," "push to origin," "push my work," or any similar phrase.
- Requests a commit even without providing a commit message; draft one from the diff if needed.
- Asks to "save" or "check in" their current work, even without explicitly mentioning git.
Pre-flight Checks
Before staging or committing anything, perform the following in order:
- Run
git statusto identify the current branch, all modified files, and any untracked files. - Run
git remote -vto confirm anoriginremote exists. If nooriginremote is configured, stop and tell the user. Do not proceed. - Run
git diff --statto get a summary of the scope of changes. - Check for a CI/CD configuration file (
.github/workflows/,Jenkinsfile,.gitlab-ci.yml,.circleci/config.yml) to determine whether a required commit message format exists (e.g., Conventional Commits). If one is found, read it and apply the format.
Exclusion List
The following files and patterns must never be staged or committed, regardless of whether they appear in git status. If they were accidentally staged, unstage them before proceeding:
.geminiignore.antigravityignoreGEMINI.mdpr-description.md- Any file matching patterns defined in
.gitignore,.geminiignore, or.antigravityignore. - Any file path under
.agents/or.gemini/that contains internal skill or configuration files. - Personal, machine-local agent files:
CLAUDE.local.md,.claude/settings.local.json, and any other*.local.*file inside an agent configuration folder (.claude/,.cursor/,.gemini/,.agents/). - Any file containing secrets, credentials, or API keys (check for patterns like
*_SECRET,*_KEY,*_TOKENin file names or content, and flag them).
If a file on the exclusion list is staged, unstage it immediately and notify the user before continuing.
Shared agent files are not excluded. CLAUDE.md, AGENTS.md, .claude/skills/, .claude/settings.json, and .cursor/rules/ are meant to be shared with the team, so commit them normally if they are part of the change, unless a rule above (such as a secret in the content) applies.
Workflow
Step 1: Gather and Filter
- Run
git statusto get the full list of modified and untracked files. - Cross-reference every file against the Exclusion List above. Unstage any excluded files that are already staged.
- Present the final, filtered list of files that will be staged to the user, so they can verify the scope before committing.
Step 2: Draft the Commit Message
- If the user provided a commit message, check whether it complies with the format required by the CI/CD configuration (if found in Pre-flight Check 4). If it does not comply, propose a corrected version and ask the user to approve it. Do not silently rewrite it.
- If no commit message was provided, run
git diff HEADto read the changes and draft a message that accurately describes the intent.- Follow Conventional Commits format if required by the project:
<type>(<scope>): <description>(e.g.,feat(auth): add email verification step). - Otherwise, write a clear imperative-mood summary (e.g., "Refactor session handling to use Redis").
- Follow Conventional Commits format if required by the project:
- Present the drafted commit message to the user and ask for explicit approval before proceeding. Do not commit without approval.
Step 3: Commit
- Once the commit message is approved, stage the filtered files from Step 1.
- Run
git commit -m "<approved-message>". - Confirm the commit was created successfully by running
git log --oneline -1.
Step 4: Mandatory Push Confirmation
Before pushing, display the following information to the user and ask for explicit confirmation:
- The target remote and branch:
origin/<branch-name>. - Whether this push will create a new upstream branch (if no upstream is set for the current branch).
- A brief summary of the commit being pushed (message and files affected).
- A prominent warning if the current branch is
mainormaster.
Do not push under any circumstance until the user explicitly says yes. If the user declines, leave the commit local, inform the user their changes are committed but not pushed, and stop.
Step 5: Push
- If the branch has no upstream set, run
git push -u origin <branch-name>. - If an upstream already exists, run
git push. - If the push is rejected (e.g., due to a diverged history or protected branch rules), capture the exact error message, report it to the user, and ask how they would like to proceed (e.g., rebase, merge, or leave as-is). Do not attempt to auto-resolve the conflict.
Step 6: Report Result
- If the push succeeds, confirm the result with the remote URL and branch name.
- If the push fails, report the exact error message and stop. Do not retry automatically.
Rules
- Confirmation before pushing is mandatory, every single time, without exception. Never push silently.
- Never use
--forceor--force-with-lease. Force-pushing is prohibited. - Never amend commits (
--amend) or rebase history as part of this skill. - Never push directly to
mainormasterwithout the Step 4 warning being displayed and the user explicitly acknowledging it. - Never commit or push any file from the Exclusion List.
- If a commit message format is required by the project's CI/CD configuration, propose a fix rather than silently rewriting the user's message.
- If
git remote -vshows nooriginremote, stop immediately and tell the user.
Output Format
At the end of the workflow, report:
- Staged Files — the list of files included in the commit.
- Commit — the commit hash (short) and the approved message.
- Push Result — success confirmation with remote URL and branch, or the exact error message if the push failed.
- Excluded Files — any files that were unstaged due to the Exclusion List, with a note explaining why each was excluded.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

