$npx -y skills add sparklabx/drawio-ai-kit --skill drawio-databricksUse when the user asks for a Databricks lakehouse architecture diagram — medallion architecture (Bronze/Silver/Gold), Delta Lake, Unity Catalog, workspace deployment, data-plane/control-plane, or any diagram built with Databricks icons. Builds with the declarative layout engine u
| 1 | # Draw.io Databricks |
| 2 | |
| 3 | Produce correct Databricks lakehouse architecture diagrams in draw.io. This skill |
| 4 | is a thin frontend; the deterministic engine, validator, and rules live in the |
| 5 | `drawio-ai-kit` package, reached via the `drawio-ai` CLI. |
| 6 | |
| 7 | ## 0. Preflight — the CLI must be installed |
| 8 | |
| 9 | ```bash |
| 10 | command -v drawio-ai >/dev/null 2>&1 || echo "Install the Kit first: npm i -g github:sparklabx/drawio-ai-kit" |
| 11 | ``` |
| 12 | |
| 13 | If `drawio-ai` is **not** on PATH, stop and tell the user to run |
| 14 | `npm i -g github:sparklabx/drawio-ai-kit`. **Never run `npm i -g` yourself** — nothing mutates the |
| 15 | user's global environment without their say-so. |
| 16 | |
| 17 | ## 1. Delegate the build (preferred when your harness supports it) |
| 18 | |
| 19 | If your harness can spawn autonomous subagents that run shell commands AND read |
| 20 | images (e.g. Claude Code's Task tool, a general-purpose agent), run the whole |
| 21 | build loop in a subagent — the rules, icon searches, and every render/fix |
| 22 | iteration then cost this conversation nothing. If it can't (or the subagent |
| 23 | can't read images), skip to **Inline path** below — same loop, same rules. |
| 24 | |
| 25 | **Before spawning**, resolve what the subagent cannot ask about: diagram scope, |
| 26 | output directory (absolute path under the user's project), filename. Run the |
| 27 | preflight above yourself. For a multi-diagram request, spawn one subagent per |
| 28 | diagram in parallel with distinct filenames. |
| 29 | |
| 30 | |
| 31 | **Model routing** — if your harness lets you choose the subagent's model, route by |
| 32 | task weight: a **fast/cheap tier** (Claude Haiku-class — must support vision) when |
| 33 | the request matches a template from the rules' Templates table (reproduction is |
| 34 | mechanical; the validator's advice strings teach every fix), your **default strong |
| 35 | model** for free-hand or novel architectures. If a cheap subagent returns VALIDATE |
| 36 | not ok or ITERATIONS > 3, respawn ONCE on the strong model before taking over |
| 37 | inline. Multi-diagram requests: route each diagram independently. |
| 38 | |
| 39 | Subagent prompt (fill every `<...>`): |
| 40 | |
| 41 | ```text |
| 42 | Build a Databricks lakehouse architecture .drawio diagram with the drawio-ai CLI. |
| 43 | Request: <user's request + clarifications, verbatim> |
| 44 | Output: <ABS_PROJECT_DIR>/<NAME>.drawio — never write inside the Kit, never into cwd. |
| 45 | Follow exactly: |
| 46 | 1. Set ROOT="$(drawio-ai root)". Read $ROOT/docs/api-cheatsheet.md — the full layout-engine |
| 47 | API in one file; never read library source. |
| 48 | 2. Run `drawio-ai workflow` and `drawio-ai principles --mode databricks` — the source of |
| 49 | truth. (Fallback if a command is blocked: read $ROOT/rules/*.md directly.) |
| 50 | 3. Look up every icon with ONE batched `drawio-ai search "a, b, c"`; never recolor icons. |
| 51 | 4. Scaffold, don't write: `drawio-ai scaffold --list`, pick the closest template, then |
| 52 | `drawio-ai scaffold <name>.mjs -o <dir>/build.mjs` — the script arrives runnable and |
| 53 | self-checking. Edit only the deltas; Write a new script only if no template is close |
| 54 | AND you'd change more than half of it. |
| 55 | 5. Each `node build.mjs` run prints validate JSON AND the render's machine-readable |
| 56 | `issues` list. Fix from THAT checklist — all issues in one Edit round — then re-run. |
| 57 | Loop until issues is empty. |
| 58 | 6. Only when issues is empty: Read the PNG once as final visual confirmation. Target <= 2 |
| 59 | PNG reads total. Then render once WITHOUT --check for the final deliverable PNG. |
| 60 | Do NOT invoke any drawio skill — this prompt already contains the full procedure. |
| 61 | Do not ask questions — make the standard choice and record it under ASSUMPTIONS. |
| 62 | Return EXACTLY this block, nothing else: |
| 63 | DRAWIO: <absolute path to .drawio> |
| 64 | PNG: <absolute path to .png> |
| 65 | VALIDATE: <verbatim final validate JSON> |
| 66 | ICONS: <comma-separated icon names used> |
| 67 | ITERATIONS: <number of render/fix cycles> |
| 68 | SUMMARY: <one sentence describing the diagram> |
| 69 | ASSUMPTIONS: <choices made without asking, or "none"> |
| 70 | ``` |
| 71 | |
| 72 | Relay `DRAWIO`, `PNG` and `SUMMARY` to the user verbatim; do NOT re-read the |
| 73 | .drawio or PNG in this conversation — the subagent already ran the vision |
| 74 | self-check. If `VALIDATE` is not ok, take over via the Inline path (the build |
| 75 | .mjs and .drawio are on disk at the returned paths). |
| 76 | |
| 77 | ## Inline path (no subagent support) |
| 78 | |
| 79 | ### 1. Shared Workflow |
| 80 | |
| 81 | ```bash |
| 82 | drawio-ai workflow |
| 83 | ``` |
| 84 | |
| 85 | Prints the build → validate → render → write-to-project-path loop every diagram |
| 86 | follows. Read it; it is the source of truth for the process. |
| 87 | |
| 88 | ### 2. Domain rules |
| 89 | |
| 90 | ```bash |
| 91 | drawio-ai principles --mode databricks |
| 92 | ``` |
| 93 | |
| 94 | Returns the Databricks rules + shared principles + catalog categories. |
| 95 | |
| 96 | ### 3. Build with the engine, then validat |