AgentSkillsCN

databricks

使用 Pest 4 PHP 框架测试应用程序。当您编写测试、创建单元测试或功能测试、添加断言、测试 Livewire 组件、进行浏览器测试、调试测试失败、处理数据集或进行模拟测试时,可启用此技能;或者当用户提到测试、规格、TDD、期望、断言、覆盖率,或需要验证功能是否正常运行时,可启用此技能。

SKILL.md
--- frontmatter
name: "databricks"
description: "Databricks CLI operations: auth, profiles, Unity Catalog, data exploration, jobs, pipelines, clusters, model serving, bundles and more. Contains up-to-date guidelines for all Databricks CLI tasks, useful for all Databricks-related tasks."
compatibility: Requires databricks CLI (>= 0.250.0)
metadata:
  version: "0.1.0"

Databricks

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

Product Skills

For specific products, use dedicated skills:

  • databricks-apps - Full-stack TypeScript app development and deployment

Prerequisites

  1. CLI installed: databricks --version

  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.

bash
# 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:

bash
# 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>

See Data Exploration for details.

Quick Reference

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

bash
# 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

ErrorSolution
cannot configure default credentialsUse --profile flag or authenticate first
PERMISSION_DENIEDCheck workspace/UC permissions
RESOURCE_DOES_NOT_EXISTVerify resource name/id and profile

Required Reading by Task

TaskREAD BEFORE proceeding
First time setupCLI Installation
Auth issues / new workspaceCLI Authentication
Exploring tables/schemasData Exploration
UC permissions/volumesUnity Catalog
Deploying jobs/pipelinesAsset Bundles

Reference Guides