Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Literature-grounded variable operationalization for observational research. Turns a data dictionary + research question into a citation-backed table of exposure/outcome/covariate definitions, cutoffs, and DB variable mappings. Prevents ad-hoc phenotype definitions that invite reviewer rejection. Bridges /search-lit output into /write-protocol Methods.
.claude/skills/aperivue-define-variables/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 69% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 86% | 0% |
Every observational study operationalizes abstract constructs (MASLD, CKD, emphysema, obesity, incidentaloma) into concrete rules against the available data dictionary. When that operationalization is invented ad-hoc from the dictionary alone, reviewers reject on construct validity regardless of downstream statistics.
This skill forces a literature-first pass: each variable is mapped to a canonical guideline/consensus definition, cross-checked against prior operationalizations in comparable cohorts, then mapped to available DB variables. Ad-hoc deviations are flagged explicitly and justified, not hidden.
Use it when:
Call after /design-study, before /write-protocol.
variable_operationalization.md in the project root (or path the user specifies).Missing inputs → ask once, then proceed.
Trigger: project has a project.yaml::db.dictionary_path field pointing to a machine-readable codebook (xlsx/csv/markdown), OR 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 single most common observational-study error: assuming a column code (status == 0, grade == 4) means what it intuitively reads like, when the codebook says otherwise.
Concrete procedure per variable:
Dict. sheet & row + Dict. verbatim columns of the operationalization table.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.
Project-level binding (recommended): commit a DICTIONARY_FIRST_POLICY.md at the project root (or shared-config path) capturing the canonical dictionary path + escalation contact. Cross-project rule template: ~/.claude/rules/dictionary-first.md.
Exit gate: check_dictionary_citations.py (or equivalent) PASS on the operationalization table before running Tier 1.
Check references/common_definitions.md (shipped with skill) for the variable. Covers high-frequency constructs:
If the variable hits Tier 1, record: guideline, year, canonical cutoff, BibTeX key. Done — no /search-lit call.
/search-lit (focused queries only)For variables NOT in Tier 1, OR when subgroup justification is needed (Asian-specific cutoff, pediatric, young-adult, pregnancy, etc.), call /search-lit with one query per variable — not a general sweep. Query pattern:
"{construct} definition {cohort type} {subgroup qualifier}"
e.g., "obstructive sleep apnea prevalence Korean health screening cohort"Cap: 5 queries per session. Stop early if first 1-2 papers converge on the same definition.
Before finalizing, run /verify-refs on the accumulated BibTeX to confirm every citation exists in PubMed/CrossRef. Ad-hoc choices (no canonical source found) must be flagged Ad-hoc: yes and justified with 1-2 sentences — never hidden.
Write to {project_root}/variable_operationalization.md using templates/variable_operationalization.md. Required structure:
| Variable | Role | Dict. sheet & row | Dict. verbatim | Canonical source | Definition | Cutoff | DB vars | Implementation | Ad-hoc? |
Role: exposure / outcome / covariate / eligibilityDict. sheet & row: e.g. 5-1.복부초음파 r12 — mandatory if a DB dictionary existsDict. verbatim: full code→meaning string copied from the dictionary — mandatory same conditionCanonical source: BibTeX key (e.g., @rinella2023_aasld_masld)Definition: one line, verbatim from guideline where possibleCutoff: numeric + unitsDB vars: exact dictionary column names usedImplementation: SQL/pandas-style pseudocode (e.g., bmi>=25 & (b_tg>=150 | b_hdl<40))Ad-hoc?: yes/no. If yes, justification below table/analyze-stats/write-paper/clean-data/calc-sample-sizeintake-project → design-study → search-lit → define-variables → write-protocol → analyze-stats → write-paper
^^^^^^^^^^^^^^^/orchestrate should insert this skill between /search-lit and /write-protocol for any observational cohort or registry study.
Every variable definition, cutoff, and era anchor must be grounded in a verified source — a clinical guideline, a peer-reviewed paper with DOI, or an established registry data dictionary. Never invent a phenotype threshold from the model's prior; if the source is unknown, mark the row Ad-hoc: yes and require user confirmation before it propagates into /write-protocol or /analyze-stats. When citing papers to justify a cutoff, verify the citation via /search-lit or /verify-refs — do not carry references from memory alone. The output table must carry explicit source, year, and guideline_version columns so downstream skills can re-verify.
status == 0, grade == 4) by its surface reading without consulting the codebook. Tier 0 exists specifically to prevent this. Distinguish from Failure #1: Tier 0 says "once you've picked the DB column, quote the codebook verbatim before using its values." Failure #1 says "don't pick DB columns before picking definitions from literature." Both rules co-exist.Ad-hoc: yes flag.Role = covariate and Implementation = "IF status == 'never' THEN dose = 0 ELSE measured_value" — and adjust on the categorical status variable, reserving the continuous dose for an exposed-only secondary analysis. /clean-data (categorical-implied-zero flag) and /analyze-stats ("Covariate Pitfalls") enforce this downstream.Some passages in this skill cite a path of the form ~/.claude/rules/<name>.md. Those are the maintainer's personal global rules, kept outside this repository. They are not shipped with this skill and will not exist on your machine; they appear only as provenance for where a convention came from. If one of them looks like it is standing in for an instruction you actually need, that is a bug — please open an issue, because the instruction belongs here.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 40,181 | 23,718 | -41% | 1 | 1 | 0% | 8,364 | 7,694 | -8% | 0 | 0 | — |
case-02 | fail→pass | 42,874 | 25,369 | -41% | 1 | 1 | 0% | 8,336 | 7,836 | -6% | 0 | 0 | — |
case-03 | fail→pass | 27,854 | 32,141 | +15% | 1 | 1 | 0% | 5,443 | 9,200 | +69% | 0 | 0 | — |
case-04 | fail→pass | 39,023 | 9,986 | -74% | 1 | 1 | 0% | 5,857 | 4,384 | -25% | 0 | 0 | — |
case-05 | fail→pass | 21,830 | 30,293 | +39% | 1 | 1 | 0% | 4,562 | 8,483 | +86% | 0 | 0 | — |
case-06 | fail→fail | 17,599 | 21,886 | +24% | 1 | 1 | 0% | 3,584 | 6,678 | +86% | 0 | 0 | — |
case-07 | pass→pass | 16,664 | 11,118 | -33% | 1 | 1 | 0% | 2,993 | 4,670 | +56% | 0 | 0 | — |
case-08 | fail→fail | 12,678 | 8,379 | -34% | 1 | 1 | 0% | 2,079 | 4,237 | +104% | 0 | 0 | — |
case-09 | pass→pass | 12,035 | 7,345 | -39% | 1 | 1 | 0% | 2,018 | 4,005 | +98% | 0 | 0 | — |
case-10 | pass→pass | 15,958 | 14,556 | -9% | 1 | 1 | 0% | 3,086 | 5,482 | +78% | 0 | 0 | — |
case-11 | fail→pass | 10,899 | 15,030 | +38% | 1 | 1 | 0% | 2,126 | 5,080 | +139% | 0 | 0 | — |
case-12 | pass→pass | 14,907 | 9,836 | -34% | 1 | 1 | 0% | 3,008 | 4,572 | +52% | 0 | 0 | — |
case-13 | pass→pass | 18,978 | 8,104 | -57% | 1 | 1 | 0% | 3,654 | 4,210 | +15% | 0 | 0 | — |
case-14 | fail→pass | 12,172 | 9,335 | -23% | 1 | 1 | 0% | 2,079 | 4,338 | +109% | 0 | 0 | — |
case-15 | fail→pass | 15,608 | 11,914 | -24% | 1 | 1 | 0% | 2,439 | 4,686 | +92% | 0 | 0 | — |
case-16 | fail→fail | 14,096 | 14,760 | +5% | 1 | 1 | 0% | 2,302 | 5,182 | +125% | 0 | 0 | — |
case-17 | pass→pass | 11,643 | 11,076 | -5% | 1 | 1 | 0% | 1,887 | 4,458 | +136% | 0 | 0 | — |
case-18 | fail→pass | 12,127 | 6,270 | -48% | 1 | 1 | 0% | 2,079 | 3,805 | +83% | 0 | 0 | — |
case-19 | pass→pass | 8,297 | 3,516 | -58% | 1 | 1 | 0% | 1,332 | 3,319 | +149% | 0 | 0 | — |
case-20 | pass→pass | 7,785 | 19,931 | +156% | 1 | 1 | 0% | 1,536 | 6,755 | +340% | 0 | 0 | — |
case-21 | fail→pass | 14,530 | 5,504 | -62% | 1 | 1 | 0% | 2,276 | 3,603 | +58% | 0 | 0 | — |
case-22 | pass→fail | 15,012 | 4,628 | -69% | 1 | 1 | 0% | 2,685 | 3,471 | +29% | 0 | 0 | — |
case-23 | pass→pass | 12,778 | 28,368 | +122% | 1 | 1 | 0% | 2,390 | 6,971 | +192% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +39 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.