Get the FREE Ultimate OpenClaw Setup Guide →

commit-changes

Scanned
npx machina-cli add skill anilcancakir/claude-code-plugins/commit-changes --openclaw
Files (1)
SKILL.md
1.7 KB

Commit Task

Create a commit for staged/unstaged changes following project conventions.

Steps

  1. Check git status for changes
  2. Analyze git log --oneline -10 to detect commit style
  3. Categorize changes (feat/fix/docs/refactor/test/chore)
  4. Generate commit message matching detected style
  5. Present to user for approval
  6. 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 }
}
PatternStyle
type(scope): messageConventional Commits (scoped)
type: messageConventional (no scope)
:emoji: messageGitmoji
Plain textSimple

Conventional Commits Types

TypeUse For
featNew features
fixBug fixes
docsDocumentation only
styleFormatting changes
refactorCode restructuring
perfPerformance improvements
testAdding/fixing tests
choreMaintenance 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 #123
  • BREAKING 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

  1. Step 1: Check git status for changes
  2. Step 2: Run the detect-commit-style.sh script to infer style from history
  3. 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

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers