---
description: Enforce structured Git commit messages.
globs: .git/*
---
# Git Commit Standards

Ensures consistent Git commit messages.

## Rule Details

- **Name:** git_commit_standards

- **Description:** Enforce structured Git commit messages.

## Filters
- file extension pattern: `\\.git/.*`

## Enforcement Checks
- Conditions:
  - pattern `^(?!fix|feat|perf|docs|style|refactor|test|chore): ` – Use a commit message prefix followed by colon and space (fix:, feat:, etc.).
    - More precise regex to ensure prefix is followed by colon and space
  - pattern `^(fix|feat|perf|docs|style|refactor|test|chore): [A-Z]` – First word after prefix should be lowercase.
    - Check for uppercase after the prefix
  - pattern `^(fix|feat|perf|docs|style|refactor|test|chore): .{46,}` – Keep commit message content (excluding prefix) under 46 characters.
    - More precise length check that excludes the prefix from the count
  - pattern `^(fix|feat|perf|docs|style|refactor|test|chore):(?! )` – Include a space after the colon in prefix.
    - Ensure there's a space after the colon

## Suggestions
- Guidance:
Recommended commit format:
- "fix: resolved bug in user authentication"
- "feat: added new search functionality"
- "docs: updated installation guide"
- "style: fixed button alignment"
- "refactor: simplified login logic"
- "test: added unit tests for auth"
- "chore: updated dependencies"
- "perf: optimized database queries"

## Metadata
- Priority: high
- Version: 1.2
