Skip to content

Commit a44f32f

Browse files
GABRIELLE DOMPREHGABRIELLE DOMPREH
authored andcommitted
refactor(serverless-storage-check): nest as sub-skill under databricks-serverless-migration
Moves skills/databricks-serverless-storage-check/ → skills/databricks-serverless-migration/databricks-serverless-storage-check/ to physically reflect the parent/sub-skill hierarchy. - Update scripts/skills.py iter_skill_dirs() to yield one level of nested skill directories (sub-skills alongside top-level skills) - Fix relative SKILL.md links: ../databricks-serverless-migration/ → ../ and ../databricks-{dabs,jobs,core}/ → ../../databricks-{dabs,jobs,core}/ - Fix databricks-serverless-migration/SKILL.md links: ../databricks-serverless-storage-check/ → databricks-serverless-storage-check/ - Regenerate manifest.json (skill count unchanged: 9) - Confirmed: python3 scripts/skills.py validate → Everything is up to date - Confirmed: stf lint → 0 errors, 0 warnings Co-authored-by: Isaac
1 parent 5f62461 commit a44f32f

21 files changed

Lines changed: 67 additions & 15 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"pipelines",
2121
"dabs",
2222
"serverless",
23+
"serverless-storage-check",
2324
"vector-search",
2425
"data-engineering"
2526
],

