Command Palette

Search for a command to run...

Back to skills
skill № 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…

FreeRuns bundled scripts
melodic-softwareby melodic-software★ 34 GitHub stars

Install 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

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
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • 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

What does the Commit skill do?

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.

How do I install the 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 Commit skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare Commit with