CtrlK
BlogDocsLog inGet started
Tessl Logo

lab-inventory-predictor

Predict depletion time of critical lab reagents based on experimental usage frequency and automatically generate purchase alerts for laboratory inventory management.

Install with Tessl CLI

npx tessl i github:aipoch/medical-research-skills --skill lab-inventory-predictor
What are skills?

56

Does it follow best practices?

Validation for skill structure

SKILL.md
Review
Evals

Lab Inventory Predictor

Function Overview

This skill is used for laboratory inventory management, predicting reagent depletion time by analyzing historical usage frequency, and automatically generating reminders when purchases are needed.

Core Capabilities

  1. Inventory Tracking - Record current reagent stock levels
  2. Usage Frequency Analysis - Calculate consumption rate based on experiment records
  3. Depletion Prediction - Predict reagent depletion date based on consumption rate
  4. Purchase Alerts - Generate alerts before reagents are about to deplete
  5. Safety Stock Alerts - Alert when inventory falls below safety threshold

Usage

Command Line Call

# View all reagent status
openclaw skill lab-inventory-predictor --action status

# Add or update reagent information
openclaw skill lab-inventory-predictor --action add-reagent \
  --name "PBS Buffer" \
  --current-stock 500 \
  --unit "ml" \
  --safety-days 7

# Record experiment consumption
openclaw skill lab-inventory-predictor --action record-usage \
  --name "PBS Buffer" \
  --amount 50 \
  --experiment "Cell Culture Experiment #2024-001"

# Get purchase alerts
openclaw skill lab-inventory-predictor --action alerts

# Generate prediction report
openclaw skill lab-inventory-predictor --action report

Python API

from skills.lab_inventory_predictor import InventoryPredictor

# Initialize
predictor = InventoryPredictor("/path/to/inventory.json")

# Add reagent
predictor.add_reagent(
    name="PBS Buffer",
    current_stock=500,
    unit="ml",
    safety_days=7,
    lead_time_days=3
)

# Record usage
predictor.record_usage("PBS Buffer", 50, "Experiment #001")

# Get prediction
prediction = predictor.predict_depletion("PBS Buffer")
print(f"Predicted depletion time: {prediction['depletion_date']}")

# Get purchase alerts
alerts = predictor.get_alerts()

Parameters

Global Parameters

ParameterTypeDefaultRequiredDescription
--actionstring-YesAction to perform (status, add-reagent, record-usage, alerts, report)
--data-filestring~/.openclaw/workspace/data/lab-inventory.jsonNoPath to inventory data file

add-reagent Action

ParameterTypeDefaultRequiredDescription
--namestring-YesReagent name
--current-stockfloat-YesCurrent stock quantity
--unitstring-YesUnit of measurement (ml, mg, etc.)
--safety-daysint7NoSafety buffer days
--lead-time-daysint3NoExpected delivery time
--safety-stockfloat-NoSafety stock threshold

record-usage Action

ParameterTypeDefaultRequiredDescription
--namestring-YesReagent name
--amountfloat-YesAmount consumed
--experimentstring-NoExperiment identifier

report Action

ParameterTypeDefaultRequiredDescription
--output, -ostringstdoutNoOutput file path
--formatstringtextNoOutput format (text, json, csv)

Data Structure

Reagent Record

{
  "name": "PBS Buffer",
  "current_stock": 500,
  "unit": "ml",
  "safety_stock": 100,
  "safety_days": 7,
  "lead_time_days": 3,
  "usage_history": [
    {
      "date": "2024-01-15",
      "amount": 50,
      "experiment": "Cell Culture #001"
    }
  ],
  "daily_consumption_rate": 10.5,
  "predicted_depletion_date": "2024-02-01",
  "last_updated": "2024-01-15T10:30:00"
}

Prediction Algorithm

Consumption Rate Calculation

daily_consumption = Σ(usage_amount) / days_span

Depletion Date Prediction

days_until_depletion = current_stock / daily_consumption
depletion_date = today + days_until_depletion

Purchase Alert Trigger Conditions

  1. Based on depletion time: When days_until_depletion <= safety_days + lead_time_days
  2. Based on safety stock: When current_stock <= safety_stock

Configuration File

Default data storage location: ~/.openclaw/workspace/data/lab-inventory.json

Configuration example:

{
  "settings": {
    "default_safety_days": 7,
    "default_lead_time_days": 3,
    "prediction_lookback_days": 30
  },
  "reagents": []
}

Dependencies

  • Python >= 3.8
  • No external dependencies (uses only standard library)

Version History

  • v1.0.0 (2024-02) - Initial version, supports basic prediction and alert functions

Author: OpenClaw Skill Framework
License: MIT

Risk Assessment

Risk IndicatorAssessmentLevel
Code ExecutionPython/R scripts executed locallyMedium
Network AccessNo external API callsLow
File System AccessRead input files, write output filesMedium
Instruction TamperingStandard prompt guidelinesLow
Data ExposureOutput files saved to workspaceLow

Security Checklist

  • No hardcoded credentials or API keys
  • No unauthorized file system access (../)
  • Output does not expose sensitive information
  • Prompt injection protections in place
  • Input file paths validated (no ../ traversal)
  • Output directory restricted to workspace
  • Script execution in sandboxed environment
  • Error messages sanitized (no stack traces exposed)
  • Dependencies audited

Prerequisites

# Python dependencies
pip install -r requirements.txt

Evaluation Criteria

Success Metrics

  • Successfully executes main functionality
  • Output meets quality standards
  • Handles edge cases gracefully
  • Performance is acceptable

Test Cases

  1. Basic Functionality: Standard input → Expected output
  2. Edge Case: Invalid input → Graceful error handling
  3. Performance: Large dataset → Acceptable processing time

Lifecycle Status

  • Current Stage: Draft
  • Next Review Date: 2026-03-06
  • Known Issues: None
  • Planned Improvements:
    • Performance optimization
    • Additional feature support
Repository
aipoch/medical-research-skills
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.