/commit - Conventional Commit & Push
Required Execution Rules (CRITICAL)
When this skill activates, you MUST execute the workflow below.
Step 1: Status Check (parallel)
bash
# Run concurrently git status # check unstaged/untracked files git diff --stat # change statistics git log --oneline -5 # check recent commit style
Step 2: Staging
- •If there are no staged changes, ask the user what to commit
- •Warn on sensitive files (.env, credentials)
- •Use
git addfor selective staging
Step 3: Generate Commit Message
Conventional Commit format:
code
<type>(<scope>): <subject> <emoji> <body> Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Types:
| Type | Description | Emoji |
|---|---|---|
| feat | New feature | sparkles |
| fix | Bug fix | bug |
| docs | Documentation | memo |
| refactor | Refactoring | recycle |
| test | Tests | check |
| chore | Maintenance | wrench |
| perf | Performance | zap |
| style | Formatting | lipstick |
Step 4: Commit
bash
git commit -m "$(cat <<'EOF' <type>(<scope>): <subject> <emoji> <body> Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> EOF )"
Step 5: Push (unless --no-push)
bash
git push origin <current-branch>
- •For new branches, use
git push -u origin <branch> - •If diverged, confirm with the user
Step 6: Output
code
Committed and pushed: feat(auth): add login feature Branch: feat/login Remote: https://github.com/user/repo/commit/abc1234
Options
| Option | Description |
|---|---|
--no-push | Commit only, skip push |
Prohibited
- •Force push to main/master (without explicit request)
- •Committing .env or credentials files
- •Using --no-verify on pre-commit hook failure
Related Commands
- •
/create pr- Create a PR after commit - •
/session changelog- Update changelog before commit