agentleFS
mattstrublemattstruble/skills/git-commit/SKILL.md

git-commit

Skill2 starsChanged 4 months agoMITView on GitHub

Git conventional commits — use this skill whenever authoring new git commits from working tree changes, writing commit messages, or planning how to organize changes into commits. Also trigger when grouping changes into logical commits, cleaning up a messy working tree, or when any agent needs to create commit messages as part of a workflow. NOT for non-authoring git operations (branching, merging, rebasing, cherry-picking, reverting, squashing, resolving conflicts, creating PRs, git configuration, or exploring git history).

174 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use github-pr-create, git-branch and 9 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.
  • mjun0812Skill

    github-pr-create

    Pull Requestを作成するSkill。現在のbranchからpull requestを作成する。言語指定可能。 ユーザーが「PR作って」「pull request作成して」のように依頼したら使うこと。

    Also in 3 projects that use this

  • MicrosoftSkill

    git-branch

    Branch management for implementation. Use when you need to create a branch, switch branches, checkout, or verify branching strategy before implementing code. Do not use for commits (use git-commit), pull requests (use pull-request), or advanced git operations (rebase, merge).

    Also in 4 projects that use this

  • klauswgSkill

    git-issue

    Prepare, review, create, or update evidence-based GitHub issues for the current repository with duplicate detection, repository-native templates, valid labels, and post-publication verification. Use when the user asks to draft, file, submit, publish, edit, or refine a GitHub issue, bug report, feature request, performance issue, or technical proposal. Always require the user to review and explicitly approve the exact final issue before any GitHub write.

    Also in 3 projects that use this

  • gologo13Skill

    git-push

    Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.

    Also in 6 projects that use this

  • GoogleSkill

    github-pr-review

    Review a GitHub pull request and leave inline comments in a natural human reviewing voice, indistinguishable from comments typed by hand on the GitHub web UI. Deliberately bounded to defects a reader can settle by looking at the anchored line, rather than a deep audit, so every comment is cheap for the author to check. Scales to 2-20 comments by PR size, parallelises analysis across sub-agents, drafts for approval, then posts individually with human pacing. Use when the user says "review this PR", "review PR 123", pastes a github.com/.../pull/N link, or asks for comments on a pull request. Don't use for reviewing local uncommitted changes or a diff against a branch (use the `review` skill for that).

    Also in 4 projects that use this

  • GitHubSkill

    multi-stage-dockerfile

    Create optimized multi-stage Dockerfiles for any language or framework

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 8 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 134 edited versions we read keep these.

  • 8

    Distinctive

    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
  1. Very specific:

    Check .commitlintrc*, commitlint.config.*, .czrc, CONTRIBUTING.md

    line 23
  2. Distinctive:

    Always: run git log --oneline -20 — even when config files exist.

    line 24
  3. Distinctive:

    If both staged and unstaged exist, work only with staged — the user staged those intentionally.

    line 38
  4. Distinctive:

    Read the actual diffs — filenames hint, but diff content tells you *what changed and why*.

    line 42
  5. Distinctive:

    Test files go with the code they test — not with all other tests

    line 58
  6. Distinctive:

    Commit order: infrastructure → refactors → features/fixes → standalone docs

    line 62
  7. Distinctive:

    After all commits are made, check for beads context:

    line 89
  8. Very specific:

    If .beads/ does not exist in the project root → skip, done.

    line 91
  9. Very specific:

    Run bd mine — if no claimed tasks → skip, done.

    line 92
  10. Very specific:

    If claimed tasks exist, ask the user: *"Does this commit close task <id>(<title>), or is this intermediate progress?"*

    line 93
  11. Distinctive:

    Subject-line only. No body: Every commit is a single line.

    line 103
  12. Very specific:

    No other footers. Never add Co-authored-by.

    line 114
  13. Very specific:

    When a change spans types, use the type that describes the production change (feat or fix).

    line 140
  14. Very specific:

    Use top-level directory or module name: src/auth/ → scope auth

    line 143
  15. Distinctive:

    Stop if you catch yourself thinking any of these:

    line 157

“Common” is measured: kept by at least 6 in 10 of the 134 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Conventional Commits

Analyze working tree changes, group by intent, write conventional commit messages that respect repo conventions.

References (read when needed):

  • references/worked-example.md — read when grouping is ambiguous or changes span multiple intents

Workflow

Step 1: Detect repo conventions

Do this before writing any messages. Repo-specific rules override defaults here.

  • Check .commitlintrc*, commitlint.config.*, .czrc, CONTRIBUTING.md
  • Always run git log --oneline -20 — even when config files exist. Config defines the rules; history shows what the team actually does. When they conflict, history wins.

Repo history is the ground truth. A feat: in a repo that uses feature: looks wrong forever.

Step 2: Assess the working tree

Run git status:

StateAction
Staged files existWork only with staged → Step 3 → Step 5 → Step 6
Unstaged/untracked onlyAnalyze all → Step 3 → Step 4 → Step 5 → Step 6
CleanNothing to commit — tell the user

If both staged and unstaged exist, work only with staged — the user staged those intentionally.

Step 3: Analyze the changes

Read the actual diffs — filenames hint, but diff content tells you what changed and why.

git diff --cached          # staged
git diff                   # unstaged
git ls-files --others --exclude-standard  # untracked

