hinna0818/ukbanalytica_v2/ukbsci-workflow
Claude Code and agent skill by hinna0818/ukbanalytica_v2
- community
Checking that the SKILL.md file is still in the repository.
End-to-end orchestrator for a UK Biobank Research Analysis Platform (RAP) study using the UKBAnalytica R package. Plans, sequences, and supervises the full pipeline — from RAP phenotype extraction, through disease-cohort construction with reusable time skeletons, variable preprocessing, baseline tables, multiple imputation, regression / survival / propensity / mediation / subgroup-sensitivity analyses, machine learning, omics workflows, and final publication-ready plots — by routing each phase to the right specialist skill (ukbsci-rap-extract, ukbsci-cohort, ukbsci-preprocess, ukbsci-baseline, ukbsci-imputation, ukbsci-regression, ukbsci-survival, ukbsci-propensity, ukbsci-mediation, ukbsci-subgroup-sensitivity, ukbsci-proteomics, ukbsci-ml, ukbsci-plot). Use this skill when the user asks for an end-to-end UKB study, an analysis plan covering multiple phases, or "RAP-to-publication" guidance. Triggers: end-to-end UKB analysis, UKB pipeline, RAP to publication, full study plan, 端到端 UKB 分析, RAP 到论文, 完整流程, 项目计划, /ukbsci-workflow. Hard rule: local agents must not read or inspect real UKB RAP participant-level data; generate scripts for RAP execution and interpret aggregate outputs only.
Install
npx vskill@latest install hinna0818/ukbanalytica_v2/ukbsci-workflowSKILL.md
ukbsci-workflow — UK Biobank end-to-end study orchestrator
0. Role of this skill
This skill is the plan-and-route layer. It does not do extraction, cohort building, regression, ML, or plotting on its own — those are delegated to the specialist ukbsci-* skills. Its responsibility is:
- Diagnose the user's study scope from their first message.
- Produce a plan (the document at
06-note/ukbsci-pipeline.md) covering
every phase, every output file, and every decision point.
- Hand off each phase to the correct specialist skill in the right order.
- Gate progress at known decision points so the user can pause / redirect.
- Write a wrap-up note at the end (
06-note/ukbsci-README.md) listing
the actual deliverables.
Think of it as an analyst-PM: it owns the project plan, not the math.
Strict local-agent boundary: this skill is for script generation, workflow planning, package guidance, and interpretation of aggregate outputs. The agent must not read, inspect, summarize, or process real UK Biobank RAP participant-level data, including de-identified row-level tables, raw RAP fields, exact dates, per-row predictions, row-level SHAP matrices, screenshots, tracebacks, or logs containing row-level values. Generate scripts for the user to run inside RAP; only aggregate results or rendered figures may be shared back with the agent. See ../references/agent-privacy-boundary.md.
1. When to load this skill
- The user asks for an end-to-end UKB study (`"help me run this analysis from
RAP to publication"`).
- The user describes a multi-phase project and wants to know the right order.
- The user has already done some phases and wants you to plan the rest.
- The user is starting a new study and isn't sure which
ukbsci-*skills are
relevant.
2. When NOT to load this skill
- The user has a single, well-scoped question (`"how do I parse ICD-10
codes?"`). Route directly to the relevant specialist skill.
- The user is debugging a specific function call. Route directly.
- The user wants a plot only. Route to
ukbsci-plot.
3. Standard project layout
All outputs live inside RAP project storage. The canonical tree:
Naming rules the skill must enforce:
- Scripts are numbered + descriptive, one per phase.
- Figures are dual-format (
.pdf+.png@ 300 dpi). - Result tables sit in
04-results/numbered to match the figure or table. - Per-figure source data sits in
05-figs/data/so reviewers can rebuild. - Every script's
stdout/stderris captured to07-log/<script>.log.
4. The eight phases
Phase 0 — Plan generation (this skill, always first)
Before writing any analysis code, produce 06-note/ukbsci-pipeline.md. The first generated script should also verify the active UKBAnalytica version and key interfaces. If functions such as build_survival_dataset() or ukb_ml_flow() are unavailable, install or load the latest project-approved UKBAnalytica source before continuing.
For skill-maintenance checks, run the shared smoke test after interface changes:
Required sections:
- Project metadata: title, primary outcome, exposure, covariates,
target population, censor date, expected sample size.
- Hypothesis & statistical question — one sentence, framed as a
testable claim.
- Phase-by-phase tree diagram (ASCII), naming every script, its inputs,
outputs, and the user-visible decisions inside it.
- Decision points (numbered) — places where the agent must pause and
ask the user.
- Deliverables — final tables and figures, with intended downstream use
(manuscript table, supplementary figure, etc.).
Sample tree (use as a template — adapt to the user's study):
Always present the plan to the user verbatim and wait for one of two responses:
"开始分析"/"start"→ proceed to Phase 1."调整计划"/"revise"→ ask which sections to change.
Do not start Phase 1 without explicit approval.
Phase 1 — RAP extraction
Hand off to ukbsci-rap-extract. Pass:
- The field IDs / variable sets derived from the plan.
- The chosen mode (
syncvsjob) based onplan$n_columns. - The exact output path (
/mnt/project/<area>/02-extract/pheno.csv). - A RAP environment check and field manifest:
ukb_check_rap_env() + ukb_create_extraction_manifest().
Verify before continuing:
Phase 2 — Cohort build
Hand off to ukbsci-cohort. Confirm the four decision points (primary disease, prevalent/outcome source sets, censor date) with the user before the script runs. Prefer ukb_time_skeleton() first, then build_survival_dataset(time_skeleton = ...). After it runs, present the aggregate attrition flow; for custom inclusion/exclusion rules use ukb_participant_flow().
Phase 3 — Preprocessing
Hand off to ukbsci-preprocess. Standard steps: negative-code sanitation, unit harmonisation, composite variables (BP, diet score, air pollution).
Phase 4 — Baseline (Table 1)
Hand off to ukbsci-baseline. Confirm strata variable with the user. Output goes to 04-results/01-baseline_table.csv as an aggregate table that may be shared with the local agent.
Phase 5 — Imputation (optional)
Only run if missingness in covariates is non-trivial. Hand off to ukbsci-imputation. Output is an imputed list, not a single table — every downstream regression must pool across imputations.
Phase 6 — Statistical modeling
Hand off to one or more of:
ukbsci-regression(Cox, logistic, linear, batch + extensions)ukbsci-survival(KM, competing risks, time-dependent ROC)ukbsci-propensity(PSM, IPTW, balance plots)ukbsci-mediation(single / multi-mediator, sensitivity)ukbsci-subgroup-sensitivity(interaction tests, exclusion criteria)
The exact subset depends on the study design. Confirm with the user.
Before running expensive models, generate a small simulated-data smoke test or use package demo data to validate function signatures. Never expose real participant rows to the local agent for debugging.
Phase 7 — Machine learning (optional)
Hand off to ukbsci-ml. Common configuration: outcome from cohort, features from preprocessed table, models = c("xgboost", "glmnet", "ranger"). Standard deliverables: ROC/PR/calibration/DCA + SHAP summary.
Phase 8 — Plots & wrap-up
Hand off to ukbsci-plot. Read source tables from 04-results/, write figures to 05-figs/, source data per figure to 05-figs/data/.
Then write the wrap-up note at 06-note/ukbsci-README.md containing:
- Citation header for
UKBAnalytica. - ASCII tree of actual files produced (use
list.files()— do not paste a
template).
- Key findings (3–5 bullets) summarising effect sizes, n's, and any
sensitivity-vs-main discrepancies.
- Caveats: imputation status, source selection, censoring date, any sources
omitted.
Present a one-paragraph summary to the user with figure count, log file status, and the top results.
5. Decision points the skill must enforce
| # | Phase | Pause and ask | |
|---|---|---|---|
| D0 | Phase 0 | Approve / revise the plan | |
| D1 | Phase 1 | Sync vs async extraction | |
| D2 | Phase 2 | primary_disease, prevalent_sources, outcome_sources | |
| D3 | Phase 3 | Negative-code list, composite variable formulas | |
| D4 | Phase 4 | Strata variable, which covariates appear in Table 1 | |
| D5 | Phase 5 | Run imputation? m, methods | |
| D6 | Phase 6 | Which models? Covariate set? Sensitivity variants? | |
| D7 | Phase 7 | Run ML? Which models and feature set? | |
| D8 | Phase 8 | Palette family; figure aspect ratios |
If the user has already pre-specified a decision, skip the prompt — but echo back the choice ("Got it — using primary_disease = AA per your earlier message").
6. Citation header (every emitted script)
7. Log capture (every script)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginst/skills/UKBAnalytica_skills/ukbsci-workflow/SKILL.md
Popularity
- Repository stars
- 33
- Repository forks
- 3
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hinna0818/ukbanalytica_v2/ukbsci-workflow)