Commit Message
npx machina-cli add skill oprogramadorreal/optimus-claude/commit-message --openclawCommit Message Suggester
Generate a conventional commit message by analyzing all local git changes (staged, unstaged, and untracked) without performing any commit.
Workflow
1. Gather Change Context
Run the following git commands to understand all local changes:
# Staged changes
git diff --cached --stat
git diff --cached
# Unstaged changes to tracked files
git diff --stat
git diff
# Untracked files
git status --short
2. Analyze Changes
Review the gathered information to understand:
- What changed: Files added, modified, or deleted
- Why it changed: Infer purpose from code context (new feature, bug fix, refactor, etc.)
- Scope: Identify the affected component or area of the codebase
3. Generate Conventional Commit Message
Always produce a message following the Conventional Commits specification, regardless of the commit style used in the repository:
<type>(<optional scope>): <description>
<optional body>
Types:
feat— New feature or capabilityfix— Bug fixrefactor— Code restructuring without behavior changedocs— Documentation onlystyle— Formatting, whitespace, semicolons (no logic change)test— Adding or updating testschore— Build, CI, dependencies, toolingperf— Performance improvement
Rules:
- Keep the subject line under 72 characters
- Use imperative mood ("Add feature" not "Added feature")
- Add a body only when the subject line alone is insufficient to explain the change
- If changes span multiple concerns, suggest separate commits with guidance on how to stage them
- Never include
Co-Authored-Byor other attribution trailers in the commit message
4. Present the Message
Output the suggested commit message in a copyable code block. Do NOT run git commit. If the changes naturally split into multiple commits, present each message separately with instructions on which files to stage for each.
Important
- Never commit, stage, or modify any files
- This skill is read-only — it only analyzes and suggests
- When changes are too broad for a single commit, recommend splitting
Source
git clone https://github.com/oprogramadorreal/optimus-claude/blob/master/skills/commit-message/SKILL.mdView on GitHub Overview
This skill analyzes all local git changes (staged, unstaged, and untracked) without performing any commit. It then infers what changed and why, and outputs a conventional commit message that follows the standard types (feat, fix, refactor, docs, etc.). It is read-only and never modifies the repository.
How This Skill Works
The tool runs read-only git commands to gather context (diffs for staged/unstaged, status for untracked). It analyzes file changes to determine what changed, why, and the scope, then generates a copyable Conventional Commits message block without altering any files or performing a commit.
When to Use It
- You want to commit a feature or bug fix but need a clear Conventional Commits message.
- There are unstaged or untracked changes and you want an accurate subject describing the change.
- Changes span multiple files; you need guidance on splitting into separate commits.
- Your project enforces Conventional Commits in CI/CD and you want a compliant message.
- You want a quick pre-commit check to validate messaging before finalizing a commit.
Quick Start
- Step 1: Run git diff --cached --stat && git diff --stat && git status --short to gather changes.
- Step 2: Use the skill to analyze the changes and generate a Conventional Commit message.
- Step 3: Copy the suggested code block and review it before making any actual commits (no changes are committed by the skill).
Best Practices
- Run the skill before committing to ensure consistency with Conventional Commits.
- Keep the subject line under 72 characters and use imperative mood.
- Include a scope when possible to clarify the affected component.
- Add a brief body only if the subject alone isn’t enough to explain the change.
- If multiple concerns exist, use the tool’s guidance to split into separate commits.
Example Use Cases
- feat(auth): add OAuth login flow
- fix(api): handle null response gracefully
- refactor(ui): simplify state management in dashboard
- docs(contributing): update contribution guidelines
- perf(cache): optimize eviction for LRU cache