Agent skill
rebase-on-main
Update main/master from origin, rebase current branch on it, resolve conflicts, and push.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/rebase-on-main
SKILL.md
Perform a rebase workflow for the current branch:
Steps
- Identify the main branch: Check if
mainormasterexists as the default branch - Save current branch name: Store the current branch name for later
- Fetch latest from origin: Run
git fetch origin - Update main/master locally: Checkout main/master and pull latest changes
- Return to feature branch: Checkout the original branch
- Rebase on main/master: Run
git rebase main(or master) - Handle conflicts if any:
- If conflicts occur, analyze each conflicting file
- Read the conflicting files to understand the context
- Resolve conflicts intelligently by understanding both changes
- Use
git addto mark resolved files - Continue rebase with
git rebase --continue - Repeat until all conflicts are resolved
- Push changes: Force push with lease using
git push --force-with-lease
Important Guidelines
- Always use
--force-with-leaseinstead of--forcefor safety - When resolving conflicts, prefer keeping functionality from both sides when possible
- If a conflict resolution is ambiguous, explain the choice made
- Report a summary of what was done at the end (commits rebased, conflicts resolved, etc.)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?