commitlisted
Install: claude install-skill thettwe/nyann
# commit
You are generating a commit message for the user's staged changes. Work
in phases. Never run `git commit` until the user has confirmed the message.
## 0. Drift check (quick, non-blocking)
Run `bash bin/session-check.sh --flow=commit`. If it produces output,
surface the line to the user verbatim. Do not block the flow.
## 1. Gather context
Run `bin/commit.sh --target <cwd>`. The script emits a JSON context object
(`target`, `branch`, `on_main`, `convention`, `staged_files`, `summary`,
`diff`, `truncated`).
Exit code handling:
- `0` → JSON context emitted. Check the `nothing_staged` field:
- `nothing_staged: true` → ask the user what they want to stage
(`git add <paths>`, `git add -p`, or "everything"), then re-run.
- Otherwise → full context available. Continue.
- `2` → not a git repo. Tell the user, stop.
If `on_main: true`, warn the user that the block-main hook will reject
the commit. Suggest they create a feature branch via the `new-branch`
skill before continuing.
## 1.5. Pre-action guards + commit hygiene
Run **both** of these before generating the message — they inform scope
choice and prevent obvious mistakes from reaching the commit message
step:
```
bash bin/pre-action-guard.sh --flow commit --target <cwd> [--profile <resolved-profile.json>]
bash bin/commit-hygiene.sh --target <cwd> [--profile <resolved-profile.json>]
```
### Guard handling (exit code)
| Exit | Meaning | Action |
|---|---|---|
| 0 | All guards passed (or only advisory wa