Write and execute a conventional commit. Trigger on: "commit", "git commit", "/commit", "commit my changes", "commit this", "write a commit", "make a commit", "commit and push", "save my work". Stages changes, writes a Conventional Commits-compliant message, and runs `git commit`. Optionally pushes when asked.
Stages changes and writes a high-quality Conventional Commits message automatically. You only need to say "commit" — the skill inspects the diff and crafts the message.
git status --short
git diff --cached --stat
git diff --stat
If nothing is staged and nothing is modified, report "Nothing to commit" and stop.
If the user specified files (e.g. "commit src/foo.ts"), stage only those:
git add <specified-files>
Otherwise, stage all tracked modifications:
git add -u
If there are untracked files the user probably wants included, ask before staging them. For new files explicitly mentioned by the user, stage them directly.
git diff --cached
Read the full diff. Understand:
Follow Conventional Commits v1.0.0.
<type>(<scope>): <short summary>
[optional body — required for non-trivial changes]
[optional footer(s)]
| Type | Use when |
|---|---|
feat | New feature or capability |
fix | Bug fix |
refactor | Code restructure with no behavior change |
perf | Performance improvement |
test | Adding or updating tests |
docs | Documentation only |
style | Formatting, whitespace (no logic change) |
chore | Build, tooling, deps, config (no app logic) |
ci | CI/CD pipeline changes |
revert | Reverts a previous commit |
Derive from the affected area: module name, directory, component, or package.
Examples: auth, api, dashboard, deps, cli, config.
Leave scope empty only when the change is genuinely cross-cutting.
If the change breaks a public API or interface, add:
BREAKING CHANGE: <description of what broke and migration path>
Closes #123
Refs #456
git commit -m "$(cat <<'EOF'
<type>(<scope>): <summary>
<body if needed>
<footers if needed>
EOF
)"
Confirm to the user:
If the user said "commit and push" or "push":
git push
If the branch has no upstream set:
git push -u origin $(git branch --show-current)
Report the remote URL and branch name after a successful push.
| Error | Cause | Fix |
|---|---|---|
nothing to commit | No staged changes | Report and stop |
not a git repository | Not inside a git repo | Report the working directory |
rejected (non-fast-forward) | Remote has newer commits | Run git pull --rebase first |
pre-commit hook failed | Hook blocked the commit | Read the hook output, fix the issue |
| Permission denied on push | Auth issue | Check SSH key or HTTPS credentials |