Skip to content
Agentmart
Submit a tool

git-commit

Git commit guidelines, including which branch a commit goes on, the first commit, and GitHub stacked pull requests.

Skill by jmfontaine

IndexedApache-2.0
Write a review

Chalk Labs

Need help deploying git-commit?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jmfontaine-git-commit

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Git commit guidelines, including which branch a commit goes on, the first commit, and GitHub stacked pull requests. Use before every git commit, including a bare "commit" or "commit and push" request, and when amending, squashing, rewording, staging files, writing commit messages, or splitting dependent changes into stacked branches and pull requests.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/git-commit

Tools it pre-approves 22

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash(git
  • add:*)
  • branch:*)
  • commit:*)
  • diff:*)
  • fetch:*)
  • log:*)
  • merge:*)
  • rebase:*)
  • show:*)
  • status:*)
  • Bash(gh
Show 10 more
  • extension
  • list:*)
  • stack
  • bottom:*)
  • checkout:*)
  • down:*)
  • init:*)
  • top:*)
  • up:*)
  • view:*)

What's inside

Skill name
git-commit
Description
Git commit guidelines, including which branch a commit goes on, the first commit, and GitHub stacked pull requests. Use before every git commit, including a bare "commit" or "commit and push" request, and when amending, squashing, rewording, staging files, writing commit messages, or splitting dependent changes into stacked branches and pull requests.
License
Apache-2.0
Allowed tools
Bash(git, add:*), Bash(git, branch:*), Bash(git, commit:*), Bash(git, diff:*), Bash(git, fetch:*), Bash(git, log:*), Bash(git, merge:*), Bash(git, rebase:*), Bash(git, show:*), Bash(git, status:*), Bash(gh, extension, list:*), Bash(gh, stack, add:*), Bash(gh, stack, bottom:*), Bash(gh, stack, checkout:*), Bash(gh, stack, down:*), Bash(gh, stack, init:*), Bash(gh, stack, rebase:*), Bash(gh, stack, top:*), Bash(gh, stack, up:*), Bash(gh, stack, view:*)
Instructions
190 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Git Commit Guidelines

## Where to Commit

Never commit on the repository's default branch. Before the first commit of a change,
run `git branch --show-current`. If it prints the default branch, create a branch named
as the `git-branch` skill describes and commit there.

Two exceptions:

- **The first commit of a repository** (see First Commit) goes straight onto the default
  branch.
- **Straight-to-main repositories:** when the repository's agent instruction files
  (AGENTS.md, CLAUDE.md) allow or require committing straight to the default branch,
  commit there, with no branches or pull requests. Once the user has approved a change
  and it is finished and checked, commit it (signed) without asking. Push only when the
  user asks, and close issues with `Closes #N` in the commit message.

## Message Style

With squash merges, only the pull request title reaches the default branch, as one
commit. Write it in Conventional Commits without a scope: `<type>: <description>`, or
`<type>!: <description>` for a breaking change (the `github-workflow` skill, if
installed, has the details). Commits on the branch are free-form but clear: say what
changed and why in a short subject.

Commits that land as-is, such as those in straight-to-main repositories, follow the
repository's style. Run `git log --oneline -20` (or
`git log -20 --format=%B` when you need bodies) and mirror the prevailing subject
format, casing, tense, prefixes, scopes, and body usage. If the history is too short to
show a style, use [Conventional Commits](https://www.conventionalcommits.org/). The
first commit has its own message (see First Commit).

## Split Check

Before committing, review all staged and unstaged changes to decide how to divide them
into branches and pull requests. Changes belong in separate branches when they are
different kinds of change (e.g., a feature and a bug fix), affect unrelated areas, or
serve distinct purposes. Commits within a branch need no such split: only the pull
request title reaches the default branch.

If the user has not explicitly asked to split, suggest doing so and list the proposed
branches. Proceed with a single branch only if all changes are logically cohesive. In a
straight-to-main repository, apply the check to commits instead, since each commit lands
as-is.

Also check for changes made outside the current session (e.g., editor saves, other
tools). If they are relevant to the commit, offer to include them. If they are
unrelated, silently ignore them unless the user asks to include them.

cSpell words added outside the session (typically by the user, in `cspell.json`,
`.cspell.json`, `.vscode/settings.json`, or a custom dictionary file) are an exception:
include them, without asking, in the commit that introduces the text using them. When
changes are split, put each word in the change it relates to.

## Staging

Stage files by explicit path (`git add <path>…`), and commit only what you staged. Never
use `git commit -a`, `git commit -am`, `git add -A` or `git add .`: other sessions or
the user may have uncommitted edits in the same checkout. To change another repository,
work in its own worktree, never in its main checkout.

## First Commit

The first commit of a repository (no commits yet, so `git log` reports none) is the
exception to "never commit on the default branch":

- It goes straight onto the default branch (`main`), with no split check.
- It uses this exact message, overriding the message style rules above:

  ```text
  That's one small step for mankind, one giant leap for a man
  ```

- It may contain a generated project skeleton, minimal README content, and the
  Manifesto. It contains no real work: start that on a branch.

Follow these rules unless the user instructs otherwise.

## Pushed Commits

Never rewrite pushed commits. Fix review findings with new commits on top. Do not force
push. To check whether a commit has been pushed, run
`git branch -r --contains <commit>`; empty output means it is unpushed.

Amending unpushed commits is allowed, but never required. Use `git commit --amend` for
the last commit, or `git commit --fixup=<commit>` followed by
`git rebase --autosquash <commit>~1` for an older one.

Why squash merges: they are the only GitHub merge method that keeps the default branch
linear with every commit signed and verified; the full rationale is in
`github-workflow/references/repository-setup.md`, if the `github-workflow` skill is
installed. The only force push the workflow allows is the rejected-layer procedure of
the `parallel-issues` skill (if installed), and only with the user's approval.

## Stacked Pull Requests

Use
[GitHub stacked pull requests](https://docs.github.com/en/pull-requests/get-started/about-stacked-prs)
when the work spans several dependent concerns that each deserve their own review, such
as a schema change, then the API using it, then the UI. Each concern gets its own
branch, and each branch builds on the one below it. A single cohesive change needs one
branch, not a stack. Independent changes go on separate branches off the default branch.

Stacks follow dependencies. The `parallel-issues` skill, if installed, also stacks
issues that edit the same files, and owns that exception.

### Availability

Stacks are available when the repository is hosted on GitHub and the `gh stack`
extension is installed. Check with `gh extension list` and look for `github/gh-stack`.
Do NOT run a `gh stack` command to find out: recent GitHub CLI versions install the
extension silently when `gh stack` is invoked.

- **`gh` is missing or the repository is not on GitHub:** skip stacks and use plain git
  branches.
- **Extension missing:** ask the user whether to install it with
  `gh extension install github/gh-stack`. If they decline, use plain git branches and do
  not ask again in this session.

From jmfontaine/agent-skills, Apache-2.0.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 18, 2026 (12 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jmfontaine

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get git-commit running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying git-commit?

CallGet help
Cite this page

git-commit skill. Agent Mart. https://agentmart.dev/skills/jmfontaine-git-commit (last updated 2026-10-24)