Writes liquid-handling protocols for Opentrons OT-2 and Flex robots using the official Protocol API v2. Automates pipetting, hardware modules, labware setup, and deck layouts.
Ships in alterlab-lab-integrations. 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.
Read when SKILL.md points to them; scripts run unread.
Opentrons is a Python-based lab automation platform for Flex and OT-2 robots. Write Protocol API v2 protocols for liquid handling, control hardware modules (heater-shaker, thermocycler), manage labware, for automated pipetting workflows.
This skill should be used when:
| Scenario | Use Instead |
|---|---|
| One script driving Hamilton/Tecan liquid handlers, plate readers, or mixed vendors | alterlab-pylabrobot |
| Sending an experiment to a remote cloud lab (Ginkgo Cloud Lab RACs) | alterlab-ginkgo-cloud |
| Protein expression/binding assays run by Adaptyv Bio's foundry | alterlab-adaptyv |
| Publishing the written wet-lab protocol with a DOI | alterlab-protocolsio |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-pylabrobot) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Every Opentrons protocol follows a standard structure:
from opentrons import protocol_api
# Metadata (descriptive only here; apiLevel lives in requirements)
metadata = {
'protocolName': 'My Protocol',
'author': 'Name <[email protected]>',
'description': 'Protocol description',
}
# apiLevel goes in exactly ONE of metadata/requirements: opentrons rejects a protocol
# that sets it in both. robotType is required for Flex protocols.
requirements = {
'robotType': 'Flex', # or 'OT-2'
'apiLevel': '2.22' # lowest level that has every feature you use (see below)
}
# Run function
def run(protocol: protocol_api.ProtocolContext):
trash = protocol.load_trash_bin('A3') # Flex: load a trash bin (or waste chute) before any drop_tip
# Protocol commands go here
Key elements:
protocol_api from opentronsmetadata for name/author/description; requirements for robotType + apiLevelrun() receiving a ProtocolContext; all protocol logic goes inside itprotocol.load_trash_bin(slot) or protocol.load_waste_chute() first, or drop_tip() fails with NoTrashDefinedErrorChoosing apiLevel: the latest is 2.29 (Flex robot software 9.1.1+; the opentrons 9.1.x package simulates up to it). Useful floors: 2.16 trash-bin/waste-chute loaders; 2.20 liquid-presence detection; 2.21 Absorbance Plate Reader; 2.22 Labware.load_liquid()/load_empty(); 2.24 liquid classes (transfer_with_liquid_class); 2.25 Flex Stacker; 2.27 concurrent module commands. Use the lowest level that covers your features so older robots can still run the protocol, and check it with opentrons_simulate.
Loading Instruments (Pipettes):
def run(protocol: protocol_api.ProtocolContext):
# Load pipette on specific mount
left_pipette = protocol.load_instrument(
'flex_1channel_1000', # Instrument name (Flex convention)
'left', # Mount: 'left' or 'right'
tip_racks=[tip_rack] # List of tip rack labware objects
)
Common pipette load names (these are the exact instrument_name strings — do NOT invent
p1000_single_flex-style names; Flex uses the flex_<channels>_<volume> convention):
flex_1channel_50, flex_1channel_1000, flex_8channel_50, flex_8channel_1000, flex_96channel_1000p20_single_gen2, p300_single_gen2, p1000_single_gen2, p20_multi_gen2, p300_multi_gen2Loading Labware:
# Load labware directly on deck
plate = protocol.load_labware(
'corning_96_wellplate_360ul_flat', # Labware API name
'D1', # Deck slot (Flex: A1-D3, OT-2: 1-11)
label='Sample Plate' # Optional display label
)
# Load tip rack
tip_rack = protocol.load_labware('opentrons_flex_96_tiprack_1000ul', 'C1')
# Load labware on adapter
adapter = protocol.load_adapter('opentrons_flex_96_tiprack_adapter', 'B1')
tips = adapter.load_labware('opentrons_flex_96_tiprack_200ul')
Loading Modules:
# Temperature module (Flex + OT-2)
temp_module = protocol.load_module('temperature module gen2', 'D3')
temp_plate = temp_module.load_labware('corning_96_wellplate_360ul_flat')
# Heater-Shaker module (Flex + OT-2)
hs_module = protocol.load_module('heaterShakerModuleV1', 'D1')
hs_plate = hs_module.load_labware('corning_96_wellplate_360ul_flat')
# Thermocycler module (takes up specific slots automatically)
tc_module = protocol.load_module('thermocyclerModuleV2')
tc_plate = tc_module.load_labware('nest_96_wellplate_100ul_pcr_full_skirt')
# Magnetic Module (OT-2 ONLY) — an active, motorized module. Flex does not
# support it; on Flex use the unpowered Magnetic Block instead (see below).
mag_module = protocol.load_module('magnetic module gen2', '1') # OT-2 numeric slot
mag_plate = mag_module.load_labware('nest_96_wellplate_100ul_pcr_full_skirt')
# Magnetic Block (Flex ONLY) — unpowered; labware is moved on/off it with the
# Gripper. There is no engage/disengage; it has no motors.
mag_block = protocol.load_module('magneticBlockV1', 'C2')
block_plate = mag_block.load_labware('nest_96_wellplate_100ul_pcr_full_skirt')
Basic Operations:
# Pick up tip
pipette.pick_up_tip()
# Aspirate (draw liquid in)
pipette.aspirate(
volume=100, # Volume in µL
location=source['A1'] # Well or location object
)
# Dispense (expel liquid)
pipette.dispense(
volume=100,
location=dest['B1']
)
# Drop tip
pipette.drop_tip()
# Return tip to rack
pipette.return_tip()
Complex Operations:
# Transfer (combines pick_up, aspirate, dispense, drop_tip)
pipette.transfer(
volume=100,
source=source_plate['A1'],
dest=dest_plate['B1'],
new_tip='always' # 'always', 'once', or 'never'
)
# Distribute (one source to multiple destinations)
pipette.distribute(
volume=50,
source=reservoir['A1'],
dest=[plate['A1'], plate['A2'], plate['A3']],
new_tip='once'
)
# Consolidate (multiple sources to one destination)
pipette.consolidate(
volume=50,
source=[plate['A1'], plate['A2'], plate['A3']],
dest=reservoir['A1'],
new_tip='once'
)
Advanced Techniques:
# Mix (aspirate and dispense in same location)
pipette.mix(
repetitions=3,
volume=50,
location=plate['A1']
)
# Air gap (prevent dripping)
pipette.aspirate(100, source['A1'])
pipette.air_gap(20) # 20µL air gap
pipette.dispense(120, dest['A1'])
# Blow out (expel remaining liquid)
pipette.blow_out(location=dest['A1'].top())
# Touch tip (remove droplets on tip exterior)
pipette.touch_tip(location=plate['A1'])
Flow Rate Control:
# Set flow rates (µL/s)
pipette.flow_rate.aspirate = 150
pipette.flow_rate.dispense = 300
pipette.flow_rate.blow_out = 400
Well Access Methods:
# By name
well_a1 = plate['A1']
# By index
first_well = plate.wells()[0]
# All wells
all_wells = plate.wells() # Returns list
# By rows
rows = plate.rows() # Returns list of lists
row_a = plate.rows()[0] # All wells in row A
# By columns
columns = plate.columns() # Returns list of lists
column_1 = plate.columns()[0] # All wells in column 1
# Wells by name (dictionary)
wells_dict = plate.wells_by_name() # {'A1': Well, 'A2': Well, ...}
Location Methods:
# Passing a Well aspirates 1 mm above its bottom by default
pipette.aspirate(100, well)
# top()/bottom() are exact: z=0 is the top rim / the well bottom itself
pipette.dispense(100, well.top()) # at the rim
pipette.aspirate(100, well.top(z=-2)) # 2 mm below the rim
pipette.aspirate(100, well.bottom(z=2)) # 2 mm above the bottom (z=0 would touch it)
# Center of well
pipette.aspirate(100, well.center())
Control temperature, magnetic, heater-shaker, thermocycler, and absorbance-reader modules. Each module context exposes its own set / wait / deactivate methods plus status properties (e.g. temp_module.set_temperature, hs_module.set_and_wait_for_shake_speed, tc_module.execute_profile). On Flex, the active Magnetic Module is replaced by the unpowered Magnetic Block (magneticBlockV1).
Full per-module code recipes (Temperature, Magnetic Module vs Flex Magnetic Block, Heater-Shaker, Thermocycler PCR cycling, Absorbance Plate Reader): see references/hardware_modules.md. The corresponding method/property tables are in references/api_reference.md.
Define Liquids:
# Define liquid types
water = protocol.define_liquid(
name='Water',
description='Ultrapure water',
display_color='#0000FF' # Hex color code
)
sample = protocol.define_liquid(
name='Sample',
description='Cell lysate sample',
display_color='#FF0000'
)
Load Liquids into Wells (API 2.22+):
# Mark starting contents per labware (volumes in µL)
reservoir.load_liquid(wells=['A1'], volume=50000, liquid=water)
plate.load_liquid(wells=['A1', 'A2'], volume=100, liquid=sample)
plate.load_liquid_by_well({'A3': 50, 'A4': 75}, liquid=sample)
# Mark wells as empty
plate.load_empty(['B1', 'B2'])
Well.load_liquid(liquid, volume) still works but is deprecated from 2.22; there is no Well.load_empty().
Execution Control:
# Pause protocol
protocol.pause(msg='Replace tip box and resume')
# Delay
protocol.delay(seconds=60)
protocol.delay(minutes=5)
# Comment (appears in logs)
protocol.comment('Starting serial dilution')
# Home robot
protocol.home()
Conditional Logic:
# Check if simulating
if protocol.is_simulating():
protocol.comment('Running in simulation mode')
else:
protocol.comment('Running on actual robot')
Rail Lights (OT-2 and Flex, API 2.5+):
# Turn lights on
protocol.set_rail_lights(on=True)
# Turn lights off
protocol.set_rail_lights(on=False)
When using multi-channel pipettes:
# Load 8-channel pipette
multi_pipette = protocol.load_instrument(
'p300_multi_gen2',
'left',
tip_racks=[tips]
)
# Access entire column with single well reference
multi_pipette.transfer(
volume=100,
source=source_plate['A1'], # Accesses entire column 1
dest=dest_plate['A1'] # Dispenses to entire column 1
)
# Column-wise with an 8-channel: target the row-A well of each column
for column_top in plate.rows()[0]: # A1, A2, ... A12
multi_pipette.transfer(100, reservoir['A1'], column_top)
With an 8-channel pipette, address row A wells only; targeting B1–H1 would put the other nozzles off the plate.
Reusable end-to-end templates cover the most common workflows: serial dilution (diluent fill plus mix-after cascade across a row), plate replication (whole-plate wells()-to-wells() copy), and PCR setup (master-mix distribute, per-sample transfer, thermocycler cycling).
Full worked-example protocols for each pattern: see references/protocol_patterns.md. Runnable .py versions are in the scripts/ directory (serial_dilution_template.py, basic_protocol_template.py, pcr_setup_template.py).
apiLevel that covers the features you use and that your robot's software accepts (confirm with opentrons_simulate)protocol.comment() for debugging and loggingnew_tip='once' when appropriate to save tipsfrom opentrons import protocol_api, the requirements/metadata, run(protocol), the thermocycler execute_profile, etc.), not only as a saved .py file — the user and reviewers read the answer, and a file left in the workspace is not visible to them.Common Issues:
For detailed API documentation, see references/api_reference.md in this skill directory.
For example protocol templates, see scripts/ directory.
Part of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)references/api_reference.md (opens in a new tab)references/hardware_modules.md (opens in a new tab)references/protocol_patterns.md (opens in a new tab)scripts/basic_protocol_template.py (opens in a new tab)scripts/pcr_setup_template.py (opens in a new tab)scripts/serial_dilution_template.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/alterlab-lab-integrations:alterlab-opentronsfrom alterlab-lab-integrations
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-lab-integrations9 skills in this plugin
/alterlab-benchlingWrites Benchling integration code against the official benchling-sdk — registry DNA/protein entities, inventory, ELN entries, workflow tasks, Benchling Apps, Data Warehouse SQL — and validates every create/update payload offline by building the SDK's typed models and serializing them, with no Benchling account; analyses Benchling CSV/warehouse exports locally. Running the code against a tenant is an optional step with the user's own API key or OAuth app. Use when scripting a Benchling registry import, inventory audit, ELN entry or workflow task, checking a Benchling payload or script before it touches a tenant, analysing a Benchling export, or querying the Benchling Data Warehouse. Part of the AlterLab Academic Skills suite./alterlab-dnanexusDevelops genomics apps, applets and workflows for the DNAnexus platform with the dxpy Python SDK and dx CLI — writes dxapp.json and entry-point code, lints the spec offline, runs entry points locally in dxpy's debug harness, and checks WDL for dxCompiler with miniwdl, all without an account; building, uploading data and running jobs on the platform is an optional step with the user's own DNAnexus login. Use when building or running a DNAnexus app, applet, or workflow, writing dxapp.json, using dx-app-wizard or dx build, calling dxpy (find_data_objects, DXApplet.run, upload_local_file), or uploading/downloading sequencing data on DNAnexus. For LatchBio (Latch SDK @workflow/@task, LatchFile) use alterlab-latchbio instead; for Benchling LIMS use alterlab-benchling. Part of the AlterLab Academic Skills suite./alterlab-ginkgo-cloudPrepares and validates Ginkgo Bioworks Cloud Lab orders with no account — picks the right protocol (cell-free protein expression validation/optimization, fluorescent pixel art, and the newer catalog), validates the inputs offline (DNA length/format for CFPS, image-to-7-strain-palette mapping for pixel art), and assembles the sample counts, pricing and Additional Details into a ready-to-order package. Placing the order runs through the cloud.ginkgo.bio web interface (there is no public ordering API) with the user's own account. Use when running cell-free protein expression (validation or optimization), generating fluorescent pixel art, preparing or pricing a Ginkgo Cloud Lab order, or interacting with Ginkgo Cloud Lab services. Part of the AlterLab Academic Skills suite./alterlab-labarchiveWrites and validates LabArchives ELN integration code and analyses exported notebooks with no account — reviews labapi/labarchives-py usage, drafts entry HTML and upload plans, and audits a LabArchives notebook export (folder tree or backup) offline for structure and provenance gaps with scripts/analyze_export.py. Reading or writing a live notebook (entries, attachments, backups) and the Protocols.io/Jupyter/REDCap bridges run against the user's own LabArchives account with their keys. Use when automating LabArchives ELN workflows, checking integration code, auditing an exported notebook, programmatically reading/writing entries or attachments, backing up a notebook, or syncing it with Protocols.io, Jupyter, or REDCap. Part of the AlterLab Academic Skills suite./alterlab-latchbioAuthors bioinformatics pipelines with the Latch SDK — @workflow/@task decorators, LatchFile/LatchDir I/O, CPU/GPU task sizing, the Latch Registry, and Nextflow/Snakemake wrapping — and validates them with no account, type-checking the decorators and workflow graph at import, running task functions locally on plain files, and inspecting the no-code UI metadata offline. Registering and running the workflow on LatchBio is an optional step with the user's own latch login and Docker. Use when developing a Latch SDK workflow, sizing task resources, checking a workflow before latch register, working with the Registry, or porting a Nextflow/Snakemake pipeline onto LatchBio. Not for DNAnexus (dxpy/dx CLI) or generic Flyte. Part of the AlterLab Academic Skills suite./alterlab-omeroWorks with microscopy image data via the OMERO Python API (BlitzGateway) — writes and validates the integration code, analyses local OME-TIFF/microscopy pixels, ROIs and channels with tifffile offline, and browses or pulls from public OMERO servers (the IDR JSON API, webgateway and OME-Zarr) with no credentials. Connecting to the user's own OMERO server to read, write or batch-process their images is an optional step with their host, port and login. Use when writing OMERO/BlitzGateway code, analysing microscopy pixels or ROIs, pulling images or datasets, managing annotations, or running high-content screening and microscopy workflows. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job