Context
- Current git status: !
git status --short
- Diff summary (file + line counts): !
git diff HEAD --stat
- Current branch: !
git branch --show-current
- Recent commits (for style matching): !
git log --oneline -10
The full diff is intentionally NOT loaded above. Read hunks on demand with git diff HEAD -- <file> for only the files you need to inspect to write the message and decide splits. Do not run git diff HEAD with no path filter.
Your task
Create atomic, self-contained commits with terse, exact messages, then push to the remote. Conventional Commits format. No fluff. Why over what.
Commit Splitting
Split into multiple commits when changes involve:
- Different concerns — unrelated parts of the codebase
- Different types — mixing feat/fix/refactor/tests/docs/config
- Different file patterns — source vs docs vs config
- Large changesets — break down for reviewability
Each commit must build and make sense on its own. If all changes relate to one concern, a single commit is fine.
Message Rules
Subject line:
<type>(<scope>): <imperative summary> — <scope> optional
- Types:
feat, fix, refactor, perf, docs, test, chore, build, ci, style, revert
- Imperative mood: "add", "fix", "remove" — not "added", "adds", "adding"
- ≤50 chars when possible, hard cap 72
- No trailing period
- Match project convention for capitalization after the colon (check recent commits above)
Body (only if needed):
- Skip entirely when the subject is self-explanatory
- Add body only for: non-obvious why, breaking changes, migration notes, linked issues
- Wrap at 72 chars
- Bullets
- not *
- Reference issues/PRs at end:
Closes #42, Refs #17
Auto-clarity — always include body for: breaking changes, security fixes, data migrations, revert commits.
Breaking changes: mark subject with ! and add a BREAKING CHANGE: footer explaining the migration.
What NEVER goes in:
- "This commit does X", "I", "we", "now", "currently" — the diff says what
- "As requested by..." — use
Co-authored-by: trailer instead
- AI attribution: "Generated with Claude Code", co-authorship footers, 🤖 emoji
- Emoji unless project convention requires
- Restating the filename when the scope already covers it
Examples
fix(auth): handle expired refresh token
feat(api): add GET /users/:id/profile
Mobile client needs profile data without the full user payload
to reduce LTE bandwidth on cold-launch screens.
Closes #128
HEREDOC Format
git commit -m "$(cat <<'EOF'
<type>(<scope>): <subject>
<body if needed>
EOF
)"
Staging Rules
- Stage specific files by name — do NOT use
git add -A or git add .
- NEVER stage files that may contain secrets:
.env, .env.*, credentials.json, *.key, *.pem, *.p12, id_rsa*, token.json, secret*. Warn the user and skip them.
- If all changes are already staged, do not re-stage them.
Push Rules
- After all commits are created, push to the remote.
- Use
git push origin <current-branch>.
- If the branch has no upstream, use
git push -u origin <current-branch>.
- If the push fails due to diverged history, do NOT force push. Inform the user and stop.
Edge Cases
- No changes (nothing staged, nothing modified): say so and stop. Do not create an empty commit.
- Only untracked files that look like generated artifacts (
dist/, node_modules/, *.log): warn the user instead of committing them.
- If the user says "normal mode" or "verbose commit": allow a longer, descriptive style for this commit only.
1---2name: commit-push3effort: low4allowed-tools: Read, Grep, Glob, Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*), Bash(git log:*), Bash(git push:*), Bash(git branch:*), Bash(git remote:*)5description: >6 Create atomic git commits with terse Conventional Commits messages, then push to remote.7 Subject ≤50 chars, body only when "why" isn't obvious. Never force pushes.8 Use when the user says "commit and push", "commit & push", "/commit-push", or asks to stage, commit, and push in one flow.9metadata:10 source: https://skillmd.com/skills/samuelpatro/commit-push11---1213## Context1415- Current git status: !`git status --short`16- Diff summary (file + line counts): !`git diff HEAD --stat`17- Current branch: !`git branch --show-current`18- Recent commits (for style matching): !`git log --oneline -10`1920The full diff is intentionally NOT loaded above. Read hunks on demand with `git diff HEAD -- <file>` for only the files you need to inspect to write the message and decide splits. Do not run `git diff HEAD` with no path filter.2122## Your task2324Create atomic, self-contained commits with terse, exact messages, then push to the remote. Conventional Commits format. No fluff. Why over what.2526### Commit Splitting2728Split into multiple commits when changes involve:2930- **Different concerns** — unrelated parts of the codebase31- **Different types** — mixing feat/fix/refactor/tests/docs/config32- **Different file patterns** — source vs docs vs config33- **Large changesets** — break down for reviewability3435Each commit must build and make sense on its own. If all changes relate to one concern, a single commit is fine.3637### Message Rules3839**Subject line:**40- `<type>(<scope>): <imperative summary>` — `<scope>` optional41- Types: `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `chore`, `build`, `ci`, `style`, `revert`42- Imperative mood: "add", "fix", "remove" — not "added", "adds", "adding"43- ≤50 chars when possible, hard cap 7244- No trailing period45- Match project convention for capitalization after the colon (check recent commits above)4647**Body (only if needed):**48- Skip entirely when the subject is self-explanatory49- Add body only for: non-obvious *why*, breaking changes, migration notes, linked issues50- Wrap at 72 chars51- Bullets `-` not `*`52- Reference issues/PRs at end: `Closes #42`, `Refs #17`5354**Auto-clarity — always include body for:** breaking changes, security fixes, data migrations, revert commits.5556**Breaking changes:** mark subject with `!` and add a `BREAKING CHANGE:` footer explaining the migration.5758**What NEVER goes in:**59- "This commit does X", "I", "we", "now", "currently" — the diff says what60- "As requested by..." — use `Co-authored-by:` trailer instead61- AI attribution: "Generated with Claude Code", co-authorship footers, 🤖 emoji62- Emoji unless project convention requires63- Restating the filename when the scope already covers it6465### Examples6667```68fix(auth): handle expired refresh token69```7071```72feat(api): add GET /users/:id/profile7374Mobile client needs profile data without the full user payload75to reduce LTE bandwidth on cold-launch screens.7677Closes #12878```7980### HEREDOC Format8182```83git commit -m "$(cat <<'EOF'84<type>(<scope>): <subject>8586<body if needed>87EOF88)"89```9091### Staging Rules9293- Stage specific files by name — do NOT use `git add -A` or `git add .`94- NEVER stage files that may contain secrets: `.env`, `.env.*`, `credentials.json`, `*.key`, `*.pem`, `*.p12`, `id_rsa*`, `token.json`, `secret*`. Warn the user and skip them.95- If all changes are already staged, do not re-stage them.9697### Push Rules9899- After all commits are created, push to the remote.100- Use `git push origin <current-branch>`.101- If the branch has no upstream, use `git push -u origin <current-branch>`.102- If the push fails due to diverged history, do NOT force push. Inform the user and stop.103104### Edge Cases105106- No changes (nothing staged, nothing modified): say so and stop. Do not create an empty commit.107- Only untracked files that look like generated artifacts (`dist/`, `node_modules/`, `*.log`): warn the user instead of committing them.108- If the user says "normal mode" or "verbose commit": allow a longer, descriptive style for this commit only.