From clawbio
Queries Labstep electronic lab notebook data — experiments, protocols, resources, and inventory — via the labstepPy Python package. Supports offline demo mode with synthetic biology data.
How this skill is triggered — by the user, by Claude, or both
Slash command
/clawbio:labstepThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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).
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).
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())
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
When the user asks about lab experiments, protocols, or inventory:
get_labstep_apikey() to connect to Labstepuser)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 workspaceexp = user.getExperiment(id)
exp.getProtocols()
exp.getDataFields()
exp.getTables()
exp.getFiles()
exp.getTags()
exp.getComments()
exp.getCollections()
exp.getCollaborators()
exp.getSharelink()
exp.export(path)
protocol = user.getProtocol(id)
protocol.getVersions()
protocol.getSteps()
protocol.getDataFields()
protocol.getInventoryFields()
protocol.getTimers()
protocol.getTables()
protocol.getFiles()
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()
# 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
Running --demo prints three sections using synthetic offline data:
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
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)
Required:
labstep (labstepPy — Labstep API client)Environment:
LABSTEP_API_KEY — API key for authentication (or configure in .claude/settings.json)This skill is invoked by the Bio Orchestrator when:
It can be chained with:
count (int) and search_query (str) parametersfieldType for data fields: 'default' (text), 'numeric', 'date', 'file''YYYY-MM-DD'setWorkspace() to switchprotocol-collection.last_version.state (ProseMirror JSON), not on experiment-linked copiesnpx claudepluginhub clawbio/clawbio --plugin clawbioIntegrates with the LabArchives electronic lab notebook API to access notebooks, manage entries and attachments, create backups, and connect with third-party tools like Protocols.io, Jupyter, and REDCap.
Manages scientific protocols through the protocols.io API — search, create, update, publish protocols, manage steps/materials, handle discussions, organize workspaces, and upload files.
Searches and retrieves protocols.io protocols (wet-lab, bioinformatics, clinical) by keyword, DOI, or category. Returns steps, reagents, materials, equipment, and timing. Supports public (no auth) and private protocol access.