release-commit-analysis-auto

A release-planning rule that reads Git commits and groups changes such as features, bug fixes, breaking changes, documentation, chores, and other work. A version bump changes the project’s version number to show the size of a release.

In plain words
What is it for?
Use it to summarize changes since the last tag and suggest an appropriate version increase before publishing or deploying a release.
Why use it?
It helps decide whether a release needs a major, minor, or patch version change without relying only on commit labels. It also handles ordinary commit messages, changed files, renamed paths, and periods with no new commits.

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/usrrname/cursorrules/release-commit-analysis-auto
Clone the repo
git clone --depth 1 https://github.com/usrrname/cursorrules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,227 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.00000 $0.02227
Opus 5 $0.00000 $0.01113
Sonnet 5 $0.00000 $0.00445
Haiku 4.5 $0.00000 $0.00223

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

Security

Grade A, and why

release-commit-analysis-auto 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/utils/release-commit-analysis-auto.mdc · 211 lines

How it starts

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

Release Commit Analysis

Critical Rules

  • Must analyze both conventional and non-conventional commit messages
  • Must categorize commits into Features, Bug Fixes, Breaking Changes, Chore, Documentation, and Other
  • Must use intelligent keyword matching for non-conventional commits
  • Must analyze file changes to help categorize documentation commits
  • Must analyze file changes to help categorize chore commits or renamed files or folders
  • Must provide comprehensive change summaries for version bump suggestions
  • Must handle cases where no commits exist since last tag

filters:

  • type: content pattern: "(release|version|tag|bump|publish|deploy).*(create|make|generate|prepare|ready)"
  • type: git_branch pattern: "^(?!main$|master$).*$"
  • type: event pattern: "chat_start|chat_response"

