commit
Create atomic git commits following best practices
What this skill does
## Current Context
- **Current branch:** !`git branch --show-current`
- **Git status:** !`git status --short`
- **Staged changes:** !`git diff --staged --stat`
- **Unstaged changes:** !`git diff --stat`
- **Recent commits:** !`git log --oneline -5`
## Git Commit Practices
**CRITICAL: Commit early, commit often, one concern per commit!**
### Branch Safety
**NEVER commit directly to main/master branches.**
If the current branch is `main` or `master`:
- Derive a descriptive feature branch name from the staged and unstaged changes
- If one clear name fits, create the branch immediately and continue
- If the branch name is ambiguous, use the available ask/question tool in the current environment to confirm or override it
- After choosing the name, create the branch yourself and proceed with the commit
- Do not ask the user to create the branch manually
- Example: `git switch -c fix-descriptive-name`
### Atomic Commits Principle
Each commit must represent **ONE logical change**:
- Easier code review - reviewers understand one change at a time
- Safer reverts - can undo specific changes without losing other work
- Clearer history - git log tells the story of the project
- Better debugging - git bisect works effectively
### Commit Granularity
**Good granularity:**
- Fix the first issue, commit, then fix the next
- One bug = one commit
- One feature component = one commit
- One refactoring aspect = one commit
**Red flags (split the commit):**
- If you need "and" to describe unrelated changes
- If `git diff` output is very long
- If changes touch 3+ files with different purposes
### Commit Message Format
```
Short summary (50 chars or less, imperative mood)
Detailed explanation if needed:
- What changed
- Why it changed
- Impact or implications
```
You can add attribution too, `Co-authored-by:`. Use Claude Code for Claude
models and OpenCode for OpenAI models. Specify the model used.
**Rules:**
- Imperative mood: "Fix bug" not "Fixed bug"
- Capitalize first word
- No period at end
- Be specific: "Fix timestamp mismatch in terminal grading" not "Fix bug"
- Stay under 50 characters when possible
### Literate Programming Projects
**CRITICAL**: In projects with .nw files, NEVER commit generated files.
Before committing, check staged files:
- If a .py or .tex file has a corresponding .nw file, it's generated - DO NOT COMMIT
- Only commit the .nw source files
- Let .gitignore handle the rest
### Pre-Commit Checklist
Before committing, verify:
- [ ] On correct branch (not main/master unless approved)
- [ ] Represents ONE logical change
- [ ] Clear, descriptive commit message
- [ ] All related changes included
- [ ] No unrelated changes included
- [ ] No generated files staged (if literate programming project)
## Your Task
Based on the context above:
1. **Check the branch** - If on main/master, create a descriptive feature branch first. Use the available ask/question tool only if the branch name needs confirmation
2. **Review staged changes** - Determine if they represent one atomic commit or should be split
3. **If changes are atomic:**
- Stage any relevant unstaged files if appropriate
- Create the commit with a proper message following the format above
- Use `git commit -m "$(cat <<'EOF' ... EOF)"` for multi-line messages
4. **If changes should be split:**
- Explain why and what the logical divisions are
- Use the available ask/question tool to ask which part to commit first, or guide through interactive staging
5. **For literate programming projects:**
- Verify no generated .py/.tex files are staged that have corresponding .nw sources
- If found, unstage them with `git reset HEAD <file>`
Execute the branch creation and commit using the available tools in the current environment. Stage and commit in a single response when appropriate.
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.