home / skills / nweii / agent-stuff / commit
This skill helps you craft conventional commit messages automatically, ensuring clear, well-formatted commits that improve traceability.
npx playbooks add skill nweii/agent-stuff --skill commitReview the files below or copy the command above to add this skill to your agents.
---
name: commit
description: "Create well-formatted commits with conventional commit messages. Use when user asks to commit, wants to commit changes, or needs help with commit messages."
metadata:
author: nweii
version: "1.0.1"
---
# Commit
Create well-formatted git commits following conventional commit conventions.
## Convention
Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification:
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
### Types
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation only
- `style`: Formatting, missing semi-colons, etc. (no code change)
- `refactor`: Code change that neither fixes a bug nor adds a feature
- `perf`: Performance improvement
- `test`: Adding missing tests
- `chore`: Maintenance tasks (build process, dependencies, etc.)
### Guidelines
- **Subject line**: Max 50 characters, imperative mood ("add" not "added")
- **Body**: Wrap at 72 characters, explain *what* and *why* (not *how*)
- **Scope**: Optional, indicates section of codebase (e.g., `feat(auth):`)
- **Breaking changes**: Add exclamation mark after type/scope (e.g., `feat!:`) and explain in footer
## Process
1. Review staged changes (`git diff --staged`)
2. Determine appropriate type and scope
3. Write concise, descriptive subject line
4. Add body if the change needs explanation
5. Execute the commit
## Examples
```
feat(auth): add OAuth2 login support
Implements Google and GitHub OAuth providers.
Closes #123
```
```
fix: resolve race condition in data fetcher
The previous implementation could return stale data
when multiple requests were in flight.
```
```
chore: update dependencies to latest versions
```
This skill creates well-formatted git commits following the Conventional Commits specification. It helps pick the correct commit type and scope, craft a concise subject line, and produce an optional body and footer when needed. Use it to standardize commit history and make changelogs, CI, and releases more reliable.
The skill inspects staged changes and recommends a commit type (feat, fix, docs, etc.) and an optional scope based on files changed. It generates a 50-character-or-less imperative subject, an optional wrapped body at 72 characters explaining what and why, and any footers for issues or breaking changes. Finally, it outputs a ready-to-run git commit command.
Do I always need a scope?
No. Use a scope only when it clarifies which part of the codebase is affected.
How do I indicate a breaking change?
Add an exclamation after the type or type(scope) like feat!: and explain the breaking change in the footer.
What should the commit body contain?
Briefly explain what changed and why. Avoid implementation details; keep lines wrapped at 72 characters.