-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit.mdc
More file actions
45 lines (40 loc) · 1.33 KB
/
commit.mdc
File metadata and controls
45 lines (40 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
description:
globs:
alwaysApply: false
---
# Commit
Create well-formatted commits with conventional commit messages.
## Features:
- Runs pre-commit checks by default (lint, build, generate docs)
- Automatically stages files if none are staged
- Uses conventional commit format
- Suggests splitting commits for different concerns
## Commit Types:
- feat: New features
- fix: Bug fixes
- docs: Documentation changes
- refactor: Code restructuring without changing functionality
- style: Code formatting, missing semicolons, etc.
- perf: Performance improvements
- test: Adding or correcting tests
- chore: Tooling, configuration, maintenance
- wip: Work in progress
- remove: Removing code or files
- hotfix: Critical fixes
- security: Security improvements
## Process:
1. Check for staged changes (`git status`)
2. If no staged changes, review and stage appropriate files
3. Run pre-commit checks (unless --no-verify)
4. Analyze changes to determine commit type
5. Generate descriptive commit message
6. Include scope if applicable: `type(scope): description`
7. Add body for complex changes explaining why
8. Execute commit
## Best Practices:
- Keep commits atomic and focused
- Write in imperative mood ("Add feature" not "Added feature")
- Explain why, not just what
- Reference issues/PRs when relevant
- Split unrelated changes into separate commits