Skip to content
Back to skills

Conventional Commit

ASecurity

Generate a Conventional Commits message for the staged diff and (optionally) create the commit. Invoke when the user asks to commit, write a commit message, or finalize staged work.

  • 86 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 5, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add MuhammadUsmanGM/claude-code-best-practices --skill conventional-commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Conventional Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Conventional Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/muhammadusmangm-conventional-commit/badge)](https://www.skillsdirectory.com/skills/muhammadusmangm-conventional-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: conventional-commit
description: Generate a Conventional Commits message for the staged diff and (optionally) create the commit. Invoke when the user asks to commit, write a commit message, or finalize staged work.
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Bash(git commit:*)
---

# Conventional Commit

You are being invoked to turn the current staged diff into a single, well-formed Conventional Commits message.

## Steps

1. Run `git status --short` and `git diff --cached --stat`. If nothing is staged, run `git diff --stat` and ask the user whether to stage everything or a subset. Do not guess.
2. Run `git diff --cached` (or `git diff` if nothing staged yet) to read the actual changes.
3. Run `git log -10 --oneline` to match the repo's existing commit style (scope naming, casing).
4. Draft a message:
   - **type**: one of `feat|fix|docs|refactor|perf|test|chore|build|ci|style|revert`
   - **scope**: optional, derived from the top-level directory or package touched
   - **subject**: imperative, ≤ 72 chars, no trailing period
   - **body**: only if the *why* isn't obvious from the subject. Wrap at 72.
   - **footer**: `BREAKING CHANGE:` or `Closes #123` only when applicable
5. Show the message to the user and ask for confirmation *unless* they already said "commit it" / "just commit."
6. On confirmation, run `git commit -m "..."` using a heredoc for multi-line bodies.

## Rules

- Never include `Co-Authored-By` lines unless the user asks.
- Never `git push`.
- Never `--amend` a commit that's already been pushed.
- If pre-commit hooks fail, fix the underlying issue and create a *new* commit. Do not `--no-verify`.

## Output

After committing, print the short SHA and subject line. Nothing else.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.