К основному содержанию
скилл CX Codex

b2-cloud-storage — скилл для Claude Code: что делает и как установить

Скилл для управления хранилищем Backblaze B2. Проводит аудит файлов и помогает настраивать правила жизненного цикла прямо через консоль агента.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add backblaze-labs/claude-skill-b2-cloud-storage --skill b2-cloud-storage -a claude-code
Открыть на GitHub

Что делает b2-cloud-storage

Скилл связывает агента с хранилищем Backblaze B2 через утилиту b2 и скрипт scripts/storage_audit.py. Скрипт находит дубликаты по хэшу SHA1 и незавершённые загрузки больших файлов, после чего оценивает ежемесячный счёт.

Для работы требуются b2 CLI v4+ и Python 3.10+. Настройки проекта можно сохранить в .claude/b2-config.json, указав бакет по умолчанию, префикс путей и расположение файла учётных данных.

Ключи доступа агент не читает. Скиллу запрещено открывать ~/.b2_account_info и вызывать подкоманды b2 key или b2 account get. Удаление без предварительного флага --dry-run и явного подтверждения заблокировано.

Какие задачи решает

  • провести аудит хранилища и оценить расходы в бакете B2
  • найти дубликаты файлов по контрольной сумме SHA1
  • очистить скрытые маркеры и незавершённые загрузки
  • обновить правила жизненного цикла объектов в корзине

Примеры запросов агенту

  • Запусти scripts/storage_audit.py для бакета my-project-bucket и покажи оценку стоимости
  • Найди все старые версии файлов с префиксом data/models/ в B2
  • Выполни сухой прогон очистки устаревших данных в бакете logs

Как установить b2-cloud-storage

1Через Skills CLI (Vercel)

npx skills add backblaze-labs/claude-skill-b2-cloud-storage --skill b2-cloud-storage -a claude-code

2Вручную: положить файлы

~/.claude/skills/b2-cloud-storage/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/b2-cloud-storage/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о b2-cloud-storage

Как установить b2-cloud-storage в Claude Code?

Выполните в терминале команду npx skills add backblaze-labs/claude-skill-b2-cloud-storage --skill b2-cloud-storage -a claude-code.

Что делает скрипт storage_audit.py?

Он проверяет соотношение активного и тарифицируемого объёма, выявляет незавершённые загрузки, старые версии, маркеры скрытия и дубликаты по SHA1. В конце скрипт выводит примерную стоимость хранения за месяц.

Что требуется настроить перед первым запуском скилла?

На рабочей машине должны стоять b2 CLI v4+ и Python 3.10+. Авторизовать CLI нужно заранее в терминале или через переменные окружения B2_APPLICATION_KEY_ID и B2_APPLICATION_KEY.

Исходный текст

SKILL.md · MIT
---
name: b2-cloud-storage
description: Manage Backblaze B2 cloud storage. List files, audit usage, estimate cost, clean up stale data, review security posture, and manage lifecycle rules. Use when the user mentions B2, Backblaze, object storage buckets, or storage cleanup.
license: MIT
compatibility: Requires user-installed b2 CLI v4+ and Python 3.10+.
metadata:
  author: jdeleon
  version: "1.2.0"
allowed-tools: Bash(b2:*) Bash(python:*) Read Write Grep Glob
---

# B2 Cloud Storage Management

Manage Backblaze B2 cloud storage: list files, audit usage, estimate cost, clean up stale data, and review security posture.

## Security Rules (MANDATORY)

1. **Never** run `b2 account get`, `b2 account clear`, or any `b2 key *` subcommand — these expose or mutate credentials.
2. **Never** read `~/.b2_account_info` or any file matching `*b2_account_info*` — this is the B2 credential database (SQLite).
3. **Always** run `b2 rm --dry-run` before any real deletion; show the user what would be deleted and require an explicit "yes" before executing.
4. **Never** change a bucket to `allPublic` without first warning the user about the security implications and getting explicit confirmation.
5. **Default to read-only** — only perform writes or deletes when the user explicitly requests them.
6. **Never** store or write API keys, application keys, or account IDs to any file.
7. If the user pastes key values into the chat instead of the terminal, warn them immediately and recommend rotating the key. Never echo, store, or reference key values that appear in conversation.

## First-Use Flow

1. Check the B2 CLI is installed: `b2 version`. If missing, ask the user to install the CLI outside the agent, then rerun `b2 version` - see `references/setup.md` for detail.
2. Verify the CLI is authorized: `b2 ls`. If it fails with an auth error, walk the user through `references/setup.md`.
3. Check for a per-project config at `.claude/b2-config.json` in the project root. If missing, ask the user for bucket + prefix and create one.

### Interactive auth note

`b2 account authorize` (no args) reads keys from an interactive prompt, which agents cannot drive. The user has two options:

- Run it themselves in the terminal — in Claude Code they can type `!b2 account authorize` to execute directly in the session.
- Pass the keyID and applicationKey as positional args: `b2 account authorize <keyID> <appKey>` (keys will appear in shell history — less safe).
- Or set `B2_APPLICATION_KEY_ID` and `B2_APPLICATION_KEY` env vars before running B2 commands (recommended for scripts and CI).

## Project-Level Config

Per-project config at `.claude/b2-config.json`:

```json
{
  "bucket": "my-project-bucket",
  "prefix": "",
  "accountInfoPath": "~/.b2_account_info"
}
```

| Field | Purpose |
|-------|---------|
| `bucket` | Default bucket name for this project |
| `prefix` | Optional prefix to scope all operations (e.g. `data/models/`) |
| `accountInfoPath` | Path to B2 credential file — allows different keys per project |

If `accountInfoPath` differs from the default, prepend `B2_ACCOUNT_INFO=<path>` when running b2 commands. This file stores bucket names and paths only — never API keys.

## Common Actions

### List & search

```bash
b2 ls b2://<bucket>                    # top-level
b2 ls -r b2://<bucket>                 # recursive
b2 ls -r --json b2://<bucket>          # JSON for scripting
b2 ls --versions -r --json b2://<b>    # include old versions + hide markers
b2 ls b2://<bucket>/<prefix>           # prefix-scoped
```

### Inspect file

```bash
b2 file info b2id://<fileId>
```

### Storage audit (usage, stale, large, duplicates, cost)

```bash
python scripts/storage_audit.py <bucket>
python scripts/storage_audit.py <bucket> --json
python scripts/storage_audit.py <bucket> --stale-days 180 --large-mb 500 --prefix-depth 2
```

Reports live vs. billable storage, unfinished large files, old versions, hide markers, SHA1-based duplicates, and an estimated monthly cost.

### Cleanup (destructive)

See `references/cleanup-playbook.md`. Never skip the dry-run step.

### Lifecycle rules

```bash
b2 bucket get <bucket>
b2 bucket update --lifecycle-rules '<json>' <bucket> allPrivate
```

Lifecycle rule JSON format is in `references/b2-cli-reference.md`.

### Security review

See `references/security-review.md` for the full checklist (bucket type, SSE, CORS, object lock, replication, lifecycle coverage).

## References

- `references/setup.md` — first-use setup walk-through (install, app-key creation, authorization)
- `references/cleanup-playbook.md` — safe deletion procedure with dry-run
- `references/security-review.md` — per-bucket security audit checklist
- `references/b2-cli-reference.md` — CLI v4 command reference

© jdeleon · MIT · backblaze-labs/claude-skill-b2-cloud-storage

Похожие скиллы

Все скиллы по теме «Облака: AWS, Azure, GCP» →
caveman-manage JuliusBrussee Проверяет состояние и результаты экспериментов Caveman Cloud, предлагает одно действие или блокирует рискованный запрос. Нужен перед запуском, одобрением, отменой или откатом. CX Codex +1 104 200установок workers-best-practices cloudflare Скилл настраивает ИИ на проверку продакшен-кода Cloudflare Workers по актуальным правилам рантайма, типам Wrangler и антипаттернам. CX Codex +1 126 100установок cloudflare-email-service cloudflare Скилл для работы с Cloudflare Email Sending и Email Routing: помогает настроить отправку и приём писем в Workers. CX Codex +1 102 300установок firebase-basics официальный google Скилл настраивает Firebase CLI, помогает войти в аккаунт, создать или выбрать проект и скачать конфигурацию Android или iOS. CX Codex 14 100установок cloudflare-one cloudflare Помогает агенту проектировать, настраивать и разбирать развёртывания Cloudflare One Zero Trust и SASE. Пригодится, когда нужно спланировать Access, Gateway или туннели без похода в документацию вручную. CX Codex +1 93 100установок cloudflare-one-migrations cloudflare Помогает спланировать переход с VPN, SWG или SASE на Cloudflare One: сопоставляет политики, находит пробелы и расписывает порядок выката. CX Codex +1 89 500установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой