Command Palette

Search for a command to run...

Назад к скиллам
скилл № 45370

Commit

Create a git commit with resolved subject convention, Co-authored-by trailer, and surgical staging (no git add -A). Prefer bundled commit/commit-push-pr if it…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

Установить Commit в Claude Code и Claude Desktop

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

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

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

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

Commit

Pre-computed context

Exec-bit backstop: !bash "${CLAUDE_PLUGIN_ROOT}/skills/commit/scripts/exec-bit-check.sh" --probe 2>/dev/null || echo "unavailable — run the check manually"

Repository context. Probe the config layers

Before the layer probes, classify the config root with bash "${CLAUDE_PLUGIN_ROOT}/lib/config-root.sh" classify. For home or non-repo, report team and personal override as not applicable and skip the repo probes (../../reference/config-resolution.md, "The three layers").

The team value of the convention keys (subject_pattern, type_list, trailer_policy) comes from docs/conventions/source-control.yaml, read when probe 1 below reports it tracked, through bash "${CLAUDE_PLUGIN_ROOT}/lib/convention-key.sh" layer "$ROOT" <key>, which prints yaml or none for a key; value and list print the YAML's value. The personal override, docs/conventions/source-control.local.yaml, wins per key; local-value and local-list print its value. Retired .claude/source-control.md, .claude/source-control.local.md, and ~/.claude/source-control.md files are not read. Report which layer supplied each value.

Run the repo-scoped probes as separate calls. Each uses git's repo-root-relative magic pathspec :/, which resolves against the top of the working tree, so these are correct from any subdirectory and never need the repository root substituted into them. Quote the pathspec, the leading : is pathspec magic, and quoting keeps the shell from reinterpreting it.

  1. Team layer, trackedness. git ls-files --error-unmatch -- ":/docs/conventions/source-control.yaml"
  2. Team layer, existence. git ls-files --cached --others -- ":/docs/conventions/source-control.yaml"
  3. Personal override, existence. git ls-files --cached --others -- ":/docs/conventions/source-control.local.yaml"

Probes 2 and 3 deliberately omit --exclude-standard, so a gitignored file is still listed.

Combine probes 1 and 2 in that order. Trackedness first, existence consulted only when trackedness comes back nonzero. They are not independent readings:

Trackedness (1) Existence (2) Team-layer state
exit 0 not consulted present (tracked), this is a config layer
nonzero non-empty output present but UNTRACKED, deliberately not a config layer
nonzero empty output absent

A nonzero exit from probe 1 is a result, not a failure: only a probe that could not run at all (git unavailable, not a repository) yields an unknown value. Never fold present but UNTRACKED into "unknown". Keep the git lines above out of ## Pre-computed context.

These are snapshots taken when they run, not substitutes for the checks. The exec-bit line only sees what was already staged when the skill loaded; anything staged in step 2 below is invisible to it, so step 4 re-runs the script for real. The config-layer probes report presence, not merged content. Read the layers that are present and merge them per key. A tracked-team layer reported present but UNTRACKED is deliberately not a layer: resolution requires the team file to be git-tracked, so an untracked or gitignored file at that well-known path must not drive the convention.

Every repo-scoped probe anchors at the repository root, via the :/ magic pathspec, never at the session's current directory, and never with a resolved root path substituted in. The reasons for each probe's shape are in reference/config-probes.md.

Per-commit checklist

Run this list for every commit, including the second and tenth commit of a session. These are commands, not remembered facts. Steps 3–5 are the ones a long session silently stops performing.

  1. Resolve the convention + trailer_policy across the config layers (once per session is enough; re-resolve if a layer changed).
  2. Stage surgically by explicit path, after checking the four pre-existing conditions below.
  3. Format, run the discoverable formatter scoped to this commit's paths, re-stage its fixes.
  4. Exec-bit, run exec-bit-check.sh --fix -- <this commit's paths>, after step 3.
  5. Pre-check the drafted subject against the resolved pattern before invoking git.
  6. Fragments, in a repository with a fragment-plugins.txt list under scripts/, pipe the drafted message to write-changelog-fragments.sh and stage the paths it prints (Task step 7).
  7. Commit via the Bash tool: git commit -F - heredoc-piped, --trailer per trailer_policy.
  8. Report the resulting SHA + subject to the user.

Purpose

Encapsulates the canonical mechanic for building a commit message that honors a subject convention, appending a Co-authored-by: trailer, and feeding the result to git commit via stdin, without these failure modes:

  • PowerShell here-string syntax (@'...'@) inside a Bash tool call produces unexpected EOF and trigg
Полный SKILL.md на GitHub

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

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

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

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

  • evals/docs/conventions/source-control.local.yaml
  • evals/docs/conventions/source-control.yaml
  • evals/evals.json
  • reference/changelog-fragments.md
  • reference/config-probes.md
  • reference/design-rationale.md
  • reference/exec-bit.md
  • reference/format-check.md
  • reference/native-commit.md
  • reference/pathspec-commits.md
  • reference/staging-preconditions.md
  • scripts/exec-bit-check.sh
  • scripts/exec-bit-check.test.sh

FAQ

Что делает скилл Commit?

Create a git commit with resolved subject convention, Co-authored-by trailer, and surgical staging (no git add -A). Prefer bundled commit/commit-push-pr if it resolves in this session only for generic or one-shot PR commits. Use when: 'commit this', 'make a commit', 'commit with message HINT'. Not for push or PRs: /source-control:pull-request.

Как установить скилл Commit?

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

Скилл Commit запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить Commit с