git-conventions

Rules for using Git, a version-control system, including commit messages, staging, and merge practices.

In plain words
What is it for?
Use them when checking status, writing commits, preparing merges, and following Conventional Commits such as feat or fix.
Why use it?
They make changes easier to understand and help prevent secrets or private keys from entering the repository.

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/ckrl/ha-gitops/git-conventions
Clone the repo
git clone --depth 1 https://github.com/ckrl/ha-gitops

Made for: Cursor.

Per session 537 This file is loaded in full into every session.
When invoked 537 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.00537 $0.00537
Opus 5 $0.00269 $0.00269
Sonnet 5 $0.00107 $0.00107
Haiku 4.5 $0.00054 $0.00054

Measured yesterday against content hash 39ca84492aab, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-conventions 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 yesterday.

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-conventions.mdc · 53 lines

What it actually says

Git Conventions

  • Always run git status before staging/committing to review changes.
  • Commit messages MUST be in English.
  • Never commit secrets, .env, tokens, or private keys.

Conventional Commits

  • Format: <type>(optional scope)!: <short, imperative summary>
  • First line <= 72 chars, no trailing period. Use imperative mood (add, fix, update).
  • Common types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.
  • Scopes (suggested): api, http, routes, config, data, ent, migrations, redis, cache, auth, docs, deps, infra, docker, k8s, tests, ci.
  • Breaking change: add ! after type/scope or a BREAKING CHANGE: footer.
  • Add an optional body after a blank line to explain what and why (not how).
  • Optional footers: Refs: #123, Co-authored-by: Name <email>.

Examples

  • feat(api): add /v1/health/check endpoint
  • fix(redis): correct TTL parsing for cache keys
  • refactor(ent): split user repository into separate package
  • perf(http)!: enable gzip by default for large JSON responses
  • Body example:
    Add rate limiting middleware for write endpoints.
    This prevents abuse and aligns with SLOs.
    
    Refs: #123
    

Merge Policy

  • Use no fast-forward merges (--no-ff) to preserve branch history.
  • Provide a concise merge summary (e.g., merge(api): add JWT middleware).
  • Do not git pull remote changes into a feature branch during merge. Rebase or merge explicitly via PR instead.

Local Commit Message Linting

  • Use gitlint (CLI) with the contrib-title-conventional-commits rule.
  • Recommended hook manager: Lefthook. Example hook: commit-msg: gitlint --msg-filename $1
  • Enforce title length (<=72), Conventional type, and English summary.

CI Recommendations

  • Run gitlint on all PR commits (e.g., GitHub Action jorisroovers/gitlint-action).
  • Optionally require 1+ approval and green checks before --no-ff merge.
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. yesterday First seen · 53 lines · 537 tokens per session scan A 39ca84492aab

Subscribe to this mod's changes

git-conventions is a cursor rule published in the GitHub repository ckrl/ha-gitops (4 stars, last pushed 3mo ago), licensed MIT. It adds 537 tokens to every session, about $0.0027 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-31.