digital-twin-patient-builder

Build digital twin patient models to test drug efficacy and toxicity in virtual environments

3,891 stars

Best use case

digital-twin-patient-builder is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Build digital twin patient models to test drug efficacy and toxicity in virtual environments

Teams using digital-twin-patient-builder should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/digital-twin-patient-builder/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/aipoch-ai/digital-twin-patient-builder/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/digital-twin-patient-builder/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How digital-twin-patient-builder Compares

Feature / Agentdigital-twin-patient-builderStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Build digital twin patient models to test drug efficacy and toxicity in virtual environments

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Digital Twin Patient Builder (ID: 208)

## Function Overview

Build a "digital twin" model of a patient, integrating genotype, clinical history, and imaging data to test the efficacy and toxicity of different drug doses in a virtual environment.

## Use Cases

- Personalized drug treatment plan design
- Drug dose optimization
- Adverse reaction risk assessment
- Clinical trial virtual simulation

## Input

| Data Type | Description | Format |
|---------|------|------|
| `genotype` | Patient genotype data (SNPs, CNVs) | JSON |
| `clinical_history` | Clinical history and laboratory indicators | JSON |
| `imaging_features` | Imaging features (MRI, CT, etc.) | JSON |

## Output

| Output Type | Description |
|---------|------|
| `efficacy_prediction` | Efficacy prediction results |
| `toxicity_prediction` | Toxicity reaction prediction |
| `optimal_dose` | Optimal dose recommendation |

## Usage

### Command Line Usage

```bash
python scripts/main.py --patient patient_data.json --drug drug_profile.json --doses "[50, 100, 150]"
```

## Parameters

| Parameter | Type | Default | Required | Description |
|-----------|------|---------|----------|-------------|
| `--patient` | string | - | Yes | Path to patient data JSON file |
| `--drug` | string | - | Yes | Path to drug profile JSON file |
| `--doses` | string | - | Yes | Dose range to test (JSON array format) |
| `--output`, `-o` | string | - | No | Output file path for simulation results |
| `--simulation-days` | int | 30 | No | Number of days to simulate |
| `--timestep` | float | 0.5 | No | Simulation timestep in days |

### Python API

```python
from scripts.main import DigitalTwinBuilder

builder = DigitalTwinBuilder()
twin = builder.build_twin(patient_data)
results = twin.simulate_drug_regimen(drug_profile, dose_range)
```

## Technical Architecture

```
digital-twin-patient-builder/
├── SKILL.md              # This file
├── scripts/
│   └── main.py           # Core implementation
│
├── Core Components:
│   ├── PatientProfile    # Patient profile management
│   ├── GenotypeModel     # Genotype modeling
│   ├── ClinicalModel     # Clinical data modeling
│   ├── ImagingModel      # Imaging feature modeling
│   ├── DigitalTwin       # Digital twin main class
│   ├── PharmacokineticModel  # Pharmacokinetic model
│   └── DrugSimulator     # Drug simulator
```

## Dependencies

- numpy >= 1.21.0
- scipy >= 1.7.0
- pandas >= 1.3.0

## Example Data Format

### Patient Data (patient_data.json)
```json
{
  "patient_id": "P001",
  "genotype": {
    "CYP2D6": "*1/*4",
    "TPMT": "*1/*3C",
    "SNPs": {"rs12345": "AG", "rs67890": "CC"}
  },
  "clinical": {
    "age": 58,
    "weight": 70.5,
    "height": 170,
    "lab_values": {"creatinine": 1.2, "alt": 45, "ast": 38},
    "comorbidities": ["hypertension", "diabetes"]
  },
  "imaging": {
    "tumor_volume": 45.2,
    "perfusion_rate": 0.85,
    "texture_features": {"entropy": 5.2, "uniformity": 0.45}
  }
}
```

### Drug Profile (drug_profile.json)
```json
{
  "drug_name": "ExampleDrug",
  "drug_class": "chemotherapy",
  "metabolizing_enzymes": ["CYP2D6", "CYP3A4"],
  "target_genes": ["EGFR", "KRAS"],
  "pk_params": {
    "clearance": 15.5,
    "volume_distribution": 45.0,
    "half_life": 8.0
  },
  "efficacy_biomarkers": ["tumor_reduction", "survival_rate"],
  "toxicity_markers": ["neutropenia", "hepatotoxicity"]
}
```

