commit
Use when the user says "commit", "/commit", "save progress", or asks to land working changes on a feature or worktree branch. Working-phase posture: minimal…
by ocx-sh★ 20 GitHub stars
Install commit in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
/commit — Working-Phase Commit Workflow
Commit working tree during active dev on feature/worktree branch. Working phase half of OCX two-phase branch workflow — rebasing-phase cleanup for main lives in /finalize.
See workflow-git.md for full model: branching rules, two-phase model, Checkpoint convention, land-ready definition. Skill assumes those, implements working-phase posture on top.
Working-Phase Posture
- Minimise commit count. Bundle freely. Amend rolling Checkpoints.
- One concern per commit relaxed. Honest bundle message (
chore(claude): bundle skill + rule + agent tweaks) beats fake one-concern narrative./finalizesplit/reword later. - Don't badger user about splitting. Worktree branches (
goat,evelynn,sion,soraka) explicitly working-phase by default. Cleanup at finalize time.
For land-ready branch contract, see "Land-Ready Definition" in workflow-git.md. That /finalize job, not /commit.
Inputs
Optional free-text arg. Treat as intent hint (e.g., fix ocx install symlink bug), not full message — still draft final message. Flags:
/commit --amend— explicitly amend HEAD (bypasses Checkpoint-only safeguard)/commit --pr— force PR-branch prompt even if previously declined/commit --no-pr— skip + record PR skip
For rebasing-phase cleanup (squash, reword, split main..HEAD), use /finalize instead.
Workflow
1. Snapshot state (parallel batch)
git status --porcelain=v1(never-uall)git diff --stagedandgit diff --statgit log -5 --oneline— recent commits + scan for strandedCheckpointin windowgit rev-parse --abbrev-ref HEAD— current branchgit rev-list --count main..HEAD 2>/dev/null— commits ahead of maingit config --get branch.<current>.ocx-skip-pr-prompt— PR prompt already answered?git log -1 --pretty=%s— HEAD itself Checkpoint?gh pr view --json number,state 2>/dev/null— open PR for branch?
If working tree clean and HEAD not Checkpoint, stop with "nothing to commit".
2. Checkpoint scan (window, not just HEAD)
Look at last 5 commits for any with subject exactly Checkpoint.
Case A — HEAD itself is Checkpoint:
Two sub-cases by working tree state:
| Sub-case | Behavior |
|---|---|
| Dirty tree (unstaged/untracked changes exist) | Auto-amend — stage all changed files by name and git commit --amend --no-edit. No question. Rolling Checkpoints absorb all active changes as union. Report what folded in. |
| Clean tree (no changes, Checkpoint holds accumulated work) | Checkpoint itself is deliverable. Draft conventional commit message from Checkpoint diff (git diff main..HEAD), show, amend: git commit --amend -m "<drafted message>". "Finalize in place" path — user called /commit to give Checkpoint real name. |
Case B — Checkpoint exists at HEAD1..HEAD5 but not HEAD (stranded): warn user. Means previous session made real work inside Checkpoint then landed other commits on top without finalizing. Offer:
| Option | Effect |
|---|---|
| Commit on top, leave stranded (default in working-phase) | Normal commit. Stranded Checkpoint handled by /finalize before landing |
Hand off to /finalize now |
Stop, tell user run /finalize for full rebase plan — safer than rewording one commit in isolation |
| Skip for now | Ignore, continue |
Case C — no Checkpoint in window: proceed.
3. Commit strategy
On worktree branch, prefer one of:
- Amend HEAD when HEAD is fresh local commit you authored (not yet touching
main's reach) and new WIP clearly continuation of same concern. Ask first — amending destructive to commit hashes. - New commit on top when HEAD already represents distinct concern.
- Start Checkpoint (
git commit -m "Checkpoint") when user says "save progress" or WIP not yet coherent enough to name.
On non-worktree branch: never auto-amend. Always create new commit unless /commit --amend passed.
On main: stop. Tell user create feature branch first.
4. Draft the commit message
Follow Conventional Commits v1.0.0. See commit_reference.md for full cheat sheet and workflow-git.md for quick rules. Key points for working phase:
chore:for AI/tooling files (.claude/,CLAUDE.md, skills, rules, hooks, taskfiles) — keeps out of changelog- Imperative mood, lowercase description, no trailing period, subject ≤72 chars
- Body explains why, not what, when non-obvious
- Breaking:
!before colon andBREAKING CHANGE:footer - Never
Co-Authored-By(OCX convention)
Working-phase bundles legitimate. If staged diff covers multiple concerns, chore(claude): bundle <what> style subject with body honestly listing clusters acceptable. Flag at body end that it will split or reword during /finalize.
Show drafted message to user for approval before com
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- commit_reference.md
FAQ
What does the commit skill do?
Use when the user says "commit", "/commit", "save progress", or asks to land working changes on a feature or worktree branch. Working-phase posture: minimal commits, amendable Checkpoints. For pre-merge cleanup, use `/finalize`.
How do I install the commit skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the commit skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…