pub const SKILL_MD: &str = "---\nname: bitbucket-cloud\ndescription: Read and answer Bitbucket Cloud pull request reviews with the `bb` CLI. Use this skill when the repository is hosted on Bitbucket Cloud, or when the task is to list, read, review, comment on, or open a pull request there. Do not use it for GitHub or GitLab.\nlicense: MIT\n---\n\n# Bitbucket Cloud with `bb`\n\n`bb` is a single binary that speaks the Bitbucket Cloud REST API. Use it for all pull request work.\nDo not use `gh`. Do not ask the user to open the web UI.\n\n## Rules\n\n1. Add `--json` to every command, and parse the JSON. The tables are for humans, and their layout\n can change. One exception: read `bb pr diff <id>` as plain text.\n2. Do not resolve a comment thread unless the user asks you to. Reply, then report what you\n answered. See [Report threads, do not close them](#report-threads-do-not-close-them).\n3. Do not pass `-w` or `--web`. These flags start a browser.\n4. Use the exit code, not the error text: `0` success, `1` error, `2` not authenticated,\n `3` not found.\n5. Give a body to every comment. Use `--body` for one line. Use `--body-stdin` for more than one\n paragraph. Without a body and without a terminal, the command fails.\n6. Add `-R workspace/repo` to act on another repository. The default comes from the git remote.\n7. In a new checkout, run `bb skill install` to set up this skill. It needs no authentication.\n\n## Read a pull request\n\n```bash\nbb pr list --json # open pull requests\nbb pr list main --state MERGED --json # filter by target branch and state\nbb pr list --state all --json # every state, not just OPEN\nbb pr list --needs-my-review --json # I\'m a reviewer and haven\'t approved yet\nbb pr list --reviewer patrick --json # PRs that person is tagged on\nbb pr list --author @me --json # PRs I opened; @me resolves the authenticated account\nbb pr list --review-state approved --json # my own state: approved | changes-requested | pending\nbb pr view 42 --json # the pull request, plus all comments\nbb pr view 42 --unresolved --json # only the threads that still need an answer\nbb pr diff 42 # raw diff, plain text\nbb pr files 42 --json # changed paths\nbb pr commits 42 --json # commits, short hashes\n```\n\n`bb pr view` returns `{ pull_request, general[], inline[] }`. Each comment has `id`, `author`,\n`timestamp`, `body`, `file`, `line`, `resolved` and `parent`. Use the comment `id` to answer in the\ncorrect thread. `parent` is `null` on the first comment of a thread, and holds that comment\'s id on\na reply. `resolved` tells you whether the thread is closed.\n\n`bb pr list` returns `state` (raw API value, e.g. `\"OPEN\"`), `draft` (bool), and `reviewers`, an\narray of `{name, uuid, state}` where `state` is `approved`, `changes_requested` or `pending`.\nThere is no `approvals` field.\n\nFind the pull request for the current branch:\n\n```bash\nbb pr list --json | jq --arg b \"$(git branch --show-current)\" \'.[] | select(.source == $b)\'\n```\n\n## Answer a review\n\n```bash\n# answer inside the thread you address\nbb pr comment 42 --reply-to 998877 --body \"Fixed in 1a2b3c4.\" --json\n\n# raise a new point on one line\nbb pr comment 42 -f src/auth.rs -l 88 --body \"This drops the error.\" --json\n\n# more than one paragraph\nprintf \'Refactored as suggested.\\n\\nThe parser is now its own module.\\n\' \\\n | bb pr comment 42 --body-stdin --json\n```\n\n`--line` needs `--file`. `--reply-to` accepts neither, because a reply inherits the location of its\nparent.\n\n## Report threads, do not close them\n\nAnswer the comments. Report what you answered. Let the user close the threads.\n\nNever resolve a thread on your own initiative. A resolved thread hides a reviewer\'s point, and only\nthe user can decide that the point is settled. This is the rule for approval and merge too.\n\nList the threads that are still open, root comments only:\n\n```bash\nbb pr view 42 --unresolved --json | jq \'.inline[] | select(.parent == null)\'\n```\n\nYou can recommend a thread to close. Wait for the answer, then resolve only the ids the user names:\n\n```bash\nbb pr resolve 42 998877 --yes --json # {resolved,pull_request}\nbb pr unresolve 42 998877 --json # reopen a thread\n```\n\n`bb pr resolve` asks a human to confirm, and fails when it has no terminal. `--yes` answers that\nprompt for you, so use it only for an id the user approved. Use one command for each thread. Do not\nput it in a loop.\n\nResolve the first comment of a thread \u{2014} the id whose `parent` is `null`. A reply id fails, and a\ngeneral comment fails: only inline threads carry a resolution.\n\nAsk the author to change the code, or withdraw that request:\n\n```bash\nbb pr request-changes 42 --json\nbb pr no-request-changes 42 --json\n```\n\n## Reviewers\n\n```bash\nbb pr reviewers 42 --json # list, same as `list`\nbb pr reviewers add 42 patrick,raigon --json # tag reviewers, comma-separated\nbb pr reviewers remove 42 raigon --json # untag a reviewer\n```\n\nNames match case-insensitively as a substring of display name or nickname, against the\nrepository\'s user list plus its default reviewers. An exact match wins over a longer substring\nmatch. Ambiguous or no match is an error, exit 1 \u{2014} the error lists the candidates when ambiguous.\nPass `{uuid}` in braces to skip name matching entirely; every error message suggests it.\n\nEvery name is resolved before any write, so one bad name in `add 42 a,b` writes nothing. Adding\nsomeone already tagged makes no write and exits 0. Removing someone not tagged is an error, exit\n1, with no write. Bitbucket rejects the PR\'s author as a reviewer (400, exit 1) \u{2014} that\'s the\nAPI\'s rule.\n\nApproving, merging and declining are not supported. Do not attempt them. Resolving a comment\nthread is supported, but only on the user\'s request \u{2014} see\n[Report threads, do not close them](#report-threads-do-not-close-them).\n\n## Open a pull request\n\n```bash\nbb pr create main --title \"Cache session lookups\" --json\nbb pr create main feat/cache --title \"...\" --description \"...\" --close-source-branch --json\nbb pr create main,develop --title \"...\" --json # one pull request per target\n```\n\nThe source branch defaults to the current checkout. The title defaults to\n`Merge <source> into <target>`. `bb` attaches the default reviewers of the repository, and removes\nyou from that list. Pass `--no-default-reviewers` to attach none. Do not pass `-i`, because it\nprompts.\n\n## Branches\n\n```bash\nbb branch list --json # newest commit first\nbb branch list -u alice -n feat/ --json # filter by author and by name\nbb branch list --limit 20 --json\n```\n\nBoth filters match a substring, and ignore case.\n\n## Command map\n\n| Command | Result |\n|---|---|\n| `bb pr list [target] [--state OPEN\\|MERGED\\|DECLINED\\|SUPERSEDED\\|DRAFT\\|ALL] [--reviewer] [--author] [--review-state] [--needs-my-review]` | `[{id,title,state,draft,author,source,destination,reviewers[],url}]` |\n| `bb pr view <id> [--unresolved] [--comments-only]` | `{pull_request,general[],inline[]}` |\n| `bb pr diff <id>` | plain diff; `--json` wraps it as `{id,diff}` |\n| `bb pr files <id>` | `[{status,path}]` |\n| `bb pr commits <id>` | `[{hash,summary}]` |\n| `bb pr comment <id> \u{2026}` | `{id,pull_request,url}` |\n| `bb pr resolve <id> <comment> --yes` | `{resolved,pull_request}`; only on the user\'s request |\n| `bb pr unresolve <id> <comment>` | `{unresolved,pull_request}` |\n| `bb pr reviewers <id>` / `list <id>` | `[{name,uuid,state}]` |\n| `bb pr reviewers add <id> <names>` / `remove <id> <names>` | `[{name,uuid,state}]` |\n| `bb pr create <target> [source] \u{2026}` | `[{id,target,url}]` |\n| `bb pr request-changes <id>` | `{requested_changes:<id>}` |\n| `bb pr no-request-changes <id>` | `{unrequested_changes:<id>}` |\n| `bb branch list \u{2026}` | `[{branch,user,updated}]` |\n| `bb auth status` | `{email,token,account}`, token redacted |\n| `bb browse --print [--pr <id>\\|--branches]` | `{url}` |\n\n`timestamp` and `updated` hold a relative time, for example `3 days ago`. For an exact time, read\nthe commit or the diff.\n\n## When a command fails\n\n- **Exit 2** \u{2014} no credentials. Ask the user to run `bb auth login`. Do not run it yourself, because\n it prompts for a token. In CI, set `BB_EMAIL` and `BB_TOKEN`.\n- **Exit 3** \u{2014} the pull request, the branch, the comment or the repository does not exist. Confirm\n the id, and confirm the repository with `bb auth status` and `-R`.\n- **A 403 message** \u{2014} the API token misses a scope. `pr list` and `pr view` need\n `read:pullrequest:bitbucket`. `pr comment`, `pr resolve`, `pr unresolve`, `pr create` and\n `pr request-changes` need `write:pullrequest:bitbucket`. `branch list` and `pr create` also need\n `read:repository:bitbucket`.\n- **`is a reply`, or `is not on the diff`** \u{2014} the id is not the first comment of an inline thread.\n Read `parent` from `bb pr view`, and pass the id that has none.\n- **`already resolved`** \u{2014} the thread is closed. Nothing to do.\n- **`no bitbucket.org remote found`**, or **`no git repository here`** \u{2014} `bb` cannot find the\n repository. Pass `-R workspace/repo`, or set `BB_REPO`.\n\nBitbucket Cloud removed app passwords on 2026-07-28. `bb` authenticates with an Atlassian account\nemail and an API token. Never suggest an app password.\n\n## Environment\n\n| Variable | Purpose |\n|---|---|\n| `BB_EMAIL`, `BB_TOKEN` | credentials for CI and other non-interactive use |\n| `BB_REPO` | default repository, the same as `-R` |\n| `NO_COLOR` | disable colour and spinners |\n\nInstall: `brew install biokraft/tap/bb`, or `cargo install bbcloud --locked`. Run `bb --help` and\n`bb <command> --help` for the full surface. Source and issues:\n<https://github.com/biokraft/bbcloud>.\n";Expand description
The skill text ships inside the binary, so every upgrade path — brew,
cargo, bb update — carries new content as an inherent consequence rather
than needing a separate sync. It also means the installed skill can never
describe a flag this binary lacks.