branch-surgery-pr-split

branch-surgery-pr-split is a skill for Codex from liatrio-labs/ai-prompts. It costs 68 tokens per session (825 once invoked), scanned A, original, Apache-2.0.

A workflow for splitting an oversized or mixed Git branch into smaller pull requests, which are proposed code changes reviewed before merging.

In plain words
What is it for?
Use it to measure a branch, compare ways to divide it, create safety references, split the work, check that nothing was lost, and plan merge order.
Why use it?
It makes tangled changes easier to review and helps preserve the branch’s complete result while reducing merge conflicts and risk.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to measure a branch, compare ways to divide it, create safety references, split the work, check that nothing was lost, and plan merge order.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/liatrio-labs/ai-prompts/branch-surgery-pr-split
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 liatrio-labs/ai-prompts --skill branch-surgery-pr-split
Clone the repo
git clone --depth 1 https://github.com/liatrio-labs/ai-prompts

Made for: 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-surgery-pr-split

README.md
[![agentmods](https://agentmods.dev/badge/skills/liatrio-labs/ai-prompts/branch-surgery-pr-split/github.svg)](https://agentmods.dev/skills/liatrio-labs/ai-prompts/branch-surgery-pr-split)
Your own site
<a href="https://agentmods.dev/skills/liatrio-labs/ai-prompts/branch-surgery-pr-split"><img src="https://agentmods.dev/badge/skills/liatrio-labs/ai-prompts/branch-surgery-pr-split/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-surgery-pr-split

Your own site · 80×15
<a href="https://agentmods.dev/skills/liatrio-labs/ai-prompts/branch-surgery-pr-split"><img src="https://agentmods.dev/badge/skills/liatrio-labs/ai-prompts/branch-surgery-pr-split.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 825 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.00068 $0.00825
Opus 5 $0.00034 $0.00413
Sonnet 5 $0.00014 $0.00165
Haiku 4.5 $0.00007 $0.00082

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

Security

Grade A, and why

branch-surgery-pr-split 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 11d 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-surgery-pr-split/SKILL.md · 124 lines

How it starts

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

Branch Surgery PR Split

Overview

Use this skill to turn a risky monolithic branch into a safe, auditable set of scoped PRs. Treat topology as a decision, not a default recipe, and collaborate with the user before executing branch surgery.

Workflow

  1. Quantify branch shape before proposing solutions.
  2. Always present the top two topology options with explicit tradeoffs.
  3. Collaborate with the user to select one topology.
  4. Produce a decision-complete split plan.
  5. Execute with safety refs and strict scope boundaries.
  6. Run parity and completeness audits.
  7. Remediate drift and generate PR metadata.

Step 1: Quantify Branch Shape

Collect objective signals first:

  • Commit count and net churn versus base.
  • Number of changed files and hotspot files.
  • Mixed-commit prevalence (single commit touching unrelated concerns).
  • Dependency density between concerns.
  • Expected review risk and conflict risk.

If signals are incomplete, gather more evidence before recommending topology.

Step 2: Generate Topology Options

Always provide the top two options with tradeoffs and a recommendation. Use references/topology-patterns.md to select options.

For each option, include:

  • Topology name.
  • Why it fits this branch shape.
  • Review ergonomics, merge complexity, and conflict risk.
  • Failure modes and mitigations.
  • Cost of execution (low/medium/high).

Do not skip tradeoffs.

Step 3: Collaborate on Topology Selection

Use targeted discovery questions from references/facilitated-discovery-questions.md. Confirm constraints before surgery:

  • Must-merge-first dependencies.
  • Parallel review goals.
  • Tolerance for stacked PR depth.
  • Documentation isolation preference.
  • Release timing constraints.

If the user is unsure, recommend one option and explain what would change with the second option.

Step 4: Produce a Decision-Complete Split Plan

Produce:

  • Branch inventory with base branch mapping.
  • Commit disposition map (keep, split, drop-as-superseded).
  • Execution order.
  • Merge order.
  • Validation gates.
  • Risk register and mitigations.

Read the full file on GitHub · 124 lines

Files

What ships with it

5 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. 11d ago First seen · 124 lines · 68 tokens per session scan A 5ef5406cf1b0

Subscribe to this mod's changes

branch-surgery-pr-split is a skill published in the GitHub repository liatrio-labs/ai-prompts (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 68 tokens to every session and 825 once invoked, about $0.0003 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

lov-rename-project

A project-renaming workflow that updates a product or repository name across source files, configuration, and documentation. It produces a reviewable plan and preserves compatibility-sensitive names and references where needed.

lovstudio/skills · 45 tokens

lov-gh-tidy

Interactive GitHub repo hygiene skill. Lists all open issues, PRs, stale branches, and orphan labels, shows a summary of each with analysis, then asks the user how to handle each item (close, merge, comment, delete, keep). Executes all chosen actions via gh CLI. Use when the user says "清理 GitHub", "tidy repo", "clean…

lovstudio/skills · 95 tokens

lov-checkpoint

A project checkpoint tool that records what changed, what was verified, unresolved work, and the next steps using Git status and history. Git is the system that tracks changes to project files.

lovstudio/skills · 38 tokens

project

Clone, index, and orchestrate multi-repo work via agent-toolkit project — symlinks, quick access, and swarm workspaces.

ulises-jeremias/agent-toolkit · 31 tokens

jira-developer-integration

Git and developer workflow integration. TRIGGERS: 'generate branch name', 'create branch name', 'branch name for', 'write PR description', 'PR description for', 'link PR', 'link pull request', 'parse commit', 'extract issue from commit', 'smart commit', 'development panel'. Use for Git, GitHub, GitLab, Bitbucket…

ulises-jeremias/agent-toolkit · 113 tokens

dsh-plugin-publisher

A release tool for DSH plugins, where DSH is the DeepSeek Harness used to load these add-ons. It validates an existing plugin package, publishes it through npm, Git, or a tarball, and checks that the harness can load it.

lovstudio/skills · 82 tokens