← 返回 Skills 市场
zan768616253

Bitbucket Toolbox

作者 zan768616253 · GitHub ↗ · v1.1.2 · MIT-0
cross-platform ✓ 安全检测通过
161
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install bitbucket-toolbox
功能描述
Bitbucket Cloud wrapper optimized for Pull Request Code Analysis. Enables the agent to securely review Pull Requests, split large diffs by file, review code...
使用说明 (SKILL.md)

Bitbucket PR Code Reviewer Skill

This skill's primary function is automated code review. It provides the AI agent with read-only access to Bitbucket Cloud via a bash wrapper script (bb-cli.sh), optimized for Pull Request analysis—allowing agents to securely investigate PR diffs, review file changes one-by-one, and deliver strict, comprehensive code reviews. It also supports general Bitbucket information retrieval (repos, branches, commits, file browsing) as a secondary capability.

⚠️ Critical Rules for the Agent

  1. Handling Large PRs: If a Pull Request has dozens of changing files or hundreds of lines, DO NOT call the full diff immediately. ALWAYS call diffstat first. Then, use diff \x3CREPO> \x3CPR_ID> \x3CFILEPATH> to safely review the PR one file at a time!
  2. Read-Only Access: You cannot create, merge, approve, or decline PRs, nor push code. Do not attempt any write operations.
  3. Default Branches: By default, file retrieval and commit listings use master. Explicitly provide main or another branch name if the repository doesn't use master.

Code Review Standards

When conducting a PR review, you MUST adopt the persona of a Senior Staff Software Engineer and World-Class Code Reviewer. Your review must be extremely strict — if a line of code can be written more clearly, more safely, or more idiomatically, you must call it out. Be exhaustive — do not stop after finding a few obvious issues. Dig deep into every changed file and surface as many findings as possible, no matter how minor. The goal is to leave no stone unturned.

Language-Agnostic Approach

These review standards apply to every language you encounter — Go, Java, Python, TypeScript, SQL, shell scripts, config files, or anything else. Do not lower the bar for any language. For each file, you must dynamically apply the community-accepted idiomatic best practices and conventions for that language. Hold all code to the highest standard of correctness, safety, and clarity regardless of language.

Two-Pass Review Methodology

You MUST perform two review passes on every PR:

Pass 1 — Architecture & Design (Holistic)

Before diving into individual lines, review the full set of changes as a whole:

  1. Read the diffstat to understand the scope and shape of the PR.
  2. Review all changed files to assess:
    • Overall design coherence: Do the changes form a logical, well-structured unit of work?
    • Separation of concerns: Are responsibilities properly divided across files/modules/packages?
    • Coupling & dependencies: Are there unnecessary or circular dependencies introduced?
    • Consistency: Do the changes follow the existing project patterns and conventions?
    • Missing pieces: Are there obvious gaps — e.g., missing tests, missing error handling, missing docs for public APIs?
    • Scope creep: Does the PR try to do too many things at once?

Pass 2 — Line-by-Line Deep Dive (Strict)

For each changed file, evaluate strictly against these six criteria:

# Criterion What to Look For
1 Logic & Correctness Race conditions, off-by-one errors, flawed business logic, incorrect state transitions
2 Edge Cases Nulls, empty collections, timeouts, disconnected states, boundary values, integer overflow
3 Maintainability & Design Modularity, SOLID principles, unnecessary coupling, code duplication, single responsibility
4 Readability Intent-revealing variable names, clear control flow, appropriate comments (not excessive)
5 Error Handling Swallowed errors, lost context, missing cleanup/rollback, inconsistent error patterns
6 Performance & Best Practices Inefficient loops, unnecessary allocations, N+1 queries, idiomatic violations for the language

Output Classification

Every finding MUST be classified as one of:

  • 🔴 Critical Issue: Must-fix logic bugs, safety issues, data loss risks, security vulnerabilities, or race conditions.
  • 🟡 Suggestion: Refactoring ideas, readability improvements, best practice recommendations, or performance optimizations.

Setup & Configuration

To use this skill, ensure the following environment variables are present in your workspace:

  • BITBUCKET_API_TOKEN — A strictly scoped token with Repositories: Read and Pull requests: Read only.
  • BITBUCKET_WORKSPACE — The workspace slug from the Bitbucket URL (e.g., dbvisitsoftware).

Note: The script is located at {baseDir}/bb-cli.sh. Ensure it has execute permissions (chmod +x {baseDir}/bb-cli.sh). {baseDir} resolves to the directory containing this SKILL.md file.


Available Commands

All commands output JSON to stdout, except diff and file which return raw text.

Pull Requests (Primary Focus)

List pull requests

{baseDir}/bb-cli.sh prs \x3CREPO_SLUG> [STATE]

Options for STATE: OPEN (default), MERGED, DECLINED Returns: { total, pullrequests: [...] }

Get PR details

