AI SummaryCursor Rules for standardized Git commit workflows that guide AI assistants through a structured process of reviewing changes, analyzing impact, and writing semantic commit messages. Developers using Cursor will benefit from consistent, high-quality commits and reduced manual formatting work.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "cursor-tdd-rules — Cursor Rules" prompt rules to my project. Repository: https://github.com/yurenju/cursor-tdd-rules Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
writing or updating git commit message
Git Workflow (AI Usage)
Before committing, follow these steps: • Review Current State: Check status, differences, and history in one command `bash # Combined command for efficiency - check status, differences, and recent history export GIT_PAGER=cat && git status && echo "=== CHANGES ===" && git diff && echo "=== RECENT COMMITS ===" && git log --oneline -5 ` • Analyze Changes and Suggest Commit Strategy: Based on the degree of file changes, decide whether to split into multiple commits Analysis Criteria: • Single commit: If changes belong to the same logical function or modification scope • Multiple commits: If changes involve multiple different functions, file types, or modification purposes Situations requiring multiple commits: • Simultaneously modified API and frontend components • Contains both new features and bug fixes (different types of changes) • Modified code in multiple different modules • Simultaneously performing feature addition and code refactoring • Contains both documentation updates and program logic modifications AI Behavior: • If suggesting multiple commits, must: • List suggested commit groupings • Provide suggested message format for each commit • List files that should be included in each commit • Stop execution, wait for user confirmation or adjustment suggestions • If judged as single commit, continue with subsequent steps Suggestion Format Example: ` Suggested split into 2 commits: Commit 1: Add user authentication API • Files: services/auth/auth.api.ts, services/auth/auth.types.ts • Message: feat(auth): add user authentication API Commit 2: Update project configuration • Files: package.json, tsconfig.json • Message: chore: update TypeScript configuration Please confirm whether to proceed with this suggestion, or tell me your adjustments. ` • Add Files: Add files to staging area and confirm `bash # For specific files git add filename && git status # For all changed files (only when confirmed as single commit) git add . && git status ` • Commit and Verify: Use Conventional Commits format for committing and verify result `bash git commit -m "type(scope): description" && git status && git log --oneline -3 `
Commit Message Examples
Feature Development ` feat(auth): add user authentication API feat(ui): implement login form validation feat: add password reset functionality ` Bug Fixes ` fix(api): resolve login timeout issue fix(ui): correct form validation error display fix: prevent memory leak in data processing ` Documentation Updates ` docs: update API documentation docs(readme): add installation instructions ` Refactoring ` refactor(auth): simplify token validation logic refactor: extract common utility functions ` Testing ` test(auth): add unit tests for login API test: improve test coverage for user service ` Build and Configuration ` chore: update dependencies to latest versions chore(config): update TypeScript configuration build: add Docker support for development ` Performance Improvements ` perf(api): optimize database query performance perf: reduce bundle size by 20% ` CI/CD ` ci: add automated testing workflow ci: update deployment configuration `
Git Commit Rules
This document outlines the complete workflow and message format specifications for AI-performed Git commits.
Complete Example Workflow
Single Commit Workflow `bash
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts