Agent skill

Rebase Main

by hyodotdev in hyodotdev/openiap

Safely update the local main branch with a fast-forward-only pull, rebase the current work branch onto it, resolve conflicts without losing local work, and restore staged, unstaged, and untracked…

MITAuto-check: notesDevelopment

Install Rebase Main

skills CLI
$ npx skills add hyodotdev/openiap --skill rebase-main -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hyodotdev/openiap rebase-main --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hyodotdev/openiap.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/rebase-main .claude/skills/rebase-main && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rebase-main
GitHub stars
154
Token cost
~1.3k tokens
SKILL.md length
687 words
Files
2
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Safely update the local main branch with a fast-forward-only pull, rebase the current work branch onto it, resolve conflicts without losing local work, and restore staged, unstaged, and untracked…

  • Works in 4 steps: Read the repository Git instructions. → Record the current branch, HEAD,… → Stop if the checkout is detached, the… → …
  • The user asks to pull main and rebase the current branch
  • SKILL.md covers Establish The Target, Safeguard Local Work, Update Main And Rebase and Restore And Verify
  • Calls git

What it does

Rebase Main is an agent skill from hyodotdev/openiap. Safely update the local main branch with a fast-forward-only pull, rebase the current work branch onto it, resolve conflicts without losing local work, and restore staged, unstaged, and untracked changes. Use when the user asks to pull main and rebase the current branch, update a branch from main, remove rebase conflicts, or says "rebase-main".

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Development, covering Git workflow. It works with Git. The repository describes itself as: Standardized protocol for in-app purchases across all platforms — backed by Meta & Amazon. The licence is MIT.

When your agent uses it

  • The user asks to pull main and rebase the current branch
  • Update a branch from main
  • Remove rebase conflicts
  • Says rebase-main

Example prompts

  • “rebase-main”
  • “/rebase-main”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Read the repository Git instructions.
  2. Record the current branch, HEAD, upstream, worktrees, staged changes,
  3. Stop if the checkout is detached, the current branch is main, another
  4. Use origin and main by default. If either is absent or the repository uses

What it can do on your machine

Read from SKILL.md and the folder at commit 75aa01c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rebase Main loads about 1.3k tokens when it runs. Until then it costs about 90 tokens; SKILL.md has 687 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:30
    `--all`: ignored `.env`, credentials, build caches, and other ignored local

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hyodotdev/openiap at commit 75aa01c, republished under its MIT licence (© hyodotdev). 687 words, ~1,274 tokens.

Download SKILL.mdSave it as .claude/skills/rebase-main/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
rebase-main
description
Safely update the local main branch with a fast-forward-only pull, rebase the current work branch onto it, resolve conflicts without losing local work, and restore staged, unstaged, and untracked changes. Use when the user asks to pull main and rebase the current branch, update a branch from main, remove rebase conflicts, or says "rebase-main".

Rebase Main

Update main, rebase the current work branch, and preserve every pre-existing working-tree change. Do not commit or push unless the user separately authorizes it.

Establish The Target

  1. Read the repository Git instructions.
  2. Record the current branch, HEAD, upstream, worktrees, staged changes, unstaged changes, untracked files, and relevant ignored environment files with content fingerprints.
  3. Stop if the checkout is detached, the current branch is main, another merge/rebase/cherry-pick is active, or main is checked out in another worktree that cannot safely be updated.
  4. Use origin and main by default. If either is absent or the repository uses another base, derive the target from repository configuration or ask.

Safeguard Local Work

If the worktree is dirty:

  1. Capture status and content fingerprints so restoration can be checked.
  2. Create one clearly named stash with --include-untracked. Never use --all: ignored .env, credentials, build caches, and other ignored local state must remain in place.
  3. Record the stash object and confirm the tracked/untracked worktree is clean.
  4. If stashing a modified ignore rule makes a previously ignored local file appear untracked, do not stash, move, or delete that file. Add only its exact path to .git/info/exclude as a recorded temporary safeguard, but only after confirming that neither main nor the work branch tracks that exact path. If either target tree contains it, stop without switching branches.
  5. If stashing fails or other changes remain unexplained, stop before switching branches.

Treat the stash as a recovery point. Do not drop it until restoration is complete and verified.

Update Main And Rebase

Before every branch switch, compare each recorded ignored/local path with the destination tree and stop on any tracked-path collision. Git normally permits a checkout to overwrite ignored files, so use git checkout --no-overwrite-ignore <branch> for these guarded transitions rather than a plain switch.

  1. Run git fetch origin main, then check every recorded ignored/local path against both the current main tree and the freshly fetched origin/main. Stop on any collision.
  2. Check out main with --no-overwrite-ignore.
  3. Run git merge --ff-only origin/main. This explicit fetch-plus-fast-forward is the guarded equivalent of git pull --ff-only origin main: it updates only to the exact remote commit whose paths were checked. Never reset, force-update, or create a merge commit for a divergent local main.
  4. Confirm that main and origin/main resolve to the exact same commit after the fast-forward. A local main that is ahead-only makes a fast-forward update report no incoming work without publishing or removing its unique commits; stop and report that divergence instead of rebasing the work branch onto unpublished work.
  5. Check out the recorded work branch with --no-overwrite-ignore after repeating the ignored-path collision check against that branch.
  6. Run git rebase origin/main, using the exact remote-tracking commit just verified against local main.
  7. For each conflict, inspect the base, new-main side, and work-branch side. Preserve both compatible intents; do not apply blanket ours/theirs resolution. Regenerate generated files through their documented generator.
  8. Run git rebase --continue only after the resolved files and staged diff have been reviewed. If intent is ambiguous, stop with the exact conflict list and keep the rebase recoverable.