{baseDir}/bb-cli.sh pr \x3CREPO_SLUG> \x3CPR_ID>

Returns: PR metadata including description, reviewers, source/destination branches, etc.

Get PR comments (contains both general and inline comments)

{baseDir}/bb-cli.sh comments \x3CREPO_SLUG> \x3CPR_ID>

Returns: { count, comments: [{ id, author, content, inline:{path, from, to}, created }] }

List commits in a PR

{baseDir}/bb-cli.sh pr-commits \x3CREPO_SLUG> \x3CPR_ID>

Returns: [{ hash, message, author, date }]

Code Changes & Diffs

Get PR diffstat (Summary of changed files) - ALWAYS RUN THIS FIRST

{baseDir}/bb-cli.sh diffstat \x3CREPO_SLUG> \x3CPR_ID>

Returns: { files_changed, total_added, total_removed, files: [{ path, status, lines_added, lines_removed }] }

Get PR diff (Full or Specific File)

{baseDir}/bb-cli.sh diff \x3CREPO_SLUG> \x3CPR_ID> [FILEPATH]

Tip: For large PRs, grab the file paths from diffstat and pass them in as the third argument to fetch the diffs for individual files safely. Returns: Raw unified diff text.

Repositories, Branches & Source Code

List all repositories

{baseDir}/bb-cli.sh repos

Returns: [{ slug, name, full_name, language, updated, is_private, url }]

List branches in a repository (can optionally filter by name)

{baseDir}/bb-cli.sh branches \x3CREPO_SLUG> [FILTER]

Returns: [{ name, hash, date, author }]

List recent commits on a branch

{baseDir}/bb-cli.sh commits \x3CREPO_SLUG> [BRANCH]

Note: Defaults to master. Returns list of commit hashes and messages.

Read file contents from source tree

{baseDir}/bb-cli.sh file \x3CREPO_SLUG> \x3CFILEPATH> [BRANCH_OR_REVISION]

Note: Third argument defaults to master. Returns raw file contents.

List directory contents

{baseDir}/bb-cli.sh ls \x3CREPO_SLUG> [PATH] [BRANCH_OR_REVISION]

Note: Third argument defaults to master. Returns: [{ path, type, size }]


Automated PR Review Export

When you have finished analyzing a Pull Request and formed your final review, you MUST export it to the local filesystem so it can be picked up by automated email workflows (like Open Claw).

Export Instructions:

  1. Target Path: Always save your review to {baseDir}/reviews/\x3CREPO_SLUG>-\x3CPR_ID>.md. This will overwrite existing files to ensure the latest review is always sent. Ensure the reviews/ directory is created if it does not exist.
  2. Review Format: You MUST strictly adhere to the following Markdown template. Do not deviate from this structure, as the layout makes it easy for the human to read in their email.
# PR Review: {REPO_SLUG} #{PR_ID}

## Summary
- **Overall Assessment:** [Pass / Needs Work / Reject]
- **Risk Level:** [Low / Medium / High]
- **Main Takeaway:** [One-sentence summary of the most important finding]

## Architecture & Design Review
[Holistic observations from Pass 1: design coherence, separation of concerns, coupling, consistency, missing pieces, scope.]

## Detailed Comments

### File: `[filepath]`

#### [Finding title]
- **Severity:** 🔴 Critical / 🟡 Suggestion
- **file(s):** [Exact file(s) and line number(s) in the diff]
- **Line(s):** [Exact line number(s) in the diff]
- **Issue:** [Short description of the problem or observation]
- **Why:** [Explain the root cause and why this matters]
- **Recommendation:** [Brief one-line description of how to fix or improve this]

*(Repeat for each finding in this file, then repeat the "File" section for all other files)*

External Endpoints

This skill makes HTTPS GET requests to the following endpoint only:

Endpoint Data Sent Purpose
https://api.bitbucket.org/2.0/* Authorization: Bearer \x3Ctoken> header Read repository data, PR metadata, diffs, comments, and file contents

No data is POST-ed, PUT, or DELETE-d. The token is sent exclusively via the Authorization header over HTTPS.


Security & Privacy

  • Read-only access: This skill cannot modify any data in Bitbucket. It uses only GET requests.
  • Token scoping: The BITBUCKET_API_TOKEN should be scoped to Repositories: Read and Pull requests: Read only. Do not use tokens with write permissions.
  • Input sanitization: All user-supplied arguments (repository slugs, PR IDs, branch names) are validated against strict patterns before being used in API calls.
  • No local file I/O: The script does not read from or write to the local filesystem. All output goes to stdout/stderr.
  • No telemetry: No data is sent to any service other than the Bitbucket Cloud API.

Trust Statement

This skill is open-source and available for inspection at github.com/zan768616253/skill-bitbucket-toolbox. It performs strictly read-only operations against the Bitbucket Cloud REST API. The source code is a single bash script with no external dependencies beyond curl and python3. All API interactions use HTTPS and Bearer token authentication. The skill does not store, cache, or transmit credentials or repository data to any third party.

