/oracle-ai-data-platform-workbench-databricks-migrator:aidp-migrate-jobfrom oracle-ai-data-platform-workbench-databricks-migrator
Executes a full Databricks-to-AIDP migration against a manifest: rewrites Databricks APIs in notebook code (Pass-1) then runs each task cell-by-cell on a live AIDP cluster with 4-way verification and up to 5 auto-retries.
Ships in oracle-ai-data-platform-workbench-databricks-migrator. 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.
aidp-migrate-job — execute the migrationThis is the main event. Pass-1 fixes the code, Pass-2 proves it runs.
Do NOT invoke this skill without:
reports/<job>_manifest.json (use aidp-build-dag).aidp-check-data (or an explicit "I know data is missing, proceed anyway" from the user).ANTHROPIC_API_KEY set.~/.oci/config valid for the chosen profile.job_migrate_from_workflow.py is the canonical runner (it drives the core job_migrate.py library — do not invoke job_migrate.py directly):
export ANTHROPIC_API_KEY=sk-ant-...
python3 ${CLAUDE_PLUGIN_ROOT}/engine/scripts/job_migrate_from_workflow.py \
--config <customer>.yaml \
--job-key <workflow-key>
Or against a pre-built manifest:
python3 ${CLAUDE_PLUGIN_ROOT}/engine/scripts/job_migrate_from_workflow.py \
--config <customer>.yaml \
--manifest reports/<MyJob>_manifest.json
The customer YAML (--config; falls back to $AIDP_CONFIG_PATH, ./aidp_migrator.yaml, ~/aidp_migrator.yaml) supplies the AIDP coordinates and paths.migrate_output; --migrate-output <path> is a per-run override (--output-base is a deprecated alias). Never pass --cluster — it is a deprecated, warned no-op; per-task clusters come from the workflow/manifest.
Tail the log in another terminal:
# the migrator streams to stdout; tee it yourself to follow from another shell:
python3 ${CLAUDE_PLUGIN_ROOT}/engine/scripts/job_migrate_from_workflow.py ... 2>&1 | tee migration.log
| Flag | When to use |
|---|---|
--start-task <substring> | Resume from this task (skip everything before). Pairs with aidp-resume-migration. |
--only-tasks <names> | Run ONLY these specific tasks. Useful for re-running a single failed task. |
--skip-migrated | Reuse notebooks already migrated in a prior run. Default OFF (fresh migration guarantees nested %run deps are converted); prefer --start-task to scope a resume. --no-skip-migrated states the default explicitly. |
--catalog-manifest <path> | Apply deterministic source-catalog → default remap in string literals (the --out-manifest file from migrate_catalog.py). Only on job_migrate_from_workflow.py — the core job_migrate.py has no such flag. |
Pass 1 — DEPS (ensure_migrated):
For every transitive %run / notebook.run target:
if already in _migration_cache or already on cluster → SKIP
else → migrate code only (Claude rewrites Databricks APIs)
save .ipynb to <migrate-output>/<job>/deps/
Pass 2 — TASKS (per task in topo order):
For each task notebook, for each code cell:
1. Analyze (cell_plan: description, action, risks)
2. Migrate (Claude with tool use rewrites)
3. Execute on live cluster via WebSocket
4. Verify:
a. raised exception?
b. error patterns in stdout? ("Error:", "Traceback", "FAILED")
c. Spark logs show stage failure?
d. Opus eval: does the output look correct?
5. If any verify check failed → call_fix() with Claude + full tools.
Up to 5 fix attempts per cell (MAX_FIX_ATTEMPTS; env AIDP_MAX_FIX_ATTEMPTS
or runtime.fix_max_attempts in the YAML). fixup_cell can rewind to
earlier indices.
Save the fixed-up .ipynb to <migrate-output>/<job>/notebooks/...
Emit JOB_REPORT.md
Key lines in the migrator's output:
[12:34:56] [<job>/<task>] Cell 5/27: OK
[12:35:42] [<job>/<task>] Cell 12/27: OK (fixed attempt 2)
[12:36:18] [<job>/<task>] Cell 14/27: VERIFY FAIL (attempt 3/5): TABLE_OR_VIEW_NOT_FOUND
[12:39:01] [<job>/<task>] [child:helpers/io_utils.ipynb] Cell 3/8: OK
[12:42:15] [<job>/<task>] [fixup_cell] Rewinding to index 7 (reason: variable redefined upstream)
[12:48:30] [<job>/<task>] RESULT: PASS
RESULT: PASS → all cells executed cleanly. RESULT: PARTIAL → some cells failed all 5 attempts; review JOB_REPORT.md. RESULT: FAIL → catastrophic (cluster died, manifest broken).
After a successful run:
<migrate-output>/<job-name>/
notebooks/Users/.../<notebook>.ipynb ← the migrated, run-validated notebook
deps/dep_<name>/<notebook>.ipynb ← Pass-1 dep artifacts (informational)
tasks/<numbered_key>/ ← per-task reports
reports/
JOB_REPORT.md ← cell pass/fail/fix counts
The migrated .ipynbs are uploaded to your AIDP workspace at <migrate-output> AND saved to your local ./reports/<job-name>/ for offline review.
| Symptom | Skill / fix |
|---|---|
RESULT: PARTIAL with N cells failing all 5 attempts | aidp-fixup-cell for each. |
| Cluster died mid-run (WS disconnects) | Restart cluster. Re-invoke with --start-task <substring> (or an explicit --skip-migrated for a confident resume — it is OFF by default). |
| User wants to abort | kill <pid> with the PID recorded at launch (SIGTERM) — lets the current cell finish. pkill -f would also hit other users' runs on a shared host. |
| User wants to resume after manual fixes to a dep | aidp-resume-migration. |
Migrated table is in the redirect schema (<sandbox>) but user expected production location | Expected: the write-redirect sandbox is mandatory during migration (there is NO bypass flag). Promote data to the production location as a deliberate post-migration step, outside the migrator. |
.saveAsTable(...) / INSERT INTO is silently rewritten to a sandbox <schema>.<table> location during migration. Source production data is never touched. The redirect schema is verified per-task (databaseExists) — if verification fails, the task fails fast.--no-redirect-schema (or equivalent) flag — the data-safety gate is unconditional during migration./Volumes/default/default/dbfs/, /tmp/) and the output directory as AIDP_SANDBOX_CATALOG / AIDP_SANDBOX_SCHEMA / AIDP_SANDBOX_PREFIX in the kernel, and freezes that declaration for the kernel. aidp_compat then refuses, before execution, any dbutils.notebook.run child cell that imports subprocess / network modules (also via importlib, builtins, sys.modules or an alias), reads os.environ, calls shutil.rmtree / eval / exec, imports or rebinds the compat shims / policy module, or opens, removes, renames or writes (open, pathlib, os.remove, shutil.move, df.write.*, writeTo, spark.sql DDL/DML, dbutils.fs.*) a target outside the sandbox (PermissionError naming notebook, cell index, rule id, remediation); targets that cannot be resolved statically are refused unless allowlisted; .. segments never count as inside. dbutils.fs.rm/mv/cp/put/mkdirs + safe_io writers assert their targets at runtime. Refusals appear in the task test report under Notebook Policy Log. If a refusal is legitimate, the fix is a reviewed exception (AIDP_NOTEBOOK_POLICY_ALLOW=<rule-id>), an extra staging prefix (comma-separated AIDP_SANDBOX_PREFIX, set on the cluster before the bootstrap -- it replaces the whole list), or AIDP_SANDBOX_ALLOW_NETWORK=1 -- never editing the gate. The gate is a static check of listed forms, not a Python sandbox; the runtime assertions are the enforcement layer for compat-helper writes (see engine/aidp_compat/SUPPORTED_OPERATIONS.md section 5 for what is not covered).dbutils.secrets resolves from OCI Vault only. Do not set AIDP_ALLOW_PLAINTEXT_SECRETS=1 on a cluster that runs customer notebooks; it is a local-demo switch. The bootstrap also restricts dbutils.secrets to the scope/key literals found while planning each task (AIDP_SECRET_SCOPES / AIDP_SECRET_KEYS; none before the first task). A NBP-RUNTIME-SECRET refusal in the Notebook Policy Log means a scope/key the plan did not see (for example a scope taken from a widget): the fix is an operator-provided AIDP_SECRET_SCOPES / AIDP_SECRET_KEYS on the cluster after review.--skip-migrated is OFF), which re-spends Claude tokens AND can overwrite manual fixes the user applied to a previously-migrated notebook at the output path. If the user has manual edits, get an explicit "yes, overwrite" or scope the run with --start-task / --only-tasks / --skip-migrated./migration-status command auto-parses it).PARTIAL cells, route to aidp-fixup-cell.aidp-acceptance-contract.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (oracle-samples/oracle-aidp-samples) — no native marketplace selected
npx claudepluginhub p/oracle-samples-oracle-ai-data-platform-workbench-databricks-migrator-ai-claude-code-plugins-oracle-ai-data-platform-workbench-databricks-migratorNone: SKILL.md is the whole skill.
11 skills in this plugin
/aidp-acceptance-contractManifest-declared acceptance contract for batch and streaming pipelines that need convergence verification, not just "no exceptions". Declares PASS only after K consecutive zero-result windows (consecutive-zero-window convergence). Use for streaming jobs, slowly-draining backfills, or any pipeline whose success is "the pending queue is empty"./aidp-bucket-mappingConfigure the s3:// → oci:// bucket / namespace mapping the migrator uses to rewrite paths during notebook + catalog migration. Use when (a) the user has external tables / files at s3:// paths that need to land on OCI Object Storage, OR (b) check_data_availability reports s3:// paths as NOT FOUND because the bucket isn't mapped, OR (c) the DDL rewriter logs an R02_BUCKET_UNMAPPED warning./aidp-build-dagBuild a migration manifest (the execution DAG) from an AIDP workflow (exported from Databricks by dbx_export). Walks %run dependency chains, captures dbutils.notebook.run invocations, and emits reports/<job>_manifest.json — the input every other execute-skill consumes. Use when the user wants to see what would migrate, or before invoking aidp-migrate-job for the first time on a new workload.Other plugins' skills for the same job