clean-copy

Recreate the current branch with clean, narrative commit history.

59|5|Updated Jun 21, 2025
One-click install
npx skills add https://github.com/bdsqqq/dots --skill clean-copy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-copy
Source: https://github.com/bdsqqq/dots/tree/main/user/amp/skills/clean-copy
Command: npx skills add https://github.com/bdsqqq/dots --skill clean-copy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill replays the current branch onto a new branch with a clean, narrative commit history that is easy to review and merge.

Core Features & Use Cases

  • Branch isolation: Create a dedicated branch to rework commits, without touching the original history.
  • Narrative commits: Break changes into logical, well-described commits.
  • PR-ready: Produce a clean history suitable for a PR against main.

Quick Start

  • Determine the target new branch name (default: <source>-clean).
  • Validate working tree is clean and up-to-date with main.
  • Create branch: git checkout -b <new-branch> main
  • Replay changes as logical commits
  • Push and open PR against main

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 my git commit history before opening a pull request?

Clean up commit history by recreating your branch on a new branch with logical, narrative commits. Validate your working tree is clean, create a new branch from main, replay your changes as well-described commits using conventional messages, then push and open your PR. This produces a readable, step-by-step history that's easy to review and merge.

What's the best way to rewrite git commits into a cleaner history?

Rewrite commits by replaying your branch onto a fresh branch created from main, organizing changes into one coherent idea per commit with conventional commit messages. This preserves your original branch while producing a separate, clean history suitable for PR review without touching the source branch's history.

Can I reorganize my commits without losing work or modifying the original branch?

Yes. Create a dedicated new branch from main and incrementally re-implement your changes as logical commits, keeping your original branch untouched. This branch-isolation approach lets you rework your commit narrative safely before pushing and opening a pull request against main.

How do I structure commits for better code review in a pull request?

Structure commits by breaking changes into logical units, each addressing one coherent idea with a conventional commit message. Replay these organized commits onto a clean branch from main, ensuring each commit is independently understandable and reviewable, making validation and merge decisions straightforward.

What should I do before rewriting my git history for a pull request?

Before rewriting, ensure your working tree has no uncommitted changes, your main branch is up-to-date, and you have no merge conflicts. Validate these prerequisites so you can safely create a new branch from main and replay your changes with a clean commit history.