define-variables

define-variables is a skill for Claude Code from Aperivue/medsci-skills. It costs 54 tokens per session (2,260 once invoked), scanned A, original, MIT.

A literature-based method for defining study variables in observational research, where researchers study existing data rather than assigning treatments. It links concepts such as obesity or kidney disease to published definitions, cutoffs, and available database fields.

In plain words
What is it for?
Use it to define exposures, outcomes, and covariates, choose evidence-backed cutoffs, map them to database variables, and document justified deviations.
Why use it?
It prevents definitions from being chosen ad hoc and makes the study easier to justify to reviewers. It also exposes mismatches between published definitions and the data you actually have.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the medsci-data plugin — 8 skills shipped together

Good fit Use it to define exposures, outcomes, and covariates, choose evidence-backed cutoffs, map them to database variables, and document justified deviations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aperivue/medsci-skills/define-variables
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Aperivue/medsci-skills --skill define-variables
Clone the repo
git clone --depth 1 https://github.com/Aperivue/medsci-skills

Made for: Claude Code.

Or install medsci-data, the plugin that ships this one along with the rest of its 8 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for define-variables

README.md
[![agentmods](https://agentmods.dev/badge/skills/aperivue/medsci-skills/define-variables/github.svg)](https://agentmods.dev/skills/aperivue/medsci-skills/define-variables)
Your own site
<a href="https://agentmods.dev/skills/aperivue/medsci-skills/define-variables"><img src="https://agentmods.dev/badge/skills/aperivue/medsci-skills/define-variables/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for define-variables

Your own site · 80×15
<a href="https://agentmods.dev/skills/aperivue/medsci-skills/define-variables"><img src="https://agentmods.dev/badge/skills/aperivue/medsci-skills/define-variables.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,260 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.02260
Opus 5.5 $0.00022 $0.00904
Sonnet 5.5 $0.00011 $0.00452
Haiku 4.5 $0.00005 $0.00226

Measured 13d ago against content hash dd4da6674d15, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

define-variables scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/define-variables/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Define-Variables Skill

Map each exposure, outcome, covariate, and eligibility variable to a canonical guideline/consensus definition, cross-check it against prior operationalizations in comparable cohorts, then map it to the available DB variables. Call after /design-study (and /search-lit), before /write-protocol.

Inputs

  1. Research question (one sentence)
  2. Candidate variables — exposure, outcome, key covariates, eligibility filters
  3. Data dictionary path (xlsx / csv / markdown) OR explicit list of available DB columns
  4. Cohort type (e.g., health-screening, NHANES-like, claims, registry) — informs which prior-art cohort to compare against

Missing inputs → ask once, then proceed.

4-Tier Pipeline (DB codebook + token-efficient literature)

Tier 0 — DB codebook lookup (mandatory for DB-backed observational studies)

Trigger: project has a project.yaml::db.dictionary_path field pointing to a machine-readable codebook (xlsx/csv/markdown), OR the user supplied a dictionary path in inputs. If neither, skip to Tier 1.

For every candidate DB variable — before touching literature — open the dictionary and record, verbatim, the sheet name, row number, and code→meaning mapping. This prevents the most common observational-study error: assuming a column code (status == 0, grade == 4) means what it intuitively reads like, when the codebook says otherwise.

Per variable:

  1. Locate the variable in the dictionary by exact column name.
  2. Copy verbatim: the sheet title, row number, and full code→meaning mapping (or unit/range statement for continuous vars).
  3. Paste into the Dict. sheet & row + Dict. verbatim columns of the operationalization table.
  4. If the variable is not found, OR the codebook is silent on a specific code value, file a question to the DB owner / data steward. Do NOT infer from cross-tabs, do NOT guess, do NOT proceed with that variable until a verbatim answer exists.

Empirical checks (value distributions, cross-tabs with related columns) are useful for sanity testing after the verbatim codebook meaning is recorded — never as a substitute for it.

Read the full file on GitHub · 103 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago Changed · +8 lines dd4da6674d15
  2. 2mo ago Changed 9bf85903bf29
  3. 2mo ago Changed · -60 lines · -15 tokens per session d5a8d500cd7a
  4. 3mo ago First seen · 155 lines · 69 tokens per session scan A bcbc6775dbb7

Subscribe to this mod's changes

define-variables is a skill published in the GitHub repository Aperivue/medsci-skills (418 stars, last pushed 4d ago), licensed MIT. It adds 54 tokens to every session and 2,260 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

define-variables compared with skills from other repositories

define-variables next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
define-variablesAperivue/medsci-skillsSkill4184d agoMITA54Claude Code
clinical-trials-searchbeita6969/ScienceClawSkill1.0kyesterdayMITB28Claude Code, Codex
shidiIcyCreamDAS/shidi-skillSkill151mo agoMITA126Claude Code, Codex
shidiIcyCreamDAS/shidi-skillSkill151mo agoMITA69Claude Code, Codex
clinical-researchbestagentkits/agency-skillsSkill285mo agoMITA152Codex
sr-search-recordqiaomiaojoe/ai-academic-workflowSkill1313d agononeA447Claude Code, Codex
critical-paper-readingqiaomiaojoe/ai-academic-workflowSkill1313d agononeA191Claude Code, Codex