recommit

Rewrites unmerged branch commits into a clean logical sequence while preserving the final tree.

Updated Aug 6, 2026
One-click install
npx skills add https://github.com/wkentaro/skills --skill recommit-wkentaro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: recommit
Source: https://github.com/wkentaro/skills/tree/main/skills/engineering/recommit
Command: npx skills add https://github.com/wkentaro/skills --skill recommit-wkentaro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Iterative development leaves branches full of fixup commits, WIP snapshots, and interleaved refactors that are painful to review. This Skill reshapes the commits a branch carries on top of its target branch into a clean, logical sequence where each commit tells one story, without changing the final committed tree. ## Core Features & Use Cases - Commit sequence planning: Reads the full diff from the merge base and designs an ordered sequence where each commit is independently buildable and testable. - Safe history rebuild: Folds existing fixup commits with autosquash or performs a full rebuild with hunk-level staging via git-hunk or patch-based fallback, always keeping a recorded recovery point. - Per-commit verification: Runs planned checks on every commit in an isolated temporary worktree and validates that the final tree matches the original branch tip exactly. - Use Case: Before opening a PR, a developer with a dozen messy commits uses this Skill to reorganize them into three reviewable commits (a refactor, a standalone fix, and the feature), each passing lint and type checks on its own. ## Quick Start Use the recommit skill to tidy this branch's unmerged commits into a clean logical sequence before I open the pull request.

Frequently Asked Questions about recommit

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

FAQPage Schema
How do I clean up messy git commits before a pull request?▼

Use this Skill to rewrite the commits after your branch's merge base into a logical sequence where each commit tells one story. It plans the sequence from the full diff, rebuilds the history, and verifies the final tree matches the original branch tip exactly.

How to fold fixup commits into a branch history?▼

When the planned sequence only folds existing fixup! or squash! commits into their named ancestors, the Skill runs git rebase -i --autosquash from the merge base. For reordering, rewording, dropping, or splitting commits, it performs a full rebuild instead.

Can I split one commit into multiple commits without git-hunk?▼

Yes, but only at whole-hunk boundaries using a patch-based fallback with git diff and git apply --cached. Splitting inside a single hunk requires git-hunk stage with line selection, so without it the plan must be revised to split at complete hunks.

Is it safe to rewrite branch history with this Skill?▼

The Skill records the original branch tip before rewriting and shows the recovery command git reset --hard ORIG before making changes. If any invariant or per-commit check fails, it restores the recorded starting point automatically.

When should I not rewrite my branch commits?▼

Do not use this Skill to change code behavior, rewrite commits the target branch already contains, or work on a branch that other people build on without coordination. It reshapes history only and preserves the exact final committed tree.