rebase-latest-main
Fetch latest origin/main and rebase it onto the current branch, resolving conflicts if necessary. Use when the user wants to rebase on main, update their branch with latest main, or sync with upstream.
Best use case
rebase-latest-main is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Fetch latest origin/main and rebase it onto the current branch, resolving conflicts if necessary. Use when the user wants to rebase on main, update their branch with latest main, or sync with upstream.
Teams using rebase-latest-main should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/rebase-latest-main/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How rebase-latest-main Compares
| Feature / Agent | rebase-latest-main | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Fetch latest origin/main and rebase it onto the current branch, resolving conflicts if necessary. Use when the user wants to rebase on main, update their branch with latest main, or sync with upstream.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Rebase Latest Main
Fetch the latest `origin/main` and rebase it onto the current working branch.
## Step 1: Verify Current State
1. Check the current branch:
```bash
git branch --show-current
```
2. Ensure there are no uncommitted changes:
```bash
git status --porcelain
```
If there are uncommitted changes, either:
- Commit them first, or
- Ask the user how to proceed (commit, stash, or abort)
## Step 2: Fetch Latest Changes
Fetch the latest changes from the remote:
```bash
git fetch origin main
```
## Step 3: Rebase onto origin/main
Start the rebase:
```bash
git rebase origin/main
```
### If rebase succeeds without conflicts:
Proceed to Step 5.
### If conflicts occur:
1. Identify conflicting files:
```bash
git diff --name-only --diff-filter=U
```
2. For each conflicting file:
- Read the file content to understand the conflict
- Analyze both versions (HEAD and origin/main)
- Resolve the conflict by choosing the appropriate changes or merging them
- Stage the resolved file:
```bash
git add <resolved-file>
```
3. Continue the rebase:
```bash
git rebase --continue
```
4. Repeat until all conflicts are resolved and rebase is complete.
## Step 4: Handle Rebase Failure
If unable to resolve conflicts automatically:
- Show the conflicting files and conflict markers to the user
- Ask for guidance on how to resolve
- If the user wants to abort:
```bash
git rebase --abort
```
## Step 5: Push Changes
After successful rebase, force push to update the remote branch:
```bash
git push --force-with-lease
```
Note: `--force-with-lease` is safer than `--force` as it prevents overwriting others' work.
## Step 6: Report Result
Summarize the operation:
1. Number of commits rebased
2. Any conflicts that were resolved
3. Confirmation that the branch is now up-to-date with origin/mainRelated Skills
rulesync
Generates and syncs AI rule configuration files (.cursorrules, CLAUDE.md, copilot-instructions.md) across 20+ coding tools from a single source. Use when syncing AI rules, running rulesync commands, importing or generating rule files, or managing shared AI coding configurations.
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
security-scan-diff
Scan for malicious code in git diff between a tag/commit and HEAD
release-dry-run
Dry run for release: summarize changes since last release and suggest version bump.
playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
git-worktree-runner
Manages git worktrees using git-worktree-runner (gtr). Use when the user needs to create, list, remove, or navigate worktrees with `git gtr` commands, open editors or AI tools in worktrees, manage parallel development branches, or check out GitHub PRs (including from forks) into worktrees.
draft-release
Draft a new release of the project.
create-scrap-issue
Create a GitHub issue that consolidates passed content into a single scrap issue with background context and solution details, labeled as maintainer-scrap. Use when the user wants to create a scrap issue, jot down notes as a GitHub issue, or save findings for later.
create-issue
Create a GitHub issue with detailed description, purpose, and appropriate labels
review-pr
Review a pull request for code quality and security issues. Use when the user wants to review a PR, check PR code changes, or audit a pull request. Triggers on: "review PR", "review pull request", "check this PR", "/review-pr".
review-and-comments
Review a PR for code quality and security issues, then post review comments on it. Runs review-pr followed by post-review-comments sequentially.
post-review-comments
Post line-level review comments and an overall review comment on a PR in English with a natural, concise writing style