git_commit

git_commit is a skill for Claude Code from theafh/ai-modules. It costs 102 tokens per session (4,315 once invoked), scanned A, original, MIT.

A writing format for instructions that an AI reads, using XML-like tags to separate roles, rules, inputs, and expected output.

In plain words
What is it for?
Use it to structure prompts, skills, commands, agent definitions, system instructions, and other documents written for AI use.
Why use it?
It makes long or complex AI instructions easier to organize and interpret consistently.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code; mentions Codex.

Part of the ai_dev plugin — 26 skills, 9 agents, 1 hook shipped together

Good fit Use it to structure prompts, skills, commands, agent definitions, system instructions, and other documents written for AI use.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/theafh/ai-modules/git_commit
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.

Any agent
npx skills add theafh/ai-modules --skill git_commit
Clone the repo
git clone --depth 1 https://github.com/theafh/ai-modules

Made for: Claude Code.

Or install ai_dev, the plugin that ships this one along with the rest of its 26 skills, 9 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git_commit

README.md
[![agentmods](https://agentmods.dev/badge/skills/theafh/ai-modules/git_commit/github.svg)](https://agentmods.dev/skills/theafh/ai-modules/git_commit)
Your own site
<a href="https://agentmods.dev/skills/theafh/ai-modules/git_commit"><img src="https://agentmods.dev/badge/skills/theafh/ai-modules/git_commit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git_commit

Your own site · 80×15
<a href="https://agentmods.dev/skills/theafh/ai-modules/git_commit"><img src="https://agentmods.dev/badge/skills/theafh/ai-modules/git_commit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,315 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00102 $0.04315
Opus 5.5 $0.00041 $0.01726
Sonnet 5.5 $0.00020 $0.00863
Haiku 4.5 $0.00010 $0.00432

Measured 10d ago against content hash af552c38300e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 10d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/commit_with_message.sh, scripts/prepare_commit_context.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.

plugins/ai_dev/skills/git_commit/SKILL.md · 73 lines

How it starts

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

git_commit

<git_commit_skill> Stage all new files and create one commit for the intended repo state. <command_intent>git add all new files and then git commit all changed files</command_intent> <path_resolution> Bundled scripts live in scripts/ next to this SKILL.md. Resolve each script's absolute path by combining the directory of this SKILL.md with scripts/<script-name> and invoke the absolute path. Every agentic IDE that surfaces a skill exposes the file path it loaded the skill from, so the parent directory is always knowable. If the first invocation reports a missing file, re-resolve the absolute path once before treating the script as failed; never switch to the fallback because of perceived path uncertainty. </path_resolution> <codex_agent_only> Codex agents apply this section. Non-Codex agents ignore this section and follow the primary workflow normally. <sandbox_preflight>When the active Codex environment reports managed filesystem sandboxing and .git is readable without write access, invoke the primary workflow scripts with Codex command escalation on their first attempt. Use sandbox_permissions: "require_escalated" for prepare_commit_context.sh and commit_with_message.sh so Git can create .git/index.lock without a failed first run.</sandbox_preflight> <fallback_boundary>Apply this only from visible Codex sandbox metadata. When .git is writable or sandbox metadata is unavailable, follow the primary workflow normally and use fallback handling only after an actual script failure.</fallback_boundary> </codex_agent_only> <primary_workflow> <prepare_worktree> Clear this pre-flight gate before gathering commit context so the working tree is already in its final committable state. Discover every agent-directed rule that bears on this commit: a standing instruction addressed to the agent, invoked only when the agent chooses to act, wherever the current harness surfaces it. Search the available rule sources openly. Repository and user standing instructions, agent memory, prompts, and any other source the harness provides all qualify without making any one surface authoritative. Keep discovery broad and treat each rule it turns up as a candidate: finding a rule records that it exists, and <relevance_test> decides which candidates this commit runs. <relevance_test>Decide each discovered obligation by domain intersection, applying the test to tree-mutating and check-only obligations alike. Read the obligation to determine the subject matter it governs (the paths, file types, or artifacts it checks or rewrites), and compare that against the paths this commit changes. Run the obligation when the two intersect and skip it when they do not, so a markdown lint over a documentation-only change still runs while a language- or asset-specific gate over that same change does not. Obtain the changed path set here by running git status --short --untracked-files=all once before prepare_commit_context.sh, reading it for path names alone; <consume_context>'s <hard_rules> expects this narrow read. Run an obligation whose governed subject matter you cannot determine, following the same no-miss-over-no-sweep tiebreaker <commit_scope> applies to the drift guard. State each skip as it happens, naming the obligation, the subject matter it governs, and the changed paths that miss it, so a wrong skip is correctable in the moment.</relevance_test> Satisfy every obligation <relevance_test> selected, including any required coordinated artifact update, generated output, or rewrite-producing format or lint pass. The tree-mutating against check-only split governs ordering alone: a selected tree-mutating obligation is settled before <gather_context> so the captured context already carries its edits, while a selected check-only obligation may run on either side of that seam. Weigh where a check-only obligation runs on both counts: running it here exposes a failing gate before context work begins, and commit time spent on a check that exercises nothing this commit touched is the cost <relevance_test> exists to spare. Leave command-triggered mechanical hooks, including git hooks and harness commit hooks, to the commit command that fires them: running or pre-empting their logic here would execute it twice. Confirm each obligation <relevance_test> chose to run is settled before proceeding to <gather_context>. Clearing this checkpoint ensures the agent-directed obligations this commit implicates are honored rather than skipped, lets prepare_commit_context.sh build and the model read the context once without a rebuild or re-read, and makes the reviewed-set baseline include the model's own pre-commit edits so <detect_drift> and the commit_with_message.sh backstop reserve foreign-drift findings for paths that appear afterward. </prepare_worktree> <gather_context>Invoke scripts/prepare_commit_context.sh. The script stages every untracked file and writes one structured context blob (status, recent commits, per-file staged/unstaged diffs, binary markers) to a file under the system tmp dir. Its stdout prints the context file's absolute path on its own line, then the blob's byte size on its own line, then a one-line consumption directive. Treat that file as the authoritative source for the commit; carry the path line forward unchanged as the argument you pass to commit_with_message.sh, and read the size line to pick your read strategy up front per <consume_context>.</gather_context> <consume_context> Choose the read strategy from the blob's byte/token size against your file-reading tool's per-read cap (the size the script prints on its own stdout line), not from a file count: a diff-dense or large blob overflows that cap far below any file-count threshold, and when the cap denies even a paginated read the ordered-slice path below still covers the blob. Every path covers the whole blob, in order. <full_read>When the blob fits under one read's cap, Read the whole file in a single call. This is the default.</full_read> <paginated_read>When the blob exceeds one read's cap, read it in sequential offset/limit pages, continuing in order until every byte is covered, never stopping after the first page. For a page that itself overflows the cap, start from a conservative line span and halve it on each overflow until the page fits, then reuse that span for the remaining pages rather than guessing new bounds by hand.</paginated_read> <slicing_fallback>When even a paginated read cannot cover the blob (the byte cap denies the read, or paginating it has become impractical), read it with ordered grep/awk/sed slices via Bash. Chunk the file into consecutive, non-overlapping spans that cover every byte and read each span in order, never querying for a specific filename. Seeing every <file_change> section in order is what a coherent multi-file message needs, and selective sampling is the failure mode this skill exists to prevent.</slicing_fallback> <no_read_tool>Where this agent has no Read tool, the shell is the sanctioned reader for the blob, not a last resort. Read the blob's line count first (wc -l), then read consecutive, non-overlapping line spans (for example sed -n ranges) that together cover every byte, in order, applying the same conservative-span, halve-on-overflow heuristic when a span overflows. This is the same whole-context, no-sampling-by-filename discipline the Read path enforces.</no_read_tool> <hard_rules>Never re-derive the commit context with git diff, git status, or git log, because the script already produced that diff/status/log bundle once, and rebuilding it to write the message wastes tokens and time. This ban covers re-deriving the message-writing context, and it carves out two narrow git status --short --untracked-files=all reads that serve purposes the one-time bundle cannot: the pre-flight read <relevance_test> takes once before the script, for path names alone, to decide which discovered obligations this commit implicates, and the re-check <detect_drift> runs once after the script, against the already-captured baseline, for drift detection. Both narrow commands are expected, so the ban here, the pre-flight gate, and the drift step read as one consistent rule. Never sample by filename; iterate every <file_change> section. Summarize updated files from their diffs, summarize new text files from their full added content, summarize binary files with a generic file-level line.</hard_rules> </consume_context> <compose_message>Compose the commit message under <message_policy> directly in the Bash heredoc you will pass to scripts/commit_with_message.sh. Do not write the message to a temporary file first, because the script reads it from stdin so there is no intermediate file to manage.</compose_message> <detect_drift>This model-side protocol is the first-line drift guard and the richer of two layers: it can pause mid-run and ask the user, which the non-interactive script cannot. commit_with_message.sh enforces the same guard as a mechanical backstop for any model that skips this step, so the drift guarantee no longer depends on the running model following a prose instruction; a commit whose drift the user has confirmed passes --accept-drift to that script (see <execute_commit>), and both layers share the one path-level reach limit <in_doubt> describes. Run one drift check at the seam this step owns: after the context blob is consumed and the message composed, and before invoking commit_with_message.sh. The <status_after_staging_new_files> block inside the context file (the git status --short --untracked-files=all snapshot the script took right after staging untracked files) is the reviewed-set baseline. Re-run that same command now, git status --short --untracked-files=all, and compare its paths to that baseline on equal footing. Three outcomes follow, per <commit_scope>: <no_drift>The re-check surfaces no path outside the reviewed-set baseline, and the path set matches. Continue to <execute_commit> with no prompt. This is the common case, a clean single-session tree included.</no_drift> <foreign_drift>One or more paths appear that were outside the reviewed-set baseline and entered commit-time status after the script captured it: a new file, or a path that was clean or absent from the baseline and is now changed. This is the concurrent-session signal: pause here, list those paths to the user, and ask whether they belong in this commit before piping the message into commit_with_message.sh. Hold the whole commit at this seam rather than staging and committing them silently.</foreign_drift> <in_doubt>A concurrent session's edit to a path already in the baseline adds no path outside it, so this path-level comparison cannot separate that further edit from this session's own. Such a same-path change stays on the commit-all path above rather than pausing. This is the deliberate reach limit, resolved by the <commit_scope> tiebreaker that favors no-miss over no-sweep.</in_doubt> </detect_drift> <execute_commit>Once <detect_drift> clears (no drift detected, or the user confirmed the drifted paths belong), invoke scripts/commit_with_message.sh CONTEXT_FILE with the composed message piped in via a single-quoted heredoc, where CONTEXT_FILE is the path printed by prepare_commit_context.sh, or the ctx_file path the manual fallback wrote in its place when that script failed (passed so the script's drift backstop reads the baseline block and the script removes the file on success). When <detect_drift> cleared because the user confirmed the drifted paths belong, append --accept-drift so the script's backstop does not re-block the commit the user already approved. The script stages the full current repo state, runs git commit -F - to consume the message from stdin exactly as composed, prints the final status so line breaks stay exact in git history, and removes the context file on success (so it persists for a retry if the commit itself fails).

Read the full file on GitHub · 73 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago Changed af552c38300e
  2. 15d ago Changed e753348abaca
  3. 1mo ago Changed · +3 lines 367c5ee92160
  4. 1mo ago Changed · +1 tokens per session e4abc7e084a1
  5. 1mo ago Changed · +1 lines 6a42112e360d
  6. 1mo ago First seen · 69 lines · 101 tokens per session scan A 8b6c4b4e5263

Subscribe to this mod's changes

git_commit is a skill published in the GitHub repository theafh/ai-modules (38 stars, last pushed today), licensed MIT. It adds 102 tokens to every session and 4,315 once invoked, about $0.0004 per session on Opus 5.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.