22description: git-commits: Git commit message standards and AI assistance
33globs: git-commits: Git commit message standards and AI assistance | *.git/* .gitignore .github/* CHANGELOG.md CHANGES.md
44---
5- # Git Commit Standards
5+ # Optimized Git Commit Standards
66
7- ## Format
7+ ## Commit Message Format
88```
9- component (commit type[sub-component /method]): concise description
9+ Component/File (commit- type[Subcomponent /method]): Concise description
1010
11- why: explanation of necessity/ impact
12- what:
13- - technical changes made
14- - keep focused on single topic
11+ why: Explanation of necessity or impact.
12+ what:
13+ - Specific technical changes made
14+ - Focused on a single topic
1515
16- refs: #issue-number, breaking changes, links
16+ refs: #issue-number, breaking changes, or relevant links
1717```
1818
19- ## Component types
20- - pyproject(ruff[per-file-ignores]) Ignore B010 (`set-attr-with-constant`) for `path/to/file.py`
21- - Pane(chore[capture_pane]): Fix typo
22- - Pane(tests[capture_pane]): Handle edgecase for capture pane
23-
24- ## Commit Types
25- - `feat`: New features/enhancements
26- - `fix`: Bug fixes
27- - `refactor`: Code restructuring
28- - `docs`: Documentation changes
29- - `chore`: Maintenance tasks (deps, tooling)
30- - `test`: Test-related changes
31- - `style`: Code style/formatting
32- - `<component-name>`: If it involves a core file or component / class, e.g.
33- just start with that Pane(chore)
34-
35- ## Guidelines
36- - Subject line: max 50 chars
37- - Body lines: max 72 chars
38- - Use imperative mood ("Add" not "Added")
39- - Single topic per commit
40- - Blank line between subject and body
41- - Mark breaking changes with "BREAKING:"
42- - Use "See also:" for external links
43-
44- ## AI Assistance in Cursor
45- - Stage changes with `git add`
46- - Use `@commit` to generate initial message
47- - Review and adjust the generated message
48- - Ensure it follows format above
49-
50- ## Examples
51-
52- Good commit:
19+ ## Component Patterns
20+ ### General Code Changes
21+ ```
22+ Component/File(feat[method]): Add feature
23+ Component/File(fix[method]): Fix bug
24+ Component/File(refactor[method]): Code restructure
5325```
54- feat(subprocess[run]): Switch to unicode-only text handling
5526
56- why: Improve consistency and type safety in subprocess handling
57- what:
58- - BREAKING: Changed run() to use text=True by default
59- - Removed console_to_str() helper and encoding logic
60- - Simplified output handling
61- - Updated type hints for better safety
27+ ### Packages and Dependencies
28+ | Language | Standard Packages | Dev Packages | Extras / Sub-packages |
29+ |------------|------------------------------------|-------------------------------|-----------------------------------------------|
30+ | General | `lang(deps):` | `lang(deps[dev]):` | |
31+ | Python | `py(deps):` | `py(deps[dev]):` | `py(deps[extra]):` |
32+ | JavaScript | `js(deps):` | `js(deps[dev]):` | `js(deps[subpackage]):`, `js(deps[dev{subpackage}]):` |
6233
63- refs: #485
64- See also: https://docs.python.org/3/library/subprocess.html
34+ #### Examples
35+ - `py(deps[dev]): Update pytest to v8.1`
36+ - `js(deps[ui-components]): Upgrade Button component package`
37+ - `js(deps[dev{linting}]): Add ESLint plugin`
38+
39+ ### Documentation Changes
40+ Prefix with `docs:`
41+ ```
42+ docs(Component/File[Subcomponent/method]): Update API usage guide
6543```
6644
67- Bad commit:
45+ ### Test Changes
46+ Prefix with `tests:`
6847```
69- updated some stuff and fixed bugs
48+ tests(Component/File[Subcomponent/method]): Add edge case tests
7049```
7150
72- Cursor Rules: Add development QA and git commit standards (#cursor-rules)
51+ ## Commit Types Summary
52+ - **feat**: New features or enhancements
53+ - **fix**: Bug fixes
54+ - **refactor**: Code restructuring without functional change
55+ - **docs**: Documentation updates
56+ - **chore**: Maintenance (dependencies, tooling, config)
57+ - **test**: Test-related updates
58+ - **style**: Code style and formatting
59+
60+ ## General Guidelines
61+ - Subject line: Maximum 50 characters
62+ - Body lines: Maximum 72 characters
63+ - Use imperative mood (e.g., "Add", "Fix", not "Added", "Fixed")
64+ - Limit to one topic per commit
65+ - Separate subject from body with a blank line
66+ - Mark breaking changes clearly: `BREAKING:`
67+ - Use `See also:` to provide external references
68+
69+ ## AI Assistance Workflow in Cursor
70+ - Stage changes with `git add`
71+ - Use `@commit` to generate initial commit message
72+ - Review and refine generated message
73+ - Ensure adherence to these standards
74+
75+ ## Good Commit Example
76+ ```
77+ Pane(feat[capture_pane]): Add screenshot capture support
7378
74- - Add dev-loop.mdc: QA process for code edits
75- - Type checking with mypy
76- - Linting with ruff
77- - Test validation with pytest
78- - Ensures edits are validated before commits
79+ why: Provide visual debugging capability
80+ what:
81+ - Implement capturePane method with image export
82+ - Integrate with existing Pane component logic
83+ - Document usage in Pane README
7984
80- - Add git-commits.mdc: Commit message standards
81- - Structured format with why/what sections
82- - Defined commit types and guidelines
83- - Examples of good/bad commits
84- - AI assistance instructions
85+ refs: #485
86+ See also: https://example.com/docs/pane-capture
87+ ```
8588
86- Note: These rules help maintain code quality and commit history
87- consistency across the project.
89+ ## Bad Commit Example
90+ ```
91+ fixed stuff and improved some functions
92+ ```
8893
89- See also: https://docs.cursor.com/context/rules-for-ai
94+ These guidelines ensure clear, consistent commit histories, facilitating easier code review and maintenance.
0 commit comments