2
2
description: git-commits: Git commit message standards and AI assistance
3
3
globs: git-commits: Git commit message standards and AI assistance | *.git/* .gitignore .github/* CHANGELOG.md CHANGES.md
4
4
---
5
- # Git Commit Standards
5
+ # Optimized Git Commit Standards
6
6
7
- ## Format
7
+ ## Commit Message Format
8
8
```
9
- type(scope[component ]): concise description
9
+ Component/File(commit-type[Subcomponent/method ]): Concise description
10
10
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
15
15
16
- refs: #issue-number, breaking changes, links
16
+ refs: #issue-number, breaking changes, or relevant links
17
17
```
18
18
19
- ## Commit Types
20
- - `feat`: New features/enhancements
21
- - `fix`: Bug fixes
22
- - `refactor`: Code restructuring
23
- - `docs`: Documentation changes
24
- - `chore`: Maintenance tasks (deps, tooling)
25
- - `test`: Test-related changes
26
- - `style`: Code style/formatting
27
-
28
- ## Guidelines
29
- - Subject line: max 50 chars
30
- - Body lines: max 72 chars
31
- - Use imperative mood ("Add" not "Added")
32
- - Single topic per commit
33
- - Blank line between subject and body
34
- - Mark breaking changes with "BREAKING:"
35
- - Use "See also:" for external links
36
-
37
- ## AI Assistance in Cursor
38
- - Stage changes with `git add`
39
- - Use `@commit` to generate initial message
40
- - Review and adjust the generated message
41
- - Ensure it follows format above
42
-
43
- ## Examples
44
-
45
- 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
46
25
```
47
- feat(subprocess[run]): Switch to unicode-only text handling
48
26
49
- why: Improve consistency and type safety in subprocess handling
50
- what:
51
- - BREAKING: Changed run() to use text=True by default
52
- - Removed console_to_str() helper and encoding logic
53
- - Simplified output handling
54
- - 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}]):` |
55
33
56
- refs: #485
57
- 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
58
43
```
59
44
60
- Bad commit:
45
+ ### Test Changes
46
+ Prefix with `tests:`
61
47
```
62
- updated some stuff and fixed bugs
48
+ tests(Component/File[Subcomponent/method]): Add edge case tests
63
49
```
64
50
65
- 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
66
78
67
- - Add dev-loop.mdc: QA process for code edits
68
- - Type checking with mypy
69
- - Linting with ruff
70
- - Test validation with pytest
71
- - 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
72
84
73
- - Add git-commits.mdc: Commit message standards
74
- - Structured format with why/what sections
75
- - Defined commit types and guidelines
76
- - Examples of good/bad commits
77
- - AI assistance instructions
85
+ refs: #485
86
+ See also: https://example.com/docs/pane-capture
87
+ ```
78
88
79
- Note: These rules help maintain code quality and commit history
80
- consistency across the project.
89
+ ## Bad Commit Example
90
+ ```
91
+ fixed stuff and improved some functions
92
+ ```
81
93
82
- 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