conventional-commits

A rule for formatting Git commit messages according to the Conventional Commits specification, a shared style that labels changes such as features, fixes, tests, or documentation.

In plain words
What is it for?
Use it to validate commit messages before committing, including their type, optional scope, description, breaking-change marker, body, and footer.
Why use it?
Consistent messages make commit history easier to read and allow tools to classify changes automatically.

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

Made for: Cursor.

Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,058 The whole file, excluding the scripts and references it only reads on demand.
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.00007 $0.01058
Opus 5 $0.00003 $0.00529
Sonnet 5 $0.00001 $0.00212
Haiku 4.5 $0.00001 $0.00106

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

Security

Grade A, and why

conventional-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 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/conventional-commits.mdc · 146 lines

How it starts

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

Conventional Commits Rule

Description

This rule defines the format and structure for commit messages following the Conventional Commits 1.0.0 specification. It ensures consistent, semantic, and machine-readable commit messages.

Rule Type

workflow

Rule Format

{
  "type": "workflow",
  "name": "conventional_commits",
  "description": "Enforces Conventional Commits 1.0.0 specification",
  "filters": [
    {
      "type": "event",
      "pattern": "pre_commit"
    }
  ],
  "steps": [
    {
      "action": "validate",
      "description": "Validate commit message format",
      "requirements": [
        "Message MUST be prefixed with a type",
        "Type MUST be one of: feat, fix, docs, style, refactor, perf, test, build, ci, chore",
        "Scope is OPTIONAL and MUST be in parentheses",
        "Description MUST immediately follow the colon and space",
        "Description MUST use imperative mood ('add' not 'added')",
        "Description MUST be less than 100 characters",
        "Breaking changes MUST be indicated by '!' or 'BREAKING CHANGE:' footer",
        "Body MUST be separated from description by one blank line",
        "Footer MUST be separated from body by one blank line"
      ]
    },
    {
      "action": "execute",
      "description": "Format and create commit",
      "script": {
        "detect_type": {
          "feat": ["add", "create", "implement", "introduce"],
          "fix": ["fix", "correct", "resolve", "patch"],
          "docs": ["document", "comment", "update.*docs"],
          "style": ["style", "format", "lint"],
          "refactor": ["refactor", "restructure", "reorganize"],
          "perf": ["optimize", "performance", "improve.*speed"],
          "test": ["test", "spec", "coverage"],
          "build": ["build", "dependency", "package"],
          "ci": ["ci", "pipeline", "workflow"],
          "chore": ["chore", "misc", "task"]
        },
        "format_message": {
          "template": "${type}${scope}: ${description}\n\n${body}\n\n${footer}",
          "variables": {
            "type": "Detected from changes or user input",
            "scope": "Optional, derived from file paths",
            "description": "First line of commit message",
            "body": "Detailed explanation of changes",
            "footer": "Optional references or breaking changes"
          }
        },
        "command": [
          "# Extract type from changes or prompt user",
          "TYPE=$(detect_change_type \"$CHANGES\" || prompt_user \"Enter commit type:\")",
          "",
          "# Extract scope from file paths",
          "SCOPE=$(get_common_path \"$CHANGED_FILES\")",
          "",
          "# Format the commit message",
          "printf \"%s\\n\\n%s\\n\\n%s\" \"$TYPE${SCOPE:+($SCOPE)}: $DESCRIPTION\" \"$BODY\" \"$FOOTER\" > \"$COMMIT_MSG_FILE\""
        ]
      }
    }
  ]
}

Read the full file on GitHub · 146 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. yesterday First seen · 146 lines · 7 tokens per session scan A ca2ca7c68218

Subscribe to this mod's changes

conventional-commits is a cursor rule published in the GitHub repository squirrelogic/cursor-rules (20 stars, last pushed 1y ago), licensed MIT. It adds 7 tokens to every session and 1,058 once invoked, about $0.0000 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.