git-conventions
Skill0 starsChanged 2 months agoMITView on GitHub
Use whenever git is involved — committing, saving or staging changes, writing a commit message, branching, or any history/publish operation — in any repository, even when the user just says 'save this' or 'commit'. Commit messages: one line (what, not how), optional Conventional Commits prefix; propose exact paths and message first, commit only after approval. Verify the declared branch and dirty state before edits or branch switches; an isolation worktree's branch is valid when the work owns it. Never push, --amend, --no-verify, --force, or merge/rebase/reset/cherry-pick without an explicit request, and never add Co-Authored-By or model-signature trailers. Use the repository's declared branch, not branch names borrowed from other repos. Read-only git is allowed. For an in-progress merge, use the `resolving-merge-conflicts` skill if available; the `technical-writing` skill, if available, covers the commit/PR prose; the `reviewing-code` skill, if available, covers diff discipline.
- Deletes or force-pushes
- Commits and pushes
22 other projects use a version of this.
Adopted by
Most recently taken up by
- delarooster/skillstheir own version, first seen Nov 29, 2026
- itsaspacestation/natural-intelligencetheir own version, first seen Nov 20, 2026
- lossless-group/lossless-agent-skillstheir own version, first seen Nov 18, 2026
- TsukiNi22/skillstheir own version, first seen Nov 16, 2026
- TsukiNi22/ai-utilstheir own version, first seen Nov 16, 2026
- gerardbalaoro/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use comments, simplify and 4 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.
AnthropicSkillcomments
Review open NPRM comment periods, log decisions, track deadlines. Use when an NPRM has a comment window open and you need to surface deadlines, decide whether to file, or record a filing / not-filing / waived decision (--decide CMT-ID).
Also in 3 projects that use this
Hugging FaceSkillsimplify
Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.
Also in 3 projects that use this
MicrosoftSkillwriting-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 3 projects that use this
Other versions22 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 22
- werf/werf★ 4.7ksame name
- deadlock-mod-manager/deadlock-mod-manager★ 638same name
- LedgerHQ/ledger-live★ 634same name
- rloisell/rl-agents-n-skills★ 8same name
- Stormix/transcripts-mcp★ 8same name
- MusserLab/lab-claude-skills★ 6same name
- lossless-group/lossless-agent-skills★ 4same name
- metraton/gaia★ 4same name
- sefaertunc/Worclaude★ 4same name
- a-novel-kit/stack★ 2same name
12 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 repository21 other files it gives its agents.
- authoring-skillsSkill
- creating-toolsSkill
- system-diagramsSkill
- java-spring-standardsSkill
- sql-authoringSkill
- exploring-designs-with-agentsSkill
- ui-authoringSkill
- project-docsSkill
- technical-writingSkill
- coding-standardsSkill
- critical-thinkingSkill
- github-workflowsSkill
- reviewing-codeSkill
- security-practicesSkill
- software-testingSkill
- version-evolutionSkill
- angular-standardsSkill
- resolving-merge-conflictsSkill
- releasing-android-appsSkill
- coordinating-agentsSkill
- masterSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 6 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
6
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 10
Run this once, when the skill loads and before its other steps.
- Very specific: line 12
Run node <skill dir>/scripts/permissions.mjs check --root <session folder> --host <claude|codex|agy>.
- Very specific: line 13
If node is missing or the command fails, say so, list the needs in <skill dir>/permissions.json and go on with the skill.
- Very specific: line 14
Read hosts.<host> in the output.
- Very specific: line 16
Run the command of the option the person chose, exactly as given.
- Distinctive: line 18
After "Skip for now", do not run this step again in the session.
- Very specific: line 50
After approval, recheck the branch, then stage and commit the approved paths in one command with an explicit pathspec, and check the result …
- Distinctive: line 59
Read a precondition in its own command and decide with its result in front of you: a check chained to the commit it should gate cannot stop …
- Very specific: line 61
Exact message: if the user provides -m "...", use that message instead of proposing another.
- Distinctive: line 81
Use the repository's declared base and work branch, not a branch inferred from the current checkout.
- Distinctive: line 90
Multi-repo: check each source against its *own* declaration.
- Very specific: line 97
Read the workflows that start on a push to that branch, in .github/workflows/.
- Distinctive: line 99
When the change is documentation alone and no path filter leaves it out, say that the push would still run those workflows, and offer the …
- Very specific: line 101
After the push, check what ran on the pushed commit, with gh run list when it is available, and report a run nobody expected.
- Very specific: line 103
Never push to find out: a deployment that restarts a service is not undone by a later commit.
- Very specific: line 109
A branch created from a remote ref tracks it: After git branch feature/x origin/<production> (or git worktree add -b), a bare git push …
“Common” is measured: kept by at least 6 in 10 of the 21 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
git-conventions — Safe git and commit conventions
Step 0 — Permissions this skill uses
Run this once, when the skill loads and before its other steps. It keeps the session from stopping on a prompt for a command this skill is known to run. It is not a security check: the host and its hooks still decide.
- Run
node <skill dir>/scripts/permissions.mjs check --root <session folder> --host <claude|codex|agy>.<skill dir>is the folder of thisSKILL.md;<session folder>is the folder where the session started; the host is the one you run in. - If
nodeis missing or the command fails, say so, list the needs in<skill dir>/permissions.jsonand go on with the skill. - Read
hosts.<host>in the output. Show itsnoticewhen there is one. - Ask each entry of its
questionswith the host's structured question tool, in the person's language: itstext, then its options in the given order, the one markedrecommendedfirst. Low-risk and high-risk needs are separate questions; ask them separately and never recommend allowing a high-risk need. - Run the
commandof the option the person chose, exactly as given. An option without a command writes nothing. Write nothing the person did not choose. - Tell the person the
appliesline of the result: whether the change works now or after a restart. If the command fails, say so and go on. - After "Skip for now", do not run this step again in the session.
Purpose
Operate git in a safe, controlled way: propose commits, respect the branch model, and never run destructive or publishing operations without the user's explicit request.
Knowledge
Operations forbidden without an explicit user request
Closed list. The AI never runs them on its own initiative:
git commit(includes--amend)git push(includes--force/-f)git merge·git rebase·git cherry-pickgit tag(create or edit)git reset --hard·git restore .·git checkout -- .·git clean -fd·git stash(when there is uncommitted work)
And always forbidden, even when the user asks for a commit: --no-verify (respect the pre-commit hooks), --force, Co-Authored-By trailers, model signatures.
Facing a wrong branch or a needed-but-unrequested commit: hand control back to the user — the user decides, never the AI. A merge already in progress may be resolved (if the resolving-merge-conflicts skill is available, it covers that), but starting a new merge still requires the person's request.
Read-only operations (always allowed, no asking)
status · log · diff · branch --show-current · branch -a · rev-parse · show · ls-files -u · merge-base.
Commits — propose-then-execute
On any commit request or trigger ("commit this", "save the changes"):
- Resolve the repo state (what changed, on which branch), inspect
git diff --cachedand identify the exact files belonging to this work. Do not include another person's changes. If files outside this work are already staged, show them and ask; never unstage them yourself. - Propose those paths and the commit message (canonical format below). Never commit until the user approves. Ask with the host's structured question tool when it has one, the recommended option first (commit as proposed, adjust, do not commit); otherwise as a labeled list.
After approval, recheck the branch, then stage and commit the approved paths in one command with an explicit pathspec, and check the result with
git log -1 --stat. Respect hooks (no--no-verify).git add -- <paths> && git commit -m "<msg>" -- <paths>The pathspec keeps out whatever the user or another session staged, also between your check and your commit; a bare
git committakes the whole index.- Nothing to commit → silent skip; report in chat.
Read a precondition in its own command and decide with its result in front of you: a check chained to the commit it should gate cannot stop it.
Exact message: if the user provides -m "...", use that message instead of proposing another; it does not authorize unrelated paths. Still confirm which paths are included, verify branch and hooks, and ask before committing unless the same request explicitly approved that exact change.
Canonical message format
- A single line, short (≤72 chars suggested), descriptive (what changes, not how).
- Name the change, not the process that produced it: no session names, plan or task numbers, unless the repository's convention asks for a ticket id.
- Conventional Commits prefix optional (
feat:fix:docs:chore:refactor:test:). - Forbidden: multi-line/body,
Co-Authored-Bytrailers, model signatures, emojis (unless explicitly requested),--no-verify.
Valid:
add email validation to sign-up
feat: new CSV export endpoint
fix: timeout when loading listingsThe message's prose follows plain technical-writing rules (short sentence, "what + why", no jargon); if the technical-writing skill is available, it covers them. Never duplicated here.
Branch model
Use the repository's declared base and work branch, not a branch inferred from the current checkout. Do not impose one repository's branch names or a shared multi-repo name on unrelated repos. An acquired isolation worktree may use its own declared branch name.
Branch verification before editing (gate)
Never assume the expected branch from the current one (the user may have switched it by hand). Before creating/resuming work or starting to edit, read the repo's instructions or task's declared branch, then verify git branch --show-current and git status --porcelain in each affected checkout against that declaration (or the owning isolation worktree). Verify again before the first write of every round of edits, even when the previous round ended well: between two turns the user may have merged and left the checkout on an integration branch. If no branch is declared, ask rather than invent one:
- Wrong + clean → propose
git checkout <branch>(still confirm; never create/switch silently). - Wrong + dirty (uncommitted changes) → PAUSE for manual resolution. Never auto
stash/reset/checkout/clean. - Analysis turning into edits → propose creating the declared work branch before the first Edit; switching a clean checkout still needs confirmation.
- Multi-repo: check each source against its own declaration; the workspace checkout is not a proxy. Recheck branch and dirty state before a Git mutation in a shared clone.
- On an integration branch with edits already made → stop and ask; never "edit now and move it later".
What a push starts
A push can start tests, a build or a deployment. Before a requested push:
- Read the workflows that start on a push to that branch, in
.github/workflows/. - Say what the push would run. When it deploys or publishes, name it before pushing, even when the person already asked for the push.
- When the change is documentation alone and no path filter leaves it out, say that the push would still run those workflows, and offer the filter. Editing a pipeline needs its own explicit yes.
[skip ci]in the message of the last commit of the push stops the workflows that push would start. Use it only when the person chooses it, and say that nothing will verify that push.- After the push, check what ran on the pushed commit, with
gh run listwhen it is available, and report a run nobody expected.
Never push to find out: a deployment that restarts a service is not undone by a later commit. The github-workflows skill, if available, covers the path filter, the templates and the operations.
Commands that mislead
git -C <path>overcdin a compound command: acdthat persists or fails sends the next commit to the wrong repository.- Before a requested push, list what will go with
git log origin/<branch>..HEAD: other sessions may have left commits there. - A branch created from a remote ref tracks it. After
git branch feature/x origin/<production>(orgit worktree add -b), a baregit pushtargets that remote branch. Rungit branch --unset-upstreamat once and check withgit rev-parse --abbrev-ref <branch>@{upstream}. git pullwith several refspecs makes an octopus merge, which can fast-forward the current branch to another branch's tip. Proposegit config pull.ff onlyfor repositories with a protected branch; a new clone does not inherit it.- Reverting a merge.
git revert -m <n>keeps parentn: check which parent is the release line before choosing. Merging the same branch again later brings nothing back until the revert itself is reverted; verify by content (git diff), not by ancestry. - A tool error is not evidence of absence.
git rev-parse --short <a> <b>fails with two refs whether or not they exist. Check one ref at a time withgit rev-parse --verify --quiet <ref>.
Output
Nothing on disk beyond the commits. It produces commits only when the user approves; never push, tag, or merge without an explicit request.
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.

