Skip to content

Guide · Agent skill

How to use the PathML agent skill for pathology research

Updated · written with AI from the project's own documentation and checked against our catalogue data

The PathML skill gives an AI agent a structured workflow for local computational pathology research on whole-slide images, covering slide loading, tiling, preprocessing, QC, multiplex quantification and spatial graphs. This guide explains what the skill changes, how to install it and set up its native dependencies, how to phrase requests so it triggers, and which privacy and safety limits apply. You do not need prior experience with agent skills to follow it.

PathML Computational Pathology HelperK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download the ZIP. Download the skill ZIP from this page. Keep the folder structure intact so SKILL.md sits at the top level.
  2. 2Install it for your agent. Unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills instead.
  3. 3Install native prerequisites. Install OpenSlide, a JDK with javac and JNI headers, and build tools using your platform's package manager, then set JAVA_HOME to the JDK.
  4. 4Create the Python environment. Use uv to create a Python 3.11 virtual environment and install pathml with uv pip install, without the all extra.
  5. 5Make a natural request. Describe the pathology research task, the stain or platform, and that the data is de-identified. The agent should load the skill.
  6. 6Run a bounded sample first. Apply the pipeline to a few tiles, check masks and coordinates, then scale up only after the sample looks right.

What the PathML skill makes the agent do

Agent skills are folders of instructions and helper scripts that an AI agent loads when a task matches their description. This one covers local computational pathology research with PathML. Once installed, the agent follows the skill's workflow instead of improvising PathML code from general knowledge.

The skill covers slide loading and tiling, preprocessing and quality control, storage in h5path files, multiplex quantification, spatial graphs and bounded model inference. It names H&E whole-slide workflows and CODEX, Vectra, Mesmer, HoVer-Net and HACTNet workflows as its target use cases.

  • Validates a slide manifest and rejects URLs and symlinks
  • Plans tiling, inference and pipeline runs before doing heavy work
  • Checks image QC on synthetic or local data
  • Validates spatial data schemas for cell and tissue graphs
  • Enforces de-identification, pseudonymous IDs and patient-level data splits

Install the skill: download the ZIP and unzip it

Download the skill ZIP from this page. Then choose one of two routes.

For Claude Code, unzip the folder into your personal skills directory ~/.claude/skills/, or into a project's .claude/skills/ directory if you want the skill available only in that project. The folder should contain SKILL.md at its top level.

In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

  • Personal use across projects: ~/.claude/skills/
  • Single project only: .claude/skills/ inside the project folder
  • Claude apps: Settings → Capabilities → Skills

Set up the PathML environment and native dependencies

The skill needs Python 3.10 to 3.12, with 3.11 recommended. Install the native prerequisites first. PathML's Java-based backend needs a full JDK with javac and JNI headers, not just a JRE, and JAVA_HOME must point to it before building. Selecting the OpenSlide reader does not avoid the Java dependencies.

Then create the environment with uv and install PathML. Do not use the all extra; the source says the package declares no extras.

  • Python 3.10 to 3.12, 3.11 recommended
  • uv package manager
  • Native OpenSlide library and a JDK 17 with javac and JNI headers
  • JAVA_HOME set to that JDK
  • Optional CUDA build matching the pinned PyTorch version, chosen with PyTorch's platform selector
  • Network access for installation and optional model or dataset downloads
# Debian/Ubuntu sudo apt-get install openslide-tools gcc g++ libblas-dev liblapack-dev openjdk-17-jdk # macOS brew install openslide openjdk@17 uv venv --python 3.11 source .venv/bin/activate uv pip install "pathml==3.0.8" python -c "import importlib.metadata as m; print(m.version('pathml'))"

Trigger the skill with natural requests

You do not need special syntax. Describe the research task and name the data type or tool, and the agent should match the skill description. Mention de-identified or pseudonymous data up front, since the skill asks for those steps before processing.

Good requests name the task, the stain or platform, and the stage you want. For example: plan the tiling for a folder of de-identified H&E slides before running anything; check tissue masks and QC on a few training slides; validate the spatial schema for a CODEX cell graph.

  • Plan tiling and memory use for a de-identified H&E slide set
  • Pilot tissue detection on representative training slides only
  • Validate a slide manifest before any processing
  • Build cell graphs from a Mesmer or HoVer-Net instance map
  • Check that a multiplex export keeps its intensities intact

