Skip to content

Commit 55fca2a

Browse files
authored
docs: Enhance commit and PR guidelines (#9)
- Add new commit changes guidelines file with improved formatting instructions - Replace conventional-commits rules with more specific pull request rules - Update gitignore to simplify cursor rules management These changes improve the development workflow by providing clearer guidance for both commit messages and pull request creation.
1 parent 5b88888 commit 55fca2a

4 files changed

Lines changed: 119 additions & 71 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: Rules for commiting and pushing changes
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Commit Changes Guidelines
7+
8+
When making changes to the codebase, follow these guidelines for committing your work:
9+
10+
## Analysis Process
11+
1. Run `git --no-pager status` to see which files have changed
12+
2. Run `git --no-pager diff` to see the actual changes in the code
13+
3. Analyze the changes to understand the purpose and impact
14+
15+
## Commit Process
16+
1. Review and stage your changes
17+
2. Prepare a proper commit message (see format below)
18+
3. Commit the changes
19+
4. Push to remote repository
20+
21+
## Commit Message Format
22+
- Title: One sentence summary (max 120 characters)
23+
- Empty line
24+
- Body: Bullet list of changes (with NO extra lines between bullet points)
25+
- No additional text
26+
27+
## Example:
28+
```
29+
Add user authentication to login page
30+
31+
- Add password validation function
32+
- Create JWT token generation
33+
- Add error handling for invalid credentials
34+
```
35+
36+
## Git Command Format
37+
For creating commit messages with proper formatting, use one of these approaches:
38+
39+
### Method 1: Build commit message using separate echo commands
40+
```
41+
# Create commit message file line by line
42+
echo "Your commit title" > /tmp/commit-msg.txt
43+
echo "" >> /tmp/commit-msg.txt
44+
echo "- First bullet point" >> /tmp/commit-msg.txt
45+
echo "- Second bullet point" >> /tmp/commit-msg.txt
46+
echo "- Third bullet point" >> /tmp/commit-msg.txt
47+
48+
# Commit using the file and clean up
49+
git commit -F /tmp/commit-msg.txt && rm /tmp/commit-msg.txt
50+
```
51+
52+
### Method 2: For simple commits, use the -m flag twice
53+
```
54+
git commit -m "Your commit title" -m "- First bullet point"
55+
```

.cursor/rules/conventional-commits.mdc

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
description: Rules for creating and updating pull requests
3+
globs:
4+
alwaysApply: false
5+
---
6+
Rule Name: pull-request-rules
7+
Description:
8+
# Pull Request Guidelines
9+
10+
When creating or updating a pull request, follow these guidelines:
11+
12+
## Analysis Process
13+
1. Run `git --no-pager status` to see which files have changed
14+
2. Run `git --no-pager diff` to compare the current branch with main
15+
3. Analyze the changes to understand the purpose and impact
16+
17+
## Pull Request Types
18+
19+
- `fix`: Patches a bug in your codebase (correlates with PATCH in Semantic Versioning)
20+
- `feat`: Introduces a new feature to the codebase (correlates with MINOR in Semantic Versioning)
21+
- `BREAKING CHANGE`: Introduces a breaking API change (correlates with MAJOR in Semantic Versioning)
22+
- Other allowed types: `build:`, `chore:`, `ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`
23+
24+
## Specification Details
25+
26+
1. Title MUST be prefixed with a type, followed by an OPTIONAL scope, OPTIONAL !, and REQUIRED terminal colon and space
27+
2. The type `feat` MUST be used when adding a new feature
28+
3. The type `fix` MUST be used when fixing a bug
29+
4. A scope MAY be provided after a type, surrounded by parenthesis (e.g., `fix(parser):`)
30+
31+
## Pull Request Format
32+
- Title: One sentence summary (max 120 characters)
33+
- Body:
34+
- Bullet list of changes (with NO extra lines between bullet points)
35+
- After the list, add a brief explanation of why this PR is needed
36+
- Do NOT repeat the title in the body
37+
38+
## Example:
39+
```
40+
feat: Add user authentication to login page
41+
42+
Body:
43+
- Add password validation function
44+
- Create JWT token generation
45+
- Add error handling for invalid credentials
46+
47+
This feature is necessary to secure user accounts and prevent unauthorized access to the application.
48+
```
49+
50+
## PR Description Formatting
51+
When creating a PR, ensure that:
52+
- The title is not repeated in the body
53+
- All bullet points are written without extra lines between them
54+
- The body starts directly with bullet points (no introductory text)
55+
- When using GitHub CLI, use `--body-file` instead of `--body` to avoid escape character issues
56+
- Always create the PR body file in the `/tmp/` folder (e.g., `/tmp/pr-body.md`)
57+
In GitHub or similar platforms, preview the PR description to verify there are no unwanted
58+
line breaks between bullet points.
59+
60+
## Process
61+
1. Analyze changes between main and current branch
62+
2. Create PR title and bullet list description
63+
3. Create new PR or update existing PR tied to current branch
64+
4. Request review if needed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ lerna-debug.log*
1515
*.swo
1616
.DS_Store
1717

18-
# mcp executable
19-
mcp
20-
mcp-config.json
21-
2218
# JetBrains IDE
2319
.idea/
2420

0 commit comments

Comments
 (0)