alterlab-preregistration-discipline

$npx mdskill add AlterLab-IEU/AlterLab-Academic-Skills/alterlab-preregistration-discipline

Enforces pre-registration discipline before any data analysis.

  • Prevents data analysis without a frozen, pre-registered analysis plan.
  • Orchestrates alterlab-open-science, alterlab-statistical-analysis, and alterlab-scientific-thinking.
  • Uses Iron Law, spirit-vs-letter, Excuse-vs-Reality table, and Red-Flags-STOP list.
  • Forces unplanned findings to be labeled exploratory with degraded p-values.

SKILL.md

.github/skills/alterlab-preregistration-disciplineView on GitHub ↗
---
name: alterlab-preregistration-discipline
description: "Enforces pre-registration discipline with the Iron Law NO DATA ANALYSIS WITHOUT A PRE-REGISTERED ANALYSIS PLAN FIRST, a spirit-vs-letter line, an Excuse-vs-Reality rationalization table, and a Red-Flags-STOP list (HARKing, optional stopping, post-hoc covariates, outlier-dropping, test-shopping). Runs a PLAN/COLLECT/CONFIRM/EXPLORE workflow that freezes hypotheses, tests, exclusions, and stopping rules before data, then forces unplanned findings to be labeled exploratory (their p-values lose confirmatory status, per COS confirmatory/exploratory model). Orchestrates, not replaces, alterlab-open-science (OSF/AsPredicted registration), alterlab-statistical-analysis (test selection, assumptions), and alterlab-scientific-thinking (bias grading). Use when analyzing data without a frozen plan, switching the primary outcome or adding covariates after seeing results, weighing early stopping, dropping outliers post-hoc, pre-registering a study, or rationalizing deviation. Part of the AlterLab Academic Skills suite."
license: MIT
allowed-tools: Read Write Edit Bash(python:*)
compatibility: No API key required. Judgment/discipline skill; the optional helper runs locally via `uv run python` (stdlib only). Defers all registration mechanics and statistics to the sibling skills it orchestrates.
metadata:
  skill-author: AlterLab
  version: "1.0.0"
  last_updated: "2026-06-06"
  depends_on: "alterlab-open-science, alterlab-statistical-analysis, alterlab-scientific-thinking"
---

# Pre-registration Discipline (Iron Law)

**Skill type: DISCIPLINE-ENFORCING.** This is not a how-to and not a reference. It
exists to stop one specific failure mode — exploiting researcher degrees of freedom
after seeing the data, then reporting the result as if it were planned. It governs
*when you are allowed to claim a confirmatory result*; it does not teach you how to
pick a test or fill an OSF form. Those are sibling skills (see the routing table).

```
THE IRON LAW

    NO DATA ANALYSIS WITHOUT A PRE-REGISTERED ANALYSIS PLAN FIRST.
```

