Pharma Skills Workshop

Hands-On AI Skills for Clinical Programming & Biostatistics

Jeff Dickinson, PhD

Associate Director, Clinical Reporting · Navitas Data Sciences

Eric Zhang, PhD

Senior Director, Biostatistics · Eikon Therapeutics

October 1, 2026

Welcome

0.1 Pharma Skills Workshop

Hands-On AI Skills for Clinical Programming & Biostatistics

R/Pharma Virtual 2026 · Thursday, October 1, 2026 · 8:00–11:00 AM CDT · Virtual

Presenters:

  • Jeff Dickinson, PhD — Associate Director, Clinical Reporting, Navitas Data Sciences
  • Eric Zhang, PhD — Senior Director, Biostatistics, Eikon Therapeutics

0.2 What you’ll do

  • Run AI skills on real-world exercises — ADaM generation and group sequential design
  • See how skills are structured and how they interact with the AI model
  • Practice using the skills, with instructor support
  • Leave with practical ideas for applying AI skills to your own work

No prior AI-skills experience required.

0.3 Who this is for

  • Statistical programmers
  • Biostatisticians
  • Clinical data scientists
  • Anyone interested in practical AI applications in pharma R&D

Pick the exercises closest to your work — the ADaM thread, the group sequential design thread, or both.

0.4 Agenda

  1. Skills overview — what they are, why they matter
  2. Environment orientation — sign in, confirm you’re ready
  3. Section A — Group sequential design (Eric)
  4. Section B — ADaM generation (Jeff)
  5. Section C — Practice using the skills
  6. Wrap-up — ideas to take back

Three hours, one break near the midpoint.

1 Skills overview

1.1 What is a “skill”?

A skill is a reusable, model-agnostic workflow an AI coding agent loads on demand:

  • A SKILL.md file — step-by-step instructions for one class of task
  • Supporting reference files — conventions, function-selection logic, failure modes
  • Bundled scripts — R / Python the agent runs in your environment

The agent reads the skill only when your request matches it, then follows it instead of improvising.

1.2 Why skills matter for clinical programming