actions:

  • type: generate content: |

    📊 Commit Analysis Process

    I'll analyze your commits to categorize changes and suggest appropriate version bumps.

    1. Check User Request for Version Bump:

      # Check if user specified version bump in their request
      if [[ "$USER_REQUEST" == *"major"* ]] || [[ "$USER_REQUEST" == *"Major"* ]]; then
        VERSION_BUMP="major"
        echo "User requested major version bump"
      elif [[ "$USER_REQUEST" == *"minor"* ]] || [[ "$USER_REQUEST" == *"Minor"* ]]; then
        VERSION_BUMP="minor"
        echo "User requested minor version bump"
      elif [[ "$USER_REQUEST" == *"patch"* ]] || [[ "$USER_REQUEST" == *"Patch"* ]]; then
        VERSION_BUMP="patch"
        echo "User requested patch version bump"
      else
        VERSION_BUMP=""
        echo "No version bump specified by user"
      fi
      
    2. Analyze Changes for Guidance:

      # Get all commits since that tag with full details
      COMMITS=$(git log --oneline --no-merges $LATEST_TAG..HEAD)
      
      # Get detailed commit information for better analysis
      COMMIT_DETAILS=$(git log --format="%H%n%s%n%b" --no-merges $LATEST_TAG..HEAD)
      
      # Analyze conventional commit types for version bump suggestion
      BREAKING_COUNT=$(echo "$COMMITS" | grep -c "BREAKING:" || echo "0")
      FEAT_COUNT=$(echo "$COMMITS" | grep -c "feat:" || echo "0")
      FIX_COUNT=$(echo "$COMMITS" | grep -c "fix:" || echo "0")
      DOCS_COUNT=$(echo "$COMMITS" | grep -c "docs:" || echo "0")
      STYLE_COUNT=$(echo "$COMMITS" | grep -c "style:" || echo "0")
      REFACTOR_COUNT=$(echo "$COMMITS" | grep -c "refactor:" || echo "0")
      PERF_COUNT=$(echo "$COMMITS" | grep -c "perf:" || echo "0")
      TEST_COUNT=$(echo "$COMMITS" | grep -c "test:" || echo "0")
      CHORE_COUNT=$(echo "$COMMITS" | grep -c "chore:" || echo "0")
      
      # Analyze non-conventional commits with intelligent categorization
      NON_CONVENTIONAL_COMMITS=$(echo "$COMMITS" | grep -v "^(feat|fix|docs|style|refactor|perf|test|chore):" | grep -v "BREAKING:")
      
      if [ -n "$NON_CONVENTIONAL_COMMITS" ]; then
        echo "🔍 Found non-conventional commits, analyzing content for categorization..."
        
        # Initialize counters for non-conventional commits
        NC_FEAT_COUNT=0
        NC_FIX_COUNT=0
        NC_BREAKING_COUNT=0
        NC_DOCS_COUNT=0
        NC_OTHER_COUNT=0
        
        # Analyze each non-conventional commit
        while IFS= read -r commit; do
          HASH=$(echo "$commit" | cut -d' ' -f1)
          MESSAGE=$(echo "$commit" | cut -d' ' -f2-)
          
          # Get files changed in this commit
          FILES_CHANGED=$(git show --name-only --format="" "$HASH" 2>/dev/null)
          
          # Categorize based on message content and file changes
          if [[ "$MESSAGE" =~ (add|new|implement|create|introduce|support|enable|feature) ]]; then
            NC_FEAT_COUNT=$((NC_FEAT_COUNT + 1))
            echo "  📝 Non-conventional commit categorized as FEATURE: $MESSAGE"
          elif [[ "$MESSAGE" =~ (fix|bug|issue|problem|error|crash|fail|broken|resolve|correct) ]]; then
            NC_FIX_COUNT=$((NC_FIX_COUNT + 1))
            echo "  🐛 Non-conventional commit categorized as FIX: $MESSAGE"
          elif [[ "$MESSAGE" =~ (BREAKING|breaking|remove|delete|drop|deprecate|change|update|upgrade|migrate) ]]; then
            NC_BREAKING_COUNT=$((NC_BREAKING_COUNT + 1))
            echo "  💥 Non-conventional commit categorized as BREAKING: $MESSAGE"
          elif [[ "$MESSAGE" =~ (doc|readme|comment|example|guide|tutorial) ]] || echo "$FILES_CHANGED" | grep -q "\.md$\|\.txt$\|docs/\|README"; then
            NC_DOCS_COUNT=$((NC_DOCS_COUNT + 1))
            echo "  📚 Non-conventional commit categorized as DOCS: $MESSAGE"
          else
            NC_OTHER_COUNT=$((NC_OTHER_COUNT + 1))
            echo "  🔧 Non-conventional commit categorized as OTHER: $MESSAGE"
          fi
        done <<< "$NON_CONVENTIONAL_COMMITS"
        
        # Add non-conventional counts to conventional counts
        FEAT_COUNT=$((FEAT_COUNT + NC_FEAT_COUNT))
        FIX_COUNT=$((FIX_COUNT + NC_FIX_COUNT))
        BREAKING_COUNT=$((BREAKING_COUNT + NC_BREAKING_COUNT))
        DOCS_COUNT=$((DOCS_COUNT + NC_DOCS_COUNT))
        
        echo "📊 Non-conventional commit analysis complete:"
        echo "  - Features: $NC_FEAT_COUNT"
        echo "  - Fixes: $NC_FIX_COUNT"
        echo "  - Breaking: $NC_BREAKING_COUNT"
        echo "  - Docs: $NC_DOCS_COUNT"
        echo "  - Other: $NC_OTHER_COUNT"
      fi
      
      # Determine version bump suggestion based on all analyzed commits
      if [ "$BREAKING_COUNT" -gt 0 ]; then
        SUGGESTED_BUMP="major"
      elif [ "$FEAT_COUNT" -gt 0 ]; then
        SUGGESTED_BUMP="minor"
      elif [ "$FIX_COUNT" -gt 0 ]; then
        SUGGESTED_BUMP="patch"
      else
        SUGGESTED_BUMP="patch"
      fi
      
      echo "📈 Commit analysis summary:"
      echo "  - Breaking changes: $BREAKING_COUNT"
      echo "  - New features: $FEAT_COUNT"
      echo "  - Bug fixes: $FIX_COUNT"
      echo "  - Documentation: $DOCS_COUNT"
      echo "  - Style/Refactor: $((STYLE_COUNT + REFACTOR_COUNT))"
      echo "  - Performance: $PERF_COUNT"
      echo "  - Tests: $TEST_COUNT"
      echo "  - Chores: $CHORE_COUNT"
      echo "  - Suggested version bump: $SUGGESTED_BUMP"
      

Read the full file on GitHub · 211 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 · 211 lines · 0 tokens per session scan A 8be17335835b

Subscribe to this mod's changes

release-commit-analysis-auto is a cursor rule published in the GitHub repository usrrname/cursorrules (10 stars, last pushed 4mo ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 2,227 tokens. 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.