Commit Message From Diff
Purpose
Draft descriptive Conventional Commits messages based on the current git diff. This skill does not run git commit unless explicitly asked.
Inputs
- •Repo path (absolute)
- •Diff target: staged only (default) or include unstaged
- •Preferred scope (optional): e.g.
header,auth,i18n - •Audience (optional): user-facing vs internal
Instructions
- •Run
git status --porcelainto see staged vs unstaged state. - •If there are staged changes, read
git diff --staged.- •If no staged changes, ask whether to use unstaged (
git diff) or abort.
- •If no staged changes, ask whether to use unstaged (
- •Identify:
- •Type:
feat,fix,refactor,docs,test,chore,build,ci. - •Scope: infer from top-level folder or feature area; use user-provided scope if given.
- •Summary: present tense, <= 72 chars, user-visible when possible.
- •Type:
- •Draft 1–3 candidate commit messages in this format:
- •
type(scope): summary - •Optional body bullets if multiple changes or rationale is important.
- •
- •If the repo uses co-authorship, optionally provide a variant with a
Co-authored-by:line but do not rungit commit.
Heuristics
- •Docs-only changes →
docs(scope). - •Formatting or lint-only →
chore(scope)orstyle(scope)(preferchoreunless the repo usesstyle). - •Dependency updates →
chore(deps)orbuild(deps). - •Tests only →
test(scope). - •Mixed changes → pick the dominant user-visible change; add a short body list for secondary changes.
Output
Provide:
- •A short bullet summary of the diff (1–3 bullets).
- •1–3 Conventional Commits message candidates.
Verification
- •Confirm the diff was read (
git diff --stagedorgit diff). - •Ensure each message is <= 72 characters for the subject line.
- •Ensure message uses
type(scope): summaryand is in present tense.
Constraints
- •Do not run
git commitunless explicitly requested.