## Model Principles

1. **Genotype Modeling**: Parse drug metabolizing enzyme genotypes to predict metabolic phenotypes (ultrarapid/normal/poor metabolizer)
2. **Physiological Modeling**: Calculate personalized pharmacokinetic parameters based on age, weight, and organ function
3. **Imaging Modeling**: Extract tumor features to predict drug responsiveness
4. **Integrated Model**: Multi-modal data fusion to build a comprehensive digital twin
5. **Drug Simulation**: PBPK (physiologically-based pharmacokinetics) + PD (pharmacodynamics) model

## References

- PBPK modeling guidelines (FDA, 2018)
- Pharmacogenomics in precision medicine (Nature Reviews, 2020)

## Risk Assessment

| Risk Indicator | Assessment | Level |
|----------------|------------|-------|
| Code Execution | Python scripts with tools | High |
| Network Access | External API calls | High |
| File System Access | Read/write data | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Data handled securely | Medium |

## Security Checklist

- [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] API requests use HTTPS only
- [ ] Input validated against allowed patterns
- [ ] API timeout and retry mechanisms implemented
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no internal paths exposed)
- [ ] Dependencies audited
- [ ] No exposure of internal service architecture
## Prerequisites

```bash
# 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

Related Skills

Go-to-Market Strategy Builder

3891
from openclaw/skills

Build a complete GTM plan for product launches, market entries, or expansion plays. Covers positioning, channel strategy, pricing, launch timeline, and success metrics.

Workflow & Productivity

Data Room Builder

3891
from openclaw/skills

Build a structured virtual data room checklist and folder hierarchy for fundraising, M&A, or due diligence.

Workflow & Productivity

AI Governance Policy Builder

3891
from openclaw/skills

Build internal AI governance policies from scratch. Covers acceptable use, model selection, data handling, vendor contracts, compliance mapping, and board reporting.

doppel-block-builder

3891
from openclaw/skills

Place MML blocks in Doppel worlds. Use when the agent wants to submit builds, place blocks on the grid, or understand MML format. Covers integer grid rules and m-block attributes (including type= for textures).

Metaverse & Virtual Worlds

douyin-cover-builder

3891
from openclaw/skills

这是一个面向中文创作者的 OpenClaw Skill,输入主题与人物气质后,会输出可直接用于生图模型的高质量提示词与创意说明。

Content Creation & Marketing

agentic-mcp-server-builder

3891
from openclaw/skills

Scaffold MCP server projects and baseline tool contract checks. Use for defining tool schemas, generating starter server layouts, and validating MCP-ready structure.

Coding & Development

aicade-app-builder

3891
from openclaw/skills

Build general aicade application prompts by taking the user's base prompt plus the platform additions from the bundled 3.1 workflow reference, then assembling a final integrated prompt in the style of 3.2.

regression-story-builder

3891
from openclaw/skills

基于历史问题生成回归测试故事集、风险等级和优先级。;use for regression, testing, qa workflows;do not use for 宣称已经执行测试, 跳过高风险路径.

emotwin

3891
from openclaw/skills

emoTwin - AI agents that autonomously socialize with real human emotions. Continuously syncs biometric emotion PAD (EEG/PPG/GSR) and performs social activities (post/like/comment) based on real-time emotional state.

sql-to-bi-builder

3891
from openclaw/skills

Convert a markdown file containing SQL queries (for example `sql.md`) into a BI dashboard specification and UI scaffold. Use when user asks to build analytics dashboards, chart pages, or BI interfaces from existing SQL statements, including query parsing, metric/dimension inference, chart recommendation, filter design, and layout generation.

aibrary-podcast-ideatwin

3891
from openclaw/skills

[Aibrary] Generate a book Idea Twin podcast script — an intellectually stimulating debate between the user's AI twin and a book expert. Based on Vygotsky's Zone of Proximal Development theory, the AI twin mirrors the user's thinking style while the expert progressively challenges their understanding. Use when the user wants to create an Idea Twin podcast, debate a book's ideas with an AI version of themselves, or explore a book through intellectual sparring.

Skill Builder — Meta-Skill for Creating Skills

3891
from openclaw/skills

## Metadata