bitbucket-pr
Skill0 starsChanged 8 months agoMITView on GitHub
Creates Bitbucket pull requests from a local git repository using the Bitbucket REST API. Use this skill whenever the user wants to open, create, or raise a PR/pull request on Bitbucket, push their branch for review, or says things like "create a PR", "open a pull request", "raise a PR", "submit my branch for review", or "push this for review". Also triggers when the user asks Claude to summarize their changes and submit them. Handles source branch auto-detection, destination branch selection, title generation from commit messages, and description generation from the diff.
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- AlanSyue/my-skillstheir own version, first seen Feb 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- AlanSyue/my-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Run these commands in the repo root:
- Very specific: line 36
Destination branch: default is develop. Use what the user specifies if given.
- Distinctive: line 37
If there are no commits ahead, warn the user and stop.
- Distinctive: line 48
Write a clear markdown description covering:
- Distinctive: line 53
Keep the description under ~300 words.
- Distinctive: line 74
Wait for confirmation. Apply edits and confirm again if requested.
- Distinctive: line 80
Check if the source branch has a remote tracking branch:
- Distinctive: line 86
If no upstream, push it:
- Very specific: line 96
Call the bundled Node.js script with only non-sensitive parameters.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bitbucket PR Skill
Creates a Bitbucket pull request from the current local git repo using the REST API v2.
Credential safety: Credentials are NEVER read by the model. A bundled Node.js script (scripts/create-pr.js, installed alongside this skill) handles all authentication internally. The model only passes non-sensitive parameters (branch names, title, description) to that script.
Step 1 — Gather git context
Run these commands in the repo root:
# Current (source) branch
git rev-parse --abbrev-ref HEAD
# Commits ahead of destination branch (default: develop)
git log origin/develop..HEAD --oneline
# Full diff vs destination branch
git diff origin/develop...HEAD- Source branch: whatever
HEADresolves to. Abort if it'sdevelop,main, ormaster. - Destination branch: default is
develop. Use what the user specifies if given. - If there are no commits ahead, warn the user and stop.
Step 2 — Generate title and description
Title — from commit messages:
- One commit: use its subject line directly.
- Multiple commits: write a single concise sentence (≤72 chars) summarising what they collectively achieve.
Description — from the diff: Write a clear markdown description covering:
- What changed — plain-English summary (2–5 sentences)
- Why — infer from commit messages if possible
- Testing notes — brief placeholder if not obvious
Keep the description under ~300 words.
Step 3 — Confirm with user
Display a summary for review before creating the PR:
Ready to create PR
From : feature/my-branch
Into : develop
Title: <generated title>
Description:
<generated description>
Proceed? (yes / edit title / edit description / cancel)Wait for confirmation. Apply edits and confirm again if requested.
Step 4 — Push branch (if needed)
Check if the source branch has a remote tracking branch:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/nullIf no upstream, push it:
git push -u origin <source-branch>Step 5 — Create the PR
Call the bundled Node.js script with only non-sensitive parameters. Credentials are loaded securely inside the script and never appear in the model's context.
node ~/.claude/skills/bitbucket-pr/scripts/create-pr.js \
"<source-branch>" \
"<destination-branch>" \
"<title>" \
"<description>"- On success: display the PR URL from the script's output. Done.
- On error: show the error output and suggest fixes (see Troubleshooting).
Troubleshooting
| Error | Likely cause | Fix |
config file not found | Config missing | Create .bitbucket.json as shown in Configuration section |
Failed to parse config file | Invalid JSON | Check .bitbucket.json syntax |
config file missing required fields | Missing fields | Verify all 4 fields (username, app_password, workspace, repo_slug) are present |
| HTTP 401 Unauthorized | Wrong credentials | Regenerate app password in Bitbucket; update .bitbucket.json |
| HTTP 404 Not Found | Wrong workspace/repo slug | Verify slugs match your Bitbucket URL |
| HTTP 400 – source branch not found | Branch not pushed | Ensure branch is pushed to remote (Step 4 should handle this) |
| HTTP 400 – PR already exists | Duplicate PR | Check Bitbucket for an existing open PR on this branch |
| No commits ahead | Branch not diverged | Make commits first or verify you're on the correct branch |
ENOENT or script not found | Script missing | Ensure ~/.claude/skills/bitbucket-pr/scripts/create-pr.js exists |
Notes
- This skill uses Bitbucket Cloud REST API v2. It does not support Bitbucket Server/Data Center.
- SSH is used by git for push; the REST API uses the app password from the config file.
close_source_branchdefaults tofalse— edit the script if you need to change this.- To use a non-default config location:
export BITBUCKET_CONFIG=/path/to/config.json
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

