reimplement-branch
Original:🇺🇸 English
Translated
Reimplement the current branch on a new branch with a clean, narrative-quality git commit history. Use when the user wants to clean up messy commits, create a tutorial-style commit history, or prepare a branch for review with logical, self-contained commits. Triggers on requests like "clean up my commits", "reimplement this branch", "create a clean history", or "make my commits reviewable".
1installs
Sourceilamanov/skills
Added on
NPX Install
npx skill4agent add ilamanov/skills reimplement-branchTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Reimplement Branch
Create a new branch with a clean, narrative-quality commit history from an existing branch's changes.
Context
- Source branch: !
git branch --show-current - Git status: !
git status --short - Commits since main: !
git log main..HEAD --oneline - Full diff against main: !
git diff main...HEAD --stat
Workflow
1. Validate source branch
- Ensure no uncommitted changes or merge conflicts
- Confirm branch is up to date with
main
2. Analyze the diff
Study all changes between source branch and . Form a clear understanding of the final intended state.
main3. Create clean branch
bash
git checkout main
git checkout -b <new-branch-name>Use the user-provided branch name, or if none provided.
{source-branch}-clean4. Plan commit storyline
Break the implementation into self-contained logical steps. Each step should reflect a stage of development—as if writing a tutorial.
5. Reimplement the work
Recreate changes in the clean branch, committing step by step. Each commit must:
- Introduce a single coherent idea
- Include a clear commit message and description
Use for intermediate commits. Pre-commit hooks check tests, types, and imports that may not pass until full implementation is complete.
git commit --no-verify6. Verify correctness
- Confirm final state exactly matches source branch:
git diff <source-branch> - Run final commit without to ensure all checks pass
--no-verify
7. Open PR
Use the skill to create a pull request. Include a link to the original branch in the PR description.
/prRules
- Never add yourself as author or contributor
- Never include "Generated with Claude Code" or "Co-Authored-By" lines
- End state of clean branch must be identical to source branch