Follow a bounded first run

The skill recommends a small manual sample before a full run. Load the slide with a PathML slide class, define a pipeline, and apply it to the first few tiles. Tiles use (row, column) coordinates at the chosen pyramid level, so record the level, downsample and microns per pixel with your results. Use level 0 or an exact integer downsample, because fractional downsample can shift the sampled region.

Before comparing measurements across scanners, check the physical calibration for X and Y separately. Do not infer it from objective magnification alone.

from pathml.core import HESlide from pathml.preprocessing import BoxBlur, Pipeline, TissueDetectionHE slide = HESlide("data/pseudonymous_slide.svs", backend="openslide") pipeline = Pipeline( [ BoxBlur(kernel_size=5), TissueDetectionHE(mask_name="tissue", min_region_size=5000), ] ) slide.run( pipeline, distributed=False, tile_size=512, tile_stride=512, level=0, tile_pad=False, ) slide.write("derived/pseudonymous_slide.h5path")

Safety notes: data, scripts and network access

PathML is beta research software and is not a validated medical device or diagnostic tool. Do not use outputs to diagnose, grade, stage or treat a patient. Pathology files can contain faces, labels, accession numbers, DICOM tags and filenames, so confirm authorization and de-identify pixels and metadata before processing. Keep the re-identification key outside the analysis workspace.

The skill runs bundled Python scripts and uses the network during installation and for optional model or dataset downloads. The planners and validators need only the standard library; optional metadata and image inspection needs its reader package. The skill's own review notes that its bundled CLIs were tested with synthetic data, and that no slides, model weights or datasets were downloaded for that review.

  • Read the scripts before running them on sensitive data
  • Keep inputs, intermediates and outputs on approved encrypted local storage
  • Do not put direct identifiers in filenames, logs or .h5path labels
  • Split by patient, then slide, before tiling or fitting preprocessing

Tips for getting reliable results

Keep the environment pinned. The skill says not to upgrade the scientific stack packages independently, and to test the exact environment you plan to use. Record provenance, including the package lock, source hashes, parameters, seeds, split manifest and QC decisions, so a run can be reproduced.

For multiplex work, bio-formats tile extraction can be told not to normalize intensities, but h5path files store tile images and masks as float16. Store quantitative images and integer instance maps separately when exact values matter.

  • Pin and test the environment before a real project
  • Freeze splits before generating overlapping tiles or features
  • Keep predictions linked to slide and tile coordinates

What people use it for

  • Planning tiling and memory use for a set of de-identified whole-slide H&E images before a run
  • Piloting tissue detection and QC on representative training slides without tuning on test data
  • Validating a manifest and checking the spatial schema for a CODEX or Vectra cell graph
  • Preparing h5path storage for multiplex quantification while keeping exact intensities separate

Frequently asked questions

How do I install the PathML agent skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

What do I need installed before using it?

You need Python 3.10 to 3.12 (3.11 recommended), the uv package manager, native OpenSlide, a JDK with javac and JNI headers with JAVA_HOME set, and network access for installation. CUDA is optional.

Is the PathML skill free to use?

The skill is MIT-licensed. PathML itself is GPL-2.0 with upstream commercial licensing options, so review upstream terms before redistributing it.

Why does PathML fail to install on my machine?

The most common cause is a missing or incomplete JDK. python-javabridge needs a JDK with javac and JNI headers, not a JRE, and JAVA_HOME must point to it before building. Old advice about Java 8 and an older javabridge release does not match the current wheel requirements.

Can I use the skill for clinical diagnosis?

No. The skill and PathML are research tools, not validated medical devices or diagnostic systems. Do not use their outputs to diagnose, grade, stage or treat a patient.

How does this compare with running PathML by hand?

The skill adds a structured workflow, validation and planning scripts, and privacy steps on top of the PathML API. The source does not compare it with other tools, so choose based on whether you want that guided workflow.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Choose this skill if you run local, de-identified computational pathology experiments with PathML and want an agent to follow a careful, reproducible workflow. Skip it if you need clinical decisions, if you are processing identifiable slides without authorization, or if you want a simple install, since the native Java and OpenSlide stack is heavy and must be tested in your exact environment.

Download the skill