Preregister

From pedrohcgs/claude-code-my-workflow · View interactive version

Preregister is an AI agent skill from the GitHub repository pedrohcgs/claude-code-my-workflow. Draft a structured preregistration document (OSF, AsPredicted, or AEA RCT Registry style) from a research spec or free-form study description. Output is a Markdown file with hypotheses, design, sampling plan, analysis plan, exclusions, and inference criteria — annotated with MUST / SHOULD / MAY clar

How to use this skill

Skill file

/preregister — Preregistration Document Generator

Produce a registry-ready preregistration document. The user uploads it to a real registry (OSF / AsPredicted / AEA RCT Registry) — this skill writes the prose and structure, it does not submit anywhere.

Why preregister

Preregistration is a written commitment to your hypotheses, design, and analysis plan before you see the data (or, for observational analyses, before you analyse the realised outcome). It separates confirmatory tests from exploratory tests and protects you from p-hacking, HARKing, and forking-paths. Different fields use different registries:

When to use

When NOT to use

Workflow

PHASE 1 — Read inputs

Two input modes:

  1. --input <path> — a research spec produced by /interview-me (saved under quality_reports/specs/) or any structured Markdown file. Read the spec and extract: research question, hypotheses (directional!), data source, design, sample, analysis approach. If the spec records a paper type (/interview-me writes it on a **Paper type:** line, e.g. survey-experiment), use it to bias the style choice.
  2. No --input — prompt the user for a 1–3 paragraph description of the study, then proceed. If the description omits a directional hypothesis, ask once. Do not fabricate.

Refusal conditions (must be checked before any drafting):

PHASE 2 — Pick the style

Default per field (used when --style is not given):

| Field signal | Default style |

|---|---|

| **Paper type:** survey-experiment or political-science / psychology context | osf |

| Field experiment in econ / labelled "RCT" / IRB-approved randomised intervention | aea-rct |

| 9-question quick-form ask, lab psych experiment, time-pressure | aspredicted |

| Anything else | osf |

User can override with --style osf|aspredicted|aea-rct.

PHASE 3 — Generate the document

Read templates/preregistration-template.md. The template has three style sections; only use the section matching the chosen style (don't merge — registries differ).

Common to all styles, the document MUST include:

Style-specific sections:

Annotate each section with one of:

Re-use the MUST/SHOULD/MAY framework from templates/requirements-spec.md. For each MUST that the input did not supply, write [CLARIFY: <specific question>] rather than fabricating content.

PHASE 4 — Cross-checks (before writing to disk)

Refuse to mark the document "ready" if any of these fails:

For each failure, the document gets a [CLARIFY: …] placeholder; the document is written to disk but flagged in the output summary as "INCOMPLETE — N MUST items unresolved".

PHASE 5 — Post-flight verification

If the document cites prior literature in the rationale section (e.g., "Building on Hainmueller et al. 2014, we expect …"), invoke /verify-claims via the Agent tool to fact-check those citations. Pass the draft path and a list of explicit citations. The claim-verifier agent (fresh context, never sees the draft) returns PASS / PARTIAL / FAIL per citation. Surface any FAIL/PARTIAL in the output summary.

Skip post-flight if:

PHASE 6 — Output

Write to quality_reports/preregistrations/YYYY-MM-DD_<slug>.md (gitignored — preregistration is meant to be timestamped and uploaded externally, not committed alongside code).

Print to chat:

✓ Preregistration draft saved: quality_reports/preregistrations/<file>.md
  Style: <osf|aspredicted|aea-rct>
  Sections: <count> total — <complete> complete, <clarify> with [CLARIFY:] placeholders
  Citations verified: <PASS>/<PARTIAL>/<FAIL>  (or "no citations to verify")
  Next: review the [CLARIFY:] placeholders, fill in, then upload to <registry-url>

Include the registry URL: OSF → osf.io/registries, AsPredicted → aspredicted.org, AEA RCT → socialscienceregistry.org.

Cross-references

Examples

Example 1 — Poli-sci survey experiment from a spec

User says: "Preregister this study" (with --input quality_reports/specs/2026-04-15_priming-effects.md)

Actions:

  1. Read spec; **Paper type:** survey-experiment → default style osf.
  2. Extract 2 directional hypotheses, MTurk N=1,200, OLS with treatment dummies.
  3. Generate OSF document, all MUST sections filled, 1 MAY left blank.
  4. No prior-lit citations beyond the spec — skip post-flight.

Result: Saved to quality_reports/preregistrations/2026-04-15_priming-effects.md. User uploads to OSF.

Example 2 — Econ field experiment, AEA RCT Registry

User says: "Draft an AEA RCT preregistration for the cash-transfer pilot" (with --style aea-rct --input quality_reports/specs/2026-03-10_ct-pilot.md)

Actions:

  1. Read spec; randomization unit = village, primary outcome = consumption.
  2. Generate AEA RCT fields. IRB number missing in spec → [CLARIFY: IRB approval number].
  3. Cross-check: estimator (cluster-robust OLS), primary outcome stated, exclusion rule (intent-to-treat) stated. Pass.
  4. No prior-lit cites — skip post-flight.

Result: Document written. Output summary flags 1 [CLARIFY:] item to fill before AEA submission.

Example 3 — Free-form description, AsPredicted short form

User says: "Preregister my next priming experiment, AsPredicted style" (no --input)

Actions:

  1. Prompt for the 1–3 paragraph description.
  2. User supplies a paragraph; hypothesis lacks direction → ask once: "Direction?"
  3. User clarifies; populate the 9 AsPredicted fields.
  4. Sample-size stopping rule omitted → [CLARIFY: target N or stopping rule].

Result: Short form written; one MUST [CLARIFY:] flagged; user told to fill before pasting into AsPredicted.

Troubleshooting

"Description contains results" — by design. Move results into a methods + results write-up; preregistration is forward-looking.

Citation post-flight fails with FAIL — claim-verifier could not find a cited paper in WebSearch / corpus. Either the citation is real but the verifier missed it (common with very recent / paywalled work — cite explicitly with URL), or the citation is hallucinated. Inspect manually before upload.

Different registries asking for different things — use the registry's own template if this skill's mapping is too coarse. The three styles cover ~90% of social-science preregistrations; edge cases (PROSPERO, ClinicalTrials.gov, ISRCTN) need the registry's native form.

Output dir doesn't exist — quality_reports/preregistrations/.gitkeep should exist on a fresh fork; if missing, the skill will create the directory before writing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.