Show full SKILL.md (163 more words)Show less

Never use git reset --hard, git checkout --, git clean, or destructive recovery shortcuts.

Restore And Verify

  1. Apply the recorded stash with its index so staged state is restored.
  2. Resolve restoration conflicts with the same three-way care. Do not drop the stash while any restoration conflict or mismatch remains.
  3. Remove any temporary .git/info/exclude entries only after the restored worktree ignore rules cover those paths again.
  4. Compare the restored staged, unstaged, and untracked state with the initial snapshot. Confirm ignored environment files still exist and were not added to Git.
  5. Once restoration is exact, drop only the named safeguard stash.
  6. Run git status, git diff --check, and the repository's affected lightweight audits or tests. Confirm the branch is based on the updated main and report the old/new main and branch heads.

If the work branch was already published, explain that the rewritten history will require a later git push --force-with-lease. Never perform that push unless the user authorized it.

© hyodotdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .codex/skills/rebase-main of hyodotdev/openiap.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 75aa01c

Compare with similar skills

Rebase Main next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rebase Main compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rebase Main this skillhyodotdev/openiap154—~1.3kAutomated safety check: NotesMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Migrate Internal Package into GhostTryGhost/Ghost55k—~3.8kAutomated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Git Merge Conflict Resolver

    tailcallhq/forgecode

    Resolves Git merge conflicts with a plan-first workflow that keeps both sides' intent, regenerates lock files and backs up deleted-but-modified files.

    7.6k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed

More from hyodotdev/openiap

All 19 skills in this repo
  • E2E Matrix Runner

    hyodotdev/openiap

    Run the full OpenIAP device matrix — six frameworks across iOS, Google Play, Amazon Appstore, Meta Horizon, and VegaOS — driving real hardware over adb and xcrun, and report one row per cell with…

    154 GitHub stars~3.4k tokensUpdated today
    Auto-check: notes
  • Generate Doc

    hyodotdev/openiap

    A skill your agent uses for OpenIAP documentation generation work, especially the release-note card each PR carries in packages/docs/src/pages/docs/updates/releases.tsx, written as already published…

    154 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Opencollective Steward

    hyodotdev/openiap

    Manage OpenIAP's OpenCollective presence, including profile copy, slug/link migrations, sponsor/backer recognition, update posts, and README/docs sponsor assets.

    154 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Iapkit E2E Martie

    hyodotdev/openiap

    Run IAPKit local receipt-validation E2E with the dev.hyo.martie React Native or Expo examples, the compiled packages/kit server, real Convex, and Apple or Google sandbox purchases.

    154 GitHub stars~5.4k tokensUpdated today
    Auto-check: notes
  • E2E Matrix Runner Apple

    hyodotdev/openiap

    Run the Apple half of the OpenIAP device matrix — six frameworks plus the native package on iOS — on a physical iPhone and report one row per cell with evidence.

    154 GitHub stars~501 tokensUpdated today
    Auto-check passed
  • E2E Matrix Runner Google

    hyodotdev/openiap

    Run the Android half of the OpenIAP device matrix — six frameworks across Google Play, Amazon Appstore, and Meta Horizon, plus VegaOS — on real hardware and report one row per cell with evidence.

    154 GitHub stars~574 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Rebase Main

What does Rebase Main do?

Safely update the local main branch with a fast-forward-only pull, rebase the current work branch onto it, resolve conflicts without losing local work, and restore staged, unstaged, and untracked…. Rebase Main is an agent skill from hyodotdev/openiap. Safely update the local main branch with a fast-forward-only pull, rebase the current work branch onto it, resolve conflicts without losing local work, and restore staged, unstaged, and untracked changes.

When should I use Rebase Main?

Rebase Main fits situations like: the user asks to pull main and rebase the current branch; update a branch from main; remove rebase conflicts; says rebase-main.

How do I install Rebase Main in Claude Code?

Run `npx skills add hyodotdev/openiap --skill rebase-main -a claude-code`. Or copy the skill folder (.codex/skills/rebase-main in hyodotdev/openiap) into .claude/skills/rebase-main in your project. Claude Code loads it when a task matches its description.

How do I install Rebase Main in Codex?

Run `npx skills add hyodotdev/openiap --skill rebase-main -a codex`. Or copy the skill folder (.codex/skills/rebase-main in hyodotdev/openiap) into .agents/skills/rebase-main in your project. Codex loads it when a task matches its description.

Can I use Rebase Main in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hyodotdev/openiap --skill rebase-main -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rebase-main, .gemini/skills/rebase-main, .github/skills/rebase-main and .opencode/skills/rebase-main in your project.

What does Rebase Main need to run?

Going by SKILL.md and its folder, Rebase Main needs the command-line tools its instructions call (git).

Does Rebase Main access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Rebase Main safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Rebase Main use?

Rebase Main is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rebase Main use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Rebase Main?

Skills that share tags, products or a category with Rebase Main: Finishing a Development Branch (obra/superpowers, 296k stars), Code Design Rationale Investigator (cursor/plugins, 10k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars) and Migrate Internal Package into Ghost (TryGhost/Ghost, 55k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rebase Main?

hyodotdev (a GitHub organization) maintains it in hyodotdev/openiap, which has 154 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 7, 2026.

Source: hyodotdev/openiap on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.