auto-squashlisted
Install: claude install-skill gsong/claude-marketplace
# Smart fixup and auto-squash
Distribute uncommitted changes across the current branch's commits via fixup, creating new commits for anything that doesn't match. Accepts an optional base branch argument: `$ARGUMENTS`
## 1. Pre-flight checks
1. Run `git status --porcelain` — if there are no uncommitted changes (modified, untracked, or deleted files), stop and inform the user
2. Run `git diff --cached --quiet` — if there are already-staged changes, stop the skill and tell the user to stash or commit them first. This skill takes exclusive control of the index to safely verify each fixup's contents; a pre-existing staged layout (e.g., partial hunks from `git add -p`) cannot survive the per-group staging and recovery cycle.
## 2. Determine branch scope
1. **Base branch**: If an argument was provided, use it as the base branch. Otherwise, infer:
- For each local branch (excluding the current one), compute `git merge-base <branch> HEAD` then `git rev-list --count <merge-base>..HEAD`
- The branch with the fewest commits ahead of the merge-base is the likely parent
- On ties, consult `git reflog show HEAD` for a `checkout: moving from <parent> to <current>` entry to disambiguate
- Fall back to `main` if inference is ambiguous or fails
- **Always confirm**: Show the inferred base branch to the user and ask for confirmation before proceeding — getting this wrong means fixup commits target the wrong history
2. **Fork point**: `git merge-base HEAD <base-branch>` — if t