Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ea73de5
Add init-template subcommands for jobs, pipelines, and empty bundles
lennartkats-db Dec 24, 2025
5db89c1
Add acceptance tests for init-template commands and remove unnecessar…
lennartkats-db Dec 26, 2025
16dc336
Refinements
lennartkats-db Dec 27, 2025
440d60a
Fix discover.go compilation error and update test
lennartkats-db Dec 29, 2025
d481799
Cleanup
lennartkats-db Dec 29, 2025
475ff84
Fix typo
lennartkats-db Jan 3, 2026
fd4c639
Rename "mixed" to "bundle" and use AllResources() for detection
lennartkats-db Jan 3, 2026
5cf32cf
Add skills system to apps-mcp
lennartkats-db Dec 29, 2025
55b6da7
Show all skills with caveats for non-matching resource types
lennartkats-db Jan 3, 2026
038e746
Remove IsAppOnly field usage and redundant test
lennartkats-db Jan 3, 2026
377035c
Fix skills embed pattern to recursively include nested files
lennartkats-db Jan 6, 2026
098717c
Use explicit directory names in skills embed pattern
lennartkats-db Jan 6, 2026
a94ced3
Add test to validate all skill directories are embedded
lennartkats-db Jan 6, 2026
b9868cb
Use separate embed directives and add error diagnostics
lennartkats-db Jan 6, 2026
d41f2d4
Merge remote-tracking branch 'origin/main' into lakeflow-mcp-skills
lennartkats-db Jan 6, 2026
8dd35fc
Fix Windows line endings in skill frontmatter parsing
lennartkats-db Jan 6, 2026
54c0a0e
Remove overkill panic checks for empty skills
lennartkats-db Jan 7, 2026
148f9f7
Merge remote-tracking branch 'origin/main' into lakeflow-mcp-skills
lennartkats-db Jan 10, 2026
292d275
Move skills package from apps-mcp to aitools
lennartkats-db Jan 11, 2026
1c48c52
Merge remote-tracking branch 'origin/main' into lakeflow-mcp-skills
lennartkats-db Jan 12, 2026
c28bc3c
Update acceptance test: apps-mcp -> aitools
lennartkats-db Jan 12, 2026
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
140 changes: 139 additions & 1 deletion acceptance/apps/init-template/app/output.txt
Original file line number Diff line number Diff line change
@@ -1 +1,139 @@
✓ Template instantiation succeeded
--
## Databricks Apps Development

### Validation
⚠️ Always validate before deploying:
invoke_databricks_cli 'experimental aitools tools validate ./'

This is battle-tested to catch common issues before deployment. Prefer using this over manual checks (e.g. `npm run lint`), as it covers more ground specific to Databricks Apps.

### Deployment
⚠️ USER CONSENT REQUIRED: Only deploy with explicit user permission.
invoke_databricks_cli 'experimental aitools tools deploy'

### View and Manage
invoke_databricks_cli 'bundle summary'

### View App Logs
To troubleshoot deployed apps, view their logs:
invoke_databricks_cli 'apps logs <app-name> --tail-lines 100'

### Local Development vs Deployed Apps

