squash
Squash commits on branch like GitHub PR squash merge
What this skill does
# Squash Commits Squash multiple commits into a single commit with GitHub PR squash merge style message. ## Use Case - Clean up commits before PR merge - Combine multiple WIP commits into one - Maintain clean commit history ## Arguments | Argument | Description | Default | |----------|--------------------------------------|---------| | (none) | All commits from base branch | - | | `<N>` | Squash only last N commits | - | ## Commit Message Format Same format as GitHub PR squash merge: ```text <user-provided title> * <commit1 message> (oldest) * <commit2 message> * <commit3 message> (newest) ``` ## Process 1. **Safety check**: Prevent running on protected branches (main, master, develop) 2. **Detect range**: - No argument: Find merge base with `git merge-base origin/<base> HEAD` - Numeric argument: Use `HEAD~N` 3. **Show commits**: Display commits to squash (chronological order) 4. **Get title**: Ask user for commit title (using AskUserQuestion) 5. **Build message**: Generate title + commit list body 6. **Execute squash**: `git reset --soft <target> && git commit` 7. **Done**: Show push instructions (user pushes manually) ## Execution Steps 1. Get current branch with `git rev-parse --abbrev-ref HEAD` 2. Check if protected branch (main, master, develop) 3. Detect base branch (main or master) 4. Determine squash target: - No argument: `git merge-base origin/<base> HEAD` - Argument N: `HEAD~N` 5. Show commits with `git log --oneline --reverse <target>..HEAD` (chronological) 6. Ask user for commit title (using AskUserQuestion) 7. Build commit message: ```text <title> * <commit1 subject> * <commit2 subject> ... ``` 8. Run `git reset --soft <target>` 9. Run `git commit` with HEREDOC for message 10. Show completion message and push instructions ## Safety Features - **Protected branches**: Never squash on main/master/develop - **No auto-push**: Only squash, user pushes manually ## Examples **Squash all commits:** ```text /stylish-git:squash -> Current branch: feature/add-button -> Base branch: main -> Commits to squash (3): 1. abc1234 feat: add button component 2. def5678 fix: button style 3. ghi9012 refactor: clean up -> Enter commit title: feat: add button component with styling -> Squashing... -> Squashed 3 commits -> Final commit message: +---------------------------------------- | feat: add button component with styling | | * feat: add button component | * fix: button style | * refactor: clean up +---------------------------------------- -> Run 'git push --force-with-lease' to update remote ``` **Squash last N commits:** ```text /stylish-git:squash 2 -> Current branch: feature/add-button -> Squashing last 2 commits -> Commits to squash (2): 1. def5678 fix: button style 2. ghi9012 refactor: clean up -> Enter commit title: fix: improve button styling -> Squashing... -> Squashed 2 commits -> Final commit message: +---------------------------------------- | fix: improve button styling | | * fix: button style | * refactor: clean up +---------------------------------------- -> Run 'git push --force-with-lease' to update remote ``` **Protected branch error:** ```text /stylish-git:squash -> Error: Cannot squash on protected branch 'main' -> Switch to a feature branch first ``` **No commits error:** ```text /stylish-git:squash -> No commits to squash -> Current branch has no commits ahead of main ```
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.