# Bitbucket

> >

- **Type:** Skill
- **Install:** `agentstack add skill-serzhik-bitbucket-skill-bitbucket-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [serzhik](https://agentstack.voostack.com/s/serzhik)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [serzhik](https://github.com/serzhik)
- **Source:** https://github.com/serzhik/bitbucket-skill

## Install

```sh
agentstack add skill-serzhik-bitbucket-skill-bitbucket-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Bitbucket Skill

Lightweight Bitbucket CLI for Claude Code. Uses a Python script that calls Bitbucket Cloud REST API 2.0 directly and returns **compact output** to minimize token usage.

When invoked with arguments (e.g. `/bitbucket create-pr 123`), run:

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py $ARGUMENTS
```

## Script Location

```
~/.claude/skills/bitbucket/bitbucket_api.py
```

Config: `~/.claude/bitbucket.config`

### Config Setup

Supports two auth methods:

**Option 1: App Password (recommended)**
```json
{
  "username": "your_bitbucket_username",
  "app_password": "your_bitbucket_app_password",
  "workspace": "your-workspace",
  "repo_slug": "your-repo"
}
```
Create: Bitbucket → Personal settings → App passwords (scopes: Repositories Read/Write, Pull requests Read/Write).

**Option 2: Repository Access Token**
```json
{
  "access_token": "your_repository_access_token",
  "workspace": "your-workspace",
  "repo_slug": "your-repo"
}
```
Create: Repository settings → Access tokens → Create.

**Note**: `workspace` and `repo_slug` are optional — auto-detected from `git remote get-url origin`.
**Note**: Atlassian API Tokens (used for JIRA) do NOT work with Bitbucket Cloud API.

## Commands

All commands are run via Bash tool:

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py  [args]
```

### Create Pull Request

**Trigger**: `/bitbucket create-pr`, `/bitbucket pr`, "create PR", "open pull request"

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py create-pr "PROJ-123: Fix customer grid" --description "Summary of changes" --destination master
```

- `--description TEXT` — PR description (markdown)
- `--source BRANCH` — source branch (default: current branch)
- `--destination BRANCH` — target branch (default: master)
- `--no-close` — don't close source branch after merge
- Returns: PR number and URL

### List Pull Requests

**Trigger**: `/bitbucket list-prs`, `/bitbucket prs`

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py list-prs [STATE]
```

- STATE: `OPEN` (default), `MERGED`, `DECLINED`, `SUPERSEDED`

### View Pull Request

**Trigger**: `/bitbucket get-pr `, `/bitbucket pr `

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py get-pr 123
```

### Merge Pull Request

**Trigger**: `/bitbucket merge-pr `

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py merge-pr 123 --strategy squash
```

- `--strategy`: `merge_commit` (default), `squash`, `fast_forward`

### Decline Pull Request

**Trigger**: `/bitbucket decline-pr `

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py decline-pr 123
```

### PR Comments

**Trigger**: `/bitbucket pr-comments `

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py pr-comments 123
```

### Add Comment to PR

**Trigger**: `/bitbucket add-comment  `

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py add-comment 123 "LGTM! Ready to merge."
```

### Pipelines

**Trigger**: `/bitbucket pipelines`

```bash
python3 ~/.claude/skills/bitbucket/bitbucket_api.py pipelines [COUNT]
```

- COUNT: number of recent pipelines to show (default: 10)

## PR Title Format

PR title **must** follow the format: `PROJ-XXX: Task title`

Example: `PROJ-123: Fix customer grid loading issue`

## PR Description Formatting

Bitbucket PR descriptions use **Markdown** format (not ADF like JIRA).

### Co-Authored-By Line

The text `Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com` **must be italic** in the PR description.

In Markdown, wrap it with `*`:
```
*Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com*
```

### PR Description Template

```markdown
## Summary

- Change description here

## Test Plan

- [ ] Test step here

---

*Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com*
```

## Code Review with Inline Comments

### Single Inline Comment

Use the `bb-comment.sh` script to add inline code review comments:

```bash
~/.claude/skills/bitbucket/scripts/bb-comment.sh    "comment text"
```

Example:
```bash
~/.claude/skills/bitbucket/scripts/bb-comment.sh 42 app/code/Vendor/Module/Model/Example.php 45 "Use dependency injection here"
```

### Batch Code Review

Use `bb-review.sh` for batch review with multiple comments:

```bash
~/.claude/skills/bitbucket/scripts/bb-review.sh  
```

Comments file format (TSV — tab separated):
```
file_pathline_numbercomment_text
```

Example:
```bash
echo -e 'src/Model.php\t45\tUse DI here\nsrc/Controller.php\t120\tAdd try/catch' > /tmp/comments.tsv
~/.claude/skills/bitbucket/scripts/bb-review.sh 42 /tmp/comments.tsv
```

Scripts auto-detect credentials from `~/.claude/bitbucket.config` or environment variables (`BB_WORKSPACE`, `BB_REPO`, `BB_USER`, `BB_APP_PASSWORD`).

## Direct API Reference

For advanced use cases not covered by the Python script, see [references/api_reference.md](references/api_reference.md).

## Notes

- Default destination branch: **master**
- Auto-detects workspace/repo from git remote if not in config
- Output is already formatted as markdown — display directly to user
- No external Python dependencies required (uses stdlib `urllib`)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [serzhik](https://github.com/serzhik)
- **Source:** [serzhik/bitbucket-skill](https://github.com/serzhik/bitbucket-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-serzhik-bitbucket-skill-bitbucket-skill
- Seller: https://agentstack.voostack.com/s/serzhik
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
