Without the skill, Claude might use wrong parameter names, forget toInteger(), or misapply spending functions.
The Cross-Package Skill: GSD + Multiplicity
The graphicalMCP-gsDesign2 skill encodes a 4-phase workflow for multi-endpoint trials (e.g., OS + PFS + ORR in subgroup + all):
Design specification — Build multiplicity graph, design the sample-size-driving hypothesis (H1), derive enrollment, compute power for remaining hypotheses
Results entry — Record event counts, nominal p-values, compute spending times
Hypothesis testing — Compute sequential p-values, test with graph_test_shortcut()
Verification — Update group sequential bounds per the graph, compare nominal p-values to updated bounds
Example 1: Ask Claude to Design a Trial
Prompt:
Design a 3-analysis group sequential survival trial with non-binding futility. Control median PFS is 8 months, target HR 0.65, 90% power, enrollment over 18 months, 24 months minimum follow-up.
Plus natural language summary of sample size, events, and timing.
Example 2: Multiplicity-Adjusted Testing
Prompt:
We have a Phase III trial with OS and PFS in a biomarker subgroup and overall population. Set up the multiplicity graph and compute sequential p-values from interim results.
With the graphicalMCP-gsDesign2 skill, Claude:
Creates the multiplicity graph with proper alpha allocation
Designs the sample-size-driving hypothesis
Computes sequential_pval() for each hypothesis at each analysis
Tests using graph_test_shortcut() with adjusted significance levels
Without the skill, Claude would not know:
That info_frac = NULL with analysis_time is the correct approach
How spending time decouples from information fraction
The event = NULL requirement in gs_power_ahr() when using timing
Multi-Endpoint Simulation Pipeline
The multi-endpoint-sim skill orchestrates 5 packages for simulation-based operating characteristics:
Illness-death model simulates correlated OS, PFS, ORR from 6 transition rates
Beyond gsDesign: Specialized Skills
Negative Binomial (gsDesignNB)
Recurrent event trial design
Event gaps, variable accrual
Blinded sample size re-estimation
rpact
Adaptive designs with sample size reassessment
Inverse normal and Fisher combination tests
Multi-arm and enrichment designs
Theoretical Foundations Encoded in Skills
Skills don’t just encode code — they encode theory:
Paper
Encoded In
What It Enables
Anderson et al. (2022)
wpgsd
Unified framework for weighted parametric GSD
Anderson & Clark (2009)
gsDesign
Two-parameter spending function families with closed-form fitting
Anderson et al. (2026)
gsDesign2, graphicalMCP-gsDesign2
Spending time theory for sequential p-values
FDA OS Guidance (2025)
gsDesign
Harm bounds design for OS safety assessment in oncology
Liu & Anderson (2008)
gsDesign, graphicalMCP-gsDesign2
Sequential p-value validity (Theorems 1–2)
Maurer & Bretz (2013)
graphicalMCP-gsDesign2
Algorithm 1 for closed testing with group sequential designs
This means Claude can explain why a spending function is well-ordered, when spending time should differ from information fraction, and how sequential p-values maintain Type I error control — not just produce code that calls the right function.
How Skills Are Used
1. Keep portable skills in your project:
# Source of truth for all assistantsgsDesignSkills/.agents/skills/# Optional: export for Claude Code compatibilitycp-r gsDesignSkills/.agents/skills/* my-project/.claude/skills/
2. Reference skills through the adapter your assistant understands:
Assistant
Adapter
Claude Code
Copy or mirror selected skills into .claude/skills/; reference them in CLAUDE.md
VS Code / Copilot
Point .github/copilot-instructions.md to .agents/skills/
Cursor
Use .cursor/rules/gsdesign-skills.mdc as the repo adapter
Cline
Point .clinerules to the relevant .agents/skills/<skill-name>/SKILL.md
3. Use naturally — the assistant reads the skill when triggered, applies code patterns as verified starting points, and consults llms.txt for full API details when needed.
Paste or attach: SKILL.md, relevant code_patterns.md, and glossary/crosswalk snippets
Ask the model to follow the same routing rules
Best fit for design review, explanation, and second opinions
What Skills Prevent
Common AI Mistakes
Wrong parameter names (ssmethod vs method)
Hallucinated functions (as_gt() on wrong object type)
Wrong API conventions (rpact dropout as percentage vs proportion)
Missing critical steps (no toInteger(), wrong test.type)
What Skills Provide
Verified parameter names and defaults
Tested code patterns that work
Cross-package conventions (gsDesign vs rpact mapping)
Domain knowledge (when to use non-binding futility, spending time vs information fraction)
AI-Readable Documentation: Vendored References
gsDesignSkills includes local machine-readable references:
Function signatures with all parameters
Return value structures
Cross-references between related functions
Compact format designed for AI context windows
These files may originate from package documentation sites, local Rd files, or earlier documentation exports, but they are vendored into gsDesignSkills. For exact current-CRAN behavior, use the installed package help as the final source of truth.
Practical Impact
Skills have been used to:
Update the gsDesign Technical Manual — Claude incorporated substantial package updates across 13 files, adding 5 new chapters and sections with assistance from these skills
Generate cross-validation code between gsDesign and rpact with correct parameter mapping
Design complex multi-endpoint trials with graphical multiplicity following the Maurer-Bretz framework
Simulate multi-endpoint group sequential trials — 5-package pipeline from design through illness-death simulation to multiplicity-adjusted testing
Create simulation studies for negative binomial and illness-death models
The key insight: domain-specific knowledge turns a general-purpose AI into a reliable statistical programming assistant.
Future Directions
Expanding skills for additional packages and design types
Delegation and verification — biostatisticians shift from writing code to reviewing AI-generated designs (Dohmke & Kalliamvakou 2025)
Validation workflows — skills that check designs against simulation
Interactive design exploration — iterative refinement of designs through conversation
Community contributions — open-source skills that improve with collective expertise
Summary
What
Curated knowledge files for AI coding assistants
Version
0.2.0
Why
Clinical trial design requires domain expertise that general AI lacks
How
SKILL.md + code patterns + vendored API references
Anderson, K. M., Guo, Z., Zhao, J., & Sun, L. Z. (2022). A unified framework for weighted parametric group sequential design. Biometrical Journal, 64(7), 1219–1239. https://doi.org/10.1002/bimj.202100085
Anderson, K. M., & Clark, J. W. (2009). Fitting spending functions. Statistics in Medicine, 29(3), 321–327.
Anderson, K. M. et al. (2026). Spending time in group sequential design. Accepted for publication.
Liu, Q., & Anderson, K. M. (2008). On adaptive extensions of group sequential trials for clinical investigations. JASA, 103(484), 1621–1630.
Maurer, W., & Bretz, F. (2013). Multiple testing in group sequential trials using graphical approaches. Statistics in Biopharmaceutical Research, 5(4), 311–320.