bb-pr-comment-investigation

star 0

Use the `bb` Bitbucket CLI to authenticate, discover workspaces/repos, inspect pull requests, list comments, and prepare reply actions. Trigger this skill when the task involves navigating Bitbucket Cloud PRs/comments from the CLI, especially when repo or PR context must be discovered first.

SimonKaran13 By SimonKaran13 schedule Updated 2/24/2026

name: bb-pr-comment-investigation description: Use the bb Bitbucket CLI to authenticate, discover workspaces/repos, inspect pull requests, list comments, and prepare reply actions. Trigger this skill when the task involves navigating Bitbucket Cloud PRs/comments from the CLI, especially when repo or PR context must be discovered first.

BB CLI PR And Comment Workflow

Overview

Use this skill to operate the bb CLI end-to-end: auth, workspace/repo discovery, PR discovery, comment retrieval, and optional reply preparation.

CLI Setup

Build the binary before running behavior checks:

go build -o bb ./cmd/bb

Install globally for the current user and update after local changes:

# one-time PATH setup
export PATH="$HOME/.local/bin:$PATH"

# install from this repo
make install

# after code changes
make update

Verify global binary resolution:

which bb
bb version

Authenticate either with environment variables (non-persistent) or login profile (persistent):

# Non-persistent auth
export BITBUCKET_EMAIL='you@example.com'
export BITBUCKET_TOKEN='your_api_token'

# Persistent auth (stores token in keychain)
./bb auth login --email you@example.com

Check auth status:

./bb auth status

Command Map

  • ./bb workspace list : list accessible workspaces
  • ./bb repo list [workspace] : list repositories
  • ./bb repo use <workspace> <repo> : set default repo context
  • ./bb pr list : list pull requests for a repo
  • ./bb pr comments <pr-id> : list comments (includes replies)
  • ./bb pr reply <pr-id> <comment-id> --body "..." : post reply

Use --json for deterministic filtering and scripting.

Context Resolution Rules

For repo-scoped commands (pr list, pr comments, pr reply):

  1. --workspace and --repo flags
  2. Saved defaults from repo use or auth login defaults
  3. Bitbucket git remote origin inference

Prefer explicit flags during investigations to avoid ambiguity.

Discovery Workflow

  1. Discover workspace:
./bb workspace list --limit 100
  1. Discover repos in workspace:
./bb repo list <workspace> --limit 1000
  1. Confirm a specific repo slug exists:
./bb repo list <workspace> --limit 1000 --json \
  | jq -r '.[] | select(.slug == "<repo>") | .full_name'
  1. Optionally set default context:
./bb repo use <workspace> <repo>

PR And Comment Workflow

  1. List PRs with broad states:
./bb pr list --workspace <workspace> --repo <repo> \
  --state OPEN --state MERGED --state DECLINED --state SUPERSEDED \
  --limit 200 --json
  1. Filter PRs by title keyword (example):
./bb pr list --workspace <workspace> --repo <repo> \
  --state OPEN --state MERGED --state DECLINED --state SUPERSEDED \
  --limit 200 --json \
  | jq -c '.[] | select((.title // "") | test("action indexer"; "i")) | {id, state, updated_on, title}'
  1. Retrieve comments for a target PR:
./bb pr comments <pr_id> --workspace <workspace> --repo <repo> --limit 200 --json
  1. Keep comment threading context:
  • Root comments have parent = null
  • Replies have parent.id set

Optional Time Window Filtering

Use this pattern for any time window (example: last 2 days in UTC):

CUTOFF=$(date -u -v-2d +"%Y-%m-%dT%H:%M:%SZ")
./bb pr comments <pr_id> --workspace <workspace> --repo <repo> --limit 200 --json \
  | jq -c --arg cutoff "$CUTOFF" '.[] | select(.created_on >= $cutoff) | {id, parent:(.parent.id // null), author:.user.display_name, created_on, body:.content.raw}'

Treat this as one filter strategy, not the default workflow.

Reply Workflow (Write Action)

Validate target PR/comment with read commands first, then reply:

./bb pr reply <pr_id> <comment_id> --workspace <workspace> --repo <repo> --body "Thanks, updated."

For scripted replies, pass body by stdin:

echo "Thanks, updated." | ./bb pr reply <pr_id> <comment_id> --workspace <workspace> --repo <repo>

Investigation Practices

  • Start read-only (workspace list, repo list, pr list, pr comments) before any reply.
  • Use --json + jq for filtering, counting, and exporting.
  • Log exact workspace/repo/PR IDs in outputs to avoid targeting mistakes.
Install via CLI
npx skills add https://github.com/SimonKaran13/simple-bitbucket-cloud-cli --skill bb-pr-comment-investigation
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator
SimonKaran13
SimonKaran13 Explore all skills →