No slash command · from git-plugin
Guides commit message formatting and staging conventions using conventional commits (type(scope): subject), logical grouping, and explicit-path staging. Reference only — does not create commits. Use when deciding how to word a message or split changes.
Ships in git-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
| Use this skill when... | Use the alternative when... |
|---|---|
| Designing the conventional-commit message and staging conventions for a repo | Use git-commit to actually create a commit (handles pre-commit hooks, issue detection) |
| Reviewing how to group changes logically into focused commits | Use git-commit-trailers for BREAKING CHANGE / Co-authored-by trailer rules |
| Discussing humble, fact-based commit communication style | Use github-issue-autodetect to pick the issues a change references (Refs #N) or its PR closes |
Authoring feat(scope): subject rules for your codebase | Use github-pr-title to apply the same conventional format to PR titles |
Expert guidance for commit message conventions, staging practices, and commit best practices using conventional commits and explicit staging workflows.
For detailed examples, advanced patterns, and best practices, see REFERENCE.md.
Before staging any files — especially for bulk-edit / commit-loop workflows that touch many subdirectories — verify the working tree is yours alone:
| Check | Why | How |
|---|---|---|
| Coworker check | Another Claude session in the same checkout may have already pre-staged files (git commit -a retry, abandoned staging) that your loop would sweep into the wrong commit. Run this up front, not opportunistically. | SlashCommand → /git:coworker-check |
| Working tree scoped | Confirm git status --porcelain shows only your edits | git status --porcelain |
If /git:coworker-check returns anything other than clear, stop and either move to a fresh worktree under <repo>/.claude/worktrees/<task> (EnterWorktree, or git worktree add .claude/worktrees/<task>) or ask the user before proceeding. See .claude/rules/agent-coworker-detection.md for the seven detection signals.
Note: Commits are made on main branch and pushed to remote feature branches for PRs. See git-branch-pr-workflow skill for the main-branch development pattern.
type(scope): description
[optional body]
[optional footer(s)]
The scope is required. Write type(scope): … — docs(readme): update install steps, never a bare docs: update install steps. The Conventional Commits spec lets you omit the scope; this house convention does not (.claude/rules/conventional-commits.md). Take it from the component or plugin the change touches.
For footer/trailer patterns (Co-authored-by, BREAKING CHANGE, Release-As), see git-commit-trailers skill.
# Feature
git commit -m "feat(auth): implement OAuth2 integration"
# Bug fix with body
git commit -m "fix(api): resolve null pointer in user service
Fixed race condition where user object could be null during
concurrent authentication requests."
# Breaking change
git commit -m "feat(api)!: migrate to GraphQL endpoints
BREAKING CHANGE: REST endpoints removed in favor of GraphQL.
See migration guide at docs/migration.md"
DO:
Refs #N; put closing keywords (Fixes #N, Closes #N) in the PR body only
(a closing keyword in a commit message closes the issue when the commit lands on the default branch,
whatever the PR body says; the no-closing-keywords commit-msg hook rejects it)DON'T:
Fixes) when you only mean to reference (Refs)Before committing, gather all context in one command:
# Basic context: status, staged files, diff stats, recent log
bash "${CLAUDE_PLUGIN_ROOT}/skills/git-commit-workflow/scripts/commit-context.sh"
# With issue matching: also fetches open GitHub issues for auto-linking
bash "${CLAUDE_PLUGIN_ROOT}/skills/git-commit-workflow/scripts/commit-context.sh" --with-issues
The script outputs: branch info, staged/unstaged status, diff stats, detected scopes, recent commit style, pre-commit config status, and optionally open issues. Use this output to compose the commit message. See scripts/commit-context.sh for details.
# Show current status
git status --porcelain
# Stage files one by one for visibility
git add src/auth/login.ts
git add src/auth/oauth.ts
git status # Verify what's staged
# Show what will be committed
git diff --cached --stat
git diff --cached # Review actual changes
# Commit with conventional message
git commit -m "feat(auth): add OAuth2 support"
When a single change touches many subdirectories (per-plugin, per-package, per-doc) and each needs its own scoped commit for release-please, write a one-shot script rather than chaining commands inline.
Why inline loops fail, the canonical one-shot script recipe, and failure recovery: REFERENCE.md.
Compose a multi-line message with a HEREDOC, not by slurping a temp file.
git commit -m "$(cat <<'EOF'
feat(auth): add OAuth2 support
Implements token refresh and secure storage.
Refs #123
EOF
)"
Passing the message by path is equally accepted — git commit -F <file> /
--file=<file> is git's analogue of gh --body-file, and the
bash-antipatterns hook exempts it (#2462):
git commit -F /tmp/commit-msg.txt
What the hook still nudges away from is the roundabout middle ground: writing a
temp file and then slurping it back through -m "$(cat /tmp/commit-msg.txt)".
Either compose inline with a heredoc, or pass the file by path.
# Good: Concise, factual, modest
git commit -m "fix(auth): handle edge case in token refresh"
git commit -m "feat(api): add pagination support
Implements cursor-based pagination for list endpoints.
Includes tests and documentation."
Focus on facts: What changed, Why it changed (if non-obvious), and Impact (breaking changes).
Commit messages reference; only the PR body closes.
| Scenario | Commit message | PR body |
|---|---|---|
| Bug fix resolving issue | Refs #123 | Fixes #123 |
| Feature completing issue | Refs #456 | Closes #456 |
| Related but not completing | Refs #789 | Refs #789 |
| Cross-repository | Refs org/lib#42 | Fixes org/lib#42 |
| Multiple issues | Refs #1, #2 | Fixes #1, fixes #2 |
# Subject line: <= 72 characters
feat(auth): add OAuth2 support
# Body: <= 72 characters per line (wrap)
# Use blank line between subject and body
| Context | Command |
|---|---|
| Pre-commit context | bash "${CLAUDE_PLUGIN_ROOT}/skills/git-commit-workflow/scripts/commit-context.sh" |
| Context + issues | bash "${CLAUDE_PLUGIN_ROOT}/skills/git-commit-workflow/scripts/commit-context.sh" --with-issues |
| Quick status | git status --porcelain |
| Staged diff stats | git diff --cached --stat |
| Recent commit style | git log --format='%s' -5 |
| Open issues for linking | gh issue list --state open --json number,title --limit 30 |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
52 skills in this plugin
/deadbranchdeadbranch CLI for stale-branch cleanup — dry-run preview, TUI or non-interactive delete, protects main/develop/WIP. Use when asked to clean up branches, prune branches, or remove stale branches./external-pr-trustAuthorship as a precondition of merging — bot vs stranger classification, what a merge executes, the merge-guard hook. Use when bulk-merging PRs, or when a merge is denied for a non-self author./gh-cli-agenticgh CLI commands with JSON output for agents. Use when querying PRs, issues, runs, or repo metadata; inspecting PR checks; fetching failed CI logs; or mapping a github.com URL to an API call./git-api-prGitHub API PR creation without local git. Use when submitting file changes as a PR without local commits — quick fixes, typos, config updates, or bypassing local git state./git-branch-namingBranch names: type prefix (feat/, fix/, chore/), issue number, kebab-case. Use when picking a name for a new branch or setting a repo's branch-naming convention./git-branch-pr-workflowBranch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.npx claudepluginhub laurigates/claude-plugins --plugin git-pluginOther plugins' skills for the same job