clean-copy

Reimplements a branch on a new branch with a clean, narrative-quality git commit history.

2|Updated Sep 14, 2026
One-click install
npx skills add https://github.com/kwanpham2195/agent-stuff --skill clean-copy-kwanpham2195
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-copy
Source: https://github.com/kwanpham2195/agent-stuff/tree/main/skills/clean-copy
Command: npx skills add https://github.com/kwanpham2195/agent-stuff --skill clean-copy-kwanpham2195

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Messy, incremental commit histories make branches hard to review. This Skill rebuilds the work of the current branch on a fresh branch as a sequence of coherent, reviewable commits without changing the final code. ## Core Features & Use Cases - History Rebuild: Replays the full diff between the source branch and the configured base branch as logical, self-contained commits. - Safety Validation: Checks for uncommitted changes, merge conflicts, and divergence from the base branch before starting, and never pulls, rebases, or force-pushes implicitly. - Exactness Verification: Confirms the final tracked tree of the clean branch exactly matches the original source branch and runs the repository's normal checks with hooks enabled. - Use Case: You finished a feature across a dozen 'wip' and 'fix' commits. Ask for a clean copy branch, and the work is recreated as a tutorial-like commit storyline ready for reviewers, optionally followed by a pull request via the pr skill. ## Quick Start Create a clean copy of my current branch with a reviewable commit history and verify it matches the original.

Frequently Asked Questions about clean-copy

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

FAQPage Schema
How do I clean up a messy git commit history before review?▼

Rebuild the branch by replaying its changes as logical, self-contained commits on a fresh branch created from the base branch. The clean-copy workflow analyzes the full diff, plans a commit storyline, and verifies the final tree matches the original branch exactly.

How to rewrite a branch as reviewable commits without changing the code?▼

Recreate the final changes step by step on a new branch, committing after each coherent idea, then confirm the tracked tree is identical to the source branch. Only the commit history differs; the code content stays the same.

Does cleaning up commit history require force pushing?▼

No. The clean branch is created under a new name (defaulting to '<source-branch>-clean'), so the original branch is untouched. Force pushing only happens if the user explicitly asks for it.

What happens if intermediate commits fail repository hooks?▼

Hooks are never bypassed during the rebuild. If a commit slice cannot pass the repository's normal hooks, the step is split or revised until each intermediate commit is coherent enough to pass.

When should I not rebuild a branch's commit history?▼

Avoid it when the branch has uncommitted changes, unresolved merge conflicts, or unexplained divergence from the base branch. These conditions are validated up front and must be resolved before the rebuild proceeds.