# Bb Pr

> bb-pr — Create a Bitbucket Pull Request

- Skill: `markbaindesign/bb-pr` (Agent Skill)
- Install (CLI): `npx skillmds@latest add markbaindesign/bb-pr`
- Raw SKILL.md: https://api.skillmd.com/api/skills/markbaindesign/bb-pr/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: markbaindesign (https://skillmd.com/u/markbaindesign)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/markbaindesign/bb-pr

---


# bb-pr — Create a Bitbucket Pull Request

Runs `~/code/bain-studio/studio/scripts/bb-pr` to open a PR on Bitbucket from the current branch.

## Usage

```
/bb-pr
/bb-pr --base develop --title "My PR title"
/bb-pr --base master --title "Title" --body "Description"
```

## Steps

### 1. Check the current branch and repo

```bash
git rev-parse --abbrev-ref HEAD
git remote get-url origin
```

Confirm we are on a feature branch (not develop or master) with a Bitbucket remote. If not, warn the user before proceeding.

### 2. Determine arguments

From the user's message, extract:
- `--base` — target branch (default: `develop`)
- `--title` — PR title (default: branch name, but suggest a better one based on the commits)
- `--body` — PR body (optional; summarise what changed if the user wants one)

To get a useful default title, run:
```bash
git log develop..HEAD --oneline
```
Use the commit messages to suggest a concise PR title if the user hasn't specified one.

### 3. Run the script

```bash
~/code/bain-studio/studio/scripts/bb-pr --base "$BASE" --title "$TITLE" --body "$BODY"
```

The script handles:
- Credential loading from `~/.config/bb-pr` (created on first run via `--setup`)
- Confirmation prompt before creating
- JSON encoding and API call

### 4. First-run credential setup

If the script prompts for setup, tell the user:
1. Go to `https://bitbucket.org/account/settings/app-passwords`
2. Create an app password with **Repositories (Read + Write)** and **Pull Requests (Read + Write)**
3. The script saves credentials to `~/.config/bb-pr` (chmod 600) — safe to use on any machine

### 5. Report

Output the PR URL. If the script errors, show the message and suggest checking credentials with `bb-pr --setup`.

