.claude/skills/simtrial/SKILL.md
Guide users through clinical trial simulation using the simtrial R package. Use this skill when the user asks about: simulating survival trials, simfix, sim_pw_surv, cutting data at calendar or event times, weighted logrank tests, MaxCombo tests, or simulation-based power.
npx skillsauth add keaven/gsDesignSkills simtrialInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Note: This skill targets simtrial >= 1.0.2 (main branch at github.com/Merck/simtrial).
references/llms.txt (source: https://gsDesign.ai)references/llms_local.txtreferences/code_patterns.mdsim_pw_surv() - Simulate piecewise exponential survival data (individual patient data)sim_fixed_n() - Fixed-sample simulation with analysis pipeline (simpler, less flexible)sim_gs_n() - Group sequential simulation (integrates with gsDesign2 designs)to_sim_pw_surv() - Convert simple rate format (control rate + HR) to sim_pw_surv formatcut_data_by_date() - Cut simulated data at a calendar datecut_data_by_event() - Cut simulated data at a target event countget_cut_date_by_event() - Find calendar date for a target event countget_analysis_date() - Get analysis date from multiple criteria (events, calendar time, follow-up)create_cut() - Create a cutting function for use in sim_gs_n pipelineswlr() - Weighted logrank test (single weight function)maxcombo() - MaxCombo test (multiple FH weight functions, correlation-adjusted p-value)rmst() / rmst_two_arm() / rmst_single_arm() - Restricted mean survival timemilestone() - Milestone analysis (survival difference at fixed time)multitest() - Apply multiple tests to one datasetcreate_test() - Create a parameterized test function for use in pipelinesfh() - Fleming-Harrington weights (rho, gamma)mb() - Magirr-Burman weights (delay period for NPH)early_zero() - Early zero weight functionwlr_weight() - General WLR weight specificationcounting_process() - At-risk/event tables from survival data (for custom analyses)rpwexp() - Random piecewise exponential generationrpwexp_enroll() - Random piecewise enrollment timesfit_pwexp() - Fit piecewise exponential modelrandomize_by_fixed_block() - Block randomizationsummary() - Summarize sim_gs_n results (power, events, timing)as_gt() - Convert summary to gt tableex1_delayed_effect through ex6_crossing - Pre-built NPH scenarios from Cross-Pharma Working GroupFor detailed code templates, read references/code_patterns.md.
Topics covered:
sim_pw_surv() (PH and NPH)wlr()) and MaxCombo (maxcombo())multitest() and create_test()sim_fixed_n() (timing_type options)sim_gs_n() (multiple tests, boundary updating)original_design parameter)to_sim_pw_surv()get_analysis_date() / create_cut()wlr() with illness-death model ADTTE datamaxcombo must be used alone in sim_gs_n(): it cannot be combined with other tests in the same test listto_sim_pw_surv(): Use this to convert the simpler rate format (control rate + HR) to the treatment-specific format needed by sim_pw_surv()sim_gs_n() + original_design: Pass a gsDesign2 design object to get boundaries updated based on actual vs planned information fractionia_alpha_spending: Controls how alpha is spent when observed events differ from planned ("min_planned_actual" is conservative default)fa_alpha_spending = "full_alpha": Spends full alpha at final analysis (default); use "info_frac" for event underrunning scenarioscreate_cut() and create_test(): These factory functions are essential for building sim_gs_n() pipelinesid, month, evntd, trt — need renaming to tte, event, treatment for use with wlr() / maxcombo()wlr(): Can be used outside sim_gs_n() with any data having tte, event, stratum, treatment columns. Returns positive Z when experimental is better. See references/code_patterns.md for illness-death model integration.testing
Guide users through weighted parametric group sequential design using the wpgsd R package. Use this skill when the user asks about: correlated test statistics across hypotheses, generate_bounds, closed_test, correlation matrices for nested populations, or parametric multiplicity adjustment with group sequential designs.
tools
Guide users through confirmatory adaptive clinical trial design and analysis using the rpact R package. Use this skill when the user asks about: adaptive designs, sample size reassessment, conditional power, inverse normal combination test, Fisher combination test, multi-stage designs, or rpact design objects.
tools
Guide users through multi-endpoint group sequential trial simulation with multiplicity-controlled testing. Use this skill when the user asks about: simulating trials with OS, PFS, and ORR endpoints, illness-death model simulation with gsDesign bounds, sequential p-values in simulation loops, combining graphicalMCP with gsDesign for simulation-based operating characteristics, cumulative rejection probabilities, or building a full pipeline from design through simulation to multiplicity-adjusted testing.
tools
Guide users through simulating clinical trials using the illness-death model with response. Use this skill when the user asks about: multi-state models for oncology trials, simulating correlated OS/PFS/ORR endpoints, transition rates between disease states, illness-death model calibration, building ADTTE datasets from simulation, analysis cut date determination, or theoretical survival curves from transition rates.