commit
Analyze changes, create conventional commits with smart splitting. Opus analyzes, Haiku executes git commands.
What this skill does
# /commit Skill
Analyze staged/unstaged changes, create conventional commits with smart splitting. You (Opus) analyze and plan; Haiku subagents execute git commands.
## Quick Reference
1. Gather git info (direct, not subagent)
2. Analyze changes → propose commit plan
3. Present commit plan → confirm with user (skip if auto argument provided)
4. Dispatch Haiku subagent(s) to execute git commands
5. Report results; handle hook failures
6. Push if requested
## Phase 1: Analysis (you do this directly)
Run these commands yourself (NOT via subagent):
```bash
${CLAUDE_PLUGIN_ROOT}/scripts/gather-info.sh
```
### File scope
If the user specified file paths, directories, or glob patterns in the arguments (e.g., `/commit src/`, `/commit *.py`), restrict the commit scope to only matching files. Still run the full git commands above for context awareness, but only include matching files in the commit plan. Unscoped `/commit` considers all changes.
### Pre-flight checks — stop and report to user if:
- Detached HEAD state
- Merge or rebase in progress
- Unresolved conflicts
- No changes to commit (nothing staged, nothing modified)
### Smart splitting heuristics
Group changes into logical commits when:
- **Unit of work**: a feature/fix and its tests belong in one commit; retroactive test coverage is a separate commit
- **Same file, different intent**: formatting changes, functional changes, and new data entries in the same file should be separate commits (e.g., a `style:` commit for formatting + a `feat:` commit for new content)
- **Different feature areas**: separate modules or components
- **Mixed intent**: refactoring mixed with functional changes
- **When in doubt**: present the split options to the user rather than guessing
### Commit message format
Always use **conventional commits**:
- `feat:` — new feature
- `fix:` — bug fix
- `refactor:` — code restructuring without behavior change
- `test:` — adding or updating tests
- `docs:` — documentation changes
- `chore:` — maintenance, dependencies, config
- `style:` — formatting, whitespace
- `perf:` — performance improvement
- `ci:` — CI/CD changes
Include a scope when obvious: `feat(auth):`, `fix(api):`, etc.
Keep messages concise, focused on **why** not **what**.
For the commit body:
- Use `- ` bullet points when the commit includes multiple distinct changes or reasons
- A single-sentence body is fine when there's only one thing to say
- Blank line between the subject line and body (standard git convention)
Use a HEREDOC for the commit message:
```bash
git commit -m "$(cat <<'EOF'
feat(auth): add OAuth2 login flow
- Implement Google OAuth2 provider with token refresh
- Add callback endpoint and session persistence
EOF
)"
```
## Phase 2: Propose Commit Plan
Present the plan to the user:
- For each commit: list files to stage + the commit message
- **ALWAYS present the plan and wait for user confirmation before executing**
- If the `auto` argument was provided, skip confirmation and execute immediately
## Phase 3: Execution (Haiku subagents)
For each commit, dispatch a Haiku subagent:
```
Task tool parameters:
subagent_type: "commit:commit"
model: "haiku"
max_turns: 3
description: "[commit] execute git add and commit"
prompt: |
Run these git commands in sequence:
1. git add <files>
2. git commit -m "$(cat <<'EOF'
<commit message>
EOF
)"
```
Execute commits **sequentially** (one subagent at a time), not in parallel.
## Phase 4: Hook Failure Handling
If Haiku reports `HOOK_FAILED`:
1. Read the full hook output
2. Determine what needs to be fixed (linting, formatting, type errors, etc.)
3. Fix the issue yourself (as Opus)
4. Stage the fix and create a **NEW commit** — never amend
5. Dispatch a new Haiku subagent for the retry
## Phase 5: Push (only if requested)
Only push if the user explicitly asked (e.g., `/commit push` or mentioned pushing).
```
Task tool parameters:
subagent_type: "commit:commit"
model: "haiku"
max_turns: 3
description: "[commit] push to remote"
prompt: |
Run: git push
```
Relay the result to the user. If GitHub printed a PR creation URL, highlight it.
## Phase 6: Report Results
Show the user:
- Commit hash(es) and messages for each successful commit
- Any PR URL from push output
- Summary of what was committed
## Safety Rules
**These are non-negotiable:**
- **NEVER** force-push (`git push --force` or `-f`)
- **NEVER** amend commits (`git commit --amend`)
- **NEVER** skip hooks (`--no-verify` or `-n`)
- **NEVER** push unless the user explicitly requested it
- **ALWAYS** create NEW commits after hook failure fixes (never amend the failed one)
- **ALWAYS** use specific file paths with `git add` (never `git add -A` or `git add .`)
- **ALWAYS** use conventional commit format
- **ALWAYS** present commit plan and confirm with user before executing (unless `auto` argument provided)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.