branch-port

branch-port is a skill for Claude Code, Codex from luabagg/agent-skills. It costs 20 tokens per session (1,118 once invoked), scanned A, original, MIT.

A method for moving a feature between Git branches that have changed substantially in different directions. A branch is a separate line of development in Git.

In plain words
What is it for?
Use it to study the source feature, create a porting plan, reimplement it for the target branch, and verify schema, migration, and test changes.
Why use it?
It avoids forcing a merge or rebase when the branches no longer share compatible structure, while preserving useful target-branch changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to study the source feature, create a porting plan, reimplement it for the target branch, and verify schema, migration, and test changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luabagg/agent-skills/branch-port
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add luabagg/agent-skills --skill branch-port
Clone the repo
git clone --depth 1 https://github.com/luabagg/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for branch-port

README.md
[![agentmods](https://agentmods.dev/badge/skills/luabagg/agent-skills/branch-port/github.svg)](https://agentmods.dev/skills/luabagg/agent-skills/branch-port)
Your own site
<a href="https://agentmods.dev/skills/luabagg/agent-skills/branch-port"><img src="https://agentmods.dev/badge/skills/luabagg/agent-skills/branch-port/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for branch-port

Your own site · 80×15
<a href="https://agentmods.dev/skills/luabagg/agent-skills/branch-port"><img src="https://agentmods.dev/badge/skills/luabagg/agent-skills/branch-port.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,118 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.01118
Opus 5 $0.00010 $0.00559
Sonnet 5 $0.00004 $0.00224
Haiku 4.5 $0.00002 $0.00112

Measured 5d ago against content hash ea7bcd7cf03e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

branch-port scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/branch-port/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Branch Port

Port a feature from a source branch to a target branch when rebase or merge will not apply cleanly. Understand the feature first, then re-implement it. Never paste source files over the target.

When NOT to use

  • git cherry-pick <sha> applies cleanly: do that.
  • Rebase has a few conflicts: resolve them. Do not re-architect.
  • The branches share a recent ancestor (hours or days): use a plain merge.
  • The feature is one or two commits: cherry-pick each.

Use this skill for long-lived divergence, major target refactors, or features that mix code the target still needs with code the target has made obsolete.

Rules (read first)

  • Never run git checkout <source-branch> -- <file>. It discards the target's evolution.
  • Never run git diff <source> | git apply across diverged branches.
  • Halt at Phase 4 (Port Plan). Wait for user confirmation before you write code.
  • If a conflict is ambiguous, stop and ask.
  • Verify schema and migration changes against the target's schema state.
  • If Phase 5 discovery invalidates the Port Plan, stop and re-plan. Do not push through a broken plan.
  • Do not mark failing ported tests @skip or xfail to get green. Rewrite them for target conventions or report the failure to the user.
  • Keep the port as one reviewable commit or a small focused series.

Phase 1: Context

git fetch --all --prune
export BASE=$(git merge-base <source> <target>)
git log --oneline "$BASE"..<source>

Ask the user only for missing information (source, target, scope). If the trigger message provided it, skip the question.

Detect overlap. Has any part of the feature already reached the target?

git range-diff "$BASE"..<source> "$BASE"..<target>

Read the output:

  • =: identical patch on target. Skip.
  • !: similar but different patch on target. Inspect manually. It could be a partial backport, a whitespace tweak, or a different implementation. Do not skip it blind.
  • -: only on source. Port.
  • +: only on target. Not relevant to the port.

Read the full file on GitHub · 120 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed · -15 lines ea7bcd7cf03e
  2. 9d ago First seen · 135 lines · 20 tokens per session scan A 7a0a515d335f

Subscribe to this mod's changes

branch-port is a skill published in the GitHub repository luabagg/agent-skills (2 stars, last pushed 3d ago), licensed MIT. It adds 20 tokens to every session and 1,118 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

generator-fix-integrator

Internal Auto-Harness generator skill for worktree-merge fix integration. Use only inside the parallel Generator integrator when it is addressing named defects from QA or retest.

redker56/auto-harness · 40 tokens

finishing-a-development-branch

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work.

obra/superpowers · 27 tokens

open-code-review

Performs AI-powered code review on Git changes using the ocr CLI from alibaba/open-code-review. Use when the user asks to review code, review a pull request, review staged/unstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can automatically apply…

alibaba/open-code-review · 98 tokens

chinese-git-workflow

A reference for configuring Git with Chinese code-hosting services such as Gitee, Coding.net, GitLab China, and CNB, including SSH, HTTPS, credentials, CI, and repository mirroring.

jnMetaCode/superpowers-zh · 69 tokens

comet-github-issue-fix

A workflow for fixing a confirmed Comet-related GitHub issue or review blocker within an isolated scope. It covers matching the work to the relevant workflow, testing the change, checking runtime results, and preparing a careful handoff.

rpamis/comet · 71 tokens

comet-github

A routing guide for Comet-related GitHub work. It directs requests about pull requests, issues, CI failures, ideas, and fixes to the appropriate review or implementation process.

rpamis/comet · 72 tokens