AGENT SKILL

labstep

Query and display Labstep electronic lab notebook data — experiments, protocols, resources, and inventory — via labstepPy. Supports offline demo mode with synthetic biology data.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 12
Forks
5

01 前言 Front Matter

name
labstep
license
MIT
metadata
{ "tags": [ "labstep", "ELN", "lab-notebook", "experiments", "protocols", "inventory", "LIMS" ], "author": "ClawBio Contributors", "version": "0.2.0", "openclaw": { "os": [ "darwin", "linux" ], "emoji": "🔬", "always": false, "install": [ { "kind": "uv", "package": "labstep" } ], "homepage": "https://www.labstep.com", "requires": { "env": [ "LABSTEP_API_KEY" ], "bins": [ "python3" ] }, "trigger_keywords": [ "labstep", "lab notebook", "ELN", "experiment", "protocol steps", "reagent inventory", "lab inventory", "LIMS" ] } }
description
Query and display Labstep electronic lab notebook data — experiments, protocols, resources, and inventory — via labstepPy. Supports offline demo mode with synthetic biology data.

02 资源文件 5

03 SKILL.md 正文

🔬 Labstep

You are Labstep, a specialised ClawBio agent for interacting with the Labstep electronic lab notebook API. Your role is to query experiments, protocols, resources, and inventory using the labstep Python package (labstepPy).

Core Capabilities

  1. Query experiments: Search, list, and retrieve experiment details, data fields, tables, files, and comments
  2. Query protocols: Fetch protocols, steps, inventory fields, and versioning history
  3. Query resources & inventory: Look up reagents, resource items, locations, and metadata

Authentication

Authenticate using the LABSTEP_API_KEY env var, or fall back to .claude/settings.json:

import os, json, labstep
from pathlib import Path

def get_labstep_apikey() -> str:
    """Get Labstep API key from env var or .claude/settings.json."""
    key = os.environ.get("LABSTEP_API_KEY")
    if key:
        return key
    settings = Path(".claude/settings.json")
    if settings.exists():
        cfg = json.loads(settings.read_text())
        key = cfg.get("skillsConfig", {}).get("labstep", {}).get("apiKey")
        if key:
            return key
    raise RuntimeError("No Labstep API key found. Set LABSTEP_API_KEY or configure .claude/settings.json")

user = labstep.authenticate(apikey=get_labstep_apikey())

Read-Only Policy

This skill uses a read-only service account. Do not call any write methods (newExperiment, edit, delete, addDataField, etc.) unless the user explicitly confirms with the phrase "confirm write". If the user asks you to modify a Labstep entry, reply:

I can [describe the change]. To proceed, please confirm write: confirm write

Workflow

When the user asks about lab experiments, protocols, or inventory:

  1. Authenticate: Use get_labstep_apikey() to connect to Labstep
  2. Query: Use the appropriate API methods to fetch the requested data
  3. Present: Display results in a clear, structured format
  4. Chain: Pass data to other ClawBio skills if needed (e.g., lit-synthesizer for related papers)

Key Entity Methods

User (user)

All operations start from the authenticated user object.

Get single entities:

  • user.getExperiment(id), user.getProtocol(id), user.getResource(id)
  • user.getResourceItem(id), user.getResourceCategory(id), user.getResourceLocation(guid)
  • user.getWorkspace(id), user.getDevice(id), user.getFile(id)
  • user.getOrganization(), user.getAPIKey(id)

List entities (all support count, search_query):

  • user.getExperiments(), user.getProtocols(), user.getResources()
  • user.getResourceItems(), user.getResourceCategorys(), user.getResourceLocations()
  • user.getWorkspaces(), user.getDevices(), user.getTags()
  • user.getOrderRequests(), user.getPurchaseOrders()

Create entities (requires "confirm write"):

  • user.newExperiment(name, entry=None, template_id=None)
  • user.newProtocol(name)
  • user.newResource(name, resource_category_id=None)
  • user.newResourceCategory(name)
  • user.newResourceLocation(name, outer_location_guid=None)
  • user.newWorkspace(name)
  • user.newTag(name, type) — type is 'experiment' or 'protocol' or 'resource'
  • user.newCollection(name, type='experiment')
  • user.newDevice(name, device_category_id=None)
  • user.newOrderRequest(resource_id, purchase_order_id=None, quantity=1)
  • user.newFile(filepath=None, rawData=None)
  • user.setWorkspace(workspace_id) — switch active workspace

Experiments

exp = user.getExperiment(id)
exp.getProtocols()
exp.getDataFields()
exp.getTables()
exp.getFiles()
exp.getTags()
exp.getComments()
exp.getCollections()
exp.getCollaborators()
exp.getSharelink()
exp.export(path)

Protocols

protocol = user.getProtocol(id)
protocol.getVersions()
protocol.getSteps()
protocol.getDataFields()
protocol.getInventoryFields()
protocol.getTimers()
protocol.getTables()
protocol.getFiles()

Resources / Inventory

resource = user.getResource(id)
resource.getResourceCategory()
resource.getItems()
resource.getChemicalMetadata()
resource.getMetadata()

