Analyzes staged changes and recent commit history to generate a well-formatted commit message that matches the project's existing commit style. Produces the commit command ready to run.
From generalnpx claudepluginhub bobmaertz/prompt-library --plugin generalThis skill is limited to using the following tools:
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Generates a commit message that matches the style of this project's existing commits. Always learns from the actual git log before writing — never applies a generic format blindly.
git log --oneline -20
Analyze the last 20 commits to detect:
feat: ...), imperative short phrases (Add ...), ticket-prefixed (JIRA-123: ...), or customMatch whatever style the project uses. Do not impose Conventional Commits if the project doesn't use them.
git diff --cached --stat
git diff --cached
Identify:
If $ARGUMENTS provides context about the purpose, use it.
Write a commit message following the detected project style:
Subject line rules (always apply):
Body (include if the project uses bodies, or if the change is complex):
Trailers (match project conventions):
Closes #123, Fixes #456, Refs #789Produce the staged diff summary and the ready-to-run commit command:
## Staged Changes
<summary from git diff --cached --stat>
## Commit Message
<subject line>
<body if needed>
<trailers if needed>
```
git commit -m "$(cat <<'EOF'
<subject line>
<body>
EOF
)"
Copy and run the command above, or confirm and I'll run it for you.
## Customizing Your Style
To lock in a specific format, add a `.commitstyle` file to your repo root:
format: conventional # conventional | imperative | ticket-prefix ticket-prefix: PROJ # e.g., PROJ-123: subject max-subject-length: 72 use-body: true trailers: Closes, Refs
When `.commitstyle` exists, it takes precedence over inferred style.
## Examples
### Conventional Commits style
feat(auth): add refresh token rotation
Rotate refresh tokens on each use to limit the blast radius of token theft. Previous tokens are immediately invalidated.
Closes #234
### Imperative short-phrase style
Add refresh token rotation to auth flow
### Ticket-prefixed style
AUTH-89: Add refresh token rotation
Rotates tokens on each use and invalidates previous tokens immediately.