git-commit

A safety checklist and workflow for creating a Git commit. A commit is a saved set of changes in a Git repository.

In plain words
What is it for?
It helps inspect repository state, stage intended files, scan the staged changes, generate an Angular-style commit message when needed, and create the commit without replacing an earlier one.
Why use it?
It checks for conflicts, secrets, unrelated changes, and repository conventions before committing. It also creates a concise standardized commit message.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/johnqtcg/awesome-skills/git-commit
Any agent
npx skills add johnqtcg/awesome-skills --skill git-commit
Clone the repo
git clone --depth 1 https://github.com/johnqtcg/awesome-skills

Made for: Claude Code, Codex.

Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,669 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00052 $0.03669
Opus 5 $0.00026 $0.01835
Sonnet 5 $0.00010 $0.00734
Haiku 4.5 $0.00005 $0.00367

Measured 2d ago against content hash 72c30961f447, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-commit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 8 executable files (scripts/detect-ecosystems.sh, scripts/run_regression.sh, scripts/run-gate.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git-commit/SKILL.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Commit (Safety Enhanced, Angular Convention)

Create a commit from the current working tree with safety gates first, then generate a concise Angular-style message in English.

Hard Rules

  • Never commit with unresolved conflicts.
  • Never commit secrets, credentials, keys, or .env sensitive values.
  • Subject line must be <= 50 characters total (including type(scope): ).
  • Do not use --amend unless explicitly requested. If already pushed, warn about force push.
  • If any safety gate fails, stop and report clearly.
  • One commit = one logical change. Do not mix unrelated fixes, features, or formatting.

Workflow

Bundled scripts are always invoked as bash "<path-to-skill>/scripts/<name>.sh"<path-to-skill> is the absolute skill directory (where this SKILL.md was loaded from), never a path relative to the repository. Keep the working directory at the target repo root; the scripts read the repo through git.

1. Preflight

git rev-parse --is-inside-work-tree                 # must print "true"
git status --short
BRANCH=$(git rev-parse --abbrev-ref HEAD)            # "HEAD" means detached (allowed)

# In-progress operation? Worktree-safe: resolve real paths, never read .git/ directly.
for state in rebase-merge rebase-apply MERGE_HEAD CHERRY_PICK_HEAD REVERT_HEAD; do
  [ -e "$(git rev-parse --git-path "$state")" ] && echo "IN_PROGRESS $state"
done

# Unresolved conflicts: this diff exits 0 regardless, so act on OUTPUT, not exit code.
git diff --name-only --diff-filter=U

STOP (hard block — report which one and what to resolve) if any of these hold:

  • --is-inside-work-tree did not print true;
  • any IN_PROGRESS <state> line printed (rebase / merge / cherry-pick / revert in progress);
  • the conflict diff printed any path (unresolved merge conflicts).

A detached HEAD is not a stop condition — proceed and note it in the report.

2. Staging

  • Snapshot what is already staged first: git diff --cached --name-only. If files are already staged that the user did not ask to commit, STOP and ask — commit them together, keep them staged for later, or split. Never silently fold pre-staged files into this commit.
  • If the user names exact files, stage those only with git add -- <paths> (the -- keeps a path that starts with - from being parsed as an option).
  • If the user says "commit my changes", start from git status --short.
  • Count changed paths. If > 8 files, always list the full file set and ask for confirmation before staging anything.
  • If <= 8 files, read the diffs and split by logical intent. If one file mixes intents, use git add -p.
  • Stage task-related untracked files only when they clearly belong to the same change.
  • If unstaged or untracked changes remain after staging, the quality gate MUST run through the isolation wrapper (§4) so it sees exactly the staged snapshot and your changes are restored on every exit path.
  • Verify staging with git diff --cached --stat. If nothing is staged, stop.
  • Run git diff --cached --submodule=short. If a submodule pointer changed, confirm it is intentional.

Read the full file on GitHub · 196 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 196 lines · 52 tokens per session scan A 72c30961f447

Subscribe to this mod's changes

git-commit is a skill published in the GitHub repository johnqtcg/awesome-skills (30 stars, last pushed 6d ago), licensed MIT. It adds 52 tokens to every session and 3,669 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.