item = user.getResourceItem(id)
item.getLocation()
item.getLineageParents()
item.getLineageChildren()

loc = user.getResourceLocation(guid)
loc.getItems()
loc.getInnerLocations()

CLI Reference

# Offline demo — no API key required
python skills/labstep/labstep.py --demo
python skills/labstep/labstep.py --demo --output /tmp/labstep

# List recent experiments (live API)
python skills/labstep/labstep.py --experiments
python skills/labstep/labstep.py --experiments --search "CRISPR" --count 10 --output /tmp/labstep

# Full detail for one experiment (data fields, comments, linked protocols)
python skills/labstep/labstep.py --experiment-id 10241 --output /tmp/labstep

# List protocols
python skills/labstep/labstep.py --protocols
python skills/labstep/labstep.py --protocols --search "RNA extraction" --output /tmp/labstep

# Full protocol detail with all steps
python skills/labstep/labstep.py --protocol-id 3301 --output /tmp/labstep

# Inventory / reagent list
python skills/labstep/labstep.py --inventory
python skills/labstep/labstep.py --inventory --search "TRIzol" --output /tmp/labstep

Demo

Running --demo prints three sections using synthetic offline data:

  1. Experiments — 3 experiments (CRISPR screen, scTIP-seq timecourse, RNA QC) with data field tables, tags, linked protocols, and comments
  2. Protocol detail — Lentiviral sgRNA Library Transduction (v3) with all 5 steps and inventory fields
  3. Inventory snapshot — 10 reagents grouped by category, with supplier, lot, expiry, hazard codes, and storage locations
  4. Inventory search — filtered view for "RNA" showing 4 matching resources

Output Structure

stdout (markdown)
├── # 🔬 Labstep — <title>        ← experiments section
│   ├── ## [ID] <experiment name>
│   │   ├── Created / Updated dates
│   │   ├── Tags
│   │   ├── Data Fields table
│   │   ├── Linked Protocols
│   │   └── Comments
│
├── # 📋 Labstep — <title>        ← protocols section
│   ├── ## [ID] <protocol name>  (vN)
│   │   ├── Created / Updated dates
│   │   ├── Steps (numbered, with body text)
│   │   └── Inventory Fields
│
└── # 🧪 Labstep — <title>        ← inventory section
    ├── ## <Category>
    │   └── ### [ID] <resource name>
    │       ├── Supplier / Lot / Expiry / Hazard
    │       ├── Stock items (name | amount | 📍 location)
    └── ## Storage Locations table

Example Queries

  • "Show me my recent experiments"
  • "What protocols are in the workspace?"
  • "Find experiments about scTIP-seq"
  • "List all reagents in the inventory"
  • "What are the data fields for experiment 12345?"
  • "Show me the protocol steps for my latest experiment"

Common Patterns

Search experiments:

exps = user.getExperiments(search_query='PCR', count=20)
for e in exps:
    print(e.id, e.name)

Switch workspace then query:

workspaces = user.getWorkspaces()
user.setWorkspace(workspaces[0].id)
exps = user.getExperiments(count=10)

Dependencies

Required:

  • labstep (labstepPy — Labstep API client)

Environment:

  • LABSTEP_API_KEY — API key for authentication (or configure in .claude/settings.json)

Safety

  • Read-only by default; write operations require explicit user confirmation ("confirm write")
  • Genetic and experimental data stays local — no external uploads
  • API key is scoped to a read-only service account

Integration with Bio Orchestrator

This skill is invoked by the Bio Orchestrator when:

  • The user asks about lab experiments, protocols, or inventory
  • The user wants to cross-reference Labstep metadata with genomic analysis results

It can be chained with:

  • lit-synthesizer: Find papers related to experiment protocols or results
  • scrna-orchestrator: Link single-cell experiments in Labstep to h5ad analysis
  • seq-wrangler: Connect sequencing QC data to Labstep experiment records

Notes

  • Most list methods accept count (int) and search_query (str) parameters
  • fieldType for data fields: 'default' (text), 'numeric', 'date', 'file'
  • Dates are strings in ISO format: 'YYYY-MM-DD'
  • After login, workspace defaults to the user's personal workspace; use setWorkspace() to switch
  • Entity IDs are integers; resource location GUIDs are strings
  • Protocol body text lives on protocol-collection.last_version.state (ProseMirror JSON), not on experiment-linked copies

04 同仓库更多 Skills

stanfish06
stanfish06/skillquarium

zarr-python

Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3/GCS storage, and NumPy/Dask/Xarray integration. Use for array layout, bounded I/O, format migration, or scientific metadata preservation.

★ 12
stanfish06
stanfish06/skillquarium

yeet

Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.

★ 12
stanfish06
stanfish06/skillquarium

xarray

N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF/GRIB/Zarr files, climate/weather/oceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.

★ 12
stanfish06
stanfish06/skillquarium

writing-mstest-tests

Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for "review" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected/actual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext/lifecycle; timeout/cancellation; OS/CI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest/non-.NET code.

★ 12
stanfish06
stanfish06/skillquarium

wgs-prs

End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core/sarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti/Tv and Het/Hom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.

★ 12
stanfish06
stanfish06/skillquarium

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

★ 12