Skip to content

Commit e8561e4

Browse files
authored
Merge pull request #2 from databricks/fabian-integ
Fabian integ
2 parents 7b398b3 + d8650b5 commit e8561e4

25 files changed

Lines changed: 7759 additions & 21 deletions

‎.claude-plugin/plugin.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "databricks-skills",
3+
"description": "Comprehensive Databricks skills for working with Databricks CLI, Apps, Unity Catalog, Model Serving, Asset Bundles, and more. Includes installation and authentication support.",
4+
"version": "1.0.0",
5+
"author": "Databricks"
6+
}

‎.devcontainer/Dockerfile‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
FROM node:20
2+
3+
ARG TZ
4+
ENV TZ="$TZ"
5+
6+
ARG CLAUDE_CODE_VERSION=latest
7+
8+
# Install basic development tools and iptables/ipset
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
10+
less \
11+
git \
12+
procps \
13+
sudo \
14+
fzf \
15+
zsh \
16+
man-db \
17+
unzip \
18+
gnupg2 \
19+
gh \
20+
iptables \
21+
ipset \
22+
iproute2 \
23+
dnsutils \
24+
aggregate \
25+
jq \
26+
nano \
27+
vim \
28+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
29+
30+
# Ensure default node user has access to /usr/local/share
31+
RUN mkdir -p /usr/local/share/npm-global && \
32+
chown -R node:node /usr/local/share
33+
34+
ARG USERNAME=node
35+
36+
# Persist bash history.
37+
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
38+
&& mkdir /commandhistory \
39+
&& touch /commandhistory/.bash_history \
40+
&& chown -R $USERNAME /commandhistory
41+
42+
# Set `DEVCONTAINER` environment variable to help with orientation
43+
ENV DEVCONTAINER=true
44+
45+
# Create workspace and config directories and set permissions
46+
RUN mkdir -p /workspace /home/node/.claude && \
47+
chown -R node:node /workspace /home/node/.claude
48+
49+
WORKDIR /workspace
50+
51+
ARG GIT_DELTA_VERSION=0.18.2
52+
RUN ARCH=$(dpkg --print-architecture) && \
53+
wget "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
54+
sudo dpkg -i "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
55+
rm "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb"
56+
57+
# Set up non-root user
58+
USER node
59+
60+
# Install global packages
61+
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
62+
ENV PATH=$PATH:/usr/local/share/npm-global/bin
63+
64+
# Set the default shell to zsh rather than sh
65+
ENV SHELL=/bin/zsh
66+
67+
# Set the default editor and visual
68+
ENV EDITOR=nano
69+
ENV VISUAL=nano
70+
71+
# Default powerline10k theme
72+
ARG ZSH_IN_DOCKER_VERSION=1.2.0
73+
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
74+
-p git \
75+
-p fzf \
76+
-a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
77+
-a "source /usr/share/doc/fzf/examples/completion.zsh" \
78+
-a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
79+
-x
80+
81+
# Install Claude
82+
RUN npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}
83+
84+
85+
# # Copy and set up firewall script
86+
# COPY init-firewall.sh /usr/local/bin/
87+
# USER root
88+
# RUN chmod +x /usr/local/bin/init-firewall.sh && \
89+
# echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall && \
90+
# chmod 0440 /etc/sudoers.d/node-firewall
91+
USER node
92+
93+
RUN curl -fsSL https://claude.ai/install.sh | bash
94+
RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc

‎.devcontainer/devcontainer.json‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "Claude Code Sandbox",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"TZ": "${localEnv:TZ:America/Los_Angeles}",
7+
"CLAUDE_CODE_VERSION": "latest",
8+
"GIT_DELTA_VERSION": "0.18.2",
9+
"ZSH_IN_DOCKER_VERSION": "1.2.0"
10+
}
11+
},
12+
"runArgs": [
13+
"--cap-add=NET_ADMIN",
14+
"--cap-add=NET_RAW"
15+
],
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"anthropic.claude-code",
20+
"dbaeumer.vscode-eslint",
21+
"esbenp.prettier-vscode",
22+
"eamodio.gitlens"
23+
],
24+
"settings": {
25+
"editor.formatOnSave": true,
26+
"editor.defaultFormatter": "esbenp.prettier-vscode",
27+
"editor.codeActionsOnSave": {
28+
"source.fixAll.eslint": "explicit"
29+
},
30+
"terminal.integrated.defaultProfile.linux": "zsh",
31+
"terminal.integrated.profiles.linux": {
32+
"bash": {
33+
"path": "bash",
34+
"icon": "terminal-bash"
35+
},
36+
"zsh": {
37+
"path": "zsh"
38+
}
39+
}
40+
}
41+
}
42+
},
43+
"remoteUser": "node",
44+
"mounts": [
45+
"source=claude-code-bashhistory-${devcontainerId},target=/commandhistory,type=volume",
46+
"source=claude-code-config-${devcontainerId},target=/home/node/.claude,type=volume"
47+
],
48+
"containerEnv": {
49+
"NODE_OPTIONS": "--max-old-space-size=4096",
50+
"CLAUDE_CONFIG_DIR": "/home/node/.claude",
51+
"POWERLEVEL9K_DISABLE_GITSTATUS": "true"
52+
},
53+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
54+
"workspaceFolder": "/workspace",
55+
// "postStartCommand": "sudo /usr/local/bin/init-firewall.sh",
56+
// "waitFor": "postStartCommand"
57+
}

