merge-bb-pr

Merges a Bitbucket pull request with validated state, strategy mapping, and merge artifact recording.

1|1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/williamthorsen/codeassembly --skill merge-bb-pr-williamthorsen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-bb-pr
Source: https://github.com/williamthorsen/codeassembly/tree/main/packages/agents/content/skills/merge-bb-pr
Command: npx skills add https://github.com/williamthorsen/codeassembly --skill merge-bb-pr-williamthorsen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Merging Bitbucket pull requests from an automated workflow requires validating PR state, mapping merge strategies to Bitbucket's API, handling branch deletion semantics, and recording merge results consistently. This Skill performs those steps as an internal delegate called by the merge-pr workflow with fully resolved inputs. ## Core Features & Use Cases - State validation before merge: Fetches the PR and refuses to merge when the state is not OPEN, failing closed when the state cannot be determined. - Strategy and deletion mapping: Maps squash, merge, and rebase strategies to Bitbucket's mergeStrategy values and maps deletion strategies to closeSourceBranch, refusing the unmappable 'both' option. - Merge artifact recording: Writes a timestamped merge artifact to the ticket directory so downstream steps like capture-lede-decision can read the merge result. - Use Case: A merge-pr orchestration flow resolves a Bitbucket PR URL, composes the merge title and body, and delegates to this Skill to execute the merge and save the artifact. ## Quick Start Ask the merge-pr workflow to merge the resolved Bitbucket pull request with the chosen strategy and let this delegate validate, merge, and record the result.

Frequently Asked Questions about merge-bb-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge a Bitbucket pull request programmatically?

Call the Bitbucket pull request tool with action merge, passing prId, mergeStrategy, message, and closeSourceBranch. Validate that the PR state is OPEN first, and map squash, merge, and rebase to squash, merge_commit, and rebase_fast_forward respectively.

How to delete the source branch when merging a Bitbucket PR?

Set closeSourceBranch to true in the merge call to delete the remote source branch. Bitbucket has no API to delete the local branch, so a deletion strategy of 'both' is refused and local cleanup is left to the user.

Does Bitbucket support rebase merging like GitHub?

Yes, Bitbucket supports rebase merging through the rebase_fast_forward merge strategy. Unlike squash or merge_commit, no composed message is passed because rebased commits keep their own messages.

Why does a Bitbucket merge fail when the PR is not OPEN?

The merge is refused when the PR state is MERGED, DECLINED, or SUPERSEDED, since only OPEN pull requests can be merged. If the state cannot be determined from the response, the merge fails closed and asks for manual verification.

What happens when the merge commit hash is missing from the Bitbucket response?

A follow-up get call retrieves the hash from a response reporting state MERGED. If the hash is still absent after a confirmed merge, it is reported as unavailable in the artifact rather than treated as a failed merge.