For each change, identify: intent (feature? fix? cleanup?), scope, logical connections to other changes.

Step 4: Group changes into commits

Only applies when no staged files exist.

Group by shared intent, not shared type. Two unrelated bug fixes = two fix: commits.

  • Test files go with the code they test — not with all other tests
  • Config/migrations that enable a feature go with that feature
  • Standalone docs (README, docs/*.md) get their own docs: commit
  • Pure refactors stay separate from feature/fix work
  • Commit order: infrastructure → refactors → features/fixes → standalone docs

See references/worked-example.md for tricky grouping decisions.

Step 5: Present the plan — STOP and wait

Do not run any git add or git commit until the user confirms. Show the proposed commits as a numbered list with the message and files for each:

1. feat(auth): add token revocation
   - src/auth/revoke.py (new)
   - tests/test_auth_revoke.py (new)

2. docs: update README with features section
   - README.md (modified)

Then ask: "Does this look right, or do you want to change anything?" and stop. Wait for the user's response before proceeding.

The user might adjust groupings, rename messages, or reorder commits — this is the whole point. Commits are permanent, so the plan must be reviewed first. This applies even for a single commit.

Step 6: Execute the commits

For each group: git add <files> → compose message → git commit -m "<message>"

Step 7: Beads task closure (if applicable)

After all commits are made, check for beads context:

  1. If .beads/ does not exist in the project root → skip, done.
  2. Run bd mine — if no claimed tasks → skip, done.
  3. If claimed tasks exist, ask the user: "Does this commit close task <id>(<title>), or is this intermediate progress?"
    • Close → bd close <id> --reason "<brief reason from commit message>"
    • Intermediate → no action

Message format

<type>(<scope>): <description>

Subject-line only. No body. Every commit is a single line. If the subject can't convey the change, rewrite the subject — don't append a body. The diff shows the how; the subject captures the what.

The only exception is footers for breaking changes or issue refs, separated by a blank line:

feat(api)!: change auth token format

BREAKING CHANGE: tokens issued before v2 are no longer accepted
Refs: #452

No other footers. Never add Co-authored-by.

Subject line rules:

  • type is required
  • scope is optional — a short noun for the affected area (e.g., auth, api, cli)
  • description: lowercase, imperative mood ("add" not "added"), no trailing period
  • Under 72 characters total
  • Breaking changes: append ! before colon
  • Describe the change, not what triggered it — never "address review findings", "code review fixes", "apply feedback", or "per suggestions"; state what was clarified, fixed, or added

Change types:

TypeWhen to use
featNew capability that didn't exist before
fixCorrects incorrect behavior
docsDocumentation only — READMEs, standalone guides
styleFormatting, whitespace — no logic change
refactorRestructuring without behavior change
perfPrimary purpose is improving performance
testAdding/updating tests with no production code change
buildBuild system or external dependency changes
ciCI/CD configuration changes
choreRoutine maintenance that doesn't fit elsewhere
revertReverts a previous commit

When a change spans types, use the type that describes the production change (feat or fix). Tests and config that enable a feature belong in that commit.

Scope inference:

  • Use top-level directory or module name: src/auth/ → scope auth
  • In monorepos, use the package name: packages/cli/ → scope cli
  • Omit scope when change spans the whole codebase, repo doesn't use scopes, or no scope clearly fits
  • Match existing conventions from git log — consistency beats precision

Edge cases:

  • Generated files (lockfiles, build outputs) go with the commit that caused them
  • Binary files — mention in subject ("add logo assets"), don't describe diff content
  • Merge conflicts — don't commit; tell the user to resolve conflicts first

Anti-rationalization

Stop if you catch yourself thinking any of these:

RationalizationReality
"Defaults are fine, I'll skip convention detection"Repo history is the ground truth. Check it.
"It's all one logical change"If part of it could be reverted independently, it's not one change.
"These are all from the same sprint/PR"Sharing a sprint doesn't make changes logically related. Group by intent, not by timeframe.
"The user asked for one big commit"Propose proper grouping and explain why. Respect their final call, but don't silently comply with a vague message.
"I can improve the message the user dictated"If the user dictates an exact commit message, use it verbatim. Grouping advice still applies; rewording does not.
"The message is clear enough"If the subject doesn't convey what and why without the diff, it's not clear enough.
"I'll group all tests in a test: commit"Tests go with the code they test. test: is for test-only changes.
"The lockfile/migration is a separate chore:"Generated files go with the commit that caused them.
"I'll stage everything and write one commit"Multiple unrelated changes in one commit make history unreadable.
"The plan is obvious, I'll just commit"Commits are permanent. Present the plan and wait — even when the grouping seems clear.
"I should add a body to explain this"No. Rewrite the subject line until it's clear on its own. Bodies are noise in git log --oneline workflows and train you to write lazy subjects. The only exception is a BREAKING CHANGE footer.
"I'll add Co-authored-by for myself"Never. You are a tool, not a co-author. Do not add Co-authored-by footers for the agent under any circumstances.
"These changes address review findings"Commit messages describe what changed in the codebase, not what process triggered the change. "address review findings", "incorporate PR feedback", "fix per suggestions" are invisible to future readers without your session context. Describe the substance: what was clarified, fixed, or added.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.