What problem does it solve? Rewriting Git history by squashing commits is risky: a wrong range, a dirty worktree, or a drifting remote tip can destroy work with no way back. This Skill performs controlled history squashing of a branch tip's first-parent commit range using dry-run planning, explicit user confirmation gates, atomic ref transactions with backup refs, and precise --force-with-lease remote publishing, so every step is verifiable and recoverable. ## Core Features & Use Cases - Dry-run planning with frozen manifest: The plan command freezes full SHAs, range counts, merge counts, worktree/dirty state, affected refs, submodule graph, and remote protection policy without creating any Git object or moving any ref. - Confirmed local transaction: The apply command creates a single new commit from the end tree with one baseline parent, then uses a compare-and-swap update-ref transaction to create a backup ref and move the target branch atomically. - Exact remote lease publishing: The publish command pushes only with --force-with-lease=<ref>:<old-sha> after re-reading the remote tip, and blocks on GitHub protection rules that disallow non-fast-forward updates. - Submodule-aware layering: Child repositories must publish before parent gitlinks advance, with planned parent trees built via a temporary index. - Use Case: Before merging a long feature branch, squash its 30 first-parent commits into one commit, keep a backup ref for recovery, and publish to GitHub only after verifying branch protection allows the force push. ## Quick Start Ask the agent to run the git-history-squash skill to squash the first-parent commits of your current feature branch into a single commit with a dry-run plan first.