squash

Squash-merges a feature branch into one conventional commit on the local trunk.

Updated May 9, 2026
One-click install
npx skills add https://github.com/natelandau/cc-plugin --skill squash-natelandau
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squash
Source: https://github.com/natelandau/cc-plugin/tree/main/plugins/natelandau-toolkit/skills/squash
Command: npx skills add https://github.com/natelandau/cc-plugin --skill squash-natelandau

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Landing a finished feature branch as a single clean commit on main or master involves many error-prone git steps: syncing the trunk, rebasing, squash-merging, writing a proper commit message, and cleaning up branches and worktrees. This Skill automates that entire destructive workflow safely, with guardrails that prevent pushing, force-deletion mistakes, and invalid commit messages. ## Core Features & Use Cases - End-to-end squash workflow: Detects the branch, trunk name, and worktree layout, syncs the local trunk, squash-merges, commits, and deletes the branch and worktree. - Conventional commit enforcement: Writes one user-facing conventional commit message describing the branch as a single shipped feature, compatible with commit-message hooks. - Branch-protection integration: Works with PreToolUse hooks that block trunk commits except during an in-progress squash merge. - Use Case: After finishing work on a feature branch in a git worktree, ask to squash it into main; the Skill rebases, merges, commits once, removes the worktree, and leaves the result local for you to push. ## Quick Start Ask the assistant to squash the current feature branch into main as a single commit and clean up the branch and worktree.

Frequently Asked Questions about squash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I squash a feature branch into main as one commit?

Run git merge --squash from the trunk checkout, then git commit with a single conventional commit message. This Skill automates the full sequence: syncing the trunk, rebasing the branch, committing, and deleting the branch afterward.

How to squash-merge a branch that lives in a git worktree?

Find the trunk checkout with git worktree list, run the squash merge there, then remove the worktree with git worktree remove before deleting the branch. A branch checked out in a worktree cannot be deleted until the worktree is removed.

Why does git branch -d fail after a squash merge?

A squash merge records no merge ancestry, so git reports the branch as not fully merged. Use git branch -D to force-delete it, but only after confirming the squash commit exists and contains the work.

Does this squash workflow push to the remote?

No, the squash lands only on the local main or master branch and the workflow explicitly never pushes. After cleanup, you review the result and push the trunk yourself.

What happens if the squash merge has conflicts?

The workflow stops and reports which files conflict, leaving resolution to the user. It does not guess at resolutions, and you resume at the commit step after resolving.