name: git-commit-message description: Draft or create git commit messages using conventional commits in a commitizen-compatible style. Use when the user asks for a commit message, wants help choosing a commit type or scope, or wants codex to commit changes with lowercase-first wording and BREAKING CHANGES footers instead of bang shorthand.
Git Commit Message
Use this skill when the user wants to:
- draft a git commit message
- choose a conventional commit type or scope
- turn staged changes into a commit
- rewrite a commit message to match repo conventions
Workflow
- Inspect the changes first. Prefer
git diff --cached --statandgit diff --cachedwhen staged changes exist. If nothing is staged, inspectgit status --shortand the relevant diff before drafting a message. - Identify the dominant intent of the change. Choose one primary type such as
feat,fix,docs,refactor,test,build,ci, orchore. - Choose a scope only when it adds useful precision. Good scopes are small and
concrete, such as
xidlc,openspec,http, orskills. Skip the scope when it adds noise. - Write the header as
type(scope): subjectortype: subject. - Add a body only when it adds useful detail that is not obvious from the header.
- Add footers when required. Use
BREAKING CHANGES:for incompatible behavior or API changes. Do not usefeat!:or any other!shorthand in the header.
Rules
- Follow Conventional Commits semantics and keep the output compatible with commitizen-style commits.
- Keep commit text lowercase by default.
- Preserve case only for proper nouns, acronyms, crate names, commands, API names, file paths, or other identifiers that would become incorrect if forced to lowercase.
- Keep the subject concise and specific. Prefer concrete subsystem names and
behavior changes over vague summaries like
update code. - Do not mention implementation trivia in the subject when the user-visible or repository-level change is clearer.
- Do not add a body or footer unless it carries real information.
- If the change is breaking, explain the incompatibility in a
BREAKING CHANGES:footer. - If the change addresses a known GitHub issue, add a footer using the
fix #idsyntax (e.g.,fix #123) to automatically close the issue.
Drafting Mode
If the user asks only for a commit message, return a draft message and do not run git commands that create the commit.
Suggested output shapes:
Single-line:
type(scope): subject
Multi-line:
type(scope): subject
body paragraph
fix #id
BREAKING CHANGES: migration or compatibility note
Execution Mode
If the user explicitly asks to create the commit:
- Inspect staged changes first.
- Draft the message using the rules above.
- If
commitizenis available and the user wants that workflow, it is acceptable to use it. - Otherwise use a normal
git commitcommand.
Prefer commitizen only as an execution option, not as a reason to change the
message format.
Heuristics
feat: new user-facing capabilityfix: bug fix or regression fixdocs: documentation-only changerefactor: code change without behavior changetest: tests added or updatedbuild: build, packaging, or dependency tooling changesci: ci workflow changeschore: repository maintenance that does not fit the above cleanly
When a change spans multiple areas, pick the type that best describes the main reason the commit should exist.
Examples
feat(xidlc): add openapi 3.2 stream schema support
test(http): expand security and stream coverage
refactor(skills): add conventional commit drafting workflow
feat(api): rename client-stream annotations
BREAKING CHANGES: replace legacy underscore annotation names with hyphenated forms
fix(http): handle concurrent stream timeouts
fix #45