Clinical programming is high-stakes, convention-heavy, and traceability-driven. A skill lets you encode, once:

  • CDISC / ADaMIG conventions ("Y"/NA flags, study-day rules, date imputation direction)
  • Function-selection logic (when derive_vars_merged() vs derive_vars_merged_lookup())
  • QC scaffolding (stopifnot() assertions, # REVIEW: markers at every protocol-specific decision)

The agent then reproduces that discipline on every run.

1.3 Skills vs. no skills — group sequential design

group-sequential-design skill — 21 trial-design scenarios, 3 models (Claude Sonnet / Opus, Gemini Flash), May 2026:

With skill Without skill
Avg score across scenarios 90% 62%
Scenario wins 16 1
Ties 4 4

1.4 Skills vs. no skills — ADaM benchmarks

Community A/B benchmarks — same task, agent with vs without the skill, scored against a methodology rubric:

Skill / task With skill Without skill
ADSL derivation (34-point rubric) 100% 62%
ADSL safety flags — SAFFL / ITTFL / PPROTFL 83% 46%
ADAE derivation 94% 33%
ADLB derivation 94% 48%
ADVS (BDS) derivation 88% 36%

The gap is mostly admiral-idiom compliance + QC annotations, not whether the numbers come out right.

1.5 The source project: pharma-skills

These skills come from the R Consortium pharma-skills project (Submissions Working Group, Pilot 7; with the BBSW AI committee).

https://github.com/RConsortium/pharma-skills/tree/main

The full catalog also includes sdtm-oak, clinical-trial-simulation, statistical-reviewer, rounding, and more, plus a skill development lifecycle and community benchmarking.

1.6 Three threads today

1.6.1 A · Group sequential design

Design a survival trial with gsDesign / gsDesign2 / lrstat:

  • Boundaries, sample size, multiplicity
  • Simulation verification + Word report

1.6.2 B · ADaM generation

Derive analysis datasets from SDTM with {admiral}:

  • admiral (parent)
  • admiral-adsl → admiral-adae → admiral-bds

1.6.3 C · practice with the skills

  • Try a skill on your own problem
  • Instructor support throughout

2 Environment orientation

2.1 No setup required

The workshop runs in a preconfigured environment with:

  • Access to the AI model, already wired up
  • A library of pharma-focused skills, pre-installed
  • All R and Python packages for both threads, already installed

You do not need to install anything or configure anything in advance.

2.2 1. Sign in

Go to https://workshop.posit.team/ and sign in.

  • Choose Sign in with OpenID or Sign in with GitHub
  • Use the same account for the whole session

2.3 2. (Optional) Fork the workshop repo

Want to keep your Section C work after today? Fork jeffreyad/rpharma-2026-workshop to your own GitHub account.

  • Skip it and you’ll work from the original repo — everything today still works; you just won’t have a place of your own to push changes
  • Needs a GitHub account — if you signed in with GitHub, it’s one click. No account? https://github.com/signup (about a minute)
  • You can also fork later and copy your work over

2.4 3. Open your Positron session

In Workbench, start the session and choose the Positron IDE.

Why Positron? One IDE, both R and Python — Section A’s report generator is Python (python-docx), Section B is R (admiral), and Section C touches both. One session covers everything.

Then open the Claude Code panel — you’ll use it for the next step.

2.5 4. Set up with Claude Code

Copy this prompt (button at top right of the box) and paste it into Claude Code:

Set up the R/Pharma 2026 workshop repo for me:

1. If rpharma-2026-workshop is already in my workspace, use that copy.
   Otherwise clone it into my home directory from my fork, if I pasted
   its URL here: ______
   or else from https://github.com/jeffreyad/rpharma-2026-workshop
2. Find Rscript on this machine and put its path on the "Rscript path:"
   line in the repo's CLAUDE.md.
3. From the repo root, run `Rscript check_setup.R` and show me the report.
4. If any R package shows [FAIL] or [WARN], run
   `Rscript install_packages.R`, then re-run check_setup.R.
5. Do not install R or Python yourself. If either is missing, stop and
   tell me.

Finish with one line: READY, or what is still failing.

When it says READY: in Positron, File → Open Folder → rpharma-2026-workshop, then start a new Claude Code session there so it picks up the repo’s CLAUDE.md and skills.

2.6 5. Confirm you’re ready

Claude Code ran this for you in step 4. To run it yourself, from the repo root:

source("check_setup.R")

Prints [ OK ] / [WARN] / [FAIL] per line for:

  • R ≥ 4.2 and the admiral set (admiral ≥ 1.2.0, dplyr, lubridate, pharmaversesdtm, pharmaverseadam, metacore, xportr)
  • The GSD set (gsDesign, gsDesign2, lrstat, graphicalMCP, jsonlite)
  • Python ≥ 3.8 with python-docx

In the preconfigured environment every line should be [ OK ]. Any [FAIL] prints the exact fix — usually:

Rscript install_packages.R

2.7 You should now see…

Tip

Ready-state checklist

  • Positron open in your browser, with the workshop repo (your fork, or the original) open as the folder in the Explorer
  • Claude Code reported READY — check_setup.R shows all checks passed (no red)
  • A fresh Claude Code session started in the repo folder
  • An R console and a Python console both available

Section A — Group sequential design

2.8 Section A — what we’ll do

Drive the group-sequential-design skill to design a survival trial:

  • Survival endpoints (OS / PFS / DFS), interim + final analyses
  • Alpha-spending boundaries (Lan-DeMets, Hwang-Shih-DeCani)
  • Sample-size / event targets (N-first approach)
  • Graphical multiplicity for co-primary / multi-population designs
  • lrstat simulation to verify the analytic design
  • A template-driven Word report (gsd_report.py)

2.9 Section A — how the skill behaves

  • Asks design questions one at a time, in plain language, no defaults offered
  • Summarises all inputs in a table and waits for your confirmation
  • Computes the design, then checks interim-analysis timing against enrollment and minimum-gap constraints
  • Verifies by simulation before delivering — power within ±2 pp, type I error within ±0.5 pp
  • Writes every number to gsd_results.json; the report reads from there (no hardcoded values)

2.10 Section A — hands-on exercise

Let’s design a Phase 3 Oncology trial

2.11 Section A — debrief

  • Are the questions asked by the skill helpful?
  • Do the outputs include everything you need?
  • Can you apply this skill to your workflow?

Section B — ADaM generation

2.12 Section B — what we’ll do

Drive the admiral skill family to derive ADaM datasets from SDTM:

Skill Produces Depends on
admiral (parent) Shared conventions — no output —
admiral-adsl ADSL (subject-level) SDTM DM, EX, DS
admiral-adae ADAE (adverse events, TEAE flag) ADSL + SDTM AE
admiral-bds ADVS / ADLB (BDS findings) ADSL + SDTM VS / LB

ADSL must be derived first — its treatment vars and population flags feed every downstream dataset.

2.13 Section B — how the skill behaves

When you ask for a derivation, the skilled agent will:

  • Generate code section by section, not one giant block
  • Use the native pipe |> and exprs() for admiral verb arguments
  • Use admiral date functions (never as.Date() on --DTC)
  • Emit "Y"/NA flags — never "N"
  • Drop a # REVIEW: comment at every protocol-specific decision
  • Add stopifnot() assertions (one row per USUBJID, source uniqueness, …)

2.14 Section B — hands-on exercise

Step 1 — everyone: derive ADSL

Prompt to give the agent (verbatim, in chat — not typed as code):

“Using the admiral-adsl skill, derive ADSL from the pharmaversesdtm DM, EX, and DS domains. Include TRT01P/TRT01A, treatment start/end dates, and the SAFFL population flag.”

Watch for: the skill should ask you to confirm the treatment variable mapping and the SAFFL definition before it writes any code — if it doesn’t ask, that’s worth flagging in debrief.

2.15 Section B — hands-on exercise (continued)

Step 2 — pick a track

  • Track 1 — ADAE: “Using the admiral-adae skill and the ADSL you just built, derive ADAE from the pharmaversesdtm AE domain. Include the TEAE flag and AE start/end study day.”
  • Track 2 — BDS (ADVS): “Using the admiral-bds skill and the ADSL you just built, derive ADVS from the pharmaversesdtm VS domain. Include baseline flag and change-from-baseline for each parameter.”

Both tracks depend on the ADSL from Step 1 — point people to their own output, not a shared copy, so the exercise mirrors a real pipeline.

2.16 Section B — what “done” looks like

  • ADSL: one row per USUBJID; TRT01P/TRT01A populated for all subjects; SAFFL is "Y"/NA, never "N"; stopifnot() guard for row uniqueness passes
  • ADAE (Track 1): TEAE flag correctly excludes pre-treatment AEs; AE start day computed relative to treatment start, not enrollment; at least one # REVIEW: comment on the TEAE window definition
  • ADVS (Track 2): baseline flag set to the last non-missing value on/before treatment start per parameter; change-from-baseline present for post-baseline records only

If your output is missing a # REVIEW: comment somewhere you’d expect one (TEAE window, baseline definition, population flag edge case), that’s the thing to raise in debrief — not a bug to fix silently.

2.17 Section B — stretch goal

Finished early? Two options:

  • Run the other track (ADAE if you did BDS, or vice versa)
  • Open skills/admiral/admiral-adae/SKILL.md (or skills/admiral/admiral-bds/SKILL.md) and find the section defining the TEAE window / baseline rule — see whether the agent’s # REVIEW: placement matches what the skill actually says to flag

2.18 Section B — debrief

  • Where did the agent place # REVIEW: markers, and were they the right places?
  • What did you have to decide that the skill correctly refused to guess?
  • How does this compare to writing the derivation from scratch?

Section C — Practice with group-sequential-design and admiral

2.19 Now it’s your turn

Try one of today’s skills on something from your own work:

  • group-sequential-design — describe a trial you’re actually designing
  • admiral (admiral-adsl / admiral-adae / admiral-bds) — point it at a dataset you work with

Just describe the task in plain language and see what the agent produces. Forked the repo? Commit anything you want to keep to your fork. We’re here to help if you get stuck.

3 Wrap-up

3.1 What you did today

  • Ran the group-sequential-design skill to design and verify a survival trial
  • Ran the admiral skills to derive ADaM datasets from SDTM
  • Tried the skills on a problem from your own work

All driven by describing the task in natural language — the skill supplied the discipline.

3.2 Take it with you

Install into your own project:

npx skills add RConsortium/pharma-skills --skill admiral-adsl --skill group-sequential-design

Running the workshop repo itself on your own machine (rather than the cloud environment)? The repo has install_packages.R + check_setup.R and a full troubleshooting guide in INSTALL.md — or paste the step 4 setup prompt into Claude Code.

3.3 Disclaimer

These skills produce drafting aids, not validated deliverables.

LLM output can be wrong or vary between runs. Independently verify all generated code and results against your own QC process before they inform any regulatory, clinical, safety, or GxP-regulated activity, and comply with your organization’s policies.

The skills bundle scripts that execute in your environment — review a skill’s contents before running it, and only supply data you are permitted to use.

3.4 Thank you

Jeff Dickinson, PhD
Associate Director, Clinical Reporting · Navitas Data Sciences
· github.com/jeffreyad

Eric Zhang, PhD
Senior Director, Biostatistics · Eikon Therapeutics
· github.com/eric-zhang16

Questions?