0xmythril/my-agent-skills/promote-branch-pr
Claude Code and agent skill by 0xmythril/my-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Compare two branches in a remote GitHub repo, report the delta, and create a promotion PR if the target is behind. Works standalone; optionally hands off to babysit-github-pr after user confirmation.
Install
npx vskill@latest install 0xmythril/my-agent-skills/promote-branch-prSKILL.md
The same SKILL.md was published earlier as 0xmythril/my-agent-skills/promote-branch-pr.
Promote Branch → Pull Request
Compare two branches in a GitHub repo, create a promotion PR if the target is behind, and optionally hand off to babysit-github-pr for monitoring.
Parse inputs from the user's message
repo_url(required) — full GitHub repo URL, e.g.https://github.com/mocaverse/air-agent-servicessource[default:staging] — branch to promote fromtarget[default:sandbox] — branch to promote intoauto_babysit[default:false] — iftrue, skip the confirmation prompt and immediately invokebabysit-github-pr
Any missing optional param falls back to the default above.
Prerequisites — check before starting
ghCLI authenticated (gh auth status). If not available, fall back togit+curlwithGITHUB_TOKEN.- The local repo does not need to be cloned. All operations work against the remote via
ghAPI orcurl.
Extract owner/repo
Step 1: Compare branches
With gh:
With curl (fallback):
Outcomes
COMMIT_COUNT | Action | |
|---|---|---|
0 or empty | Report "$target is already up to date with $source. No PR needed." and exit. | |
> 0 | Continue to Step 2. |
Step 2: Check for existing open PR
Search for an open PR with head=$source and base=$target.
With gh:
With curl:
If EXISTING is non-empty:
- Report the existing PR URL.
- Ask the user:
"An open PR already exists. Babysit it? (yes/no)" - If yes → invoke
babysit-github-prwithpr_url=$EXISTING. - Exit without creating a new PR.
Step 3: Build PR body
Generate a promotion body that includes the commit list and a machine-readable footer.
To build the commit list dynamically, reuse the output from Step 1.
Step 4: Create the promotion PR
With gh:
Capture the returned PR URL.
With curl:
If creation fails, report the error and exit.
Step 5: Report and ask about babysitting
Report to the user:
Then ask:
"PR created. Run babysit-github-pr to monitor it? (yes/no)"
- If user says yes (or
auto_babysit=true): - Invoke
babysit-github-prwithpr_url=$PR_URL. - Pass sensible defaults:
duration=2h,interval=10m. - NEVER merge the PR yourself — leave it merge-ready for the user to merge.
- If user says no:
- Report
"Done. PR is open at PR_URL."and exit.
Agent autonomy boundary
- Create the PR if it doesn't exist.
- Monitor it if asked (via
babysit-github-pr). - Resolve merge conflicts, review comments, and CI failures.
- Report when the PR is merge-ready.
- NEVER merge the PR into the target branch. That action belongs to the user.
Standalone guarantee
This skill never depends on babysit-github-pr being present. If the user declines babysitting, or the skill is unavailable, promotion still completes successfully. The handoff is strictly optional.
Edge cases
| Scenario | Behavior | |
|---|---|---|
source == target | Report error, exit | |
source or target branch does not exist | Report error from GitHub API, exit | |
| Open PR already exists | Report it, ask to babysit, do not duplicate | |
COMMIT_COUNT == 0 | Report up-to-date, exit | |
| PR creation fails (permissions, rules) | Report raw error, exit | |
PR is CONFLICTING/DIRTY | Trivial/format drift only: Resolve locally (see below), then re-check. Non-trivial: Halt and ask user for guidance. | |
gh missing and no GITHUB_TOKEN | Fail fast with auth setup instructions |
Resolving trivial merge conflicts (format drift)
Promotion PRs often become CONFLICTING due to biome/format/style drift on target (e.g. sandbox had formatting-only changes that diverged from source). These are safe to resolve mechanically without human review.
Detection
After finding an existing PR, check its merge state:
If mergeable: CONFLICTING and the repo uses automated formatters (Biome, Prettier, ESLint), the conflicts are likely trivial.
Resolution workflow
- Ensure the repo is cloned locally and
originpoints to the remote:
``bash git fetch origin $source $target ``
- Checkout the source branch and merge target into it:
``bash git checkout $source git merge origin/$target --no-edit ``
- Accept the source branch versions for all conflicted files:
``bash git checkout --ours <file1> <file2> ... # or accept all conflicts programmatically: git diff --name-only --diff-filter=U | xargs git checkout --ours ``
- Commit and push:
``bash git add -A git commit -m "chore: resolve $target→$source promotion conflicts" git push origin $source ``
- Re-check the PR — it should flip to
MERGEABLE.
Pitfalls
--oursvs--theirsis counterintuitive during a merge:--oursmeans the branch you checked out (source),--theirsmeans the branch you merged in (target). For promotion PRs, always accept source (--ours) because source is the source of truth.- Do NOT use
--forcewhen pushing the resolved source branch. - If conflicts are in non-formatting files (logic, types, schemas), stop and ask the user before resolving.
See references/resolve-promotion-conflicts.md for a worked example from the mocaverse/air-agent-services repo.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/promote-branch-pr/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/0xmythril/my-agent-skills/promote-branch-pr)