git-history-surgery
Installation
SKILL.md
Git History Surgery
When to invoke
Trigger on any of:
- "split this commit into smaller ones" (after a push)
- "rebase this into atomic commits"
- User points out a bulk commit and asks to fix history
- You bulked a multi-concern change into one commit and caught it before/after pushing
Why a throwaway worktree
Doing git reset --soft HEAD~1 in an existing worktree is risky:
- Another session might be on the same repo in a different worktree/branch. Your reset doesn't affect them, but switching branches there will.
- If the worktree you're in isn't on the branch you think (e.g. ops/main worktree was on
fix/usage-async-loadin a past session), a reset rewrites the wrong branch. - Existing worktrees may carry uncommitted state you'd lose.
The safe pattern: fresh detached worktree at origin/, do surgery, push, discard.
Related skills
More from stevengonsalvez/agents-in-a-box
frontend-design
Frontend design skill for UI/UX implementation - generates distinctive, production-grade interfaces
31commit
Create well-formatted git commits for changes made during the session
14reflect
|
2plan-tdd
Create a test-driven development plan for the project
1oracle
Best practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
1gh-issue
Analyze and fix the specified GitHub issue
1