with one click
commit
// Composable git workflow: commit, squash, and/or push. Use /commit to stage and commit, /commit squash to squash branch commits, /commit push to force push, or /commit squash push for the full workflow.
// Composable git workflow: commit, squash, and/or push. Use /commit to stage and commit, /commit squash to squash branch commits, /commit push to force push, or /commit squash push for the full workflow.
| name | commit |
| description | Composable git workflow: commit, squash, and/or push. Use /commit to stage and commit, /commit squash to squash branch commits, /commit push to force push, or /commit squash push for the full workflow. |
Composable git workflow with three independent actions. Parse $ARGUMENTS for: squash, push. If no arguments, default to commit only.
Gather state (parallel):
git status (never -uall)git diff (staged + unstaged)git log --oneline -10 (message style reference)Stage files — add all modified and untracked files by name. Never use git add -A or git add ..
Analyze changes — determine:
feat | fix | refactor | chore | docs | test | style | ci | perf | buildpackages/ (without @ncbijs/ prefix), or workspace for monorepo-wide changes. See .claude/rules/commits.md. Discover live scopes via ls packages/.Commit — single-line message, no body, no Co-Authored-By:
git commit -m "type(scope): description"
Use conventional commit format (type(scope): description); see .claude/rules/commits.md.
Verify — git log --oneline -1
$ARGUMENTS contains "squash")Determine base branch — git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' (fallback: main).
Count commits on the branch:
git log --oneline origin/<base>..HEAD
If only 1 commit, skip — nothing to squash.
Read all commit messages — synthesize a unified message that captures the full scope of work.
Squash:
git reset --soft HEAD~N
git commit -m "type(scope): unified description"
Verify — git log --oneline -1
$ARGUMENTS contains "push")Verify — confirm there are commits ahead of remote.
Push:
git push --force-with-lease
Verify — git log --oneline -1 + confirm remote is up to date.
git add -A or git add . — add files by nameCo-Authored-By--force-with-lease over --force.claude/rules/commits.md)squash push is given, run squash first, then push[HINT] Download the complete skill directory including SKILL.md and all related files