Command Palette

Search for a command to run...

Назад к скиллам
скилл № 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…

БесплатноБез исполняемых скриптов
openreachtechот openreachtech★ 17 звёзд на GitHub

Установить hoc-git-commit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

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
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

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

FAQ

Что делает скилл 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 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.

Как установить скилл hoc-git-commit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hoc-git-commit запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить hoc-git-commit с