feat: add commit skill

This commit is contained in:
2026-07-10 09:16:06 -04:00
parent e16ca1114a
commit 36536e0e11
2 changed files with 31 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
---
name: commit
description: Commit staged files with a conventional commit message.
disable-model-invocation: true
---
Commit staged files with a conventional commit message.
## Process
1. **Check the staging area** — Run `git diff --cached --stat`. If empty, report "nothing staged" and stop.
Completion criterion: Staged files are listed, or the skill terminates.
2. **Draft the message** — Inspect `git diff --cached` to understand what changed. Write a [conventional commit](https://www.conventionalcommits.org/) message:
- Format: `type(scope): summary` — scope is optional.
- Common types: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`, `style`, `perf`, `ci`, `build`.
- Summary: imperative mood, lowercase, no period, ≤72 characters.
- Body (if needed): wrap at 72 characters, explain _what_ and _why_, not _how_.
Completion criterion: A conventional commit message is composed.
3. **Commit** — Run `git commit -m "<message>"`. If the commit fails, report the error and stop.
Completion criterion: `git commit` exits 0.
4. **Report** — Print the short commit hash and the first line of the message.
Completion criterion: The hash and message are printed.