manifest.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,23 @@
390390
"agents/openai.yaml",
391391
"assets/databricks.png",
392392
"assets/databricks.svg",
393+
"databricks-serverless-storage-check/SKILL.md",
394+
"databricks-serverless-storage-check/agents/openai.yaml",
395+
"databricks-serverless-storage-check/assets/databricks.png",
396+
"databricks-serverless-storage-check/assets/databricks.svg",
397+
"databricks-serverless-storage-check/eval/evaluation_results.json",
398+
"databricks-serverless-storage-check/eval/ground_truth.yaml",
399+
"databricks-serverless-storage-check/eval/manifest.yaml",
400+
"databricks-serverless-storage-check/eval/output_instructions.md",
401+
"databricks-serverless-storage-check/eval/report.html",
402+
"databricks-serverless-storage-check/eval/tests/conftest.py",
403+
"databricks-serverless-storage-check/eval/tests/test_integration.py",
404+
"databricks-serverless-storage-check/eval/tests/test_unit.py",
405+
"databricks-serverless-storage-check/eval/thinking_instructions.md",
406+
"databricks-serverless-storage-check/references/pattern-catalog.md",
407+
"databricks-serverless-storage-check/references/remediation-guide.md",
408+
"databricks-serverless-storage-check/scripts/preflight.py",
409+
"databricks-serverless-storage-check/scripts/test_preflight.py",
393410
"references/code-patterns.md",
394411
"references/compatibility-checks.md",
395412
"references/configuration-guide.md",
@@ -411,13 +428,22 @@
411428
"agents/openai.yaml",
412429
"assets/databricks.png",
413430
"assets/databricks.svg",
431+
"eval/evaluation_results.json",
432+
"eval/ground_truth.yaml",
433+
"eval/manifest.yaml",
434+
"eval/output_instructions.md",
435+
"eval/report.html",
436+
"eval/tests/conftest.py",
437+
"eval/tests/test_integration.py",
438+
"eval/tests/test_unit.py",
439+
"eval/thinking_instructions.md",
414440
"references/pattern-catalog.md",
415441
"references/remediation-guide.md",
416442
"scripts/preflight.py",
417443
"scripts/test_preflight.py"
418444
],
419445
"repo_dir": "skills",
420-
"version": "0.1.0"
446+
"version": "0.2.0"
421447
},
422448
"databricks-spark-structured-streaming": {
423449
"description": "Comprehensive guide to Spark Structured Streaming for production workloads. Use when building streaming pipelines, working with Kafka ingestion, implementing Real-Time Mode (RTM), configuring triggers (processingTime, availableNow), handling stateful operations with watermarks, optimizing checkpoints, performing stream-stream or stream-static joins, writing to multiple sinks, or tuning streaming cost and performance.",

scripts/skills.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040

4141

4242
def iter_skill_dirs(repo_root: Path, parent: str = STABLE_REPO_DIR):
43-
"""Yield skill directories under `parent` that contain SKILL.md."""
43+
"""Yield skill directories under `parent` that contain SKILL.md.
44+
45+
For the stable skills dir, also yields one level of nested sub-skill
46+
directories (e.g. skills/databricks-serverless-migration/databricks-serverless-storage-check/).
47+
"""
4448
skills_dir = repo_root / parent
4549
if not skills_dir.exists():
4650
return
@@ -52,6 +56,15 @@ def iter_skill_dirs(repo_root: Path, parent: str = STABLE_REPO_DIR):
5256
if not (item / "SKILL.md").exists():
5357
continue
5458
yield item
59+
if parent == STABLE_REPO_DIR:
60+
for subitem in sorted(item.iterdir()):
61+
if not subitem.is_dir():
62+
continue
63+
if subitem.name.startswith("."):
64+
continue
65+
if not (subitem / "SKILL.md").exists():
66+
continue
67+
yield subitem
5568

5669

5770
def iter_experimental_skill_dirs(repo_root: Path):

skills/databricks-serverless-migration/SKILL.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ parent: databricks-core
1313

1414
Analyze existing Databricks code for serverless compute compatibility and guide migration from classic clusters. The skill follows a 4-step migration lifecycle: **Ingest** the workload → **Analyze** for compatibility → **Test** via A/B comparison → **Validate** and iterate.
1515

16+
## Sub-skills
17+
18+
This skill is the top of a small hierarchy. Once a single-notebook migration is done, hand off to the niche sub-skill below for multi-task hardening before deploying to serverless:
19+
20+
| Sub-skill | Use when |
21+
|-----------|----------|
22+
| [`databricks-serverless-storage-check`](databricks-serverless-storage-check/SKILL.md) | The job has **multiple tasks** (parent/child notebooks via `dbutils.notebook.run`, sibling `notebook_task`s, or a `pipeline_task` downstream of a `notebook_task`) and shares files between them. Detects the `INTERNAL_ERROR: [Errno 13] Permission denied` / `/local_disk0/.../trustedTemp/...` failure class and rewrites the handoff to UC Volumes / `/Workspace` / `taskValues`. Invoke after this skill's single-notebook port, before the Step-3 test run. |
23+
24+
The sub-skill is a **diagnostic + fix** layer, not a replacement — keep this skill's 4-step lifecycle as the spine and call into the sub-skill only when the multi-task triggers fire.
25+
1626
## When to Use This Skill
1727

1828
- Migrating notebooks, jobs, or pipelines from classic compute to serverless
@@ -198,7 +208,7 @@ Scan the code for patterns that are incompatible with the serverless compute arc
198208
| Pattern | Severity | Fix |
199209
|---------|----------|-----|
200210
| `dbfs:/` or `/dbfs/` paths (persistent data) | Blocker | Replace with `/Volumes/<your_catalog>/schema/volume/path` |
201-
| `dbfs:/tmp/`, `/dbfs/tmp/`, paths with `cache`/`scratch`/`temp` | Warning | Use `/tmp/` or `/local_disk0/tmp/` (local driver disk) — do not use Volumes for temp files due to performance. **Per-task scratch only**: if another task (child notebook, sibling job task, or pipeline) needs to read the file, use UC Volumes or `/Workspace` — see [`databricks-serverless-storage-check`](../databricks-serverless-storage-check/SKILL.md). |
211+
| `dbfs:/tmp/`, `/dbfs/tmp/`, paths with `cache`/`scratch`/`temp` | Warning | Use `/tmp/` or `/local_disk0/tmp/` (local driver disk) — do not use Volumes for temp files due to performance. **Per-task scratch only**: if another task (child notebook, sibling job task, or pipeline) needs to read the file, use UC Volumes or `/Workspace` — see [`databricks-serverless-storage-check`](databricks-serverless-storage-check/SKILL.md). |
202212
| `file:///dbfs/` FUSE mount paths | Warning | Replace persistent paths with `/Volumes/...`; replace temp paths with `/local_disk0/tmp/` |
203213
| `dbutils.fs.mount(...)` | Blocker | Create UC external location + external volume |
204214
| `hive_metastore.db.table` | Warning | Migrate to UC or use HMS Federation: `CREATE FOREIGN CATALOG ... USING CONNECTION hms_connection` |

skills/databricks-serverless-storage-check/SKILL.md renamed to skills/databricks-serverless-migration/databricks-serverless-storage-check/SKILL.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: databricks-serverless-storage-check
33
description: "Detect cross-task file-sharing antipatterns in Databricks serverless jobs (writes to /local_disk0, /tmp, or trustedTemp that are read by sibling or child tasks on potentially different compute nodes) and recommend UC Volumes or /Workspace for handoff. Use when a serverless job fails with `INTERNAL_ERROR: [Errno 13] Permission denied` on /local_disk0 paths, when parallel child notebooks fail intermittently, when reviewing a DAB job before deploying to serverless, or when the user mentions trustedTemp, fan-out, or cross-task file handoff. Complements databricks-serverless-migration (which covers single-notebook migration)."
44
compatibility: Requires databricks CLI (>= v0.292.0) for --job-id and --run-id modes; --notebook / --dir / --job-yaml modes have no external dependencies.
55
metadata:
6-
version: "0.1.0"
7-
parent: databricks-core
6+
version: "0.2.0"
7+
parent: databricks-serverless-migration
88
---
99

1010
# Serverless Storage Check
1111

12-
**FIRST**: Use the parent `databricks-core` skill for CLI basics, authentication, and profile selection.
12+
**FIRST**: Use the parent `databricks-serverless-migration` skill for the overall classic-to-serverless migration workflow (Ingest → Analyze → Test → Validate), CLI auth (which it inherits from `databricks-core`), and per-task scratch guidance (`/local_disk0/tmp`). This skill is a niche sub-skill of that workflow — it focuses **only** on the cross-task handoff antipattern that the parent skill explicitly delegates here (see the Category B → DBFS-paths row in `databricks-serverless-migration/SKILL.md`).
1313

1414
This skill detects a specific class of serverless failure: **cross-task file handoffs through local disk**. On serverless compute, each task may run on a different node, so a path written by a parent task to `/local_disk0`, `/tmp`, or a `trustedTemp` directory is not guaranteed to be visible to a child task. The typical symptom is:
1515

@@ -32,14 +32,16 @@ Use this skill when any of these triggers appear:
3232
- The user mentions "trustedTemp", "fan-out", "cross-task file sharing", or `/local_disk0`
3333
- A new serverless job design needs a sanity check before first run
3434

35-
This skill is **complementary to**, not a replacement for, [`databricks-serverless-migration`](../databricks-serverless-migration/SKILL.md). That skill handles single-notebook migration and explicitly recommends `/local_disk0/tmp` for per-task scratch which is correct *inside* a task. The boundary between the two skills:
35+
This skill is a **niche sub-skill** of [`databricks-serverless-migration`](../SKILL.md) — the parent owns single-notebook migration and explicitly recommends `/local_disk0/tmp` for per-task scratch (which is correct *inside* a task). This sub-skill picks up where the parent leaves off: anything that crosses a task boundary. The boundary between the two skills:
3636

3737
| Concern | Use skill |
3838
|---------|-----------|
39-
| Migrating one notebook from classic DBR to serverless | `databricks-serverless-migration` |
40-
| Per-task scratch storage (intra-task) | `databricks-serverless-migration` (recommends `/local_disk0/tmp`) |
41-
| **Cross-task file handoff between parent/child notebooks or sibling tasks** | **this skill** |
42-
| Permission-denied on `/local_disk0` during a multi-task run | **this skill** |
39+
| Migrating one notebook from classic DBR to serverless | `databricks-serverless-migration` (parent) |
40+
| Per-task scratch storage (intra-task) | `databricks-serverless-migration` (parent — recommends `/local_disk0/tmp`) |
41+
| **Cross-task file handoff between parent/child notebooks or sibling tasks** | **this skill (sub-skill)** |
42+
| Permission-denied on `/local_disk0` during a multi-task run | **this skill (sub-skill)** |
43+
44+
Always invoke the parent skill **first** for the overall migration plan, then return here to harden cross-task handoffs before deploying a multi-task serverless job.
4345

4446
## Quick start
4547

@@ -131,10 +133,10 @@ If the scanner emits `ENV001`:
131133

132134
## Related skills
133135

134-
- [`databricks-serverless-migration`](../databricks-serverless-migration/SKILL.md)single-notebook classic-to-serverless migration. **Use that skill first** if the workload hasn't been migrated yet.
135-
- [`databricks-dabs`](../databricks-dabs/SKILL.md) — DAB structure and resource definitions. Use when authoring or fixing the `job.yml` flagged by `FANOUT003` or `FANOUT004`.
136-
- [`databricks-jobs`](../databricks-jobs/SKILL.md) — Lakeflow Jobs orchestration. Use when restructuring task dependencies to avoid the fan-out antipattern.
137-
- [`databricks-core`](../databricks-core/SKILL.md)parent skill for CLI auth and profile selection.
136+
- [`databricks-serverless-migration`](../SKILL.md)**parent skill**. Single-notebook classic-to-serverless migration and the overall Ingest → Analyze → Test → Validate lifecycle. **Always invoke first** if the workload hasn't been migrated yet — this sub-skill assumes you've already done the single-notebook port and are now hardening cross-task handoffs.
137+
- [`databricks-dabs`](../../databricks-dabs/SKILL.md) — DAB structure and resource definitions. Use when authoring or fixing the `job.yml` flagged by `FANOUT003` or `FANOUT004`.
138+
- [`databricks-jobs`](../../databricks-jobs/SKILL.md) — Lakeflow Jobs orchestration. Use when restructuring task dependencies to avoid the fan-out antipattern.
139+
- [`databricks-core`](../../databricks-core/SKILL.md)grandparent skill, inherited via `databricks-serverless-migration`, for CLI auth and profile selection.
138140

139141
## Reference docs
140142

skills/databricks-serverless-storage-check/agents/openai.yaml renamed to skills/databricks-serverless-migration/databricks-serverless-storage-check/agents/openai.yaml

File renamed without changes.

skills/databricks-serverless-storage-check/assets/databricks.png renamed to skills/databricks-serverless-migration/databricks-serverless-storage-check/assets/databricks.png

File renamed without changes.

skills/databricks-serverless-storage-check/assets/databricks.svg renamed to skills/databricks-serverless-migration/databricks-serverless-storage-check/assets/databricks.svg

File renamed without changes.

skills/databricks-serverless-storage-check/eval/evaluation_results.json renamed to skills/databricks-serverless-migration/databricks-serverless-storage-check/eval/evaluation_results.json

File renamed without changes.

skills/databricks-serverless-storage-check/eval/ground_truth.yaml renamed to skills/databricks-serverless-migration/databricks-serverless-storage-check/eval/ground_truth.yaml

File renamed without changes.

0 commit comments

Comments
 (0)