Skip to content

K-Dense-AI/scientific-agent-skills / skills/opentrons-integration

opentrons-integration

Verified

Authors, reviews, migrates, simulates, and troubleshoots official Opentrons Python Protocol API v2 protocols for Flex and OT-2 robots. Use for robot-specific liquid handling, deck and labware setup, pipettes, modules, runtime parameters, liquid classes, and Opentrons App analysis. Use pylabrobot instead when one workflow must support multiple robot vendors.

scripts/runtime_parameters_template.py

View on GitHub
"""Flex runtime-parameter template with simulation-safe defaults.

The operator can choose sample count, transfer volume, and dry-run mode in the
Opentrons App without editing source code. Validate the full allowed parameter
space and volume budget before adapting this template to an assay.
The dry_run parameter only shortens a delay: liquid handling still occurs.
"""

from opentrons import protocol_api

metadata = {
    "protocolName": "Flex Runtime Parameters Template",
    "author": "Customize before use",
    "description": "Distribute buffer using operator-selected safe parameters.",
}

requirements = {
    "robotType": "Flex",
    "apiLevel": "2.29",
}


def add_parameters(parameters: protocol_api.ParameterContext) -> None:
    """Define values that the operator may change during run setup."""
    parameters.add_int(
        variable_name="sample_count",
        display_name="Sample count",
        description="Number of destination wells to fill.",
        default=8,
        minimum=1,
        maximum=12,
    )
    parameters.add_float(
        variable_name="transfer_volume",
        display_name="Transfer volume",
        description="Buffer volume delivered to each well.",
        default=50.0,
        minimum=10.0,
        maximum=100.0,
        unit="µL",
    )
    parameters.add_bool(
        variable_name="dry_run",
        display_name="Dry run",
        description="Shorten incubation only; liquid handling still occurs.",
        default=True,
    )


def run(protocol: protocol_api.ProtocolContext) -> None:
    """Distribute buffer according to validated runtime values."""
    sample_count = protocol.params.sample_count
    transfer_volume_ul = protocol.params.transfer_volume
    dry_run = protocol.params.dry_run

    tips = protocol.load_labware(
        "opentrons_flex_96_tiprack_200ul",
        "D1",
        label="200 µL Tips",
    )
    reservoir = protocol.load_labware(
        "nest_12_reservoir_15ml",
        "D2",
        label="Buffer Reservoir",
    )
    plate = protocol.load_labware(
        "nest_96_wellplate_200ul_flat",
        "C2",
        label="Destination Plate",
    )
    protocol.load_trash_bin("A3")
    pipette = protocol.load_instrument(
        "flex_1channel_1000",
        "left",
        tip_racks=[tips],
    )

    buffer = protocol.define_liquid(
        name="Buffer",
        description="Example distribution buffer",
        display_color="#1F77B4",
    )
    reservoir.load_liquid(
        wells=["A1"],
        volume=2_000,
        liquid=buffer,
    )
    destinations = plate.wells()[:sample_count]
    plate.load_empty(wells=destinations)

    protocol.comment(
        f"Filling {sample_count} wells with {transfer_volume_ul:.1f} µL each."
    )

    with protocol.group_steps(
        name="Distribute Buffer",
        description="Fill the selected number of destination wells.",
    ):
        pipette.distribute(
            volume=transfer_volume_ul,
            source=reservoir["A1"],
            dest=destinations,
            new_tip="once",
            disposal_volume=20,
        )

    protocol.delay(
        seconds=1 if dry_run else 60,
        msg="Example incubation; replace with an assay-specific duration.",
    )
    protocol.comment("Parameterized distribution complete.")
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall