claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdatabase

🧱databricks-core

プラグイン
databricks

説明

Databricks CLIの操作、および全てのDatabricksに関する作業の親スキル/エントリーポイントスキルです。 認証、プロファイルの選択、データ探索、バンドル、そしてGenieによる自然言語データQ&Aを担当します。 次のような場合に使用: Databricksに関する任意のタスク(CLI、認証、プロファイル、カタログ/テーブルの探索など)において、最初にこのスキルをロードし、その後に対応するプロダクトスキルをロードしてください。 DatabricksのCLIタスクに関する最新のガイドラインを含みます。

原文を表示

Databricks CLI operations and the parent/entry-point skill for all Databricks work: authentication, profile selection, data exploration, bundles, and Genie natural-language data Q&A. Load this first for any Databricks task (CLI, auth, profiles, exploring catalogs/tables), then load the matching product skill. Contains up-to-date guidelines for Databricks-related CLI tasks.

ユースケース

  • Databricksに関する任意のタスクを実行するとき
  • CLI操作を行うとき
  • 認証とプロファイル選択が必要なとき
  • データ探索を行うとき
  • 自然言語でデータQ&Aを行うとき

本文(日本語訳)

Databricks

Databricks CLI、認証、データ探索のためのコアスキル。

プロダクトスキル

特定のプロダクトには、専用スキルを使用してください:

  • databricks-jobs - Lakeflow Jobs の開発とデプロイ
  • databricks-pipelines - Lakeflow Spark Declarative Pipelines(バッチおよびストリーミングデータパイプライン)
  • databricks-apps - フルスタック TypeScript アプリの開発とデプロイ
  • databricks-lakebase - Lakebase Postgres Autoscaling プロジェクト管理
  • databricks-model-serving - Model Serving エンドポイントの管理と推論

前提条件

  1. CLI のインストール: databricks --version を実行して確認してください。

    • CLI が存在しない、または古いバージョン(v0.292.0 未満)の場合: 処理を中断してください。CLI が存在しない状態で作業を続行したり回避策を講じたりしないでください。
    • CLI Installation 参照ファイルを読み、手順に従ってユーザーをインストール作業へ案内してください。
    • 注意: サンドボックス環境(Cursor IDE、コンテナ)では、インストールコマンドがワークスペース外に書き込みを行うため、ブロックされる場合があります。インストールコマンドをユーザーに提示し、ユーザー自身のターミナルで実行するよう依頼してください。
    • 例外: CLI のインストールがブロックされている場合(サンドボックスコンテナ、制限された環境)、シェルに DATABRICKS_HOST および DATABRICKS_TOKEN 環境変数が存在する場合に限り、直接 REST API 呼び出しへフォールバックするかどうかユーザーに確認してください。Databricks REST API ドキュメント を参照してください。
  2. 認証済みであること: databricks auth profiles

プロファイル選択 — 重要

プロファイルを自動選択しないでください。

  1. プロファイルの一覧表示: databricks auth profiles
  2. ワークスペース URL とともに全プロファイルをユーザーに提示する
  3. ユーザーに選択させる(1つしか存在しない場合でも)
  4. 必要に応じて新規プロファイルの作成を提案する

Claude Code — 重要

各 Bash コマンドは 独立したシェルセッション 上で実行されます。

# 有効: --profile フラグを使用する
databricks apps list --profile my-workspace

# 有効: && でチェーンする
export DATABRICKS_CONFIG_PROFILE=my-workspace && databricks apps list

# 無効: コマンドを別々に実行する
export DATABRICKS_CONFIG_PROFILE=my-workspace
databricks apps list  # プロファイルが設定されていない!

データ探索 — AI ツールを使用する

カタログ・スキーマ・テーブルを手動で参照する代わりに、以下を使用してください:

# テーブル構造の確認(カラム、型、サンプルデータ、統計情報)
databricks experimental aitools tools discover-schema catalog.schema.table --profile <PROFILE>

# アドホック SQL クエリの実行
databricks experimental aitools tools query "SELECT * FROM table LIMIT 10" --profile <PROFILE>

# デフォルトウェアハウスの確認
databricks experimental aitools tools get-default-warehouse --profile <PROFILE>

