agentleFS
dzivkovidzivkovi/agent-skills-on-databricks/CLAUDE.md

agent-skills-on-databricks

CLAUDE.md2 starsChanged 4 months agoMITView on GitHub

An imported skill is READ-ONLY: skills/<name>/ is byte-identical to what a Claude Code user has, and nothing Databricks-specific may be added to it - no wrapper, no import, no registration. All platform code lives in the harness (src/run_skill.py plumbing, src/adapters.py shaping, databricks.yml config). When Databricks throws an obstacle, the harness absorbs it; the skill never learns. This repo is teaching material, and that boundary is the lesson - do not erode it for convenience. Adapter choice is harness config: the…

The file

We split this CLAUDE.md into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every new feature with a runtime surface adds (or extends) a scripts/e2e_*.py suite.

    line 24
  2. Distinctive:

    Never let a PR say "Closes #N" on local proof alone.

    line 35
  3. Distinctive:

    When a change spans the runner AND skills, republish the skills FIRST (additive - the old runner ignores new files), then databricks bundle …

    line 44
  4. Very specific:

    Do not reach for the alternatives: dbutils.jobs.taskValues is documented notebook-only and does not exist in a spark_python_task.

    line 55
  5. Very specific:

    Only ok (which must carry a report_path) and rejected are legal statuses.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md - agent working notes for this repo

The boundary (read this before touching skills/)

An imported skill is READ-ONLY: skills/<name>/ is byte-identical to what a Claude Code user has, and nothing Databricks-specific may be added to it - no wrapper, no import, no registration. All platform code lives in the harness (src/run_skill.py plumbing, src/adapters.py shaping, databricks.yml config). When Databricks throws an obstacle, the harness absorbs it; the skill never learns. This repo is teaching material, and that boundary is the lesson - do not erode it for convenience.

Adapter choice is harness config: the job passes --adapter report|deck. It is never declared in SKILL.md, because which adapter to use is a fact about the platform, not the skill. A skill of an existing shape costs nothing to add (publish the folder, point --skill-dir at it); only a new output SHAPE needs a new adapter, in src/adapters.py.

Definition of done

A feature is done only when the DEPLOYED system passes the full smoke suite, not when unit tests are green:

python scripts/smoke.py --profile coldstart    # pytest + every scripts/e2e_*.py, live

Every new feature with a runtime surface adds (or extends) a scripts/e2e_*.py suite; smoke.py auto-discovers them, so coverage cannot silently lag the feature list.

Two kinds of test, kept apart on purpose: tests/ is creds-free (every Databricks dependency is faked, so it runs anywhere with no workspace and no token), and scripts/e2e_*.py are live standalone scripts a bare pytest does not collect. If you ever add a test to tests/ that DOES need a real workspace, mark it @pytest.mark.integration so CI can run pytest -m "not integration". The marker is registered in pytest.ini with strict_markers, which turns a typo into a collection error - without it a mistyped marker is only a warning and -m "not integration" then INCLUDES that test, so the workspace-dependent test runs in CI anyway.

Never let a PR say "Closes #N" on local proof alone. If any acceptance criterion or premise is unverified against the deployed system, the PR says "Refs #N" and the ticket stays open until a live run proves it. (Lesson of 2026-07-16: "Closes #2" shipped while the skill had never run on Databricks; the owner discovered the gap from a closed tracker.)

Rollout order (skills are volume-published, not bundled)

databricks.yml excludes skills/ from the bundle; skills live on a shared UC volume. After changing a skill, republish it: python scripts/publish_skill.py skills/<name> --profile coldstart. When a change spans the runner AND skills, republish the skills FIRST (additive - the old runner ignores new files), then databricks bundle deploy.

Chaining skills (the report_to_deck job)

A chain is not a new program: it is two runs of the SAME runner with different --skill-dir. The upstream task writes a run-scoped manifest (--manifest-out .../_runs/{{job.run_id}}/manifest.json), the downstream task reads it (--manifest-in <same path>) and works on whatever the upstream produced. The manifest carries STATUS, not just a path, so a quarantined input makes the downstream task SKIP and succeed - the reject queue's promise held across a chain.

Do not reach for the alternatives: dbutils.jobs.taskValues is documented notebook-only and does not exist in a spark_python_task; recomputing the upstream's dated filename breaks when a run straddles UTC midnight; glob-newest is brittle under retries and concurrent runs.

A multi-task job must be triggered with JOB parameters (run_now(job_parameters={...})), never python_params - the latter pushes identical argv into every task, and chained tasks by definition need different arguments.

Only ok (which must carry a report_path) and rejected are legal statuses; a downstream task raises on anything else rather than skipping, because a malformed manifest that read as a clean skip would be a silent no-output success. Note the downstream task re-guards its input, which for a chain is the upstream's generated report (not the original document - the report carries metrics plus an LLM reading, never the raw source). Guarding a derived artifact again is accepted on purpose: it is the artifact a human opens, and a rejection there behaves like any other - the report is quarantined with a reason and the batch still succeeds.

Unity Catalog volume traps

Volumes support sequential writes, NOT random access. Anything that seeks while writing - a zip archive, and therefore any .pptx/.xlsx/.docx - fails at close() with OSError errno 5 (I/O error) or errno 95 (operation not supported) when written straight to /Volumes/.... Build such artifacts in memory (BytesIO) or on local disk, then write the finished bytes in one sequential write. Plain markdown/text writes are unaffected. Found live in the #2 e2e; the fix belongs in the harness adapter (src/adapters.py), never in the skill or the runner's plumbing.

Git Bash traps (Windows)

  • Volume paths need the scheme prefix: databricks fs ls dbfs:/Volumes/... (a bare /Volumes/... path gets mangled by Git Bash, and MSYS_NO_PATHCONV=1 does not fix it).
  • databricks bundle run <job> -p <profile> -- --flag value REPLACES the deployed task parameters wholesale (no merge). To override selectively, read the deployed params first the way scripts/e2e_test.py does.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.