skills/generate-commit-message/SKILL.md
Use this skill whenever you need to commit changes or generate a conventional commit message for user review.
npx skillsauth add anchildress1/awesome-github-copilot generate-commit-messageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce exactly one Conventional Commits v1.0.0 message derived strictly from the git diff. Output must pass @commitlint/config-conventional default rules out of the box (with one documented Jira-scope caveat).
Two output modes (chosen by request intent + permission, see §"Output mode"):
commit.tmp. No repo mutation.commit.tmp written on success.git --no-pager diff --cachedgit --no-pager diffPick commit mode only when ALL of these are true:
commit this, commit these changes, /commit, go ahead and commit, make the commit, git commit, or post-draft confirmations like yes, commit it / looks good, commit.git commit invocation by this skill is allowed in the current session (Claude Code permission mode is acceptEdits/bypassPermissions, OR the user has granted the prompt). If the commit call gets blocked, see §"Commit blocked — fall back to draft".git --no-pager diff --cached returns content).main/master UNLESS the user explicitly said to commit on that branch in this turn.If any of those is false, use draft mode.
Phrases like write a commit message, draft a commit message, what would the commit message be, save a commit message always force draft mode regardless of permission.
git add, git push, git rebase, git reset, git commit --amend, or any other history-mutating command. The only repo-mutating command the skill may run is git commit -S in commit mode.commit.tmp ONLY.--no-verify, --no-gpg-sign, or any flag that bypasses hooks or signing.commit.tmp.main/master unless the user explicitly directed it this turn.Reference: https://www.conventionalcommits.org/en/v1.0.0/
Format:
<type>[optional scope][!]: <subject>
[optional body]
[optional footer(s)]
type-enum defaults):
build, chore, ci, docs, feat, fix, perf, refactor, revert, style, testtype-case: lower-case).type-empty: never).feat MUST be used when adding a feature (SemVer MINOR).fix MUST be used for bug fixes (SemVer PATCH).Wrapped in parentheses, immediately after type: feat(parser):
commitlint default scope-case: lower-case.
Jira-key exception: this skill emits Jira keys uppercase (feat(PROJ-123):) per the scope precedence below. If your project uses Jira keys, override scope-case in your commitlint config:
rules: { 'scope-case': [0] }
// or restrict to upper-case for Jira:
rules: { 'scope-case': [2, 'always', 'upper-case'] }
subject-full-stop: never).subject-empty: never).subject-case: never [...]). Lowercase or mixed lowercase/identifier-case is fine.body-max-line-length default).Two forms, both valid per spec:
feat(api)!: drop deprecated /v1 endpointBREAKING CHANGE: <details> (or BREAKING-CHANGE: — spec §16 makes the hyphen form synonymous).Use the ! form when the body/footer already explains the break elsewhere or when no extra detail is required. Use the footer form when the user needs explicit migration steps. You may use both together.
Token-Name: value or Token-Name #value.- instead of spaces (e.g., Reviewed-by), except BREAKING CHANGE (which the spec exempts).footer-max-line-length default). If a footer value would exceed 100 chars, fold it onto continuation lines with a leading space (git trailer continuation), or shorten the prose. Do not let any line exceed 100.Refs: PROJ-123Closes #42BREAKING CHANGE: <migration note>Signed-off-by (out of scope; user must add manually if DCO-required).Goal: choose an optional scope value (prefer a Jira-style key) with this precedence:
argument-hint)commit.tmp scope (if already present)Rules:
[A-Z][A-Z0-9]+-\d+docs/core) when no issue key exists. Omit scope.Steps:
git --no-pager rev-parse --abbrev-ref HEAD and extract the first matching issue key.commit.tmp exists, read line 1 and reuse a scope matching the Jira regex.git --no-pager diff --cached.git --no-pager diff.Infer <type>, optional (scope), breaking-change indicator, and subject/body strictly from diff hunks. Do not use chat history, prior commits, or memory to decide what changed.
Type heuristics (in order; first match wins):
! or BREAKING CHANGE: footer.feat.fix.perf.refactor.style.test.docs.ci.build.revert.chore.Scope is determined by §0 only — diff may inform type and subject, never scope.
Pick exactly one tier from diff hunks + session memory only:
Generated-byCo-authored-byAssisted-byCommit-generated-byIf uncertain, default to crediting the human (pick the less-crediting tier).
<type>[(<scope>)][!]: <subject>
- <single-line bullet>
- <single-line bullet>
<footer(s)>
Hard formatting rules:
subject-case above.Writing rules:
Order, when present:
Issue refs (if user-provided or branch-derived):
Refs: PROJ-123
Or Closes #42 if a GitHub issue number was provided.
Breaking change (only when user action is required and not fully captured by !):
BREAKING CHANGE: <explicit incompatibility and required action>
AI attribution (REQUIRED, exactly one):
<Attribution-Tier>: <YOUR_AI_NAME> <[email protected]>
Prohibited:
Signed-off-by.Immediately before writing commit.tmp OR running git commit:
Before any output, verify:
^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?!?: .+$ and is ≤ 72 chars...If any check fails, regenerate before output. Do not emit a non-conformant message.
Draft mode:
commit.tmp in the current working directory.Commit mode:
Re-confirm preconditions one more time:
main/master (or user explicitly OK'd it).Run the commit using a HEREDOC for proper formatting and -S for gpg signing:
git commit -S -m "$(cat <<'EOF'
<full message body here, including blank lines and footers>
EOF
)"
Do NOT pass --no-verify or --no-gpg-sign. Hooks and signing must run.
Do NOT stage anything. Commit only what is already staged.
If commit succeeds: report the new commit's short SHA + subject. Do not write commit.tmp.
If commit fails (hook rejection, permission denied, signing failure, etc.):
commit.tmp so work isn't lost.If at any point during commit-mode the commit cannot be performed because:
git commit permission, ORmain/master and the user did not explicitly authorize, OR…then write the message to commit.tmp instead and tell the user exactly why commit was skipped. Never silently downgrade — the user needs to know their commit didn't happen.
1) Minor bug fix, no scope, AI assisted
fix: pin qs to 6.14.2 to address prototype-pollution vulnerability
- add npm override for qs across the dependency tree
- align instantsearch.js resolution to the pinned version
Assisted-by: Claude Haiku 4.5 <[email protected]>
2) Feature with Jira scope, AI majority
feat(PROJ-123): add OAuth2 device-code flow to login
- support polling token endpoint with backoff
- surface user_code + verification_uri in CLI output
- cover happy-path and timeout in unit tests
Refs: PROJ-123
Generated-by: Claude Opus 4.7 <[email protected]>
3) Breaking change via !
feat(api)!: drop deprecated /v1 endpoints
- remove /v1/users and /v1/sessions handlers
- migrate fixture suite to /v2 equivalents
BREAKING CHANGE: clients pinned to /v1 must upgrade to /v2 before this release. See docs/migration-v2.md.
Generated-by: Claude Opus 4.7 <[email protected]>
4) Docs-only, trivial AI involvement
docs: clarify token-refresh semantics in README
- note that refresh tokens rotate on every use
- add a sequence diagram for the silent-renewal flow
Commit-generated-by: Claude Haiku 4.5 <[email protected]>
development
Generate, audit, or improve a project README following a 15-section structure (Title, Table of Contents, About, Features, Tech Stack, Architecture, Project Structure, Getting Started, Configuration, Security, How to Contribute, What's Next, License, Acknowledgements, Author) with Mermaid diagrams for architecture and flows. Use this skill whenever the user asks to "write a README", "create a README", "draft a README", "generate README.md", "scaffold project docs", "document this repo", "improve my README", "audit my README", "what should go in my README", or starts a new repository and needs documentation. Also trigger on phrases like "the README is bare", "this project has no docs", "fill in my README sections", or any request that produces or reviews a top-level repository README. The skill defaults to Mermaid for diagrams because it renders natively on GitHub, GitLab, Bitbucket, and most modern Markdown viewers — no external image hosting required.
tools
Write, extend, or review tests in any codebase. Use this skill whenever the user asks to write tests, add test coverage, test a new feature, fix failing tests, or audit existing test files — regardless of language, framework, or project. Also trigger for "add tests for", "write tests for", "cover this with tests", "test this file", "update the tests", "improve coverage", or "this needs tests". This skill enforces universal testing rules (no .skip, no lowering thresholds, full-path coverage) and adapts its mock patterns and tooling to whatever stack the repo uses.
tools
Generate or update an ESLint plugin that exports rule configs compatible with ESLint v8 (eslintrc) and ESLint v9 (flat config).
documentation
Rewrites changelog entries with cheeky, narrative flair following project conventions. Use this when asked to rewrite or update CHANGELOG.md entries.