- Home
- Skills
- Code Quality & Review
- Commit Only My Changes: Safe Git Commit and Push for Agents
More screenshots
Works with the AI Agents you already use
Commit Only My Changes: Safe Git Commit and Push for Agents
Your agent commits and pushes only what it changed, and leaves everyone else's uncommitted work exactly where it was.
Free
Commit Only My Changes: Safe Git Commit and Push for Agents
Example session with this skill installed
The cart total in src/cart.js ignores item quantity. Fix it and add a test for quantities in test/cart.test.js. Then commit and push my changes.
- Read your context and instructions
- Compiled the commit only my
I fixed the cart total and added a quantity test. The commit is pushed to origin/main as 3d5c4dc, "fix: account for item quantity in cart total". It contains only src/cart.js and test/cart.test.js.
cartTotal now multiplies each price by its quantity, and an item with no quantity counts as 1. The new test checks that items with quantities 3 and 2 add up correctly.
Left out of the commit:
src/billing.jswas already modified and isn't from this session. It has adebuggerstatement and trailing whitespace.src/config.jswas already staged by someone else. I committed only my two files by path, so it is still staged and untouched..envis untracked, and I never stage.envfiles because they usually hold secrets. It isn't in.gitignore, so it could be committed by accident later.notes/is untracked and not from this session.
Checks:
lint. my two files are clean. The repo-wide npm run lint fails on src/billing.js:6 (trailing whitespace) and src/billing.js:8 (debugger), both in that unfinished work. I didn't touch the file.
format. I skipped it. npm run format runs on ., which would rewrite other people's uncommitted files.
tests. npm test passes ("cart tests passed").
Do you want the src/billing.js work committed separately once its debugger is removed?
Connects securely to your tools. The creator never sees your data.
About this skill
The problem. You run two agent sessions in one repo, or you and an agent share a checkout, or a teammate's draft sits uncommitted. You say "commit and push my changes" and the agent reads "my" as "everything dirty": someone's half-finished feature, a file another session staged, a draft section at the bottom of the file it edited. Once that is pushed, it is in everyone's history. With this skill, the commit holds only what this session changed, and everything else in the folder stays where it was.
What it does. Ask "Fix the cart total, add a test, then commit and push my changes" in a folder where someone else left src/billing.js half done (with a debugger in it), staged src/config.js, and an untracked .env. The pushed commit holds src/cart.js and test/cart.test.js and nothing else. The report lists each file it left out and why, and asks whether you want the billing work committed separately once its debugger is removed.
- Sorts every dirty file into "mine" and "not mine" before running anything, so someone else's unfinished work stays out of your history.
- Commits only its own lines in a shared file, so a teammate's draft section in the same file stays uncommitted on disk.
- Leaves files someone else staged out of the commit, and still staged, so their next commit is theirs to make.
- Runs the repo's own lint, format and tests on its own files, skips what the repo does not have, and reports failures in other people's files instead of editing them, so their work does not go out under your name.
- Checks the remote, branch and identity, then confirms the push landed, so you know exactly what went where.
- Built never to stage
.envfiles or keys, and tells you when a secret file is not in.gitignore.
Why this beats prompting it yourself. Same repo, same request.
Without the skill, agents often:
- Read "my changes" as everything dirty and pushed someone's unfinished file,
debuggerand all - Committed a whole shared file, someone else's draft section included
- Never ran the repo's linter
With the skill:
- The commit held only this session's files
- Only its own line from the shared file; the draft stayed on disk
- Ran the linter and reported failures in other people's files instead of "fixing" them
Limits. Needs a terminal and git; it does nothing in a chat-only agent. Its rules are instructions to your agent, not a technical lock; your agent's permission settings are the lock. When it cannot cleanly separate its lines from someone else's in a shared file, it leaves the file out and asks.
What's inside: SKILL.md (the method, in order: file set, secrets, checks, staging, push gate, report), references/recipes.md (exact git commands for a pre-staged index, a shared file, a private index, undoing an over-wide commit, a remote that moved, and verifying the push), examples/scenarios.md (four worked scenarios with the commit that should come out). Customize it by editing the tables: add your linter or formatter, your deploy targets, or more secret patterns.
- It works from what the agent knows it changed this session. A file the agent edited and forgot about, or edits made outside the agent in the same file, need the agent to read the diff carefully; when it cannot separate the lines, it leaves the file out and asks.
- "Never stage
.env", "never force push" and the rest are instructions to your agent, not a technical lock. Your agent's permission settings are the lock. - Needs a terminal and git. Not for chat-only agents.
- If the remote moved and the incoming commits touch a file someone else has uncommitted edits in, it stops and asks instead of merging.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Permissions
File Scopes
no scripts, no installs, no credentials, no environment reads. The skill text names destructive commands (`git reset --hard`, `git clean`, `git push --force`) only to forbid them.