Command Palette

Search for a command to run...

Back to skills
skill № 66618

hoc-git-commit

Conventions for git commits, in either message format. Use before writing a commit message, and before splitting a working tree into commits. The order…

FreeNo executable scripts
openreachtechby openreachtech★ 17 GitHub stars

Install hoc-git-commit in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Git Commit

Conventions for what goes into one commit and how that commit is described.

These are two concerns decided at two different moments:

  • Granularity is decided while working — which changes get staged together.
  • Format is decided at commit time — how the staged change is worded.

Granularity comes first. A badly scoped commit cannot be rescued by a well-written subject line, because the subject is then forced to describe several unrelated things at once.

Choosing the format

Two message formats are in use across projects. They are not interchangeable within a repository — one repository uses one format throughout its history.

Resolve which one applies, in this order.

  1. The project's CLAUDE.md. A project declares its format under a ## Commit message format heading:

    ## Commit message format
    
    - Format: imperative
    

    The accepted values are imperative and conventional.

  2. The existing history, when CLAUDE.md declares nothing. Read the recent non-merge subjects and count how many carry a type prefix:

    git log --no-merges -n 30 --pretty=format:'%s'
    

    If most of them begin with a lowercase word and a colon — feat: / fix: / refactor: / docs: and the rest, optionally with a scope, as in feat(resolver): — the project uses conventional. Otherwise it uses imperative. The types themselves are listed in the conventional format file; read the ones named here as examples, not as the whole set.

  3. Default to imperative when the history is too short to judge, as in a new repository.

  • Never mix the two formats within one repository. A history that is genuinely split down the middle is a defect to raise with the user — it is not a licence to choose per commit.
  • When a project's resolved format contradicts what the user asks for in the moment, follow the user for that commit, but tell them which format the repository otherwise uses.
  • Once resolved, follow the matching detail file: format-imperative.md or format-conventional.md.

The resolved format governs what to write, never how to read

A history may hold subjects in any other convention — written before the project settled on one, or by another team, or by hand in a hurry — and those commits are still the record of what happened. So when searching for where something changed, do not filter on the resolved format alone.

git log --format='%h %s' <range>                                            # no filter
git log --format='%h %s' <range> | grep -P '^\S+ [a-z-]+(\([^)]*\))?!?: '   # type prefixes

Filter the subject line, as above, rather than reaching for --grep: that searches the whole message, so it also matches trailers such as Co-Authored-By:. And treat any subject filter as a shortcut rather than a guarantee — read the range's subjects, or its diff, without one before concluding that a change is not in the history.

Rules that apply to both formats

Subject line

  • The subject is a single line, and carries no trailing period.
  • Keep the subject below 72 characters as much as possible. This is a target, not a hard limit — most subjects should clear it, and a minority legitimately will not.
    • When a subject runs long, the usual cause is that the commit is doing more than one thing. Reach for granularity.md first: splitting the commit shortens both subjects and is the fix that actually improves the history.
    • The other legitimate cause is a long but precise identifier. Here the target yields: naming BaseRestfulApiLauncher#createResponseBodyParser() in full is worth more than hitting 72. Never truncate, abbreviate, or paraphrase an identifier to fit.
    • What the target rules out is padding — the redundant trailing clause that restates what the identifier already says. Cut the clause, not the identifier.
  • Describe the change, not the activity that produced it. wip, save progress, Update files, and Address feedback describe a working session; they tell a later reader nothing about what the tree now does differently. (Two commits are deliberate exceptions: the branch-opening marker below, which carries no changes at all, and the throwaway save point in granularity.md, which is deleted before anyone reads it.)
  • A subject names the work, never the paths it touched. A path is where the change landed, and a list of paths is the diff's own table of contents, which the reader already holds. Add the API reference of AlphaClass says what was done, and Add docs/en/api/AlphaClass.md says only where it ended up; a subject written that way grows one path for every file the work reaches. What an Add brings and what a Purge takes away are named by what they are — `Add RE
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/format-conventional.md
  • references/format-imperative.md
  • references/granularity.md

FAQ

What does the hoc-git-commit skill do?

Conventions for git commits, in either message format. Use before writing a commit message, and before splitting a working tree into commits. The order commits land in belongs to the commit order convention; the branches commits land on, and the two commits a branch makes about itself, to the git branch convention; the commands that gate a commit, to the workflows convention.

How do I install the hoc-git-commit skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the hoc-git-commit skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare hoc-git-commit with