This skill inspects your staged changes and produces a commit message that follows the Conventional Commits specification. It picks the right type and scope, writes a concise imperative subject, adds a body explaining the why when the change is non-trivial, and flags breaking changes correctly — so your history stays readable and your tooling (changelogs, semantic-release) keeps working.
When to use this skill
- You have changes staged with
git add and want to commit them.
- You want a consistent, spec-compliant message instead of free-form text.
- You are unsure which type (
feat, fix, chore, …) fits the change.
- Your repo uses semantic versioning or automated changelog generation that depends on commit conventions.
[!NOTE]
This skill only reads and commits what is already staged. Stage the exact hunks you want first (git add -p). It will not stage files for you.
Instructions
- Read the staged diff to understand what actually changed:
git diff --cached
If nothing is returned, stop and tell the user there are no staged changes to commit.
- Check the staged file list for scope hints (directory or package names):
git diff --cached --name-only
- Choose the type from the staged changes:
feat — a new user-facing capability
fix — a bug fix
docs — documentation only
style — formatting, no logic change
refactor — code change that neither fixes a bug nor adds a feature
perf — performance improvement
test — adding or correcting tests
build / ci — build system or pipeline changes
chore — maintenance, deps, tooling
- Derive an optional scope in parentheses from the affected area (e.g.
auth, api, parser). Omit it if the change is broad.
- Write the subject line:
type(scope): summary
- Imperative mood ("add", not "added" or "adds").
- No trailing period; aim for 50 characters, hard limit 72.
- If the change is non-trivial, add a blank line then a body explaining the motivation and any context the diff alone does not convey. Wrap at ~72 columns.
- If the change breaks compatibility, mark it: append
! after the type/scope (e.g. feat(api)!:) and add a BREAKING CHANGE: footer describing the migration.
- Add footers for issue references when relevant (e.g.
Refs: #123, Closes: #456).
- Present the proposed message to the user for confirmation, then commit:
git commit -m "feat(parser): add support for nested arrays" \
-m "Handles arbitrarily deep nesting by recursing on bracket pairs." \
-m "Closes: #128"
Examples
Suppose git diff --cached --name-only shows src/auth/session.ts and the diff replaces a 1-hour token TTL with a configurable value, removing the old constant.
feat(auth)!: make session token TTL configurable
Replace the hardcoded 1-hour TTL with SESSION_TTL_SECONDS so deployments
can tune session lifetime without a rebuild. Falls back to 3600 when the
variable is unset.
BREAKING CHANGE: the SESSION_MAX_AGE constant has been removed. Set the
SESSION_TTL_SECONDS environment variable instead.
Closes: #214
Commit it:
git commit \
-m "feat(auth)!: make session token TTL configurable" \
-m "Replace the hardcoded 1-hour TTL with SESSION_TTL_SECONDS so deployments can tune session lifetime without a rebuild. Falls back to 3600 when the variable is unset." \
-m "BREAKING CHANGE: the SESSION_MAX_AGE constant has been removed. Set the SESSION_TTL_SECONDS environment variable instead." \
-m "Closes: #214"
1---2name: conventional-commits3description: Generate clear Conventional Commits messages from staged changes. Use when committing code and you want a well-structured, consistent commit message.4---56This skill inspects your staged changes and produces a commit message that follows the [Conventional Commits](https://www.conventionalcommits.org/) specification. It picks the right type and scope, writes a concise imperative subject, adds a body explaining the *why* when the change is non-trivial, and flags breaking changes correctly — so your history stays readable and your tooling (changelogs, semantic-release) keeps working.78## When to use this skill910- You have changes staged with `git add` and want to commit them.11- You want a consistent, spec-compliant message instead of free-form text.12- You are unsure which type (`feat`, `fix`, `chore`, …) fits the change.13- Your repo uses semantic versioning or automated changelog generation that depends on commit conventions.1415> [!NOTE]16> This skill only reads and commits what is **already staged**. Stage the exact hunks you want first (`git add -p`). It will not stage files for you.1718## Instructions19201. Read the staged diff to understand what actually changed:21 ```bash22 git diff --cached23 ```24 If nothing is returned, stop and tell the user there are no staged changes to commit.252. Check the staged file list for scope hints (directory or package names):26 ```bash27 git diff --cached --name-only28 ```293. Choose the **type** from the staged changes:30 - `feat` — a new user-facing capability31 - `fix` — a bug fix32 - `docs` — documentation only33 - `style` — formatting, no logic change34 - `refactor` — code change that neither fixes a bug nor adds a feature35 - `perf` — performance improvement36 - `test` — adding or correcting tests37 - `build` / `ci` — build system or pipeline changes38 - `chore` — maintenance, deps, tooling394. Derive an optional **scope** in parentheses from the affected area (e.g. `auth`, `api`, `parser`). Omit it if the change is broad.405. Write the **subject** line: `type(scope): summary`41 - Imperative mood ("add", not "added" or "adds").42 - No trailing period; aim for 50 characters, hard limit 72.436. If the change is non-trivial, add a blank line then a **body** explaining the motivation and any context the diff alone does not convey. Wrap at ~72 columns.447. If the change breaks compatibility, mark it: append `!` after the type/scope (e.g. `feat(api)!:`) **and** add a `BREAKING CHANGE:` footer describing the migration.458. Add footers for issue references when relevant (e.g. `Refs: #123`, `Closes: #456`).469. Present the proposed message to the user for confirmation, then commit:47 ```bash48 git commit -m "feat(parser): add support for nested arrays" \49 -m "Handles arbitrarily deep nesting by recursing on bracket pairs." \50 -m "Closes: #128"51 ```5253## Examples5455Suppose `git diff --cached --name-only` shows `src/auth/session.ts` and the diff replaces a 1-hour token TTL with a configurable value, removing the old constant.5657```text58feat(auth)!: make session token TTL configurable5960Replace the hardcoded 1-hour TTL with SESSION_TTL_SECONDS so deployments61can tune session lifetime without a rebuild. Falls back to 3600 when the62variable is unset.6364BREAKING CHANGE: the SESSION_MAX_AGE constant has been removed. Set the65SESSION_TTL_SECONDS environment variable instead.6667Closes: #21468```6970Commit it:7172```bash73git commit \74 -m "feat(auth)!: make session token TTL configurable" \75 -m "Replace the hardcoded 1-hour TTL with SESSION_TTL_SECONDS so deployments can tune session lifetime without a rebuild. Falls back to 3600 when the variable is unset." \76 -m "BREAKING CHANGE: the SESSION_MAX_AGE constant has been removed. Set the SESSION_TTL_SECONDS environment variable instead." \77 -m "Closes: #214"78```