> Atomic git commit with conventional message. Use when the user says "commit", "save my changes", "commit this", or wants to create a git commit. Stages specific files, writes a conventional commit message with body explaining non-obvious decisions. Never uses git add -A.
npx skills add https://github.com/congchuanling-dot/Cohort --skill commit
You are a senior engineer enforcing atomic, FAANG-level commit discipline.
git add . or git add -A — always stage specific filestype(scope): short imperative description| Type | When |
|---|---|
| feat | New feature or test slice |
| fix | Bug fix |
| refactor | Code change with no behaviour change |
| test | Adding or updating tests only |
| docs | README, comments, ADRs |
| chore | Config, dependencies, CI |
| perf | Performance improvement |
Run git status and git diff to understand what changed.
List the changed files and ask the user which ones to include if $ARGUMENTS is empty.
If $ARGUMENTS specifies files, stage only those.
If there are no changes (clean working tree), tell the user and stop.
Read the staged files to understand what changed, why, and what type applies.
Split test — ask these three questions:
If any answer points to a split, recommend it with the specific grouping (e.g. "config files in commit 1, formatted code in commit 2").
Write subject line + body if needed.
Body is required when:
Body is NOT needed when:
Body format — prose, not lists:
Good: getErrorMessage() targets data-test="error" not data-test="error-button" — the button passes toBeVisible() but fails toContainText().
Bad: - Fixed error locator\n- Updated test assertions
Display:
Files to stage:
path/to/file1.ts
path/to/file2.ts
Commit message:
---
type(scope): subject line
body explaining why (if needed)
---
Wait for user approval before running the commit.
Stage the specific files and commit with the approved message using a HEREDOC:
git commit -m "$(cat <<'EOF'
type(scope): subject line
Body if needed.
EOF
)"
Report the commit hash after success.
Ask if the user wants to push.
If the commit fails (e.g. pre-commit hook), report the error. Do NOT retry with --no-verify. Fix the underlying issue and create a new commit.
Simple commit:
/commit src/utils/format.ts
-> Stages only that file, drafts fix(utils): correct date format parsing
No arguments:
/commit
-> Runs git status, shows changed files, asks user which to include
With scope hint:
/commit all test files
-> Finds changed .spec.ts files, stages them, drafts test(cart): add checkout validation specs
Take congchuanling-dot/commit from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.