commit
This skill should be used when the user asks to commit changes, craft a commit message, or run a commit workflow. Creates atomic git commits with conventional-commit formatting and optional deep analysis or push. Flags: --all, --deep, --close, --push.
What this skill does
# Git Commit
Create atomic commits by staging the right files, analyzing the staged diff, composing a conventional commit message, and optionally pushing.
## Workflow
### 1) Pre-flight + context (single call)
Run all checks and context collection in one bash call:
```bash
git rev-parse --is-inside-work-tree \
&& ! test -d "$(git rev-parse --git-dir)/rebase-merge" \
&& ! test -f "$(git rev-parse --git-dir)/MERGE_HEAD" \
&& ! test -f "$(git rev-parse --git-dir)/CHERRY_PICK_HEAD" \
&& git symbolic-ref HEAD \
&& git status --short --branch
```
If any check fails, stop with a clear error and suggested fix.
Arguments: `$ARGUMENTS`
### 2) Parse arguments
- Flags:
- `--all` commit all changes
- `--deep` deep analysis, breaking changes, concise body
- `--push` push after commit
- `--close <issue_numbers>` append `Closes #N` trailers for listed issues (comma/space-separated)
- Value arguments:
- Type keyword (any conventional type) overrides inferred type
- Quoted text overrides inferred description
### 3) Stage + read diff
- If `--all`:
- If no changes at all: error "No changes to commit"
- If unstaged changes exist: `git add -A`
- If already staged: proceed
- Otherwise (atomic commits):
- Session-modified files = files edited in this session
- Currently staged files: `git diff --cached --name-only`
- For staged files NOT in session-modified set: `git restore --staged <file>`
- For session-modified files with changes: `git add <file>`
- If none: error "No files modified in this session"
- **Unrelated changes**: session-modified files may contain pre-existing uncommitted changes (hunks not from this session). Include the entire file—partial staging is impractical. Never revert, discard, or `git checkout` unrelated changes.
- Read the staged diff once: `git diff --cached`
- Log staged files with status (A/M/D)
### 4) Analyze + compose message
Read the staged diff and produce the commit message in a single pass.
**Type inference** — infer the type from the dominant user-visible intent, not the largest file diff or the presence of
dependency/config churn.
Choose the highest-signal behavior that explains why the commit exists:
- If a dependency bump is only the enabler for a migration/refactor/fix, use the migration/refactor/fix type instead of
`chore(deps)`.
- If changed tooling/scripts/config are required to keep existing behavior working after a code migration, include them in
the same type as the migration.
- Use `chore` only for maintenance that does not fit a more specific behavioral category.
- Use `chore(deps)` only for dependency-only updates or dependency updates whose main purpose is routine maintenance.
| Behavior | Type |
| --------------------------------------------------- | ------------- |
| New functionality | `feat` |
| Bug fix / error handling | `fix` |
| Code migration or API adaptation without new UX/API | `refactor` |
| Code reorganization, no behavior change | `refactor` |
| Documentation | `docs` |
| Tests | `test` |
| Build system (webpack, vite, esbuild) | `build` |
| CI/CD pipelines | `ci` |
| Dependency-only maintenance | `chore(deps)` |
| Formatting / whitespace only | `style` |
| Performance | `perf` |
| Reverting previous commit | `revert` |
| AI config (CLAUDE.md, .claude/, .gemini/, .codex/) | `ai` |
| Other maintenance | `chore` |
Explicit type keyword in arguments takes precedence over inference.
**Scope** — infer only when path makes it obvious (lowercase).
**Unrelated hunks** — ignore pre-existing changes when determining type/scope/description. If unrelated changes are in the same file as session changes, they are included in the commit scope but should not influence the message.
**Message format:**
- Subject line (\<= 50 chars): `type(scope): description` or `type: description`
- Imperative mood ("add" not "added"), lowercase, no period
- Describe what the change does, not which files changed
- Body: hyphenated lines for distinct changes; skip for trivial changes
**Issue linking** — scan the chat transcript for GitHub issue references (e.g. `#123`, `owner/repo#123`, issue URLs) that the current changes resolve. For each match, append a `Closes #N` trailer. Skip issues merely mentioned in passing; include only ones the commit actually closes.
**If `--deep`:**
- Deep semantic analysis; detect breaking changes
- Infer scope from code structure even when path isn't clear
- Body: 2-3 hyphenated lines max, focus on WHY
- Breaking change: `BREAKING CHANGE:` + one-line migration note
**If `--close`:**
- Append a `Closes #N` line for each issue number provided
- Multiple issues: one `Closes #N` per line in the body/trailer
- Merge with transcript-scanned issues; de-duplicate
### 5) Commit
- Use `git commit -m "subject"` (add `-m "body"` only if body is non-empty)
- Output exactly: commit hash, subject, and `N files changed` summary. Nothing else.
- Do not report branch ahead/behind counts, unpushed commits, push availability, unrelated tree state, staging steps, or pre-commit hook activity unless a command failed.
- If failed: show error + suggest fix
- **Pre-commit hook failure:** if the hook fails on unrelated/pre-existing changes (not this session's changes), retry automatically with `git commit --no-verify` — do not ask. Report the bypass in one line, noting the failure was unrelated to the staged changes. Never bypass hooks for failures caused by the session's own changes; fix those or surface the error instead.
### 6) Push (if `--push`)
- If upstream exists: `git push`
- If no upstream: `git push -u origin HEAD`
- If failed: show error + suggest fix (pull/rebase first, set upstream, check auth)
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.