/databricks-skills:build-appfrom databricks-skills
Builds Databricks Apps using cookbook recipes for Dash, Streamlit, Reflex, and FastAPI frameworks. Scaffolds folder layout, app.yaml, multi-page wiring, and runtime rules from repo samples and docs.
Ships in databricks-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Stop and point the user at the other product. Do not scaffold Dash/Streamlit/Reflex/FastAPI from this cookbook.
| User wants | Use instead |
|---|---|
| Charts/KPIs only, no custom app | AI/BI (Lakeview) dashboards / skill databricks-aibi-dashboards |
| Natural-language app in the Databricks UI, App Spaces, scale-to-zero (Beta) | Genie App Builder |
Default new custom-code app (TypeScript/React), databricks apps init | Official AppKit skill databricks-apps via Databricks Agent Skills / databricks aitools install |
| MCP tools for Cursor/Claude (SQL, UC functions, Genie, AI Search) | Official managed MCP + Unity Gateway; pair with Databricks Agent Skills. Not cookbook MCP recipes |
If ambiguous (new app, no framework named), ask: cookbook Python (this skill) vs AppKit vs Genie App Builder. Platform rules (OAuth scopes, apps deploy) still come from Databricks Agent Skills; this skill supplies recipes.
If the cookbook MCP is connected (list_cookbook_recipes / get_cookbook_recipe), use it to resolve snippets and permissions. Otherwise read docs/docs/ and sample trees as in Constraints.
Implementations must trace to:
| Layer | Source |
|---|---|
| Samples | dash/, streamlit/, reflex/, fastapi/ |
| Docs | docs/docs/ → apps-cookbook.dev |
Those pairs are tested together. Do not treat generic tutorials or external snippets as authoritative.
Outside scope: TypeScript/React (use AppKit), Vue/Angular SPAs, Gradio-only, Flask-only, etc.—no tested recipes in this repo.
FastAPI: This cookbook ships API samples + docs, not a bundled SPA under /.
Order matters—especially categories before individual recipes.
Gather constraints — Audience, browser vs API consumers, maintenance expectations.
Select one primary framework — Dash, Streamlit, Reflex, or FastAPI using the recipe index and Framework matrix so planned capabilities have ✓.
Identify documentation categories first — Before copying specific .mdx files, determine which docs/docs/<framework>/<category>/ folders apply (authentication, tables, workflows, …). Use Recipe categories below as the taxonomy: each category groups related permissions, dependencies, and patterns. Skipping this step produces mismatched grants and duplicate connection logic.
Map categories → concrete recipes — Within each category, pick README rows / Doc path stems → specific .mdx files + matching sample modules.
Compose — Follow Combining recipes; extend the cookbook only via CONTRIBUTING.md.
Wire app.yaml and deploy — Single process for the whole app (all pages/routes); command + env / valueFrom per app.yaml and Databricks Apps runtime below; deploy via docs/docs/deploy.md.
One deployable app = one top-level folder with app.yaml at its root. Multi-page UIs still use one app.yaml—the runtime serves every page/route from one process.
| Piece | Dash | Streamlit | Reflex | FastAPI |
|---|---|---|---|---|
| Entry | app.py | app.py | reflex/app/app.py (imports app) | app.py / ASGI app |
| Multi-page / routes | pages/ (dash.pages) | views/ + view_groups.py | app/pages/ + cookbook_state.py nav | routes/ + router include |
| Config / theme | assets/, styles | .streamlit/ optional | theme.py, rxconfig.py | config/ |
| Dependencies | requirements.txt | requirements.txt | requirements.txt | requirements.txt |
| App metadata | APP_DESCRIPTION.md | APP_DESCRIPTION.md | APP_DESCRIPTION.md | README.md, APP_DESCRIPTION.md |
| Bundle / workspace | app.yaml | app.yaml | app.yaml, databricks.yml if used | app.yaml |
app.yaml)| Framework | How multiple screens work |
|---|---|
| Dash | dash.pages: one module per screen under pages/; app.py hosts layout + sidebar_structure for nav order/labels. |
| Streamlit | view_groups.py defines groups → app.py builds st.navigation pages from those definitions → views/*.py per screen. |
| Reflex | app/pages/ components + routes in cookbook_state.navigation_items (and related collapsed-section state). |
| FastAPI | Routers (e.g. routes/v1/) mounted under one FastAPI app—OpenAPI covers all endpoints at /docs. |
Adding a recipe usually means adding one page/view/router module and registering it in the framework’s nav/registry—not a second app.yaml.
app.yaml (cookbook-aligned)command: must launch the framework entrypoint (see table below). Match the sample folder’s app.yaml / streamlit/app.yaml / reflex/app.yaml / fastapi/app.yaml.env: inject resource IDs via valueFrom keys tied to resources configured on the app in the workspace UI—never hardcode warehouse IDs, secret names, or Lakebase identifiers in source (Databricks Apps resources).DATABRICKS_APP_PORT (default 8000); do not bind 8080. FastAPI commands should listen on 0.0.0.0 and the chosen port (see FastAPI sample).| Framework | Typical command |
|---|---|
| Dash | ["python", "app.py"] |
| Streamlit | ["streamlit", "run", "app.py"] |
| Reflex | ["reflex", "run", "--env", "prod"] |
| FastAPI | ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] — align port with runtime |
Multi-page apps do not add extra command entries—navigation is entirely inside the Python tree above.
Authoritative platform detail: Databricks Apps.
| Rule | Requirement |
|---|---|
| Credentials | databricks.sdk.core.Config() — no hardcoded tokens |
| Resource IDs | app.yaml env + valueFrom — no literals for warehouses, endpoints, Lakebase, secrets |
| Dash layout | dash-bootstrap-components / Bootstrap themes |
| Streamlit SQL | @st.cache_resource for connector-backed resources |
| FastAPI serve | uvicorn for deployment—not a dev-only server in prod |
| Port | DATABRICKS_APP_PORT (default 8000) — not 8080 |
| Model | Mechanism | Typical use |
|---|---|---|
| App (SP) | DATABRICKS_CLIENT_ID / DATABRICKS_CLIENT_SECRET; Config() | Shared data, jobs, resources for all users |
| User (OBO) | x-forwarded-access-token when deployed | Per-user UC enforcement |
Use managed keys in valueFrom: SQL warehouse, Lakebase DB, serving endpoint, secrets, UC volumes, vector search, Genie spaces, UC connections/functions, MLflow experiments, Lakeflow jobs—only what your chosen recipes need.
| Backend | When | Cookbook touchpoints |
|---|---|---|
| SQL warehouse | Analytical Delta SQL | tables/*, many aiml/*, bi/* |
| Lakebase | Transactional / low-latency | Lakebase + OLTP recipes; add psycopg2 / asyncpg to requirements.txt if used |
| Databricks SDK | Jobs, clusters, UC APIs | workflows, compute |
Python 3.11, ~2 vCPU / 6 GB; frameworks pre-installed—only extra deps go in requirements.txt.
Treat each docs/docs/<framework>/<category>/ folder as a slice to understand first: shared concerns, permissions, and deps for that domain. Then open specific .mdx files (README Doc path + .mdx).
Sample code roots: dash/pages/, streamlit/views/, reflex/app/pages/, fastapi/routes/ (Reflex filenames vary—reflex/APP_DESCRIPTION.md).
Dash / Streamlit / Reflex:
| Category | Covers |
|---|---|
authentication/ | Current user; OAuth OBO (Streamlit/Reflex). Secrets: Streamlit/Reflex → authentication/secrets_retrieve; Dash → external_services/secrets_retrieve. |
external_services/ | External connections; Dash secrets live here. |
compute/ | Interactive compute attach. |
tables/ | Delta read/write; Streamlit Lakebase read; OLTP (Dash / Reflex variants). |
volumes/ | Upload / download. |
visualizations/ | Charts & maps (Streamlit-only ✓ in README). |
bi/ | Embedded dashboards; Genie. |
aiml/ | Serving, vector search, MCP. |
workflows/ | Run jobs; retrieve results. |
FastAPI: getting_started/ vs building_endpoints/ — see README FastAPI-only table.
| Axis | Dash | Streamlit | Reflex | FastAPI |
|---|---|---|---|---|
| Surface | Python UI | Python UI | Python UI | HTTP API |
| Strength | Plotly / analytics | Defaults / speed | Reactive Python | REST + Lakebase samples |
.mdx Permissions section.docs/docs/deploy.md.Config, env, helpers.requirements.txt.Chain: README → docs/docs/.../*.mdx → matching sample file(s).
Dual stack (UI + FastAPI): two folders, two doc trees—rare.
When the app works from dash/, streamlit/, reflex/, or fastapi/ (correct app.yaml, recipes composed), use productionize-app-dab to wrap it in Databricks Asset Bundles: databricks.yml, resources/app.yml, src/app/ packaging, bundle deploy / run, optional CI/CD—that skill is framework-specific (Streamlit vs Dash vs Reflex vs FastAPI command and folder copy).
→ ../productionize-app-dab/SKILL.md
readme.md — Recipe index.CONTRIBUTING.md — Porting or adding recipes.databricks-skills/README.md — Skill sections index (all skills live under databricks-skills/, not under framework folders).What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/cookbook-aimlInvoke ML models, run vector search, and connect to MCP servers from Databricks Apps. Use when the user wants to call a model serving endpoint, query a vector search index, use LLMs/embeddings, or connect to an MCP server in Dash, Streamlit, Reflex, or FastAPI./cookbook-authenticationImplement authentication in Databricks Apps: get current user info, on-behalf-of-user (OBO) auth, service principal auth, and OAuth patterns. Use when the user asks about auth, user tokens, service principals, OAuth, or OBO in Dash, Streamlit, Reflex, or FastAPI./cookbook-biEmbed AI/BI dashboards and integrate Genie Spaces into Databricks Apps. Use when the user wants to embed a Databricks dashboard or build a chat interface with the Genie Conversations API in Dash, Streamlit, or Reflex.npx claudepluginhub databricks-solutions/databricks-apps-cookbook --plugin databricks-skillsOther plugins' skills for the same job