Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ AI-Driven Development (vibe coding) on Databricks just got a whole lot better. T
| [**Visual Builder App**](#visual-builder-app) | Web-based UI for Databricks development | `databricks-builder-app/` |
| [**Core Library**](#core-library) | Building custom integrations (LangChain, OpenAI, etc.) | `pip install` |
| [**Skills Only**](databricks-skills/) | Provide Databricks patterns and best practices (without MCP functions) | Install skills |
| [**Genie Code Skills**](databricks-skills/install_skills_to_genie_code.sh) | Install Databricks skills for Genie Code to reference | [Genie Code skills (install)](#genie-code-skills) |
| [**Genie Code Skills**](databricks-skills/install_skills.sh) | Install skills into your workspace for Genie Code (`--install-to-genie`) | [Genie Code skills (install)](#genie-code-skills) |
| [**MCP Tools Only**](databricks-mcp-server/) | Just executable actions (no guidance) | Register MCP server |
---

Expand Down Expand Up @@ -160,23 +160,32 @@ Works with LangChain, OpenAI Agents SDK, or any Python framework. See [databrick

---
## Genie Code Skills

Will install and deploy all available skills to your personal skills directory for all Genie Code sessions to reference while planning/building anything directly in the UI. No post-install steps as workspace is automatically configured during install process for Genie Code to use the skills.

**Basic installation** (uses DEFAULT profile)
Install skills into `./.claude/skills` (relative to the directory where you run the script), then upload them to your workspace at `/Workspace/Users/<you>/.assistant/skills` so Genie Code can use them in the UI. Requires the [Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/) authenticated for your workspace.

**Always run from the project directory** where you want `.claude/skills` created (for example your repo root or `ai-dev-kit`).

**From this repo (recommended if you have a clone):**

```bash
#Execute from root folder (/ai-dev-kit)
./databricks-skills/install_skills_to_genie_code.sh
# Databricks skills from this checkout + upload (DEFAULT CLI profile)
./databricks-skills/install_skills.sh --local --install-to-genie

# Download all skills from GitHub, then upload
./databricks-skills/install_skills.sh --install-to-genie

# Explicit Databricks CLI profile
./databricks-skills/install_skills.sh --install-to-genie --profile YOUR_PROFILE
```

**Advance installation** (uses provided profile)
**Without cloning** (run from the directory that should contain `.claude/skills`):

```bash
#Execute from root folder (/ai-dev-kit)
./databricks-skills/install_skills_to_genie_code <profile_name>
curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash -s -- --install-to-genie
```

Combine `--profile`, `--local`, specific skill names, `--mlflow-version`, etc. as needed; see `./databricks-skills/install_skills.sh --help` or [databricks-skills/README.md](databricks-skills/README.md).

**Skill modification or Custom Skill**

After the script successfully installs the skills to your workspace, you may find the skills under `/Workspace/Users/<your_user_name>/.assistant/skills`.
Expand Down
49 changes: 44 additions & 5 deletions databricks-skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,61 @@ Skills that teach Claude Code how to work effectively with Databricks - providin

## Installation

Run in your project root:
Run from your **project root** (the directory where you want `.claude/skills` created).

### From this repository (local script)

If you already have the repo (fork or clone), use the script on disk:

```bash
# Install all skills (Databricks + MLflow)
curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash
# Install all skills (Databricks + MLflow + APX) — downloads from GitHub by default
./databricks-skills/install_skills.sh

# Install Databricks skills only from this checkout (no network for those skills)
./databricks-skills/install_skills.sh --local

# Install specific skills
./databricks-skills/install_skills.sh databricks-bundles agent-evaluation

# Pin MLflow / APX versions
./databricks-skills/install_skills.sh --mlflow-version v1.0.0

# List available skills
./databricks-skills/install_skills.sh --list

# Install + upload to workspace for Genie Code (/Workspace/Users/<you>/.assistant/skills)
./databricks-skills/install_skills.sh --install-to-genie

./databricks-skills/install_skills.sh --install-to-genie --profile prod

# Local Databricks skills + Genie upload
./databricks-skills/install_skills.sh --local --install-to-genie
```

Paths assume you are at the **ai-dev-kit** repo root. From another project, copy or symlink the script, or use the `curl` flow below.

### Without cloning (curl)

Use this when you only want the installer and not the full repo:

```bash
# Install all skills
curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash

# Install specific skills (pass args after bash -s --)
curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash -s -- databricks-bundles agent-evaluation

# Pin MLflow skills to a specific version
curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash -s -- --mlflow-version v1.0.0

# List available skills
curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash -s -- --list

curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash -s -- --install-to-genie

curl -sSL https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main/databricks-skills/install_skills.sh | bash -s -- --install-to-genie --profile prod
```

`--install-to-genie` uploads the tree under `./.claude/skills` to the workspace (requires the `databricks` CLI).

This creates `.claude/skills/` and downloads all skills. Claude Code loads them automatically.
- **Databricks skills** are downloaded from this repository
- **MLflow skills** are fetched dynamically from [github.com/mlflow/skills](https://github.com/mlflow/skills)
Expand Down
113 changes: 113 additions & 0 deletions databricks-skills/install_skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# ./install_skills.sh databricks-bundles agent-evaluation # Install specific skills
# ./install_skills.sh --mlflow-version v1.0.0 # Pin MLflow skills version
# ./install_skills.sh --local # Install Databricks skills from local directory
# ./install_skills.sh --install-to-genie # Install then upload ./.claude/skills to workspace (Genie Code / Assistant)
# ./install_skills.sh --install-to-genie --profile prod --local
# ./install_skills.sh --list # List available skills
# ./install_skills.sh --help # Show help
#
Expand All @@ -35,6 +37,9 @@ REPO_URL="https://github.com/databricks-solutions/ai-dev-kit"
REPO_RAW_URL="https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/main"
SKILLS_DIR=".claude/skills"
INSTALL_FROM_LOCAL=false
INSTALL_TO_GENIE=false
# Databricks CLI profile for workspace upload (only used with --install-to-genie)
DB_PROFILE="${DATABRICKS_CONFIG_PROFILE:-DEFAULT}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# MLflow skills configuration
Expand Down Expand Up @@ -180,6 +185,9 @@ show_help() {
echo " --list, -l List all available skills"
echo " --all, -a Install all skills (default if no skills specified)"
echo " --local Install from local files instead of downloading"
echo " --install-to-genie After install, upload ./.claude/skills to workspace"
echo " /Users/<you>/.assistant/skills for Genie Code (uses cwd; requires databricks CLI)"
echo " --profile <name> Databricks config profile for workspace upload (default: DEFAULT or \$DATABRICKS_CONFIG_PROFILE)"
echo " --mlflow-version <ref> Pin MLflow skills to specific version/branch/tag (default: main)"
echo " --apx-version <ref> Pin APX skills to specific version/branch/tag (default: main)"
echo ""
Expand All @@ -191,6 +199,8 @@ show_help() {
echo " ./install_skills.sh --mlflow-version v1.0.0 # Pin MLflow skills version"
echo " ./install_skills.sh --apx-version v1.0.0 # Pin APX skills version"
echo " ./install_skills.sh --local # Install all from local directory"
echo " ./install_skills.sh --install-to-genie # Install all, then upload to workspace for Genie Code"
echo " ./install_skills.sh --install-to-genie --profile prod # Same with explicit Databricks CLI profile"
echo " ./install_skills.sh --list # List available skills"
echo ""
echo -e "${GREEN}Databricks Skills:${NC}"
Expand Down Expand Up @@ -245,6 +255,93 @@ is_valid_skill() {
return 1
}

# Upload one skill folder to workspace /Users/<user>/.assistant/skills/<skill>/
upload_skill_to_genie_workspace() {
local skill_dir="$1"
local skills_path="$2"
local db_profile="$3"

skill_dir="${skill_dir%/}"
local skill_name
skill_name=$(basename "$skill_dir")

if [[ "$skill_name" == "."* ]] || [[ "$skill_name" == "TEMPLATE" ]] || [[ ! -d "$skill_dir" ]]; then
return 0
fi
if [[ ! -f "$skill_dir/SKILL.md" ]]; then
return 0
fi

echo -e " ${GREEN}Uploading${NC} $skill_name"
databricks workspace mkdirs "$skills_path/$skill_name" --profile "$db_profile" 2>/dev/null || true

while IFS= read -r -d '' file; do
rel_path="${file#$skill_dir/}"
dest_path="$skills_path/$skill_name/$rel_path"
parent_dir=$(dirname "$dest_path")
if [[ "$parent_dir" != "$skills_path/$skill_name" ]]; then
databricks workspace mkdirs "$parent_dir" --profile "$db_profile" 2>/dev/null || true
fi
databricks workspace import "$dest_path" --file "$file" --profile "$db_profile" --format AUTO --overwrite 2>/dev/null || true
done < <(find "$skill_dir" -type f \( -name "*.md" -o -name "*.py" -o -name "*.yaml" -o -name "*.yml" -o -name "*.sh" \) -print0)
}

# Upload all skills under SKILLS_DIR to workspace for Genie Code / Assistant agent mode
install_skills_to_genie_workspace() {
if ! command -v databricks >/dev/null 2>&1; then
echo -e "${RED}Error: databricks CLI not found. Install it to use --install-to-genie.${NC}"
return 1
fi

local abs_skills_dir
if [ ! -d "$SKILLS_DIR" ]; then
echo -e "${RED}Error: Skills directory not found: ${SKILLS_DIR} (run from the directory where skills were installed).${NC}"
return 1
fi
abs_skills_dir="$(cd "$SKILLS_DIR" && pwd)"

echo ""
echo -e "${BLUE}════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE} Uploading skills to workspace (Genie Code)${NC}"
echo -e "${BLUE}════════════════════════════════════════════════════════════${NC}"
echo -e "Databricks profile: ${DB_PROFILE}"
echo -e "Local skills (cwd-relative): ${SKILLS_DIR}/ → ${abs_skills_dir}"
echo ""

local user_name
user_name=$(databricks current-user me --profile "$DB_PROFILE" --output json 2>/dev/null | python3 -c "import sys, json; d=json.load(sys.stdin); print(d.get('userName', ''))" 2>/dev/null || echo "")
if [ -z "$user_name" ]; then
echo -e "${RED}Error: Could not determine workspace user. Check authentication and --profile.${NC}"
return 1
fi

local skills_path="/Users/$user_name/.assistant/skills"
echo -e "Workspace user: ${user_name}"
echo -e "Workspace path: ${skills_path}"
echo ""

echo -e "${GREEN}Creating workspace skills directory...${NC}"
databricks workspace mkdirs "$skills_path" --profile "$DB_PROFILE" 2>/dev/null || true

echo -e "${GREEN}Uploading skills...${NC}"
local skill_dir
for skill_dir in "$abs_skills_dir"/*/; do
[ -d "$skill_dir" ] || continue
upload_skill_to_genie_workspace "$skill_dir" "$skills_path" "$DB_PROFILE"
done

echo ""
echo -e "${GREEN}Workspace listing:${NC}"
databricks workspace list "$skills_path" --profile "$DB_PROFILE" 2>/dev/null || echo -e " ${YELLOW}(Could not list workspace path)${NC}"

local skills_count
skills_count=$(find "$abs_skills_dir" -maxdepth 1 -type d -exec test -f {}/SKILL.md \; -print 2>/dev/null | wc -l | tr -d ' ')
echo ""
echo -e "${GREEN}Genie Code upload complete.${NC} ${skills_count} skills under ${skills_path}"
echo ""
return 0
}

# Function to download a Databricks skill
download_databricks_skill() {
local skill_name=$1
Expand Down Expand Up @@ -455,6 +552,18 @@ while [ $# -gt 0 ]; do
INSTALL_FROM_LOCAL=true
shift
;;
--install-to-genie|--deploy-to-assistant)
INSTALL_TO_GENIE=true
shift
;;
--profile)
if [ -z "$2" ] || [ "${2:0:1}" = "-" ]; then
echo -e "${RED}Error: --profile requires a profile name${NC}"
exit 1
fi
DB_PROFILE="$2"
shift 2
;;
--mlflow-version)
if [ -z "$2" ] || [ "${2:0:1}" = "-" ]; then
echo -e "${RED}Error: --mlflow-version requires a version/ref argument${NC}"
Expand Down Expand Up @@ -567,3 +676,7 @@ for skill in $SKILLS_TO_INSTALL; do
fi
done

if [ "$INSTALL_TO_GENIE" = true ]; then
install_skills_to_genie_workspace || exit 1
fi

119 changes: 0 additions & 119 deletions databricks-skills/install_skills_to_genie_code.sh

This file was deleted.