swapnildahiphale/opensre/vcs-bitbucket
Claude Code and agent skill by swapnildahiphale/opensre
- community
Checking that the SKILL.md file is still in the repository.
Bitbucket Data Center and Cloud repos, pull requests, branches, issues, webhooks, and pipelines via bkt CLI. Safe read-before-write workflow. Use when investigating PR failures, repo state, or Bitbucket pipeline issues.
Install
npx vskill@latest install swapnildahiphale/opensre/vcs-bitbucketSKILL.md
The same SKILL.md was published earlier as swapnildahiphale/opensre/vcs-bitbucket.
Authentication
IMPORTANT: In proxy/production mode, credentials may be injected automatically. Do not assume BKT_TOKEN is visible in the shell — run the smoke test below before mutating commands.
In direct/local mode, OpenSRE uses environment-variable auth (no bkt auth login required). Set in repo root .env (passed to the sre-agent container via docker-compose):
| Variable | Required | Description | |
|---|---|---|---|
BKT_TOKEN | Yes | Atlassian API token (Cloud) or PAT (Data Center). Bypasses OS keychain. | |
BKT_HOST | Yes | https://bitbucket.org (Cloud) or https://bitbucket.example.com (DC) | |
BKT_USERNAME | Cloud: yes | Atlassian account email (Cloud API tokens). DC: PAT owner username. | |
BKT_WORKSPACE | Cloud: recommended | Default workspace slug (e.g. your-workspace) | |
BKT_PROJECT | DC: recommended | Default project key | |
BKT_REPO | No | Default repo slug when commands omit --repo |
The default workspace comes from BKT_WORKSPACE in the repo root .env, which is passed into the sre-agent container via docker-compose env_file. Omit --workspace on commands unless you need to override that default. Do not hardcode workspace names in command examples.
See .claude/skills/vcs-bitbucket/.env.example for templates.
Verify before running commands (read-only smoke test — works in Docker and on host):
Expected: at least one repository line for your workspace (e.g. your-workspace/<repo-slug>).
On macOS host only, bkt auth status may also show token source: BKT_TOKEN when env vars are set. In the sre-agent container (Linux), bkt auth status / bkt auth doctor only inspect libsecret/keychain and will say "No hosts configured" even when BKT_* env auth works — do not treat that as a failure if bkt repo list succeeds.
Host-only fallback: bkt auth login ... --web stores credentials in macOS Keychain — that does not propagate into Docker. Prefer BKT_* in .env for container runs.
Dependency check: bkt --version must succeed. The binary is pre-installed in the sre-agent Docker image; on the host install via brew install avivsinai/tap/bitbucket-cli.
Skill: Bitbucket CLI (Portable)
Use this skill for Bitbucket operations from terminal-based agents.
Cross-Compatibility
This skill is repository-local and tool-agnostic. It works in Codex, Claude Code, Cursor, and other IDE agents via the bkt CLI.
Token Scopes
You can name the Bitbucket token whatever you want. As an example, opensre-bitbucket is a reasonable token name for this skill.
If you are using a Bitbucket token for app/API access, the configured scopes should include:
Read:
read:user:bitbucketread:issue:bitbucketread:pullrequest:bitbucketread:repository:bitbucket
Write:
write:issue:bitbucketwrite:pullrequest:bitbucketwrite:repository:bitbucket
These scopes match the read/write workflows documented in this skill for repositories, pull requests, and Bitbucket issues.
Safe Workflow
OpenSRE / Docker: Credentials are injected via BKT_* environment variables. Do not run bkt auth status or bkt auth login as a prerequisite — on Linux those commands report "No hosts configured" even when env auth works. Start with bkt repo list --limit 1; if it returns repos, proceed.
- Confirm exact target host/project/workspace/repo/PR before execution.
- Start with read-only commands (
bkt repo list,view,pr list) before any mutation. - For mutating commands (
create,edit,merge,delete,grant,run), confirm the exact command and target in the response before running. - Do not ask the user for credentials when
bkt repo listsucceeds — env auth is already configured. - Do not use
--allow-insecure-storeunless the user explicitly requests it and accepts the risk. - After each write, immediately verify with a read command and report resulting IDs/state.
Read/Search Commands
Cloud issue tracking:
Write Commands
Pull request actions:
Repository and branch actions:
Webhooks/pipelines:
Permissions (DC):
Output and API Escape Hatch
References
- Full command appendix:
.claude/skills/vcs-bitbucket/references/commands.md
Troubleshooting
| Symptom | Meaning | Do this | |
|---|---|---|---|
newosproc, failed to create new OS thread, fork: Resource temporarily unavailable | Process/thread budget exhausted (container PID cap or fork storm) | Stop spawning new tools; use one Bitbucket REST call via curl -u "$BKT_USERNAME:$BKT_TOKEN" or a single python3 script | |
bkt repo list fails with above | Environment constraint, not auth | Do not install gh, do not dump env/printenv, do not retry bkt in a tight loop | |
| Auth works via curl Basic but Bearer 401 | Wrong auth mode | Prefer Basic auth with BKT_USERNAME + BKT_TOKEN (already documented for Cloud) |
REST fallback (when bkt cannot fork):
Adjust host/path for Data Center (${BKT_HOST}/rest/api/1.0/...). One curl or one short script — no parallel tool storms.
Best Practices
- Keep host/context explicit on every command in multi-tenant environments.
- Prefer scoped contexts over repeatedly passing project/workspace flags.
- Report command output facts only; do not infer missing server state.
- For write failures, re-read current state before retrying.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsre-agent/.claude/skills/vcs-bitbucket/SKILL.md
Popularity
- Repository stars
- 108
- Repository forks
- 26
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/swapnildahiphale/opensre/vcs-bitbucket)