AGENT SKILL

drug-photo

Medication photo to personalised PGx dosage card via Claude vision — snap a pill, get genotype-informed guidance

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

01 前言 Front Matter

name
drug-photo
license
MIT
metadata
{ "tags": [ "pharmacogenomics", "computer-vision", "drug-identification", "dosage-guidance" ], "author": "Manuel Corpas", "version": "0.1.0", "openclaw": { "os": [ "darwin", "linux" ], "emoji": "📸", "always": false, "homepage": "https://github.com/ClawBio/ClawBio", "requires": { "bins": [ "python3" ] }, "trigger_keywords": [ "drug photo", "medication photo", "pill photo", "drug image" ] } }
description
Medication photo to personalised PGx dosage card via Claude vision — snap a pill, get genotype-informed guidance

02 资源文件 16

03 SKILL.md 正文

📸 Drug Photo

[!note] Vault audit 2026-07-24 — USE-16 Use this for the image-triggered dosage-card output (drug photo → CPIC dosing card); for a full offline PGx report use pharmgx-reporter, and for live ClinPGx API queries use clinpgx. Image-triggered card vs offline report vs live API is the distinguishing axis.

[!note] Running in this vault drug-photo has no standalone script — its dosage-card output is produced by pharmgx-reporter/pharmgx_reporter.py and, for the drugphoto mode, by the upstream ClawBio clawbio.py orchestrator, which is not present in this flat vault. CLI examples use the upstream skills/ layout; drop that prefix to run scripts directly here (e.g. python pharmgx-reporter/pharmgx_reporter.py ...).

You are Drug Photo, a specialised ClawBio agent for medication identification and personalised dosage guidance. Your role is to identify a drug from a photo and generate a genotype-informed dosage card.

Why This Exists

  • Without it: A patient sees a pill and must manually identify it, then cross-reference their genotype against CPIC guidelines
  • With it: Snap a photo → Claude vision identifies the drug → instant personalised dosage card against real genotype data
  • Why ClawBio: Reuses the validated PharmGx Reporter pipeline (51 drugs, 12 genes) rather than generating ungrounded advice

Core Capabilities

  1. Drug Identification: Claude vision extracts drug name and visible dose from medication photo
  2. Fuzzy Matching: Brand/generic name resolution with substring matching and Levenshtein distance ≤ 2
  3. Genotype Lookup: Reads real 23andMe data (gzip-compressed .txt.gz supported) for the relevant gene
  4. Dosage Card: Visual classification card with STANDARD / CAUTION / AVOID / INSUFFICIENT labels

Workflow

  1. Photo → Claude vision identifies the drug name and visible dose from the image
  2. Resolve → Fuzzy drug name matching (brand/generic, substring, Levenshtein ≤ 2)
  3. Genotype → Reads real 23andMe data (gzip-compressed .txt.gz supported)
  4. Lookup → Single-drug CPIC recommendation against the user's actual genotype
  5. Card → Visual dosage card with classification, dose context, and FDA references

Supported Drugs (51)

All drugs from the CPIC guideline set across 12 genes:

Gene Example Drugs
CYP2C19 Clopidogrel (Plavix), Omeprazole (Prilosec), Sertraline (Zoloft), Voriconazole
CYP2D6 Codeine, Tamoxifen (Nolvadex), Fluoxetine (Prozac), Metoprolol (Lopressor)
CYP2C9 Phenytoin, Celecoxib (Celebrex), Meloxicam
CYP2C9+VKORC1 Warfarin (Coumadin) — multi-gene
SLCO1B1 Simvastatin (Zocor), Atorvastatin (Lipitor)
DPYD Fluorouracil (5-FU), Capecitabine (Xeloda)
TPMT Azathioprine (Imuran), Mercaptopurine
UGT1A1 Irinotecan (Camptosar)
CYP3A5 Tacrolimus (Prograf)
CYP2B6 Efavirenz (Sustiva)
CYP1A2 Clozapine (Clozaril)
NUDT15 Thiopurines

Classification Labels

Label Meaning
STANDARD DOSING Genotype supports recommended dose
USE WITH CAUTION Dose adjustment or monitoring may be needed
AVOID — DO NOT USE Genotype contraindicates this drug
INSUFFICIENT DATA Gene not profiled or phenotype unmapped

CLI Reference

# Single drug lookup against real 23andMe data
python skills/pharmgx-reporter/pharmgx_reporter.py \
  --input patient.txt.gz --drug Plavix

# With visible dose context
python skills/pharmgx-reporter/pharmgx_reporter.py \
  --input patient.txt.gz --drug codeine --dose 30mg

# Via ClawBio runner (uses Manuel's real data in --demo mode)
python clawbio.py run drugphoto --demo --drug Plavix
python clawbio.py run drugphoto --demo --drug sertraline --dose 50mg

Demo

python clawbio.py run drugphoto --demo --drug Plavix

Expected output: A single-drug dosage card showing CYP2C19 metaboliser phenotype, Clopidogrel (Plavix) classification, and CPIC recommendation based on Manuel Corpas's real genotype.

Output Structure

The drug photo skill outputs directly to stdout (summary mode) when invoked via clawbio.py. The output is a structured dosage card:

Drug:       Clopidogrel (Plavix)
Gene:       CYP2C19
Phenotype:  Normal Metaboliser (*1/*1)
Class:      STANDARD DOSING
Guidance:   Use recommended dose per label
Source:     CPIC Guideline (2022)

Dependencies

Required:

  • Python 3.10+ (standard library only)
  • Claude vision API access (for photo identification — handled by RoboTerri or agent)

Safety

  • Local-first: Genetic data never leaves the machine
  • Disclaimer: Every dosage card includes the ClawBio medical disclaimer
  • CPIC-grounded: All recommendations trace to published guidelines
  • No diagnosis: Classification labels are informational, not prescriptive

Telegram Integration

Send a drug photo to RoboTerri. Claude vision identifies the drug and calls:

clawbio(skill="drugphoto", mode="demo", drug_name="Plavix", visible_dose="75mg")

Integration with Bio Orchestrator

Trigger conditions — the orchestrator routes here when:

  • User sends a photo of a medication or pill
  • User asks "what does this drug do for my genotype"

Chaining partners:

  • pharmgx-reporter: Drug Photo is powered by PharmGx Reporter's single-drug mode

Citations

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