Design and simulate adaptive clinical trials with interim analyses, decision rules, and operating-characteristic summaries; use when planning adaptive designs or comparing stopping, enrichment, or sample-size re-estimation strategies.
63
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./scientific-skills/Protocol Design/adaptive-trial-simulator/SKILL.mdStatistical simulation platform for designing and validating adaptive clinical trial designs in silico. Enables optimization of interim analysis strategies, sample size adaptation, and early stopping rules while maintaining Type I error control.
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.pyUse these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py --design group_sequential --n-simulations 50
python scripts/main.py --design adaptive_reestimate --n-simulations 25 --optimize# Run standard group sequential design
python scripts/main.py
# Adaptive design with sample size re-estimation
python scripts/main.py --design adaptive_reestimate
# Optimize design parameters
python scripts/main.py --optimize| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
--design | str | group_sequential | No | Trial design type |
--n-simulations | int | 10000 | No | Number of Monte Carlo simulations |
--sample-size | int | 200 | No | Initial sample size per arm |
--effect-size | float | 0.3 | No | Effect size (Cohen's d) |
--alpha | float | 0.05 | No | Type I error rate |
--power | float | 0.80 | No | Target statistical power |
--interim-looks | int | 1 | No | Number of interim analyses |
--spending-function | str | obrien_fleming | No | Alpha spending function |
--reestimate-method | str | promising_zone | No | Sample size re-estimation method |
--output | str | results.json | No | Output file path |
--visualize | flag | False | No | Generate visualization charts |
--optimize | flag | False | No | Search for optimal design parameters |
# Full adaptive design with visualization
python scripts/main.py \
--design adaptive_reestimate \
--n-simulations 50000 \
--sample-size 250 \
--effect-size 0.35 \
--interim-looks 2 \
--spending-function obrien_fleming \
--visualize \
--output adaptive_results.json| Design Type | Description | Use Case |
|---|---|---|
| Group Sequential | Fixed interim looks with stopping boundaries | Standard adaptive trials |
| Adaptive Re-estimate | Sample size adjustment based on interim data | Uncertain effect size |
| Drop the Loser | Multi-arm trials dropping inferior arms | Phase II dose selection |
| Function | Characteristics | Early Boundary |
|---|---|---|
| O'Brien-Fleming | Conservative early | High Z-scores early |
| Pocock | Aggressive early | Lower Z-scores throughout |
| Power Family | Moderate (ρ=3) | Balanced approach |
{
"design_config": {
"design_type": "adaptive_reestimate",
"sample_size_per_arm": 200,
"effect_size": 0.3,
"alpha": 0.05,
"target_power": 0.8
},
"simulation_results": {
"power": 0.8234,
"type_i_error": 0.0481,
"expected_sample_size": 385.2,
"early_stop_rate": {
"efficacy": 0.1523,
"futility": 0.0841
}
}
}⚠️ AI independent acceptance status: manual inspection required This skill requires:
pip install -r requirements.txtnumpy>=1.20.0
scipy>=1.7.0
matplotlib>=3.4.0| Risk Indicator | Assessment | Level |
|---|---|---|
| Code Execution | Python scripts with mathematical calculations | Medium |
| Network Access | No network access | Low |
| File System Access | Writes simulation results | Low |
| Instruction Tampering | Statistical parameters could affect results | Medium |
| Data Exposure | No sensitive data exposure | Low |
pip install -r requirements.txt
python scripts/main.py --helpAvailable in references/:
⚠️ DISCLAIMER: This tool provides simulation results for research and planning purposes only. All clinical trial designs should be reviewed by qualified biostatisticians and regulatory experts before implementation.
Every final response should make these items explicit when they are relevant:
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.This skill accepts requests that match the documented purpose of adaptive-trial-simulator and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
adaptive-trial-simulatoronly handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Use the following fixed structure for non-trivial requests:
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
| Field | Required | Format/Source | Example | If Missing |
|---|---|---|---|---|
| User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide |
| Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing |
| Output preference | No | Text | Language, format, target journal, template | Use skill default format |
63c61d3
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.