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.
npx agentmods add skills/theafh/ai-modules/git_commitnpx skills add theafh/ai-modules --skill git_commitgit clone --depth 1 https://github.com/theafh/ai-modulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00101 | $0.03498 |
| Opus 5 | $0.00051 | $0.01749 |
| Sonnet 5 | $0.00020 | $0.00700 |
| Haiku 4.5 | $0.00010 | $0.00350 |
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.
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.
How it starts
The opening of the file, as written. The whole thing — 69 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.
Satisfy every discovered tree-mutating obligation before <gather_context>, including any required coordinated artifact update, generated output, or rewrite-producing format or lint pass. Check-only obligations may also run here to expose a failing gate before context work begins; only obligations that mutate the tree must precede context capture. 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 discovered tree-mutating obligation is settled before proceeding to <gather_context>. Clearing this checkpoint ensures agent-directed obligations 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 — 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, not the single git status --short --untracked-files=all the <detect_drift> step runs once after the script, against the already-captured baseline, for the separate purpose of drift detection the one-time bundle cannot serve; that one narrow command is expected, so the ban here 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 — 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 — 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 (passed so the script can remove it 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).
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.
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.
- 2d ago First seen · 69 lines · 101 tokens per session scan A 8b6c4b4e5263
git_commit is a skill published in the GitHub repository theafh/ai-modules (38 stars, last pushed 2d ago), licensed MIT. It adds 101 tokens to every session and 3,498 once invoked, about $0.0005 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.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…