‎.gitignore‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
__pycache__/
22
*.pyc
33
.DS_Store
4+
5+
# Local development configuration
6+
.claude/
7+
8+
# Development-only skills (not part of plugin)
9+
skills/skill-creator/
10+
11+
# Temporary files
12+
/*taxi*/

‎CLAUDE.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Databricks Skills Plugin
2+
3+
This is a Claude Code plugin that provides comprehensive skills for working with Databricks services, CLI tools, and development workflows.
4+
5+
## Plugin Structure
6+
7+
- `.claude-plugin/plugin.json` - Plugin manifest with metadata
8+
- `skills/` - All skill definitions for the plugin
9+
- `.claude/` - Local development configuration (not included when plugin is distributed)
10+
- `README.md` - Plugin documentation and usage guide
11+
- `CLAUDE.md` - Development guidelines and security practices
12+
13+
## Development Workflow
14+
15+
1. Perform tasks using the Claude agent to explore Databricks capabilities
16+
2. Document findings and successful approaches
17+
3. Create or update skills in the `skills/` directory
18+
4. Test the plugin locally with: `claude --plugin-dir .`
19+
5. Update version in `.claude-plugin/plugin.json` when ready to release
20+
21+
## Documentation Guidelines
22+
23+
### Security and Privacy
24+
25+
**CRITICAL**: When documenting examples in skills, always obfuscate sensitive information:
26+
27+
1. **Workspace IDs/URLs**: Replace real workspace IDs with sequences of repeated digits
28+
- ❌ Bad: `https://adb-1966697730403610.10.azuredatabricks.net`
29+
- ✅ Good: `https://adb-1111111111111111.10.azuredatabricks.net`
30+
- ✅ Good: `https://company-workspace.cloud.databricks.com`
31+
32+
2. **Obfuscation Pattern**: Use repeated digits (e.g., `1111111111111111`, `2222222222222222`) instead of real identifiers
33+
- For numeric IDs: Use sequences like `11111111`, `22222222`, `99999999`
34+
- For alphanumeric: Use generic placeholders like `company-workspace`, `your-workspace`
35+
36+
3. **Other Sensitive Information**:
37+
- Never include real access tokens, passwords, or credentials
38+
- Use placeholder names for users, teams, and organizations
39+
- Obfuscate job IDs, cluster IDs, and other resource identifiers
40+
41+
### Why This Matters
42+
43+
- Protects internal workspace information from being exposed publicly
44+
- Prevents potential security risks from sharing real identifiers
45+
- Makes examples more universal and relatable for all users
46+
- Follows security best practices for documentation

‎skills/databricks-apps/SKILL.md‎

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,32 @@ metadata:
66
version: "0.1.0"
77
---
88

9+
**CRITICAL**: Before proceeding with ANY databricks-apps task, you MUST first invoke the `databricks` skill using the Skill tool. The databricks skill provides essential context for:
10+
- Authentication and profile selection (NEVER auto-select profiles)
11+
- Data exploration commands (`discover-schema`, `query`)
12+
- SQL warehouse identification
13+
- CLI usage patterns specific to Claude Code
14+
15+
**Action Required**: If you haven't already invoked the `databricks` skill in this conversation, invoke it now with: `Skill(command: "databricks")`
16+
917
# Databricks Apps Development
1018

1119
Build TypeScript apps that query Databricks SQL warehouses and deploy to Databricks Apps.
1220

1321
## Workflow
1422

15-
1. **Verify auth**: `databricks auth profiles`
16-
2. **Find warehouse**: `databricks sql warehouses list`
17-
3. **Explore data**: `databricks experimental aitools tools discover-schema CATALOG.SCHEMA.TABLE`
18-
4. **Scaffold project**: `databricks experimental aitools tools init-template --name my-app --description "..."`
19-
5. **Develop**: `cd my-app && npm install && npm run dev`
20-
6. **Validate**: `databricks experimental aitools tools validate ./`
21-
7. **Deploy**: `databricks experimental aitools tools deploy` (requires user permission)
23+
1. **Verify auth**: See `databricks` skill
24+
2. **Find warehouse**: See `databricks` skill
25+
3. **Explore data**: See `databricks` skill
26+
4. **Scaffold project**: `apps init --description "<APP_DESCRIPTION>" --features analytics --warehouse-id <WAREHOUSE_ID> --name <APP_NAME>
27+
--run none --profile `
28+
5. **Develop**: `cd <APP_NAME> && npm install && npm run dev`
29+
6. **Validate**: `databricks apps validate`
30+
7. **Deploy**: `databricks apps deploy --profile <PROFILE>` (⚠️ USER CONSENT REQUIRED: Only deploy with explicit user permission.)
2231

2332
## Data Exploration
2433

25-
```bash
26-
# list catalogs/schemas/tables
27-
databricks catalogs list
28-
databricks schemas list <catalog>
29-
databricks tables list <catalog> <schema>
30-
31-
# discover table schema (columns, types, sample data)
32-
databricks experimental aitools tools discover-schema CATALOG.SCHEMA.TABLE
33-
34-
# test queries
35-
databricks experimental aitools tools query "SELECT * FROM catalog.schema.table LIMIT 10"
36-
```
37-
38-
Note: Use separate arguments for `catalogs/schemas/tables` commands. Dot notation only works in `discover-schema` and `query`.
34+
See `databricks` skill
3935

4036
## Project Structure
4137

0 commit comments

Comments
 (0)