agentleFS
Vishalj32Vishalj32/claude-skills/bitbucket-pr/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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
  1. Distinctive:

    Run these commands in the repo root:

    line 22
  2. Very specific:

    Destination branch: default is develop. Use what the user specifies if given.

    line 36
  3. Distinctive:

    If there are no commits ahead, warn the user and stop.

    line 37
  4. Distinctive:

    Write a clear markdown description covering:

    line 48
  5. Distinctive:

    Keep the description under ~300 words.

    line 53
  6. Distinctive:

    Wait for confirmation. Apply edits and confirm again if requested.

    line 74
  7. Distinctive:

    Check if the source branch has a remote tracking branch:

    line 80
  8. Distinctive:

    If no upstream, push it:

    line 86
  9. Very specific:

    Call the bundled Node.js script with only non-sensitive parameters.

    line 96

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 HEAD resolves to. Abort if it's develop, main, or master.
  • 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:

  1. What changed — plain-English summary (2–5 sentences)
  2. Why — infer from commit messages if possible
  3. 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/null

If 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

ErrorLikely causeFix
config file not foundConfig missingCreate .bitbucket.json as shown in Configuration section
Failed to parse config fileInvalid JSONCheck .bitbucket.json syntax
config file missing required fieldsMissing fieldsVerify all 4 fields (username, app_password, workspace, repo_slug) are present
HTTP 401 UnauthorizedWrong credentialsRegenerate app password in Bitbucket; update .bitbucket.json
HTTP 404 Not FoundWrong workspace/repo slugVerify slugs match your Bitbucket URL
HTTP 400 – source branch not foundBranch not pushedEnsure branch is pushed to remote (Step 4 should handle this)
HTTP 400 – PR already existsDuplicate PRCheck Bitbucket for an existing open PR on this branch
No commits aheadBranch not divergedMake commits first or verify you're on the correct branch
ENOENT or script not foundScript missingEnsure ~/.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_branch defaults to false — edit the script if you need to change this.
  • To use a non-default config location: export BITBUCKET_CONFIG=/path/to/config.json

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.