About git-commit
git-commit is a skill for structuring automated Git commits according to Conventional Commits. It outlines a workflow for grouping changes, staging selected files, writing commit messages, and checking history.
Key features
- 01Group changes by logical scope
- 02Follow Conventional Commits
- 03Stage files selectively
- 04Write commit bodies for complex changes
- 05Review recent commit history
Use cases
- 01Split commits by feature or module
- 02Create structured messages for code changes
- 03Ensure commits contain only intended files
- 04Review Git history after committing
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ dhruvanbhalara/ skills --skill git-commitAfter installing, type/git-commitin Claude Code to confirm it loaded.
Details
From the project READMEAutomated Git Commits
This skill provides instructions for performing atomic, well-structured Git commits following the Conventional Commits specification.
1. Analyze Changes
- Identify Modified Files: Run
git status --shortto see all staged and unstaged changes. - Respect Ignore Rules: Do NOT include files that the user has explicitly requested to ignore or that match
.gitignorepatterns. - Group by Scope: Group modified files by their logical "scope" (e.g., a specific module, feature, or layer like
data,domain,ui).
2. Branching
- Feature Branches: ALWAYS create descriptive feature branches from
main(e.g.,feat/login-logic). - Merge Flow: Merge back into
mainonly after passing all quality checks and PR approval.
3. Generate Commit Message
- Conventional Commits: Each commit MUST follow the pattern:
<type>(<scope>): <message>.- Types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert. - Scope: The module or area being changed (e.g.,
auth,api). - Message: A concise description in imperative mood.
- Types:
- Sub-messages (Commit Body):
- ALWAYS include a detailed body if the change involves logic, breaking changes, or multiple steps.
- Explain the "What", "Why", and "How" of the change.
- Use blank lines to separate the subject from the body.
3. Atomic Commits
- One Scope per Commit: Perform separate commits for different scopes.
- Stage Selectively: Stage only the files belonging to the current scope.
4. Execution Flow
- Step 1: Group files by scope.
- Step 2: For each group:
- Stage the files.
- Generate the conventional commit message (subject + body).
- Execute:
git commit -m "<subject>" -m "<body>"
- Step 3: Verify history (
git log -n 5).
Comments
Markdown supported