commit
Skill548 starsChanged 8 days agoApache-2.0View on GitHub
Stages and commits the current changes onto a safe working branch, enforcing branch discipline and optionally pushing upstream. TRIGGER when: the user wants to commit, save, or check in the current changes. DO NOT TRIGGER when: opening a pull request → pr.
- Reads credentials
- Commits and pushes
188 other projects use a version of this.
Adopted by
Most recently taken up by
- daledesilva/obsidian_inktheir own version, first seen Nov 9, 2026
- thoughtbot/rails-consultanttheir own version, first seen Nov 8, 2026
- pedrohcgs/claude-code-my-workflowtheir own version, first seen Nov 8, 2026
- jisuzzzz/haechitheir own version, first seen Nov 8, 2026
- dirien/yet-another-agent-harnesstheir own version, first seen Nov 8, 2026
- denysdovhan/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use validate-plan, act-on-feedback and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
shawn-dumasSkillvalidate-plan
Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.
Also in 5 projects that use this
MicrosoftSkillact-on-feedback
Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.
Also in 3 projects that use this
decocmsSkilladd-mcp-tools
Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth integration
Also in 3 projects that use this
MicrosoftSkillgenerate-run-commands
Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.
Also in 3 projects that use this
mitsuhikoSkilloebb-scotty
Austrian rail travel planner (ÖBB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ÖBB trains, S-Bahn, regional trains, and connections to neighboring countries.
Also in 3 projects that use this
mitsuhikoSkillpi-share
Load and parse session transcripts from shittycodingagent.ai/buildwithpi.ai/buildwithpi.com/pi.dev (pi-share) URLs. Fetches gists, decodes embedded session data, and extracts conversation history.
Also in 3 projects that use this
Other versions188 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 188
- microsoft/vscode★ 195ksame name
- TryGhost/Ghost★ 56ksame name
- ToolJet/ToolJet★ 41ksame name
- ShareX/ShareX★ 41ksame name
- openai/symphony★ 27ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- windmill-labs/windmill★ 18ksame name
- EverMind-AI/EverMemOS★ 14ksame name
- EverMind-AI/EverOS★ 14ksame name
178 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- backend/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- analyzing-ci-flakinessSkill
- audit-docsSkill
- creating-changelog-entriesSkill
- creating-issuesSkill
- creating-prdSkill
- grilling-ideasSkill
- harvesting-reviewSkill
- migrate-feature-pageSkill
- monitoring-pull-requestsSkill
- neo4j-cypher-guideSkill
- opsmill-dev-analyzing-bugsSkill
- opsmill-dev-fixing-bugsSkill
- opsmill-dev-test-driving-bugsSkill
- pre-ciSkill
- prSkill
- rebaseSkill
- reviewing-pull-requestsSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-critique-runSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-opsmill-autoSkill
- speckit-opsmill-extractSkill
- speckit-opsmill-implementSkill
- speckit-opsmill-prepSkill
- speckit-opsmill-retrospectSkill
- speckit-opsmill-summarySkill
- speckit-planSkill
- speckit-review-codeSkill
- speckit-review-commentsSkill
- speckit-review-errorsSkill
- speckit-review-runSkill
- speckit-review-simplifySkill
- speckit-review-testsSkill
- speckit-review-typesSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- upgrading-infrastructure-dependenciesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. 0 are common, 17 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 168 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Run git status to see staged, unstaged, and untracked files.
- Distinctive: line 33
Run git branch --show-current to identify the current branch.
- Distinctive: line 34
Run git diff --stat and git diff --cached --stat to summarise the change footprint.
- Distinctive: line 35
If there are no changes to commit (working tree clean, nothing staged) — STOP and tell the user there's nothing to commit.
- Very specific: line 36
If a merge, rebase, or cherry-pick is in progress (git status reports it, or .git/MERGE_HEAD / .git/rebase-* / .git/CHERRY_PICK_HEAD exist) …
- Distinctive: line 47
If the current branch is unsafe by any of those rules:
- Distinctive: line 49
Do NOT commit on the current branch.
- Very specific: line 55
Use a concise kebab-case slug.
- Very specific: line 57
After approval, create and switch to the branch: git checkout -b <branch-name>.
- Distinctive: line 59
If the current branch is already a real feature branch (i.e.
- Distinctive: line 64
If staged changes already exist (the user pre-staged), respect that staging and only add additional files when it's clearly intended.
- Distinctive: line 69
Follow the repo's conventional-commit style (visible in git log):
- Very specific: line 71
Use a type prefix: feat:, fix:, refactor:, docs:, test:, chore:, ci:, etc.
- Very specific: line 89
Run git commit -m "<message>".
- Very specific: line 100
Do NOT pass --no-verify — let pre-commit hooks run.
- Distinctive: line 101
Read the hook output carefully.
- Distinctive: line 104
Run git status after the commit to confirm a clean tree and verify success.
- Distinctive: line 105
Run git log -1 --stat so the user can see what landed.
- Very specific: line 111
When push IS provided:
- Distinctive: line 114
Check whether the branch already tracks a remote:
- Very specific: line 116
If no upstream exists: git push -u origin <branch-name>.
- Distinctive: line 117
If an upstream exists: git push.
- Distinctive: line 126
If asked to override the rule, refuse and explain — the user can switch branches themselves first if they truly intend to commit there (in …
- Very specific: line 146
Prefer explicit git add <path> over wholesale git add -A.
- Distinctive: line 160
All staged/unstaged changes that the user wanted to capture are committed on a safe working branch.
- Very specific: line 163
If push was provided, the branch is pushed upstream.
- Distinctive: line 164
Every branch deemed unsafe in step 2 is left untouched in all cases.
“Common” is measured: kept by at least 6 in 10 of the 168 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Commit Changes
Introduction
Stage and commit the current changes onto a safe working branch. This skill enforces branch discipline: when the current branch is unsafe to commit to (the canonical rules live in step 2 below), it proposes a new fix/, feat/, docs/, etc. branch and switches to it after approval. It works equally well for brand-new work and for additional commits on an existing feature branch. If the user passes push, the branch is pushed upstream after the commit.
Arguments
<arguments> $ARGUMENTS </arguments>
Supported arguments:
push— After committing, push the branch upstream (git push -u origin <branch>on first push, otherwisegit push).
Main Tasks
1. Assess Current State
- Run
git statusto see staged, unstaged, and untracked files. - Run
git branch --show-currentto identify the current branch. - Run
git diff --statandgit diff --cached --statto summarise the change footprint. - If there are no changes to commit (working tree clean, nothing staged) — STOP and tell the user there's nothing to commit. Do not create an empty commit.
- If a merge, rebase, or cherry-pick is in progress (
git statusreports it, or.git/MERGE_HEAD/.git/rebase-*/.git/CHERRY_PICK_HEADexist) — STOP and surface it to the user rather than committing into the middle of that operation.
2. Branch Safety — Never Commit to a Protected or Placeholder Branch
A branch is unsafe to commit to if any of the following hold:
- It is the repository's default branch (resolve with
git symbolic-ref refs/remotes/origin/HEAD --short 2>/dev/null | sed 's@^origin/@@', falling back togit remote show origin | sed -n 's/ *HEAD branch: //p'). - It is a long-standing integration branch by name:
main,master,stable,develop,dev,trunk. - It is a release branch: matches
release/*,release-*, or is otherwise clearly namedrelease-something(e.g.release-2026.05,releases/v3). - It is a placeholder / scratch branch generated by the harness or a worktree — specifically the auto-generated
adjective-animalpattern (e.g.wary-cuckoo,lumbar-gorilla,wacky-otter,silent-fox), where the second word is an animal. These exist only to host a session and should not be committed to directly. Be careful not to over-match: legitimate two-word branches likedark-mode,rate-limit,cache-layer, oruser-authare real feature branches, not scratch branches. When a name is ambiguous (two hyphenated words but not clearlyadjective-animal), do not assert it is unsafe — instead ask the user "this looks like it might be a generated scratch branch — is it, or is it a real branch you want to commit to?" and proceed on their answer.
If the current branch is unsafe by any of those rules:
- Do NOT commit on the current branch.
- Analyse the changes (diffs from step 1) to understand whether the work is a bug fix or new/extended behaviour.
- Propose a branch name using the conventional prefix that matches the change:
- Bug fix →
fix/<short-description>(e.g.fix/graphql-codegen-missing-types). - New feature or enhancement →
feat/<short-description>(e.g.feat/add-commit-skill). - Docs-only, chore, refactor, etc. → mirror the conventional-commit type:
docs/<…>,chore/<…>,refactor/<…>. - Use a concise kebab-case slug. If the repo has a visible naming convention in
git branch -aor inAGENTS.md/CONTRIBUTING.md, follow that instead.
- Bug fix →
- Present the proposed branch name to the user and wait for explicit approval (the user may suggest a different name).
- After approval, create and switch to the branch:
git checkout -b <branch-name>. The uncommitted changes carry across automatically.
If the current branch is already a real feature branch (i.e. not in any of the unsafe categories above), continue on it. Do not create a new branch unless the user explicitly asks for one.
3. Stage Changes
- Review what will be staged. Prefer adding files explicitly by path rather than
git add -Aorgit add ., especially when untracked files are present — this avoids accidentally committing secrets (.env, credentials, key files) or large/generated artefacts. - If staged changes already exist (the user pre-staged), respect that staging and only add additional files when it's clearly intended.
- Warn the user and require explicit confirmation before staging any file that looks sensitive (
.env*,*secret*,*credential*,*.key,*.pem) or generated/large (node_modules/, build artefacts,dist/,__pycache__/, lockfiles changed unexpectedly).
4. Draft the Commit Message
Follow the repo's conventional-commit style (visible in git log):
- Use a type prefix:
feat:,fix:,refactor:,docs:,test:,chore:,ci:, etc. - Optional scope in parentheses:
feat(backend): ...,fix(e2e): .... - Subject line under ~72 characters, imperative mood, no trailing period.
- Focus on the why — what changed in terms of behaviour or capability, not a file list.
- For multi-area changes, add a short body explaining the motivation.
- Respect any repo or harness commit-trailer convention (e.g. a
Co-Authored-Bytrailer the harness expects to append). Don't strip trailers that are already part of the project's workflow. - Never write a session-link trailer into the commit — strip it if the harness added one. Some harnesses append a line pointing at the private agent session, e.g.
Claude-Session: https://claude.ai/code/session_…(or any trailer carrying a URL to an agent, chat, or coding session). These leak an internal, usually unshareable URL into the project's permanent — often public — git history, and they reference session state no future reader can open, so they're pure noise at best and a disclosure at worst. This is the one exception to "don't strip trailers" above: if the harness has inserted such a line, remove it before committing, and never author one yourself. Legitimate project trailers (Co-Authored-By,Signed-off-by,Reviewed-by, etc.) still stay.
Inspect the most recent ~20 commits with git log --oneline -20 and mirror the style you see (scope conventions, capitalisation, whether bodies are used). Generic examples:
fix: correct off-by-one in pagination cursordocs: archive completed specs and extract durable knowledgefeat: add commit skill for safe branch discipline
Present the proposed commit message to the user before committing. Adjust based on feedback.
5. Create the Commit
Run
git commit -m "<message>". For multi-line messages, use a HEREDOC:git commit -m "$(cat <<'EOF' <subject> <body> EOF )"- Do NOT pass
--no-verify— let pre-commit hooks run. If a hook fails:- Read the hook output carefully.
- Fix the underlying issue (formatting, lint, etc.) rather than bypassing.
- Re-stage the fixed files and create a NEW commit so each fix stays traceable. (Don't reach for
--amendto absorb hook fixes — only amend a commit you deliberately intend to rewrite.)
- Run
git statusafter the commit to confirm a clean tree and verify success. - Run
git log -1 --statso the user can see what landed.
6. Push Upstream (only when push argument is provided)
Skip this phase entirely if push was NOT passed.
When push IS provided:
- Re-verify the branch is not unsafe per the rules in step 2 (defence in depth, though step 2 should have prevented this).
- Check whether the branch already tracks a remote:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
- If no upstream exists:
git push -u origin <branch-name>. - If an upstream exists:
git push. - Never use
--forceor--force-with-leaseunless the user explicitly asks for it. Regulargit pushwill fail if the remote has diverged — surface that error to the user instead of overwriting. - Report the push result and, if a remote URL is configured (
git config --get remote.origin.url), the branch URL the user can open.
Notes
Branch Safety:
- The canonical list of unsafe branches lives in step 2 — that is the single source of truth; don't re-derive it from memory.
- If asked to override the rule, refuse and explain — the user can switch branches themselves first if they truly intend to commit there (in which case this skill no longer applies).
This is a discipline skill — hold the line under pressure. Refusing to commit to a protected branch is the whole point, and the excuses below will appear. None of them change where the commit should land:
| Excuse / pressure | Reality |
| "It's urgent / it's an emergency, just commit to main." | Urgency doesn't change where the commit lands. A feat//fix/ branch takes seconds and is just as fast to merge. |
| "Just this once, skip the branch." | There is no "just once" — the rule exists precisely for the tempting one-off. Propose a branch. |
| "It's a tiny change, the branch is overkill." | Size is irrelevant to branch safety; a one-line fix on main is still a direct commit to a protected branch. |
"The hook is failing, just use --no-verify." | Fix the violation instead. Bypassing the hook defeats its purpose. |
"The remote diverged, just --force." | Never force-push unless the user explicitly asks. Surface the divergence instead. |
Red-flags self-check — if you catch yourself thinking any of these, STOP and re-read step 2:
- "This branch is probably fine to commit to."
- "I'll commit here and sort the branch out later."
- "The user clearly wants this on
main, so the rule doesn't apply."
Secret Hygiene:
- Prefer explicit
git add <path>over wholesalegit add -A. - Warn before staging anything that looks like a secret or credential.
- A session-link trailer (
Claude-Session:/ any agent-session URL) is a disclosure too — strip it from the commit message before committing, per step 4.
Hook Discipline:
- Pre-commit hooks exist for good reasons. Fix violations rather than bypassing with
--no-verify.
Idempotency:
- Safe to invoke repeatedly. With no changes to commit, the skill exits cleanly without creating an empty commit.
Expected Outcome
- All staged/unstaged changes that the user wanted to capture are committed on a safe working branch.
- The branch is named meaningfully (existing real feature branch preserved, or a new
fix/<…>/feat/<…>/docs/<…>/ etc. name approved by the user). - The commit message follows the repo's existing conventional-commit style.
- If
pushwas provided, the branch is pushed upstream. - Every branch deemed unsafe in step 2 is left untouched in all cases.
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.