名前はリテラルです。 カタログ・スキーマ・テーブル名は与えられた通りに使用し、 ハイフンをアンダースコアに変換するなど正規化しないでください。 SQL では、特殊文字を含む名前の各部分をバッククォートで囲んでください (例: `my-catalog`.schema.table)。クォートされていないハイフンはパースエラーの原因となります。

詳細は Data Exploration を参照してください。

クイックリファレンス

⚠️ 重要: コマンドによってはフラグではなく位置引数を使用するものがあります

# 現在のユーザー
databricks current-user me --profile <PROFILE>

# リソース一覧の表示
databricks apps list --profile <PROFILE>
databricks jobs list --profile <PROFILE>
databricks clusters list --profile <PROFILE>
databricks warehouses list --profile <PROFILE>
databricks pipelines list --profile <PROFILE>
databricks serving-endpoints list --profile <PROFILE>

# ⚠️ Unity Catalog — 位置引数を使用(フラグではない!)
databricks catalogs list --profile <PROFILE>

# ✅ 正しい: 位置引数を使用
databricks schemas list <CATALOG> --profile <PROFILE>
databricks tables list <CATALOG> <SCHEMA> --profile <PROFILE>
databricks tables get <CATALOG>.<SCHEMA>.<TABLE> --profile <PROFILE>

# ❌ 誤り: 以下のフラグ・コマンドは存在しない
# databricks schemas list --catalog-name <CATALOG>    ← 失敗する
# databricks tables list --catalog <CATALOG>           ← 失敗する
# databricks sql-warehouses list                       ← 存在しない。`warehouses list` を使用すること
# databricks execute-statement                         ← 存在しない。`experimental aitools tools query` を使用すること
# databricks sql execute                               ← 存在しない。`experimental aitools tools query` を使用すること

# 不明な場合はヘルプを確認:
# databricks schemas list --help

# 詳細の取得
databricks apps get <NAME> --profile <PROFILE>
databricks jobs get --job-id <ID> --profile <PROFILE>
databricks clusters get --cluster-id <ID> --profile <PROFILE>

# バンドル
databricks bundle init --profile <PROFILE>
databricks bundle validate --profile <PROFILE>
databricks bundle deploy -t <TARGET> --profile <PROFILE>
databricks bundle run <RESOURCE> -t <TARGET> --profile <PROFILE>

トラブルシューティング

エラー 解決策
cannot configure default credentials --profile フラグを使用するか、先に認証を行ってください
configuration does not support OAuth tokens このコマンドには OAuth が必要です(例: databricks apps logs)。databricks auth login --host <URL> --profile <PROFILE> で再認証してください。CLI Authentication を参照してください。
PERMISSION_DENIED ワークスペースおよび Unity Catalog の権限を確認してください
RESOURCE_DOES_NOT_EXIST リソース名・ID およびプロファイルを確認してください

タスク別の必読ガイド

タスク 作業前に必ず読むこと
初回セットアップ CLI Installation
認証の問題・新規ワークスペースの追加 CLI Authentication
テーブル・スキーマの探索 Data Exploration
Jobs・Pipelines のデプロイ /databricks-dabs を使用すること

リファレンスガイド

原文(English)を表示

Databricks

Core skill for Databricks CLI, authentication, and data exploration.

Product Skills

For specific products, use dedicated skills:

  • databricks-jobs - Lakeflow Jobs development and deployment
  • databricks-pipelines - Lakeflow Spark Declarative Pipelines (batch and streaming data pipelines)
  • databricks-apps - Full-stack TypeScript app development and deployment
  • databricks-lakebase - Lakebase Postgres Autoscaling project management
  • databricks-model-serving - Model Serving endpoint management and inference

Prerequisites

  1. CLI installed: Run databricks --version to check.

    • If the CLI is missing or outdated (< v0.292.0): STOP. Do not proceed or work around a missing CLI.
    • Read the CLI Installation reference file and follow the instructions to guide the user through installation.
    • Note: In sandboxed environments (Cursor IDE, containers), install commands write outside the workspace and may be blocked. Present the install command to the user and ask them to run it in their own terminal.
    • Exception: If CLI installation is blocked (sandboxed containers, restricted environments), ask the user whether to fall back to direct REST API calls using DATABRICKS_HOST and DATABRICKS_TOKEN environment variables if present in the shell. See the Databricks REST API docs.
  2. Authenticated: databricks auth profiles

