commit-changes
Scannednpx machina-cli add skill anilcancakir/claude-code-plugins/commit-changes --openclawCommit Task
Create a commit for staged/unstaged changes following project conventions.
Steps
- Check
git statusfor changes - Analyze
git log --oneline -10to detect commit style - Categorize changes (feat/fix/docs/refactor/test/chore)
- Generate commit message matching detected style
- Present to user for approval
- Execute commit
Commit Style Detection
Use the detection script for accurate results:
# Returns JSON with style and confidence
"${CLAUDE_PLUGIN_ROOT}/scripts/detect-commit-style.sh"
Output example:
{
"style": "conventional-scoped",
"confidence": 80,
"stats": { "total": 10, "conventional_scoped": 8, "gitmoji": 2 }
}
| Pattern | Style |
|---|---|
type(scope): message | Conventional Commits (scoped) |
type: message | Conventional (no scope) |
:emoji: message | Gitmoji |
| Plain text | Simple |
Conventional Commits Types
| Type | Use For |
|---|---|
| feat | New features |
| fix | Bug fixes |
| docs | Documentation only |
| style | Formatting changes |
| refactor | Code restructuring |
| perf | Performance improvements |
| test | Adding/fixing tests |
| chore | Maintenance tasks |
Message Format
<type>(<scope>): <subject>
<body>
<footer>
Subject Rules:
- Imperative mood ("add" not "added")
- No period at end
- Max 50 characters
- Lowercase
Body (optional):
- Explain what and why
- Wrap at 72 characters
Footer (optional):
Closes #123BREAKING CHANGE: description
Output
Present message for approval before committing.
Source
git clone https://github.com/anilcancakir/claude-code-plugins/blob/main/pre-commit-flow/skills/commit-changes/SKILL.mdView on GitHub Overview
This skill creates well-formatted commits by auto-detecting the project’s commit style from git history. It categorizes changes, generates a matching message, and prompts for approval before executing the commit.
How This Skill Works
The tool checks the repo for changes, analyzes the recent git log to detect the commit style via a detection script, and categorizes changes (feat/fix/docs/refactor/test/chore). It then generates a message that matches the detected style and presents it for user approval before executing the commit.
When to Use It
- When adding a new feature or fixing a bug in a project that uses conventional commit rules
- When updating documentation or configuration following project conventions
- When performing a refactor and you want a scoped, clear message
- When executing maintenance tasks (chore, perf, test) that should be tracked
- When you want an approval step before finalizing a commit
Quick Start
- Step 1: Check git status for changes
- Step 2: Run the detect-commit-style.sh script to infer style from history
- Step 3: Review the proposed message and approve to execute the commit
Best Practices
- Ensure changes are staged before running the workflow
- Let the tool detect style from the recent commit history to align with project conventions
- Write the subject in imperative mood, lowercase, no trailing period, max 50 chars
- Include a relevant scope when applicable and allowed by the chosen style
- Review the generated message and approve it before the commit is executed
Example Use Cases
- feat(auth): add user login via oauth
- fix(ui): correct button alignment on mobile
- docs(readme): update setup instructions
- refactor(api): simplify request builder
- chore(deps): bump dependency versions