安全使用建议
This skill appears to do exactly what it says: read-only Bitbucket PR and repo browsing via a bundled bash script. Before installing, ensure the BITBUCKET_API_TOKEN you provide is scoped to read-only access for Repositories and Pull Requests and stored securely (e.g., secrets manager). Review the bundled bb-cli.sh to confirm it will run in your environment (it uses curl and python3 and only calls https://api.bitbucket.org). Also fix the minor metadata gap (no primary credential listed) if you rely on tooling that expects primaryEnv to be set.
功能分析
Type: OpenClaw Skill Name: bitbucket-toolbox Version: 1.1.2 The bitbucket-toolbox skill is a well-structured tool designed for automated Pull Request reviews on Bitbucket Cloud. The core component, bb-cli.sh, is a read-only wrapper for the Bitbucket REST API that includes robust input validation for repository slugs, PR IDs, and branch names. The SKILL.md instructions provide a detailed framework for the AI agent to perform comprehensive code reviews and export them to a local directory, which is consistent with the stated purpose. No indicators of data exfiltration, malicious execution, or harmful prompt injection were identified.
能力评估
Purpose & Capability
Name/description (Bitbucket PR review) match the declared requirements: only curl, python3, BITBUCKET_API_TOKEN, and BITBUCKET_WORKSPACE are required. All required items are appropriate for a Bitbucket read-only wrapper.
Instruction Scope
SKILL.md explicitly limits the agent to read-only operations and prescribes using diffstat before fetching large diffs. The included script implements only HTTPS GET requests to the Bitbucket API and performs input validation; instructions do not request irrelevant system data or broad access.
Install Mechanism
No remote install or downloads are performed (instruction-only skill with an included bash script). No third-party URLs, package installs, or archive extraction are present.
Credentials
The skill requests only two environment variables (BITBUCKET_API_TOKEN and BITBUCKET_WORKSPACE), which are proportional. Minor inconsistency: registry metadata lists no primary credential while the script requires BITBUCKET_API_TOKEN — this is a documentation/metadata gap rather than a functional risk.
Persistence & Privilege
Skill does not request permanent/always-on presence (always:false) and does not attempt to modify other skills or system configuration. It operates only when invoked.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bitbucket-toolbox
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bitbucket-toolbox 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.2
bitbucket-toolbox 1.1.2 - Expanded the PR review guidelines to require exhaustive, in-depth analysis for every changed file, encouraging reviewers to dig deep and surface as many findings as possible. - Clarified the expectation to be thorough and not stop at the first few obvious issues, emphasizing a higher bar for comprehensive code review. - No changes to commands or functionality; documentation update only.
v1.1.1
bitbucket-toolbox 1.1.1 - Documentation updated in SKILL.md. - No code or functionality changes; version bump and doc refresh only.
v1.1.0
Version 1.1.0 — Major update focused on enforcing code review standards for PR analysis. - Added detailed instructions requiring the reviewer persona to act as a strict, senior-level code reviewer, enforcing the highest community standards for all languages. - Introduced a mandated two-pass review process: (1) holistic architecture/design pass, (2) strict line-by-line evaluation with clear criteria. - Defined output classification standards for code review findings (Critical Issue and Suggestion). - Clarified the primary and secondary functions of the skill. - No command/technical interface changes—usage instructions for Bitbucket API remain the same.
v1.0.0
Initial release of bitbucket-toolbox, a Bitbucket Cloud read-only wrapper focused on Pull Request code analysis: - Provides secure, read-only access to Bitbucket Cloud for Pull Request review and code structure exploration. - Includes commands to review PRs, analyze diffs (with file-by-file inspection for large changes), view comments, browse repositories, branches, and directory listings. - Optimized to prevent context overflows by recommending diffstat-first workflow and incremental diff processing. - Operates via a single bash script (`bb-cli.sh`), requiring only `curl` and `python3`. - Enforces strict security: only GET requests, no write operations, input validation, and no data storage or telemetry. - Suitable for automated code reviews and debugging of Bitbucket PRs.
元数据
Slug bitbucket-toolbox
版本 1.1.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Bitbucket Toolbox 是什么?

Bitbucket Cloud wrapper optimized for Pull Request Code Analysis. Enables the agent to securely review Pull Requests, split large diffs by file, review code... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 161 次。

如何安装 Bitbucket Toolbox?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bitbucket-toolbox」即可一键安装,无需额外配置。

Bitbucket Toolbox 是免费的吗?

是的,Bitbucket Toolbox 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Bitbucket Toolbox 支持哪些平台?

Bitbucket Toolbox 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Bitbucket Toolbox?

由 zan768616253(@zan768616253)开发并维护,当前版本 v1.1.2。

💬 留言讨论