| name | global-commit |
| description | Create a git commit following Conventional Commits specification |
| allowed-tools | Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*), Bash(git log:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(git stash:*), Bash(git rm:*) |
| disable-model-invocation | true |
Context
- Current git status: !
git status
- Staged changes: !
git diff --cached
- Unstaged changes: !
git diff
- Current branch: !
git branch --show-current
- Recent commits: !
git log --oneline -10
- Repository root path: !
git rev-parse --show-toplevel
Conventional Commits
We use Conventional Commits specification for all commit messages.
Format
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types
| Type | Description |
|---|
feat | A new feature |
fix | A bug fix |
docs | Documentation only changes |
style | Changes that do not affect the meaning of the code (white-space, formatting, etc) |
refactor | A code change that neither fixes a bug nor adds a feature |
perf | A code change that improves performance |
test | Adding missing tests or correcting existing tests |
build | Changes that affect the build system or external dependencies |
ci | Changes to CI configuration files and scripts |
chore | Other changes that don't modify src or test files |
revert | Reverts a previous commit |
Rules
- The description MUST be in lowercase and start with a verb in imperative mood (add, fix, change, etc.)
- The description MUST NOT end with a period
- Use scope to provide additional context (e.g.,
feat(auth): add login endpoint)
- Breaking changes MUST be indicated by
! after type/scope or BREAKING CHANGE: in footer
- Keep the first line under 72 characters
Examples
feat(api): add user authentication endpoint
fix(ui): resolve button alignment issue on mobile
docs: update installation instructions
refactor!: drop support for Node 14
chore(deps): update dependencies
Co-authors
Always add a co-author trailer to the commit message with the following format:
Co-Authored-By: {tool} - {model.name} {model.version} ({model.reasoning_effort}) <{tooling_email}>
tool: The AI coding tool used (e.g. Claude Code, Cursor, Copilot, Codex)
model.name: The name of the model used to make the change (e.g. Claude Opus, Cursor Composer, OpenAI GPT)
model.version: The version of the model used to make the change (e.g. 4.6, 1.5, 5.4)
model.reasoning_effort: The reasoning effort of the model used to make the change (e.g. low, medium, high)
tooling_email:
- Claude Code:
noreply@anthropic.com
- Cursor:
cursoragent@cursor.com
- Copilot:
copilot@github.com
- Codex:
codex@openai.com
NEVER guess or hardcode these values. They MUST reflect the tool, model, version, and reasoning effort actually running this session and producing the changes — including the real, currently selected reasoning_effort. If you cannot determine a value with certainty, ask instead of inventing one.
When the tool is Claude Code, read the currently selected reasoning_effort from the Claude Code status line, which reflects the effort active for this session.
Task
Based on the changes shown above:
- Analyze the changes to determine the appropriate commit type and scope
- When in doubt, prefer multiple focused commits over a single large one — do NOT ask
- Stage relevant files and create commit messages following the Conventional Commits specification
- Execute the commits
Always run git commit outside the sandbox, since GPG signing needs access to the gpg-agent and ~/.gnupg, which the sandbox blocks.
Course Repository Scope Convention
This section ONLY applies when the last segment of the repository root path (shown above) ends in -course.
When in a course repository, the commit scope MUST always reflect the course module and lesson numbers derived from the folder path.
Scope Format
The folder structure follows the pattern <module>-<topic>/<lesson>-<name>. Extract the module and lesson numbers to build the scope as <module>-<lesson>.
Examples
| Changed folder | Scope | Full commit example |
|---|
01-agents/2-init | 01-2 | feat(01-2): add agent initialization |
02-tools/3-search | 02-3 | fix(02-3): resolve search query parsing |
03-prompts/1-basics | 03-1 | refactor(03-1): simplify prompt builder |
Rules
- The scope MUST always include the module and lesson numbers — never omit them
- If changes span multiple folders, use the most relevant one or split into separate commits