skills/git-workflows/skills/rebase/SKILL.md
Use when rebasing the current branch onto main with guidance through each step.
npx skillsauth add dtsong/my-claude-setup git-rebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
--force-with-lease after rebase.., shell metacharacters, or null bytes.--continue, --abort accepted. Reject arbitrary strings.Rebase your feature branch onto the latest main for a clean, linear history.
/git-rebase # Rebase onto main
/git-rebase develop # Rebase onto develop
/git-rebase --continue # Continue after resolving conflicts
/git-rebase --abort # Abort rebase in progress
CURRENT=$(git branch --show-current)
# Cannot rebase main
if [ "$CURRENT" = "main" ] || [ "$CURRENT" = "master" ]; then
echo "Cannot rebase main onto itself."
exit 1
fi
# Check for uncommitted changes
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "You have uncommitted changes."
echo "Stash or commit them first:"
echo " /git-stash"
echo " /commit"
exit 1
fi
# Fetch latest main
git fetch origin main
# Show what will happen
COMMITS=$(git log --oneline origin/main..HEAD | wc -l)
echo "Will rebase $COMMITS commits onto origin/main"
# Files that might conflict
echo "Files modified in both branches:"
git diff --name-only origin/main...HEAD
# Standard rebase onto main
git rebase origin/main
On success or conflict, provide appropriate guidance.
Rebasing feat/dark-mode onto main...
Rebased 3 commits:
abc1234 Add theme toggle component
def5678 Wire up theme context
ghi9012 Add dark mode styles
New base: origin/main (xyz7890)
Your branch now has a clean, linear history!
Note: You'll need to force push to update remote:
git push --force-with-lease
Or use: /git-push --force-with-lease
Branch feat/dark-mode is already based on latest main.
No rebase needed.
Conflict during rebase!
Currently rebasing commit: abc1234 Add theme toggle
Conflicting files:
- src/components/Theme.tsx
To resolve:
1. Edit the conflicting files
2. git add <resolved-files>
3. git rebase --continue
Or abort entirely:
/git-abort
(or: git rebase --abort)
Tip: Use /git-conflicts for guided resolution
To continue the rebase after resolving conflicts:
git add <resolved-files>
git rebase --continue
Remaining commits to rebase: 2
Current status:
[x] abc1234 Add theme toggle (resolved)
[ ] def5678 Wire up theme context
[ ] ghi9012 Add dark mode styles
Since rebase rewrites history, you need to force push:
# Safe force push (fails if remote changed)
git push --force-with-lease
# Regular force push (use carefully)
git push --force
Warning: Only force push if:
Before (merge):
main: A---B---C---F---G
\ /
feature: D---E
After merge, feature has merge commit.
Before (rebase):
main: A---B---C
\
feature: D---E
After rebase:
main: A---B---C
\
feature: D'--E'
Rebase creates linear history (D and E rebased as D' and E').
--force/git-merge-main instead for shared branches/git-conflicts for conflict resolution help/git-abort to cancel a problematic rebase/git-push --force-with-lease after successful rebasedevelopment
Use when the council needs to surface organizational knowledge buried across multiple internal sources (wikis, design docs, ADRs, past tickets, postmortems, chat archives, code repos). Plans where to look, what to cross-reference, and how to synthesize findings into evidence the council can act on. Do not use for external market research (use competitive-analysis), library evaluation (use library-evaluation), or technology trend assessment (use technology-radar).
testing
Use to convert a Word .docx file to PDF and/or verify its page count. Triggers on: converting docx to pdf, rendering a document, checking how many pages a docx produces, or asserting a page-count constraint (e.g. a resume must stay 2 pages). Wraps LibreOffice headless conversion.
development
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
development
Interactive wizard to craft effective prompts using Claude Code best practices