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 skills add stephansama/packages --skill ai-commit-msggit clone --depth 1 https://github.com/stephansama/packagesWrote 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.
[](https://agentmods.dev/skills/stephansama/packages/ai-commit-msg)<a href="https://agentmods.dev/skills/stephansama/packages/ai-commit-msg"><img src="https://agentmods.dev/badge/skills/stephansama/packages/ai-commit-msg/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.
<a href="https://agentmods.dev/skills/stephansama/packages/ai-commit-msg"><img src="https://agentmods.dev/badge/skills/stephansama/packages/ai-commit-msg.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00182 | $0.01954 |
| Opus 5.5 | $0.00073 | $0.00782 |
| Sonnet 5.5 | $0.00036 | $0.00391 |
| Haiku 4.5 | $0.00018 | $0.00195 |
Grade A, and why
ai-commit-msg 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 22d 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 — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ai-commit-msg
Writes an AI-generated conventional commit message to the COMMIT_EDITMSG file via the prepare-commit-msg Git hook. Reads the staged diff and passes it to your configured AI provider through TanStack AI adapters.
Setup
- Install and initialise husky:
npm install --save-dev husky && npx husky init
- Create
.husky/prepare-commit-msg:
#!/bin/sh
ai-commit-msg -o "$1"
- Create a config file at
ai-commit-msg.config.ts(orpackage.jsonkeyai-commit-msg):
// ai-commit-msg.config.ts
export default {
provider: "google",
model: "gemini-2.5-flash",
};
- Set the required environment variable:
export GOOGLE_GENERATIVE_AI_API_KEY=your-key
Core Patterns
Anthropic provider
export default {
provider: "anthropic",
model: "claude-opus-5-5",
};
Requires ANTHROPIC_AUTH_TOKEN, ANTHROPIC_OAUTH_TOKEN, or ANTHROPIC_API_KEY in the environment (checked in that order). ANTHROPIC_AUTH_TOKEN is sent as a bearer token (or as a Claude OAuth token when it starts with sk-ant-oat), ANTHROPIC_OAUTH_TOKEN as a Claude OAuth token, and ANTHROPIC_API_KEY as an x-api-key header.
Google provider
export default {
provider: "google",
model: "gemini-2.5-flash",
};
Requires GOOGLE_GENERATIVE_AI_API_KEY, GOOGLE_API_KEY, or GEMINI_API_KEY in the environment (checked in that order).
OpenAI provider
export default {
provider: "openai",
model: "gpt-4o-mini",
};
Requires OPENAI_API_KEY in the environment.
Ollama provider (local, no API key)
export default {
provider: "ollama",
model: "llama3.2",
};
Requires the Ollama server running locally (ollama serve). Set OLLAMA_HOST to use a server other than http://localhost:11434.
Custom prompt
export default {
provider: "google",
model: "gemini-2.5-flash",
prompt:
"Write a short conventional commit message in lowercase for this diff:\n\n{{diff}}",
};
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.
- 22d ago Changed · +13 lines · +31 tokens per session dc6e03c9eb88
- 1mo ago Changed · +26 lines · +51 tokens per session ae4655bf367f
- 3mo ago First seen · 209 lines · 100 tokens per session scan A 5698e8132a75
ai-commit-msg is a skill published in the GitHub repository stephansama/packages (5 stars, last pushed 11d ago), licensed MIT. It adds 182 tokens to every session and 1,954 once invoked, about $0.0007 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-31.
ai-commit-msg compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ai-commit-msgstephansama/packages | Skill | 5 | 11d ago | MIT | A | 182 | Claude Code, Codex |
| create-prprisma/orm | Skill | 48k | today | Apache-2.0 | A | 47 | Claude Code, Codex |
| review-implement-phaseprisma/orm | Skill | 48k | today | Apache-2.0 | A | 38 | Claude Code |
| review-triage-phaseprisma/orm | Skill | 48k | today | Apache-2.0 | A | 36 | Claude Code |
| multiline-commit-messagesprisma/orm | Skill | 48k | today | Apache-2.0 | A | 35 | Claude Code, Codex |
| pr-writeroxc-project/oxc | Skill | 24k | today | MIT | A | 31 | Claude Code, Codex |
| stacking-prsPostHog/posthog | Skill | 41k | today | none | A | 136 | Claude Code, Codex |