phenoml-workflow
Create and execute PhenoML workflows for healthcare data processing, including condition creation from clinical notes and patient registration with deduplication
What this skill does
# PhenoML Workflow Skill
## Instructions
This skill provides an end-to-end guided experience for creating and testing PhenoML workflows. The skill walks users through the complete workflow setup process using executable scripts.
### When to Use This Skill
Use this skill when users want to:
1. Set up a new PhenoML workflow from scratch
2. Create workflows for processing clinical notes into FHIR Condition resources
3. Set up patient registration workflows with deduplication
4. Test workflows with example data
5. Set up or verify FHIR provider connections
### Interactive Workflow Setup Flow
This skill provides a step-by-step interactive experience where the skill **gathers information from the user conversationally**, then **executes reusable Python scripts** with that information to create and test workflows.
**Step 0: Ensure Dependencies are Installed**
- Before running any scripts, ensure the required Python packages are installed:
```bash
pip install python-dotenv phenoml
```
- If the user gets import errors when running scripts, guide them to install these packages
**Step 1: Check FHIR Provider Setup**
- First, locate and run `check_env.py` (search for it using glob `**/check_env.py`) to check credentials and detect instance type
- **If SHARED EXPERIMENT is detected** (experiment.app.pheno.ml):
- **Skip FHIR provider setup entirely** - shared experiment uses a pre-configured Medplum sandbox
- The system automatically uses "experiment-default" as the FHIR_PROVIDER_ID
- No FHIR credentials (CLIENT_ID, CLIENT_SECRET, BASE_URL) are required
- Proceed directly to Step 2 (Gather Workflow Requirements)
- **If on a DEDICATED INSTANCE** (e.g., acme.app.pheno.ml), ask the user if they have already created a FHIR provider
- If NO:
- Run `check_env.py` to verify credentials
- If FHIR credentials are missing, guide them to add the credentials to .env with examples:
- **Medplum**: `FHIR_PROVIDER_BASE_URL=https://api.medplum.com/fhir/R4`
- **Athena**: `FHIR_PROVIDER_BASE_URL=https://api.preview.platform.athenahealth.com/fhir/r4`
- **Epic**: `FHIR_PROVIDER_BASE_URL=https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4`
- **Cerner**: `FHIR_PROVIDER_BASE_URL=https://fhir-myrecord.cerner.com/r4/[tenant-id]`
- Run `setup_fhir_provider.py` to create the provider
- The script will save FHIR_PROVIDER_ID to .env automatically
- If YES: Run `check_env.py` to verify FHIR_PROVIDER_ID is set
**Step 2: Gather Workflow Requirements**
- Ask what type of data they want the workflow to process (e.g., clinical notes, patient demographics, lab results)
- Ask them to describe what the workflow should do in their own words
- Provide examples of common workflow types to help guide them
**Step 3: Refine Workflow Description**
- Based on their description, identify the workflow type (condition creation, patient registration, observation creation, or custom)
- Present a refined version of their workflow using best practices
- Show them the recommended workflow instructions and settings (dynamic_generation, etc.)
- Ask for confirmation or allow them to modify
**Step 4: Create the Workflow**
- Run `create_workflow.py` with CLI arguments:
- `--name "Workflow Name"`
- `--instructions "workflow instructions..."`
- `--sample-data '{"key": "value"}'`
- `--dynamic-generation true`
- The script will create the workflow and save WORKFLOW_ID to .env
- Show the user the created workflow details
**Step 5: Test the Workflow**
- Ask what patient/data they want to test with (or provide examples)
- Run `test_workflow.py` with CLI arguments:
- `--input-data '{"patient_last_name": "Smith", ...}'`
- Show the execution results
- Offer to run additional tests with different data
### Key Principles
1. **Gather information conversationally** - Ask the user questions first to understand their needs
2. **Find and use the reusable scripts** - First locate the scripts using glob `**/phenoml-workflow/scripts/*.py`, then execute them with appropriate CLI arguments
3. **Always pass --env-file** - Since the scripts may be in a different directory than the user's project, always pass `--env-file /path/to/user/project/.env` to ensure the scripts find the correct .env file (use the user's current working directory)
4. **Prefer CLI arguments over .env** - For workflow-specific data (name, instructions, test data), pass via CLI args rather than adding to .env
5. **Use .env for credentials** - Guide users to store credentials (PHENOML_*, MEDPLUM_*, etc.) in .env for security
6. **Guide progressively** - Go step-by-step, ensuring each step completes before moving to the next
7. **Confirm before executing** - Before running each script, explain what it will do
8. **Provide context** - Explain why each step is necessary and what it accomplishes
9. **Offer examples** - When asking for user input, always provide clear examples
### Available Scripts
**Important:**
1. Before running any script, first locate it using glob `**/phenoml-workflow/scripts/*.py` to find the correct path.
2. Always pass `--env-file` pointing to the user's project .env file (their current working directory).
#### 0. check_env.py
**Purpose:** Safely verifies which environment variables are set without exposing their values
**How it works:**
- Loads .env file using python-dotenv
- Checks presence of required credentials (returns TRUE/FALSE only)
- Never exposes actual credential values
- Provides clear guidance on missing credentials
**Usage:**
```bash
# Check all credentials (pass user's .env path)
python3 /path/to/check_env.py --env-file /user/project/.env
# JSON output only
python3 /path/to/check_env.py --env-file /user/project/.env --json
# Verbose output (formatted + JSON)
python3 /path/to/check_env.py --env-file /user/project/.env --verbose
```
**Security:**
- This script is designed to prevent credential leakage in LLM conversations
- It only reports TRUE/FALSE for each credential, never the actual values
- Safe to run in any context where credentials need to be verified
**Outputs:**
- Formatted status report with ✅/❌ indicators
- Guidance on missing credentials
- Exit code 1 if core credentials are missing
#### 1. setup_fhir_provider.py
**Purpose:** Creates a FHIR provider using credentials from .env
**How it works:**
- Reads FHIR credentials from .env (FHIR_PROVIDER_BASE_URL, FHIR_PROVIDER_CLIENT_ID, FHIR_PROVIDER_CLIENT_SECRET)
- Creates the FHIR provider in PhenoML
- Saves FHIR_PROVIDER_ID to .env
**Usage:**
```bash
# Create provider using .env credentials
python3 /path/to/setup_fhir_provider.py --env-file /user/project/.env
# With custom name and provider type
python3 /path/to/setup_fhir_provider.py --env-file /user/project/.env --name "My FHIR Server" --provider athena
```
**Required .env variables:**
- PHENOML_USERNAME, PHENOML_PASSWORD, PHENOML_BASE_URL
- FHIR_PROVIDER_BASE_URL, FHIR_PROVIDER_CLIENT_ID, FHIR_PROVIDER_CLIENT_SECRET
**Example FHIR_PROVIDER_BASE_URL values:**
- **Medplum**: `https://api.medplum.com/fhir/R4`
- **Athena**: `https://api.preview.platform.athenahealth.com/fhir/r4`
- **Epic**: `https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4`
- **Cerner**: `https://fhir-myrecord.cerner.com/r4/[tenant-id]`
**Optional .env variables:**
- FHIR_PROVIDER_NAME (default: "FHIR Server")
- FHIR_PROVIDER_TYPE (default: "medplum")
- FHIR_AUTH_METHOD (default: "client_secret")
**Outputs:**
- FHIR_PROVIDER_ID saved to .env
#### 2. create_workflow.py
**Purpose:** Creates a PhenoML workflow from .env or CLI arguments
**How it works:**
- Reads workflow configuration from CLI args or .env
- Creates the workflow in PhenoML
- Saves WORKFLOW_ID to .env
**Usage:**
```bash
# Create workflow with CLI arguments (recommended)
python3 /path/to/create_workflow.py \
--env-file /user/project/.env \
--name "Extract Conditions" \
--instructions "You are a helpful agent who..." \
--sample-data '{"patient_last_name": "Smith", "diagnosis_text": "Patient presentsRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.