reimplement-branch

📁 ilamanov/skills 📅 7 days ago
4
总安装量
2
周安装量
#49862
全站排名
安装命令
npx skills add https://github.com/ilamanov/skills --skill reimplement-branch

Agent 安装分布

amp 2
opencode 2
kimi-cli 2
codex 2
claude-code 2

Skill 文档

Reimplement Branch

Create a new branch with a clean, narrative-quality commit history from an existing branch’s changes.

Gather Context

Run these commands to understand the current state:

git branch --show-current          # Source branch
git status --short                 # Uncommitted changes
git log main..HEAD --oneline       # Commits since main
git diff main...HEAD --stat        # Full diff summary

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 main. Form a clear understanding of the final intended state.

3. Create clean branch

git checkout main
git checkout -b <new-branch-name>

Use the user-provided branch name, or {source-branch}-clean if none provided.

4. 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 git commit --no-verify for intermediate commits. Pre-commit hooks check tests, types, and imports that may not pass until full implementation is complete.

6. Verify correctness

  • Confirm final state exactly matches source branch: git diff <source-branch>
  • Run final commit without --no-verify to ensure all checks pass

7. Open PR

Use the /pr skill to create a pull request. Include a link to the original branch in the PR description.

Rules

  • 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