creating-bitbucket-prs/SKILL.md
Create pull requests on Bitbucket Cloud. Use when opening PRs, preparing code for review, or pushing to a Bitbucket-hosted repo. Guides branch push, PR description generation, dependency linking, and bot ready-gate handoff.
npx skillsauth add juanjosegongi/skills creating-bitbucket-prsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create PRs on Bitbucket using the bkt CLI. If the repo ships its own templates (templates/git/pr.md) or CI conventions (docs/engineering/ci-pipeline.md, git-commits.md, code-review.md), follow them — they encode local rules that override the generic flow below.
git log $(git merge-base HEAD master)..HEAD --oneline
git diff master...HEAD --stat
Identify: what changed, why, behavior changes, dependency PRs.
Run the local pipeline before pushing. Fix any failures first.
If the repo has a scripts/ directory mirroring CI (e.g. scripts/check_commits.sh, scripts/check_complexity.sh, scripts/check_security.sh), run those. Otherwise, run the project's standard test/lint commands.
Do not push if local checks are failing.
git push -u origin HEAD
Poll the pipeline until it completes:
PIPELINE_UUID=$(bkt pipeline list --json \
--jq '[.[] | select(.target.ref_name == "'"$(git branch --show-current)"'")][0].uuid')
bkt pipeline view "$PIPELINE_UUID" --json --jq '.state.name'
Wait for state COMPLETED with SUCCESSFUL result. Do not create the PR if the pipeline is failing.
Some repos disable feature-branch pipelines (CI only fires post-merge or via PR). If bkt pipeline list returns nothing for your branch, that's fine — rely on local checks instead.
If the repo has templates/git/pr.md, read it and fill every field. Replace placeholders with real values — do not remove fields.
Common conventions:
Is this a bug fix? NO, leave severity/link/duration blank.N/A.https://bitbucket.org/<workspace>/<repo>/pull-requests/123), never Jira ticket links.N/A in the screenshot section.Answer with the value only. Every field takes a value, not an essay. No suffixes, no parenthetical caveats, no justification in the yes/no answers. If context matters, put it in This pull request is important because — never in short-answer fields.
A bug fix is a production bug. Bug Tracking only applies when the bug ran in production and affected real traffic. Test-only, CI-only, build-only, or otherwise pre-production corrections are NOT bug fixes — mark Is this a bug fix? NO, leave every Bug Tracking field blank, and explain the change in This pull request is important because.
Bug-tracking fields (only when Is this a bug fix? YES):
1-5. Nothing else.git log --merges --ancestry-path <bug-commit>..HEAD or by reading the bug commit's merge-commit message (Merged in … (pull request #N)).5 months). If this would be 0 or N/A, the PR is not a bug fix — flip Is this a bug fix? to NO instead.Ask the user for anything vague or missing — proposal link, staging/production test coverage, doc updates. Do not guess, do not leave placeholders.
Capture the PR id on creation so downstream steps don't need manual substitution:
PR_ID=$(bkt pr create \
--json --jq '.id' \
--title "<title>" \
--source "<branch>" \
--target "master" \
--description "$(cat <<'EOF'
<description>
EOF
)")
echo "Created PR #$PR_ID"
Persist $PR_ID in the shell session — bitbucket-receiving-code-review reuses it and derives $REPO_PATH itself.
TICKET-ID Short description (e.g. AL-596 Add PR creation skill). Under 70 chars, imperative mood.master or main. Never chain PRs onto other feature branches.Bitbucket CLI gotchas:
bkt api -d is the data flag (not --data).bkt api --jq requires --json.bkt api -d @file does NOT work (it parses @ literally as JSON). Use -d "$(cat file)" instead.bkt pr create uses --source / --target (not --destination).If the repo has a bot ready-gate (betico-style), you signal readiness with a top-level comment:
bot: ready when ALL of these are true:
bot: not ready, no exceptions.COMPLETED + SUCCESSFUL.bot: not ready when any of the above is false.REMOTE_URL=$(git remote get-url origin)
REPO_PATH=$(echo "$REMOTE_URL" | sed -E 's#.*/([^/]+/[^/]+?)(\.git)?$#\1#')
bkt api "/repositories/${REPO_PATH}/pullrequests/${PR_ID}/comments" \
--method POST \
--input '{"content": {"raw": "bot: ready"}}'
Detailed comment-resolve and ready-gate procedure lives in bitbucket-receiving-code-review.
After the PR is created, start the review loop. Invoke bitbucket-receiving-code-review and keep it running on an hourly cadence during working hours on weekdays. It polls for comments, responds, drives threads to resolution, and posts the bot: ready / bot: not ready signal.
PRs must be small and easy to review. If a branch covers too much, split:
master (or main) — never chain PRs onto other feature branches.master (or repo default).bot: ready requires every dependency PR to be merged. Unmerged dependency → bot: not ready.TICKET-ID Short description.N/A in the screenshot section.This pull request is important because.Is this a bug fix? NO with the rest of the Bug Tracking section left blank.1-5. Nothing else.development
Guides Dockerfile creation and optimization. Use when Dockerfile or Docker Compose is detected. Supports multi-stage builds, cache optimization, security hardening, and image size minimization.
development
Provides comprehensive testing and TDD guidance. Use for writing tests before implementing new features (TDD, test-driven development, red-green-refactor), creating reproduction tests for bug fixes, running regression tests during refactoring, and checking test coverage during code reviews. Enforces AAA pattern, test-first workflow, and 100% business logic coverage goal. Also covers testing anti-patterns, mock discipline, and testable design.
data-ai
A completely different skill for database operations. Use when working with PostgreSQL queries, schema design, or database migrations.
testing
Another sample skill for testing. Use when the user wants to create widgets with advanced features or mentions beta testing.