During development:
- Start template-specific dev server (see project's CLAUDE.md for command and port)
- Use localhost URL shown when dev server starts

After deployment:
- Get URL from: invoke_databricks_cli 'bundle summary'

Decision tree:
- "open the app" + not deployed → localhost
- "open the app" + deployed → ask which environment
- "localhost"/"local" → always localhost


## Skills

You have access to modular Skills for domain-specific expertise knowledge.

### Skill Selection & Loading
* When a user request matches a skill's scope description, select that Skill
* Load skills using the MCP tool: `read_skill_file(file_path: "category/skill-name/SKILL.md")`
* Example: `read_skill_file(file_path: "pipelines/materialized-view/SKILL.md")`
* Skills may contain links to sub-sections (e.g., "category/skill-name/file.md")
* If no Skill is suitable, continue with your base capabilities
* Never mention or reference skills to the user, only use them internally

### Skill Registry (names + brief descriptors)


**Note**: The following skills are for other resource types and may not be directly relevant to this project.

* **pipelines/auto-cdc/SKILL.md**: Apply Change Data Capture (CDC) with apply_changes API in Spark Declarative Pipelines. Use when user needs to process CDC feeds from databases, handle upserts/deletes, maintain slowly changing dimensions (SCD Type 1 and Type 2), synchronize data from operational databases, or process merge operations.



=== CLAUDE.md ===
TypeScript full-stack template powered by **Databricks AppKit** with tRPC for additional custom API endpoints.

- server/: Node.js backend with App Kit and tRPC
- client/: React frontend with App Kit hooks and tRPC client
- config/queries/: SQL query files for analytics
- shared/: Shared TypeScript types
- docs/: Detailed documentation on using App Kit features

## Quick Start: Your First Query & Chart

Follow these 3 steps to add data visualization to your app:

**Step 1: Create a SQL query file**

```sql
-- config/queries/my_data.sql
SELECT category, COUNT(*) as count, AVG(value) as avg_value
FROM my_table
GROUP BY category
```

**Step 2: Define the schema**

```typescript
// config/queries/schema.ts
export const querySchemas = {
my_data: z.array(
z.object({
category: z.string(),
count: z.number(),
avg_value: z.number(),
})
),
};
```

**Step 3: Add visualization to your app**

```typescript
// client/src/App.tsx
import { BarChart } from '@databricks/appkit-ui/react';

<BarChart queryKey="my_data" parameters={{}} />
```

**That's it!** The component handles data fetching, loading states, and rendering automatically.

**To refresh TypeScript types after adding queries:**
- Run `npm run typegen` OR run `npm run dev` - both auto-generate type definitions in `client/src/appKitTypes.d.ts`
- DO NOT manually edit `appKitTypes.d.ts`

## Installation

**IMPORTANT**: When running `npm install`, always use `required_permissions: ['all']` to avoid sandbox permission errors.

## NPM Scripts

### Development
- `npm run dev` - Start dev server with hot reload (**ALWAYS use during development**)

### Testing and Code Quality
See the databricks experimental aitools tools validate instead of running these individually.

### Utility
- `npm run clean` - Remove all build artifacts and node_modules

**Common workflows:**
- Development: `npm run dev` → make changes → `npm run typecheck` → `npm run lint:fix`
- Pre-deploy: Validate with `databricks experimental aitools tools validate .`

## Documentation

**IMPORTANT**: Read the relevant docs below before implementing features. They contain critical information about common pitfalls (e.g., SQL numeric type handling, schema definitions, Radix UI constraints).

- [SQL Queries](docs/sql-queries.md) - query files, schemas, type handling, parameterization
- [App Kit SDK](docs/appkit-sdk.md) - TypeScript imports, server setup, useAnalyticsQuery hook
- [Frontend](docs/frontend.md) - visualization components, styling, layout, Radix constraints
- [tRPC](docs/trpc.md) - custom endpoints for non-SQL operations (mutations, Databricks APIs)
- [Testing](docs/testing.md) - vitest unit tests, Playwright smoke/E2E tests

=================

3 changes: 1 addition & 2 deletions acceptance/apps/init-template/app/script
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
$CLI experimental aitools tools init-template app --name test_app --sql-warehouse-id abc123 --output-dir output > /dev/null 2>&1
echo "✓ Template instantiation succeeded"
$CLI experimental aitools tools init-template app --name test_app --sql-warehouse-id abc123 --output-dir output 2>&1 | grep -A 9999 "^--$"
rm -rf output
67 changes: 66 additions & 1 deletion acceptance/apps/init-template/empty/output.txt
Original file line number Diff line number Diff line change
@@ -1 +1,66 @@
✓ Template instantiation succeeded
--
## Adding Databricks Resources

Add resources by creating YAML files in resources/:

**Jobs** - `resources/my_job.job.yml`:
```yaml
resources:
jobs:
my_job:
name: my_job
tasks:
- task_key: main
notebook_task:
notebook_path: ../src/notebook.py
```

**Pipelines** (Lakeflow Declarative Pipelines) - `resources/my_pipeline.pipeline.yml`:
```yaml
resources:
pipelines:
my_pipeline:
name: my_pipeline
catalog: ${var.catalog}
target: ${var.schema}
libraries:
- notebook:
path: ../src/pipeline.py
```

**Dashboards** - `resources/my_dashboard.dashboard.yml`
**Alerts** - `resources/my_alert.alert.yml`
**Model Serving** - `resources/my_endpoint.yml`
**Apps** - `resources/my_app.app.yml`

**Other resource types**: clusters, schemas, volumes, registered_models, experiments, quality_monitors

### Deployment
For dev targets you can deploy without user consent. This allows you to run resources on the workspace too!

invoke_databricks_cli 'bundle deploy --target dev'
invoke_databricks_cli 'bundle run <resource_name> --target dev'

View status with `invoke_databricks_cli 'bundle summary'`.

### Documentation
- Resource types reference: https://docs.databricks.com/dev-tools/bundles/resources
- YAML examples: https://docs.databricks.com/dev-tools/bundles/examples


## Skills

You have access to modular Skills for domain-specific expertise knowledge.

### Skill Selection & Loading
* When a user request matches a skill's scope description, select that Skill
* Load skills using the MCP tool: `read_skill_file(file_path: "category/skill-name/SKILL.md")`
* Example: `read_skill_file(file_path: "pipelines/materialized-view/SKILL.md")`
* Skills may contain links to sub-sections (e.g., "category/skill-name/file.md")
* If no Skill is suitable, continue with your base capabilities
* Never mention or reference skills to the user, only use them internally

### Skill Registry (names + brief descriptors)
* **pipelines/auto-cdc/SKILL.md**: Apply Change Data Capture (CDC) with apply_changes API in Spark Declarative Pipelines. Use when user needs to process CDC feeds from databases, handle upserts/deletes, maintain slowly changing dimensions (SCD Type 1 and Type 2), synchronize data from operational databases, or process merge operations.


3 changes: 1 addition & 2 deletions acceptance/apps/init-template/empty/script
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
$CLI experimental aitools tools init-template empty --name test_empty --catalog main --output-dir output > /dev/null 2>&1
echo "✓ Template instantiation succeeded"
$CLI experimental aitools tools init-template empty --name test_empty --catalog main --output-dir output 2>&1 | grep -A 9999 "^--$"
rm -rf output
121 changes: 120 additions & 1 deletion acceptance/apps/init-template/job/output.txt
Original file line number Diff line number Diff line change
@@ -1 +1,120 @@
✓ Template instantiation succeeded
--
## Lakeflow Jobs Development

This guidance is for developing jobs in this project.

### Project Structure
- `src/` - Python notebooks (.ipynb) and source code
- `resources/` - Job definitions in databricks.yml format

### Configuring Tasks
Edit `resources/<job_name>.job.yml` to configure tasks:

```yaml
tasks:
- task_key: my_notebook
notebook_task:
notebook_path: ../src/my_notebook.ipynb
- task_key: my_python
python_wheel_task:
package_name: my_package
entry_point: main
```

Task types: `notebook_task`, `python_wheel_task`, `spark_python_task`, `pipeline_task`, `sql_task`

### Job Parameters
Parameters defined at job level are passed to ALL tasks (no need to repeat per task). Example:
```yaml
resources:
jobs:
my_job:
parameters:
- name: catalog
default: ${var.catalog}
- name: schema
default: ${var.schema}
```

### Writing Notebook Code
- Use `spark.read.table("catalog.schema.table")` to read tables
- Use `spark.sql("SELECT ...")` for SQL queries
- Use `dbutils.widgets` for parameters

### Unit Testing
Run unit tests locally with: `uv run pytest`

### Documentation
- Lakeflow Jobs: https://docs.databricks.com/jobs
- Task types: https://docs.databricks.com/jobs/configure-task
- Databricks Asset Bundles / yml format examples: https://docs.databricks.com/dev-tools/bundles/examples

## Adding Databricks Resources

Add resources by creating YAML files in resources/:

**Jobs** - `resources/my_job.job.yml`:
```yaml
resources:
jobs:
my_job:
name: my_job
tasks:
- task_key: main
notebook_task:
notebook_path: ../src/notebook.py
```

**Pipelines** (Lakeflow Declarative Pipelines) - `resources/my_pipeline.pipeline.yml`:
```yaml
resources:
pipelines:
my_pipeline:
name: my_pipeline
catalog: ${var.catalog}
target: ${var.schema}
libraries:
- notebook:
path: ../src/pipeline.py
```

**Dashboards** - `resources/my_dashboard.dashboard.yml`
**Alerts** - `resources/my_alert.alert.yml`
**Model Serving** - `resources/my_endpoint.yml`
**Apps** - `resources/my_app.app.yml`

**Other resource types**: clusters, schemas, volumes, registered_models, experiments, quality_monitors

### Deployment
For dev targets you can deploy without user consent. This allows you to run resources on the workspace too!

invoke_databricks_cli 'bundle deploy --target dev'
invoke_databricks_cli 'bundle run <resource_name> --target dev'

View status with `invoke_databricks_cli 'bundle summary'`.

### Documentation
- Resource types reference: https://docs.databricks.com/dev-tools/bundles/resources
- YAML examples: https://docs.databricks.com/dev-tools/bundles/examples


## Skills

You have access to modular Skills for domain-specific expertise knowledge.

### Skill Selection & Loading
* When a user request matches a skill's scope description, select that Skill
* Load skills using the MCP tool: `read_skill_file(file_path: "category/skill-name/SKILL.md")`
* Example: `read_skill_file(file_path: "pipelines/materialized-view/SKILL.md")`
* Skills may contain links to sub-sections (e.g., "category/skill-name/file.md")
* If no Skill is suitable, continue with your base capabilities
* Never mention or reference skills to the user, only use them internally

### Skill Registry (names + brief descriptors)


**Note**: The following skills are for other resource types and may not be directly relevant to this project.

* **pipelines/auto-cdc/SKILL.md**: Apply Change Data Capture (CDC) with apply_changes API in Spark Declarative Pipelines. Use when user needs to process CDC feeds from databases, handle upserts/deletes, maintain slowly changing dimensions (SCD Type 1 and Type 2), synchronize data from operational databases, or process merge operations.


3 changes: 1 addition & 2 deletions acceptance/apps/init-template/job/script
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
$CLI experimental aitools tools init-template job --name test_job --catalog main --output-dir output > /dev/null 2>&1 || exit 1
echo "✓ Template instantiation succeeded"
$CLI experimental aitools tools init-template job --name test_job --catalog main --output-dir output 2>&1 | grep -A 9999 "^--$"
rm -rf output
Loading