git-commits

git-commits is a cursor rule for Cursor from golid-ai/golid. It costs 1,050 tokens per session, scanned A, original, MIT.

Rules for Git commit messages and branches, including commit types, wording, size, and a required specification-drift check.

In plain words
What is it for?
Use them to write or review commits, choose prefixes such as fix or feat, keep changes logically separate, and run the required check before committing module-owned files.
Why use it?
They make project history easier to scan, review, and investigate when a change causes a regression.

Cursor rule for Cursor

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 rules/golid-ai/golid/git-commits
Clone the repo
git clone --depth 1 https://github.com/golid-ai/golid

Made for: Cursor.

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-commits

README.md
[![agentmods](https://agentmods.dev/badge/rules/golid-ai/golid/git-commits.svg)](https://agentmods.dev/rules/golid-ai/golid/git-commits)
Your own site
<a href="https://agentmods.dev/rules/golid-ai/golid/git-commits"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/git-commits.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,050 This file is loaded in full into every session.
When invoked 1,050 The same file — it is already loaded in full.
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.01050 $0.01050
Opus 5 $0.00525 $0.00525
Sonnet 5 $0.00210 $0.00210
Haiku 4.5 $0.00105 $0.00105

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

Security

Grade A, and why

git-commits 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 3d 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.

.cursor/rules/git-commits.mdc · 96 lines

How it starts

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

Git Commits

Thesis: Atomic commits with consistent prefixes make history scannable, bisectable, and reviewable. One logical change per commit, imperative mood, body explains "why" not "what".

Commit Message Format

type: short description (imperative, lowercase after type)

Optional body explaining the "why" — not the "what".
Keep to 1-3 sentences. Reference specific files or functions
only when it adds clarity.

Types

Type When
feat New feature or capability
fix Bug fix
refactor Code restructure with no behavior change
perf Performance improvement
docs Documentation only
test Adding or updating tests
chore Deps, config, CI, dead code removal
style Formatting, whitespace, CSS-only changes

Rules

  • First line under 72 characters
  • Imperative mood: "add", "fix", "remove" — not "added", "fixes", "removing"
  • No period at end of first line
  • Body separated from title by blank line
  • One logical change per commit — don't bundle unrelated changes
  • Before committing code that touches module-owned files, run scripts/check_spec_drift.sh <base-ref> and fix any drift in the same commit. If the change legitimately does not affect module behavior, add the required [skip-spec(<module>): <reason>] marker to the commit message.
  • Use HEREDOC for multi-line: git commit -m "$(cat <<'EOF' ... EOF)"
  • Do NOT commit .env, credentials, or secret files
  • Do NOT amend commits that have been pushed

Parallel Shared-File Exception

The "one logical change" rule has one narrow exception: cross-cutting touches produced by parallel subagents working on shared files. See parallel-subagents before using this exception.

If you're writing one, name it explicitly: chore: sweep-up shared-file edits from <batch-name>. Full checklist and examples live in docs/git-reference.md.

Change Sizing

Aim for ~100 lines of diff per logical commit. Reviewable in one sitting, bisects to a single intent. The line count is a guideline, not a hard cap — but if you're past 300 lines the commit is almost certainly bundling.

Read the full file on GitHub · 96 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. 3d ago First seen · 96 lines · 1,050 tokens per session scan A 108e0903bd37

Subscribe to this mod's changes

git-commits is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It adds 1,050 tokens to every session, about $0.0052 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.