Profile Selection - CRITICAL

NEVER auto-select a profile.

  1. List profiles: databricks auth profiles
  2. Present ALL profiles to user with workspace URLs
  3. Let user choose (even if only one exists)
  4. Offer to create new profile if needed

Claude Code - IMPORTANT

Each Bash command runs in a separate shell session.

# WORKS: --profile flag
databricks apps list --profile my-workspace

# WORKS: chained with &&
export DATABRICKS_CONFIG_PROFILE=my-workspace && databricks apps list

# DOES NOT WORK: separate commands
export DATABRICKS_CONFIG_PROFILE=my-workspace
databricks apps list  # profile not set!

Data Exploration — Use AI Tools

Use these instead of manually navigating catalogs/schemas/tables:

# discover table structure (columns, types, sample data, stats)
databricks experimental aitools tools discover-schema catalog.schema.table --profile <PROFILE>

# run ad-hoc SQL queries
databricks experimental aitools tools query "SELECT * FROM table LIMIT 10" --profile <PROFILE>

# find the default warehouse
databricks experimental aitools tools get-default-warehouse --profile <PROFILE>

Names are literal. Use catalog/schema/table names exactly as given — never change a hyphen to an underscore or otherwise normalize them. In SQL, backtick-quote any name part with special characters (e.g. `my-catalog`.schema.table); unquoted hyphens cause a parse error.

See Data Exploration for details.

Quick Reference

⚠️ CRITICAL: Some commands use positional arguments, not flags

# current user
databricks current-user me --profile <PROFILE>

# list resources
databricks apps list --profile <PROFILE>
databricks jobs list --profile <PROFILE>
databricks clusters list --profile <PROFILE>
databricks warehouses list --profile <PROFILE>
databricks pipelines list --profile <PROFILE>
databricks serving-endpoints list --profile <PROFILE>

# ⚠️ Unity Catalog — POSITIONAL arguments (NOT flags!)
databricks catalogs list --profile <PROFILE>

# ✅ CORRECT: positional args
databricks schemas list <CATALOG> --profile <PROFILE>
databricks tables list <CATALOG> <SCHEMA> --profile <PROFILE>
databricks tables get <CATALOG>.<SCHEMA>.<TABLE> --profile <PROFILE>

# ❌ WRONG: these flags/commands DON'T EXIST
# databricks schemas list --catalog-name <CATALOG>    ← WILL FAIL
# databricks tables list --catalog <CATALOG>           ← WILL FAIL
# databricks sql-warehouses list                       ← doesn't exist, use `warehouses list`
# databricks execute-statement                         ← doesn't exist, use `experimental aitools tools query`
# databricks sql execute                               ← doesn't exist, use `experimental aitools tools query`

# When in doubt, check help:
# databricks schemas list --help

# get details
databricks apps get <NAME> --profile <PROFILE>
databricks jobs get --job-id <ID> --profile <PROFILE>
databricks clusters get --cluster-id <ID> --profile <PROFILE>

# bundles
databricks bundle init --profile <PROFILE>
databricks bundle validate --profile <PROFILE>
databricks bundle deploy -t <TARGET> --profile <PROFILE>
databricks bundle run <RESOURCE> -t <TARGET> --profile <PROFILE>

Troubleshooting

Error Solution
cannot configure default credentials Use --profile flag or authenticate first
configuration does not support OAuth tokens The command requires OAuth (e.g., databricks apps logs). Re-authenticate with databricks auth login --host <URL> --profile <PROFILE>. See CLI Authentication.
PERMISSION_DENIED Check workspace/UC permissions
RESOURCE_DOES_NOT_EXIST Verify resource name/id and profile

Required Reading by Task

Task READ BEFORE proceeding
First time setup CLI Installation
Auth issues / new workspace CLI Authentication
Exploring tables/schemas Data Exploration
Deploying jobs/pipelines Use /databricks-dabs

Reference Guides

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。