The frozen hypothesis + analysis plan is the research analog of a failing test
written before the implementation: you commit to what would count as a result
*before* you can see whether you got one. Run an unplanned analysis and the rule is
absolute — **it is exploratory. Label it, timestamp it, and you cannot report its
p-value as confirmatory.** (Per the Center for Open Science confirmatory/exploratory
model: in exploratory work, p-values lose their diagnostic value and findings require
independent replication. Verified at https://www.cos.io/initiatives/prereg.)

> **Violating the letter of the pre-registration is violating the spirit of the science.**

That line pre-empts the predictable defense — *"pre-registration is bureaucratic, I'm
following the scientific spirit."* There is no spirit-following exception. Iterate
freely in the EXPLORE phase; the confirmatory claim needs the frozen plan.

## When to Use This Skill

Use it the moment a confirmatory claim is on the table without a frozen plan behind
it, or the moment the plan is being bent after data are visible:

- About to analyze a dataset and there is no written, pre-data analysis plan.
- Switching the primary outcome, adding/removing a covariate, or changing the test
  *after* seeing results or p-values.
- Peeking at accruing data and weighing whether to stop now ("it's already significant").
- Dropping outliers, transforming variables, or changing exclusions that were not
  pre-specified.
- Drafting an OSF / AsPredicted / PROSPERO pre-registration (route the *mechanics* to
  `alterlab-open-science`; this skill enforces that the plan is actually *frozen* and
  honored).
- Rationalizing a deviation from an existing registration.
- A deadline-pressure ask like *"just p-hack this borderline result into something
  publishable."* — refuse the framing; offer the PLAN/CONFIRM/EXPLORE path instead.

### Does NOT Trigger

This skill is the *gatekeeper*, not the *toolbox*. It orchestrates siblings and routes
everything mechanical away. Route adjacent requests as follows:

| The request is really about… | Route to | Not this skill because… |
|---|---|---|
| Registration mechanics: OSF Registries / AsPredicted templates / PROSPERO, DMPs, FAIR data, repository choice, registered reports | `alterlab-open-science` | That skill owns the *how to register*; this one only enforces *freeze and honor it*. |
| Which test to run, assumption checks (Shapiro/Levene), power/sample-size, APA results | `alterlab-statistical-analysis` | Test *selection and execution* is statistics, not pre-registration discipline. |
| Grading evidence quality (GRADE, RoB), spotting biases/confounders, design validity | `alterlab-scientific-thinking` | Judging an *existing* body of evidence ≠ committing to a plan before data. |
| Whether a citation exists / supports a claim | `alterlab-citation-verifier` | Citation integrity, not analysis-plan integrity. |
| Reporting completeness of an analysis already run (effect sizes, CIs, every test disclosed) | `alterlab-results-transparency` | That is the *reporting* gate downstream of CONFIRM/EXPLORE. |
| Choosing among candidate tests for a borderline distribution before any peeking | `alterlab-test-selection-guard` | Locking the test choice is its own guard; this skill assumes the test is already in the frozen plan. |
| Writing a TÜBİTAK / grant proposal's methods section | `alterlab-tubitak-proposal` / `alterlab-grant-reporting` | Proposal authoring, not pre-registration enforcement. |
| Research ethics approval / KVKK / data-management compliance | `alterlab-tr-research-ethics` / `alterlab-kvkk-dmp` | Ethics & data governance, distinct from analysis-plan freezing. |

**REQUIRED BACKGROUND** (this skill orchestrates, it does not reimplement):
`alterlab-open-science` for the registration artifact, `alterlab-statistical-analysis`
for test choice + assumptions, `alterlab-scientific-thinking` for bias framing. When a
step needs any of those, hand off — do not restate their content here.

## The Workflow: PLAN → COLLECT → CONFIRM → EXPLORE

This is the research analog of red → green → refactor. Each phase has an exit gate; you
may not enter the next phase until the current gate passes.

### 1. PLAN — freeze it before any data are visible

Write down, and lock, **all** of:

1. The hypotheses (directional where applicable).
2. The primary outcome and any secondary outcomes — ranked.
3. The exact test(s) for each hypothesis (defer the *choice* to
   `alterlab-statistical-analysis`; record the decision here).
4. Inclusion/exclusion rules and the **outlier rule**, pre-specified.
5. The stopping rule / planned sample size (so optional stopping is off the table).
6. Covariates, transformations, and how missing data are handled.

Register the artifact via `alterlab-open-science` (OSF Registries / AsPredicted /
PROSPERO). **Gate:** the plan exists, is timestamped, and nothing in it depends on
having seen the outcome data. If you cannot answer "what result would falsify this?"
you are not done planning.

### 2. COLLECT — data, untouched

Collect according to the stopping rule. **Do not peek at the outcome to decide whether
to keep going.** If an interim look is genuinely needed, it had to be a pre-specified
sequential design (record that in PLAN). **Gate:** data collection matched the frozen
rule; no outcome-dependent stopping occurred.

### 3. CONFIRM — run exactly the planned tests

Run the pre-specified tests, in the pre-specified order, on the pre-specified sample.
Assumption checks (via `alterlab-statistical-analysis`) run and are reported **before**
interpreting the result — you do not get to swap the test because an assumption failed
unless the swap was pre-specified; an unplanned swap demotes the result to EXPLORE.
**Gate:** every confirmatory number traces to a line in the frozen plan.

### 4. EXPLORE — everything else, explicitly flagged

Anything not in the frozen plan lives here: new subgroups, post-hoc covariates,
alternative tests, interesting patterns. This work is valuable — it generates the
*next* study's hypotheses — but it is reported under an **Exploratory** heading, its
p-values are descriptive not confirmatory, and it carries a "requires replication"
caveat. **Gate:** every exploratory finding is labeled as such; none is laundered into
the confirmatory narrative.

A decision flowchart and the full phase gates live in
[references/workflow_gates.md](references/workflow_gates.md).

## Excuse vs. Reality

The predictable rationalizations, and what is actually happening. (Seeded from the
documented researcher-degrees-of-freedom literature — see
[references/researcher_degrees_of_freedom.md](references/researcher_degrees_of_freedom.md).)

| Excuse | Reality |
|---|---|
| "The data suggested a better test/model." | You are fitting noise. That is HARKing — hypothesizing after results are known. Report it as exploratory. |
| "We only peeked once." | Optional stopping inflates the Type I error rate. Report the (pre-specified) sequential design, or stop peeking. |
| "Pre-registration is rigid; science is iterative." | Iterate in the EXPLORE section. The confirmatory claim still needs the frozen plan. |
| "We dropped 3 outliers to meet normality." | Outlier rules must be pre-specified, or reported as a sensitivity analysis — not a silent edit. |
| "This covariate obviously belongs in the model." | "Obvious" post-hoc = a researcher degree of freedom. Pre-specify it, or flag it as exploratory. |
| "We switched to Mann–Whitney because the t-test wasn't significant." | Choosing a test by its p-value is test-shopping. Pre-register the decision rule or label the result exploratory. |
| "The deviation follows the spirit of the registration." | Violating the letter is violating the spirit. There is no spirit exception. |
| "It's only exploratory, so registration is overkill." | Then label every finding exploratory and claim no confirmatory p-values. You don't get confirmatory credit without the plan. |

## Red Flags — STOP

If you catch yourself (or the user) thinking any of these, **STOP**:

- "Let me just try a different test and see."
- "I'll drop these outliers and rerun."
- "The effect is there if I add this one covariate."
- "We can stop collecting now — it's already significant."
- "I'll just report the analyses that worked."
- "This subgroup is fascinating (we didn't predict it, but…)."
- "Let me change the primary outcome to the one that came out."
- "Pre-registration is overkill for a study like this."

All of these mean the same thing: **you are exploiting researcher degrees of freedom.**
Either return to the frozen plan, or label the work exploratory and forfeit the
confirmatory claim. There is no third option.

## The Multiple-Comparisons Escalation Gate

A hard, countable rule (the analog of "3 failed fixes = wrong architecture"):

> Ran **3+ tests on the same hypothesis** searching for significance? STOP. This is
> multiple comparisons / test-shopping. Either correct for **all** of them (Bonferroni /
> Benjamini–Hochberg FDR — via `alterlab-statistical-analysis`) or declare the whole
> analysis exploratory. Do **not** run test #4 to find p < .05.

## Deviation Disclosure Gate

If a deviation from the frozen plan is unavoidable (a genuine error in the plan, an
impossible assumption), it is not silently absorbed. Run, in order:

1. **STATE** the original frozen specification (quote the plan).
2. **STATE** the deviation and the concrete reason it was forced.
3. **CLASSIFY** the affected result as exploratory unless the deviation provably
   cannot have been outcome-driven.
4. **DISCLOSE** the deviation in the manuscript's transparency/deviations section
   (route reporting completeness to `alterlab-results-transparency`).

You can run a quick structured self-audit of a plan-vs-actual story with the optional
helper:

```bash
uv run python skills/methodology/alterlab-preregistration-discipline/scripts/prereg_check.py \
    --plan plan.json --actual actual.json
```

It is a stdlib-only checklist scorer (no network, no third-party APIs) — it does **not**
run statistics. See its `--help`.

## Self-Check Before Claiming a Confirmatory Result

- Does a frozen, timestamped plan exist, written before the outcome data were visible?
- Does every confirmatory number trace to a line in that plan?
- Were assumption checks run and reported before interpretation?
- Is every unplanned analysis under an **Exploratory** heading with a replication caveat?
- Are all deviations disclosed, not absorbed?

Any "no" → the result is exploratory, not confirmatory. Say so plainly.

## References

- [references/workflow_gates.md](references/workflow_gates.md) — the PLAN/COLLECT/CONFIRM/EXPLORE
  phase gates and decision flowchart in full.
- [references/researcher_degrees_of_freedom.md](references/researcher_degrees_of_freedom.md) —
  the documented failure modes (HARKing, optional stopping, p-hacking, the garden of
  forking paths) this skill is built to catch, with sources.
- Center for Open Science — Preregistration. https://www.cos.io/initiatives/prereg
  (confirmatory vs. exploratory model; verified during authoring).
- Orchestrated siblings: `alterlab-open-science`, `alterlab-statistical-analysis`,
  `alterlab-scientific-thinking`.

Part of the AlterLab Academic Skills suite.

More from AlterLab-IEU/AlterLab-Academic-Skills

SkillDescription
alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(seed=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite.
alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.
alterlab-accreditation-aolScaffolds program-level Assurance-of-Learning (AoL) documentation for AACSB (2020 Standard 5) and ABET (Criterion 3 Student Outcomes, Criterion 4 Continuous Improvement) accreditation — program learning outcomes / competency goals, curriculum-to-outcome mapping matrices, direct- and indirect-assessment plans, rubric design, and closing-the-loop continuous-improvement narratives — and validates the structure of an outcome-mapping matrix with scripts/aol_matrix.py. Use when the user needs AACSB or ABET assurance-of-learning material, a program-learning-outcomes set, a curriculum/outcome map or coverage matrix, a direct/indirect assessment plan, a closing-the-loop report, or accreditation self-study text. For single-course design or course rubrics prefer alterlab-teaching-design; for post-award grant reports prefer alterlab-grant-reporting. Part of the AlterLab Academic Skills suite.
alterlab-adaptyvSubmits and tracks protein-testing experiments on the Adaptyv Bio Foundry cloud lab (wet-lab validation), and optimizes protein sequences before submission with computational tools (NetSolP, SoluProt, SolubleMPNN, ESM). Use when designing proteins that need wet-lab validation - binding/affinity screening, expression testing, thermostability, or fluorescence assays - or when submitting experiments to the Foundry API, browsing the target catalog, tracking experiment status, retrieving results, or pre-screening sequences for solubility/expression. Triggers on "Adaptyv", "Foundry API", "cloud lab", "biolayer interferometry / BLI", "wet-lab validation". Part of the AlterLab Academic Skills suite.
alterlab-aeonRuns time series machine learning with the aeon library — classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search via scikit-learn compatible APIs. Use when working with temporal data, sequential patterns, or time-indexed observations (univariate or multivariate) that need specialized algorithms beyond standard ML approaches. Part of the AlterLab Academic Skills suite.
alterlab-akademik-tesvikComputes the annual Turkish academic-incentive (akademik teşvik) score for Devlet (state) university öğretim elemanı (academic staff) from a classified activity list, applying the verified Akademik Teşvik Ödeneği Yönetmeliği (2018/11834) Faaliyet Hesaplama Tablosu headline puanları (Proje 20, Araştırma 15, Yayın 30, Patent 30, Atıf 30, Tebliğ 20, Ödül 20) with the k (author-count), p (Q1 1/Q2 0.8/Q3 0.5/Q4 0.25), and r (project-role) coefficients via türü puanı = Σ(faaliyet oranları) × headline (MADDE 8/2), then enforcing the per-type headline ceilings, the 100 cap (MADDE 8/3), and the net-30 payment gate (MADDE 10/3) in a deterministic scripts/tesvik_score.py. Use when the user wants to calculate akademik teşvik puanı, check the en az 30 (net-30) threshold, apply TABLO 4 ceilings, or estimate teşvik eligibility; keeps its coefficients separate from doçentlik scoring. For doçentlik point eligibility prefer alterlab-docentlik-eligibility. Part of the AlterLab Academic Skills suite.
alterlab-alpha-vantageAccesses real-time and historical stock market data, forex rates, cryptocurrency prices, commodities, economic indicators, and 50+ technical indicators via the Alpha Vantage API (requires a free API key from alphavantage.co). Use when fetching stock prices (OHLCV), company fundamentals (income statement, balance sheet, cash flow), earnings, options data, market news/sentiment, insider transactions, GDP, CPI, treasury yields, gold/silver/oil prices, Bitcoin/crypto prices, forex exchange rates, or calculating technical indicators (SMA, EMA, MACD, RSI, Bollinger Bands). Part of the AlterLab Academic Skills suite.
alterlab-alphafoldPredict protein 3D structures with AlphaFold2 via ColabFold — MMseqs2-accelerated MSAs, monomer and AlphaFold2-Multimer complex folding, and confidence-based validation (pLDDT, pTM/ipTM, PAE). Use when folding a protein sequence or complex from FASTA, generating a predicted structure with confidence metrics, ranking models, or checking self-consistency of a design. For co-folding a protein WITH a small-molecule ligand or predicting binding affinity prefer alterlab-boltz; for antibody–antigen or one-FASTA multi-entity complexes prefer alterlab-chai; to LOOK UP an already-computed structure prefer alterlab-alphafold-db; for ESM embeddings or inverse folding prefer alterlab-esm. Part of the AlterLab Academic Skills suite.
alterlab-alphafold-dbAccess the AlphaFold DB of 200M+ AI-PREDICTED protein structures — retrieve models by UniProt accession, download PDB/mmCIF files, and analyze prediction confidence metrics (pLDDT, PAE). Use when a UniProt ID needs a computationally predicted 3D structure or when no experimental structure exists, for homology modeling, protein engineering, or structure-based drug discovery; for EXPERIMENTALLY determined structures (X-ray, cryo-EM, NMR) prefer alterlab-pdb, and for protein sequences, annotations, or accession ID mapping prefer alterlab-uniprot instead. Part of the AlterLab Academic Skills suite.
alterlab-anndataBuild, slice, concatenate, read, and write AnnData annotated data matrices (obs, var, X, layers, obsm, uns) — the scverse data STRUCTURE, not an analysis pipeline. Use when creating or wrangling .h5ad/zarr files, managing cell and gene annotations, concatenating batches, or handling layers/obsm/backed-mode; for the QC, normalization, clustering, UMAP, and differential-expression analysis pipeline prefer alterlab-scanpy instead, and for RNA velocity from spliced/unspliced layers prefer alterlab-scvelo instead. Part of the AlterLab Academic Skills suite.