admiral

Generates CDISC-conformant ADaM dataset derivation R code using the admiral pharmaverse package.

13|6|Updated Aug 9, 2026
One-click install
npx skills add https://github.com/kaipingyang/CDISC_training --skill admiral-kaipingyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: admiral
Source: https://github.com/kaipingyang/CDISC_training/tree/main/.claude/skills/admiral
Command: npx skills add https://github.com/kaipingyang/CDISC_training --skill admiral-kaipingyang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires admiral, dplyr, lubridate, metacore, xportr, pharmaversesdtm, pharmaverseadam, and includes references (resource) components.

What problem does it solve? Clinical programmers need to derive ADaM analysis datasets (ADSL, ADVS, ADLB) from SDTM data following strict CDISC conventions, and mistakes in date imputation, flag conventions, or function selection create regulatory submission risk. This Skill encodes the shared conventions and dataset-specific workflows an experienced admiral programmer applies, so an AI agent generates QC-ready, audit-traceable R code. ## Core Features & Use Cases - Shared ADaM conventions: Enforces library setup, native pipe style, date derivation rules (derive_vars_dt, never as.Date on --DTC), flag conventions ("Y"/NA, never "N"), DOMAIN removal, and stopifnot assertions across all derivations. - Child skill routing: Routes to admiral-adsl for subject-level datasets (treatment dates, disposition, population flags) and admiral-bds for BDS findings datasets (ADVS, ADLB with baseline, change from baseline, and analysis flags). - QC-ready output: Requires # REVIEW: annotations at every protocol-specific decision point and programmatic uniqueness assertions for regulatory review. - Use Case: A clinical data programmer asks the agent to derive ADSL from DM, EX, and DS domains; the Skill produces step-by-step admiral R code with correct imputation flags, population flag logic, and review annotations aligned to the ADaM spec. ## Quick Start Ask the agent to derive an ADSL dataset from the SDTM DM, EX, and DS domains using admiral, following the study's ADaM specification.

Frequently Asked Questions about admiral

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I derive an ADSL dataset in R with admiral?

Start from DM as the subject spine, then use derive_vars_merged with mode first/last to get treatment dates from EX, derive disposition from DS, and add population flags with derive_var_merged_exist_flag. The admiral-adsl child skill provides the full step-by-step workflow with QC assertions.

How do I derive ADVS or ADLB from SDTM using admiral?

Use the admiral-bds child skill: merge ADSL backbone variables, map parameters with derive_vars_merged_lookup, derive ADT with derive_vars_dt, flag baseline with restrict_derivation plus derive_var_extreme_flag, then compute BASE, CHG, and PCHG with derive_var_base and derive_var_chg.

Why should I not use as.Date on SDTM --DTC variables?

as.Date silently returns NA for partial dates like "2023-06" without warning. Always use derive_vars_dt or derive_vars_dtm with explicit date_imputation and flag_imputation = "auto" so partial dates are imputed and traceable via DTF/TMF flag variables.

What is the CDISC convention for ADaM flag variables?

Flag variables such as SAFFL, ABLFL, and ANL01FL must be "Y" or NA, never "N". When using derive_var_merged_exist_flag, set true_value to "Y" and both false_value and missing_value to NA_character_.

Does this skill support ADAE or time-to-event datasets?

ADAE (OCCDS) and ADTTE (time-to-event) child skills are planned but not yet available. The current family covers shared conventions, ADSL, and BDS findings datasets ADVS and ADLB.

What R packages are required to run the generated admiral code?

The generated code requires admiral (>= 1.2.0), dplyr, and lubridate as core dependencies, plus metacore and xportr for submission-ready attributes, and pharmaversesdtm and pharmaverseadam for benchmark input and reference data.