commit
Installation
SKILL.md
Git Commit
Create a single, well-crafted git commit from the current working tree changes.
Context
Gather the working-tree context by running each command below as its own shell tool call — a single argv-style invocation (just the program and its arguments). Do not join them with ;, &&, ||, pipes, $(...), or redirects like 2>/dev/null: that syntax parses only under POSIX shells and aborts under Windows PowerShell. Read each command's exit status directly — a non-zero exit is a normal state to interpret, not a failure to suppress.
| Command | Purpose | Non-zero exit / empty output means |
|---|---|---|
git status |
Working-tree state | Not a git repository — report and stop |
git diff HEAD |
Uncommitted changes | Unborn repo with no commits yet — treat every tracked change as new |
git branch --show-current |
Current branch | Empty output = detached HEAD |
git log --oneline -10 |
Recent commit style | Unborn repo — no history to match yet |
git rev-parse --abbrev-ref origin/HEAD |
Remote default branch | No origin/HEAD set — resolve the default branch per Step 1 |
These values are a snapshot taken before any action. Re-read anything consequential (the current branch, the staged set) immediately before committing, since the working tree can change between gathering context and acting on it.