-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(cursor[rules]): Add git commit message standards
why: Establish clear conventions for commit messages and AI assistance what: - Created git-commits.mdc with commit format guidelines - Added commit type definitions and examples - Included instructions for using Cursor's AI commit features - Documented best practices for commit message structure See also: https://docs.cursor.com/context/rules-for-ai
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
description: git-commits: Git commit message standards and AI assistance | ||
globs: git-commits: Git commit message standards and AI assistance | *.git/* .gitignore .github/* CHANGELOG.md CHANGES.md | ||
--- | ||
# Git Commit Standards | ||
|
||
## Format | ||
``` | ||
type(scope[component]): concise description | ||
|
||
why: explanation of necessity/impact | ||
what: | ||
- technical changes made | ||
- keep focused on single topic | ||
|
||
refs: #issue-number, breaking changes, links | ||
``` | ||
|
||
## Commit Types | ||
- `feat`: New features/enhancements | ||
- `fix`: Bug fixes | ||
- `refactor`: Code restructuring | ||
- `docs`: Documentation changes | ||
- `chore`: Maintenance tasks (deps, tooling) | ||
- `test`: Test-related changes | ||
- `style`: Code style/formatting | ||
|
||
## Guidelines | ||
- Subject line: max 50 chars | ||
- Body lines: max 72 chars | ||
- Use imperative mood ("Add" not "Added") | ||
- Single topic per commit | ||
- Blank line between subject and body | ||
- Mark breaking changes with "BREAKING:" | ||
- Use "See also:" for external links | ||
|
||
## AI Assistance in Cursor | ||
- Stage changes with `git add` | ||
- Use `@commit` to generate initial message | ||
- Review and adjust the generated message | ||
- Ensure it follows format above | ||
|
||
## Examples | ||
|
||
Good commit: | ||
``` | ||
feat(subprocess[run]): Switch to unicode-only text handling | ||
|
||
why: Improve consistency and type safety in subprocess handling | ||
what: | ||
- BREAKING: Changed run() to use text=True by default | ||
- Removed console_to_str() helper and encoding logic | ||
- Simplified output handling | ||
- Updated type hints for better safety | ||
|
||
refs: #485 | ||
See also: https://docs.python.org/3/library/subprocess.html | ||
``` | ||
|
||
Bad commit: | ||
``` | ||
updated some stuff and fixed bugs | ||
``` |