# Squash Commits

Reorganize messy branch commits into a small set of logical, meaningful commits without...

- Repository: https://github.com/pipecat-ai/pipecat (16982 stars)
- Category: Engineering
- License: BSD-2-Clause
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add pipecat-ai/pipecat --skill squash-commits -g -a claude-code -y`
Codex: `npx skills add pipecat-ai/pipecat --skill squash-commits -g -a codex -y`
Cursor: `npx skills add pipecat-ai/pipecat --skill squash-commits -g -a cursor -y`
Gemini CLI: `npx skills add pipecat-ai/pipecat --skill squash-commits -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add pipecat-ai/pipecat`

## Description

Reorganize messy branch commits into a small set of logical, meaningful commits without changing any content. Drops merge-from-main commits. Safe: creates a backup branch first.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

Reorganize the commits on the current branch into a small number of logical commits. Do NOT change any file content, only the commit structure changes.

## Instructions

### 1. Safety check

```bash
git status --short
```

If there are uncommitted changes, stop and tell the user to commit or stash them first.

### 2. Inspect the branch

```bash
git log main..HEAD --oneline
git diff main..HEAD --name-only
```

List every file changed vs `main` and every commit on the branch (excluding merge commits from main).

### 3. Create a backup branch

```bash
git branch backup/<current-branch-name>
```

Tell the user the backup exists so they can recover if needed.

### 4. Soft-reset to main and unstage everything

```bash
git reset --soft main
git restore --staged .
```

All branch changes are now in the working tree, unstaged. No content has changed.

### 5. Plan the logical groups

Read the changed files and the original commit messages to understand what the work covers. Group related files into logical commits. Typical groups:

- Core feature or fix (new source files + modified core files)
- Secondary features or fixes (each as its own commit if distinct)
- Refactoring or renames
- Tests
- Changelogs / docs

Use the changelog files (if any) as a strong hint, each changelog entry often maps to one commit.

Present the proposed grouping to the user and ask for confirmation before committing.

### 6. Commit in logical groups

For each group, stage only the relevant files and commit with a clear message following the project's conventions:

```bash
git add <file1> <file2> ...
git commit -m "..."
```

Use conventional commit prefixes if the project uses them (`feat:`, `fix:`, `refactor:`, `test:`, `chore:`).

### 7. Verify

```bash
git log main..HEAD --oneline
git diff main..HEAD --name-only
git status --short
```

Confirm:
- Commit count is small and each message is meaningful
- The set of changed files vs `main` is identical to before
- Working tree is clean

The rest: https://github.com/pipecat-ai/pipecat/blob/HEAD/.claude/skills/squash-commits/SKILL.md
