Install
$ agentstack add skill-liatrio-labs-ai-prompts-branch-surgery-pr-split ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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
- Quantify branch shape before proposing solutions.
- Always present the top two topology options with explicit tradeoffs.
- Collaborate with the user to select one topology.
- Produce a decision-complete split plan.
- Execute with safety refs and strict scope boundaries.
- Run parity and completeness audits.
- 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.
Use templates in references/pr-stack-templates.md.
Step 5: Execute Branch Surgery Safely
Execution rules:
- Create backup refs first (tag and/or backup branch).
- Preserve explicit scope contracts per split branch.
- For mixed commits, use
cherry-pick -nand stage only owned files/hunks. - Keep shared-doc churn isolated when selected topology calls for it.
- Avoid hidden carryover changes by checking staged file lists before commit.
Step 6: Audit Before Confidence
Run audit gates from references/audit-gates.md. A split is incomplete until all gates pass or deviations are documented.
Mandatory checks:
- No missing files compared to original net diff.
- No unexpected extra files.
- Per-file parity or intentional documented divergence.
- Deletion semantics parity.
- Branch scope boundaries match PR intent.
Step 7: Remediate and Package PRs
If audit finds issues:
- Fix scope drift or ownership errors.
- Re-run audits.
- Remove redundant branches.
Then generate PR metadata and merge sequencing notes using references/pr-stack-templates.md.
Output Standard
Always provide:
- Chosen topology and why it won over the runner-up.
- Branch plan and merge order.
- Audit summary with pass/fail status per gate.
- Remediation actions taken.
References
references/topology-patterns.mdreferences/facilitated-discovery-questions.mdreferences/audit-gates.mdreferences/pr-stack-templates.md
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: liatrio-labs
- Source: liatrio-labs/ai-prompts
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.