Install
openclaw skills install phenoskillExtract clinical phenotypes and medication entities from user-provided text using PhenoSnap, producing a timestamped JSON output.
openclaw skills install phenoskillUse this skill when the user provides their own:
Examples that should trigger:
Do not use this skill when:
python3 available on PATH.{baseDir}/resources/hp.oboHPO_OBO_PATHhp.obo. You must supply it.Recommended (best practice):
pip.{baseDir}/artifacts/phenosnap_inputs/input_<YYYYMMDD_HHMMSS>.txt{baseDir}/artifacts/phenosnap_outputs/phenotypes_<YYYYMMDD_HHMMSS>.json{baseDir}/third_party/phenosnap_main.zip{baseDir}/third_party/get-pip.pyTrigger if the user message contains any of:
symptom(s), phenotype(s), Dx, diagnosis, PMH, Hx, history of, or a symptom-like listmeds, medications, taking, prescribed, plus patterns like:
\b\d+(\.\d+)?\s?(mg|mcg|g|ml|units)\bqd, q.d., bid, b.i.d., tid, t.i.d., qhs, qAM, qPM, daily, weeklyDo not trigger for purely informational questions without user-provided phenotype/medication content.
Create if missing:
{baseDir}/PhenoSnap/{baseDir}/artifacts/phenosnap_inputs/{baseDir}/artifacts/phenosnap_outputs/{baseDir}/resources/{baseDir}/third_party/[REDACTED_EMAIL][REDACTED_PHONE][REDACTED_ID][REDACTED_ADDRESS]Name: [REDACTED_NAME]Target location: {baseDir}/PhenoSnap/
{baseDir}/PhenoSnap/ exists and contains extract_phenotypes.pyProceed to dependency self-test.
{baseDir}/PhenoSnap/ does NOT exist (or missing extract_phenotypes.py)Prefer git; fallback to zip.
git is availableRun:
git clone https://github.com/WGLab/PhenoSnap.git "{baseDir}/PhenoSnap"git is NOT availableDownload zip:
https://github.com/WGLab/PhenoSnap/archive/refs/heads/main.zip{baseDir}/third_party/phenosnap_main.zipDownload method (pick first available):
curl exists:
curl -L "https://github.com/WGLab/PhenoSnap/archive/refs/heads/main.zip" -o "{baseDir}/third_party/phenosnap_main.zip"Invoke-WebRequest -Uri "https://github.com/WGLab/PhenoSnap/archive/refs/heads/main.zip" -OutFile "{baseDir}/third_party/phenosnap_main.zip"Unzip (choose by OS/tools):
Expand-Archive -Path "{baseDir}/third_party/phenosnap_main.zip" -DestinationPath "{baseDir}/third_party/phenosnap_unzip" -Forceunzip -o "{baseDir}/third_party/phenosnap_main.zip" -d "{baseDir}/third_party/phenosnap_unzip"If neither unzip nor Expand-Archive is available, use Python:
python3 -c "import zipfile; z=zipfile.ZipFile(r'{baseDir}/third_party/phenosnap_main.zip'); z.extractall(r'{baseDir}/third_party/phenosnap_unzip')"Then rename/move the extracted folder to {baseDir}/PhenoSnap/:
{baseDir}/third_party/phenosnap_unzip/PhenoSnap-main{baseDir}/PhenoSnap/Final check:
{baseDir}/PhenoSnap/extract_phenotypes.py exists.{baseDir}/PhenoSnap/ and {baseDir}/third_party/phenosnap_unzip/.Run from inside {baseDir}/PhenoSnap/.
Run:
python3 -c "import importlib.util; spec=importlib.util.spec_from_file_location('extract_phenotypes','extract_phenotypes.py'); m=importlib.util.module_from_spec(spec); spec.loader.exec_module(m); print('ok')"If it prints ok, proceed.
Check:
python3 -m pip --versionIf that fails, try:
python3 -m ensurepip --upgradeCheck again:
python3 -m pip --versionIf still failing, bootstrap pip via get-pip.py:
https://bootstrap.pypa.io/get-pip.py to {baseDir}/third_party/get-pip.py
curl -L "https://bootstrap.pypa.io/get-pip.py" -o "{baseDir}/third_party/get-pip.py"Invoke-WebRequest -Uri "https://bootstrap.pypa.io/get-pip.py" -OutFile "{baseDir}/third_party/get-pip.py"python3 "{baseDir}/third_party/get-pip.py"python3 -m pip --versionIf pip still cannot be used, stop and report the error output.
From {baseDir}/PhenoSnap/, run:
python3 -m pip install -r requirements.txtRe-run:
python3 -c "import importlib.util; spec=importlib.util.spec_from_file_location('extract_phenotypes','extract_phenotypes.py'); m=importlib.util.module_from_spec(spec); spec.loader.exec_module(m); print('ok')"If still failing, stop and return:
Resolve HPO OBO path in this order:
HPO_OBO_PATH is set and file exists, use that.{baseDir}/resources/hp.obo if it exists.If the resolved file does not exist:
hp.obo at {baseDir}/resources/hp.obo or set HPO_OBO_PATH to its full path.YYYYMMDD_HHMMSS (local time).{baseDir}/artifacts/phenosnap_inputs/input_<TS>.txtFrom {baseDir}/PhenoSnap/, run:
python3 extract_phenotypes.py --input-file "{baseDir}/artifacts/phenosnap_inputs/input_<TS>.txt" --hpo-obo "<HPO_OBO_PATH>" --output "{baseDir}/artifacts/phenosnap_outputs/phenotypes_<TS>.json" --format jsonValidate:
If validation fails:
Return a concise confirmation:
{baseDir}/PhenoSnap/extract_phenotypes.py exists.python3 -m venv .venv then activate and rerun skill.{baseDir}/resources/hp.obo or set HPO_OBO_PATH.User:
Action:
phenotypes_<TS>.jsonUser:
Action:
User:
Action: