Skip to content
Back to skills

Aea Replication Run

ASecurity

Use when actually RUNNING an author's replication package during an AEA Data Editor review — running the deposit's own master file or building one where none exists, locating and wiring up restricted-access data, executing the code under containerized Stata (or R, MATLAB, Python), iterating on failures, verifying the reported numbers against the manuscript, and writing the results into REPLICATION.md's Findings/Replication steps/Classification sections. Triggers on "run the replication packag...

  • 24 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
devopspythongoshellbashgitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add AEADataEditor/replication-template --skill aea-replication-run --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Aea Replication Run?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Aea Replication Run
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aeadataeditor-aea-replication-run/badge)](https://www.skillsdirectory.com/skills/aeadataeditor-aea-replication-run)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: aea-replication-run
description: Use when actually RUNNING an author's replication package during an AEA Data Editor review — running the deposit's own master file or building one where none exists, locating and wiring up restricted-access data, executing the code under containerized Stata (or R, MATLAB, Python), iterating on failures, verifying the reported numbers against the manuscript, and writing the results into REPLICATION.md's Findings/Replication steps/Classification sections. Triggers on "run the replication package", "run the author's code", "does this deposit run", "the code failed at X", "verify the numbers", "check the tables against the paper", "build a master.do", "where is the restricted data", "resume the replication", or being handed an aearep-NNNN repo whose REPLICATION.md is not yet filled in. This is the stage BEFORE the report is finalized — hand off to aea-report-finalize once Findings and Classification reflect what actually happened.
---

# Running an AEA Replication Package

You are the replicator. Find out whether the deposited code runs, whether it
produces the numbers in the paper, and write down what you found precisely
enough that the editor can act on it.

The pipeline has already downloaded the deposit and filled the report's scan
appendices. You run the code and fill the narrative sections. Then
`aea-report-finalize` consolidates tags and drafts the SUMMARY; don't do its
job (no SUMMARY, no `aeaready`, no approval commit).

The human version of this procedure is the LDI manual:
[11-05 Preparing to run code](https://labordynamicsinstitute.github.io/ldilab-manual/11-05-preparing-to-run-code.html),
[11-06 Running code](https://labordynamicsinstitute.github.io/ldilab-manual/11-06-running-code.html),
[11-07 Writing the report](https://labordynamicsinstitute.github.io/ldilab-manual/11-07-workflow-writing-report.html)
(Markdown sources: `https://github.com/labordynamicsinstitute/ldilab-manual/blob/main/<page>.md`).
Consult it for anything this skill doesn't cover rather than improvising.

## Models

This is long, judgment-heavy work (diagnosing failures, deciding what you may
fix, calibrating the classification). Run it as the coordinator on **Opus**.
If the session is on a smaller model, say so at the start and suggest
`/model opus`; continue if the user prefers.

Hand narrow, read-only chores to **Sonnet** sub-agents so their file dumps
stay out of your context: inventorying the code (paths, globals, `use`/`save`
targets, output directories), grepping long logs for errors and the sentinel,
and the cell-by-cell comparison of one table against the manuscript. Give each
one the exact files and what to return (a short list or table, not the files).
Decisions about fixes, exclusions and classification stay with you.

## Writing style

Write Findings and Replication steps in natural, everyday English. Avoid stiff
or overly formal phrasing. Short, plain sentences in the past tense: "The
program stopped at line 42 because `reghdfe` was not installed. We added it to
`config.do`." The editor and the authors both read this text. Tags you copy
from `sample-language-report.md` stay verbatim; this rule is for your own
words.

## Orient before touching anything

Derive everything from the repo. The **package folder** is where the deposit
landed: a bare number for openICPSR, a prefixed name otherwise (`wb-…`,
`dv-…`, `zenodo-…`, `osf-…`). Resolve it as the pipeline does:

```bash
. ./tools/resolve_project_id.sh     # sets $projectID from config.yml
```

Read `REPLICATION.md` first: a prior round may have findings already, and on a
revision round the ticket in `config.yml` (`jiraticket:`) may be newer than
the directory name. If `REPLICATION-PartA.md`/`REPLICATION-PartB.md` exist,
the narrative sections live in Part B (`automations/50_merge-parts.sh`
regenerates `REPLICATION.md`, so edits there would be lost).

Then read the package README and answer two questions before writing anything:
**is there a master file**, and **is any of the data restricted**.

## Discover the package's conventions

Every run starts in the package folder (`cd "$projectID"`): the container
wrappers mount only the current directory, so launching from `code/` hides
sibling data. From there, read the code (a Sonnet inventory is a good fit) for
where programs expect the working directory to be, how paths are built (root
globals, undefined globals, hard-coded absolute or Windows paths), where output
goes, and whether programs depend on each other's in-memory state or files.

```bash
grep -rnEi '^\s*(cd|use|save|import|export|include|global)\b' "$projectID" --include='*.do' | head -50
```

Adapt the run to what you find (`cd` inside Stata, set the authors' root global
to `${rootdir}`, create assumed output directories) rather than reshaping the
package. Every hard-coded path you replace is a finding.

## Master file and config

Running the authors' own entry point is always preferable: a driver you invent
can hide ordering assumptions. A build tool, shell script, or Python/R master
counts as a master.

```bash
ls "$projectID"/{main,master,run,runall,_master}*.* 2>/dev/null
grep -rlEi '^\s*(do|include)\s' "$projectID" --include='*.do' | head
```

- **One exists** → use it; fix what breaks, don't replace it. If it covers only
  part of the package, that is a finding.
- **None exists** → that is a finding; build one. Also needed whenever the
  config can't be included the usual way. Read
  [references/master-and-config.md](references/master-and-config.md).

Either way, use the template config for the language (`template-config.do`,
`template-config.m`, `template-main.R`; a dedicated venv for Python) so the run
records logs, system info, a package-local library path and declared
dependencies. Don't wrap calls in `cap` (stop at the first failure), and echo a
sentinel (`===== END MASTER =====`) at the end so you can tell a finished run
from a killed one. Language-specific detail lives in the LDI manual, not here:
[Stata 96-01–96-05](https://labordynamicsinstitute.github.io/ldilab-manual/96-01-using-config-stata.html),
[R 96-10–96-16](https://labordynamicsinstitute.github.io/ldilab-manual/96-10-using-R.html),
[MATLAB 96-20–96-24](https://labordynamicsinstitute.github.io/ldilab-manual/96-20-using-matlab.html),
[Python 96-30](https://labordynamicsinstitute.github.io/ldilab-manual/96-30-running-python-jupyter.html).

## Restricted data (only if there is any)

No restricted data → skip this section. But a missing `restricted/` directory
does not mean there is none; Jira is the authority:

```bash
python3 tools/jira_get_info.py <TICKET> dcaf_private   # "yes" if privately available
```

If it says yes, or the README describes data that isn't in the deposit, read
[references/restricted-data.md](references/restricted-data.md) before going
further. Restricted data must never reach git.

## Run

Stata runs through the containerized `stata*` wrappers from editor-scripts
([docs](https://aeadataeditor.github.io/editor-scripts/)). Before the first
containerized run, read
[references/stata-container.md](references/stata-container.md): permissions,
TTY, stdin and misleading exit codes each cost hours to diagnose otherwise.
The short version: `chmod -R go+w "$projectID"`, launch with
`script -qec "stata19 -b do master.do" /dev/null </dev/null`, and judge the
run from the log, never the exit code.

If the README offers a full rebuild of intermediate files, follow it, then
compare regenerated files to the supplied ones (`cf` in Stata, `cmp`/`diff`
otherwise) and report differences.

## Iterate on failures

Run, fix or exclude, commit, run again. The judgment is which fixes are yours:

- **Fix directly** when small and obviously right (a variable name that
  doesn't match the data, a missing package declaration). Note it as a fix.
  Remember dependencies of dependencies: `ssc install` doesn't resolve them.
- **Ask first** for anything larger: rewriting a specification, working around
  a resource limit, restructuring the authors' logic, or excluding a program.
- **When a full pass is expensive** (hours per run, many failures left),
  propose a plan before improvising a different way of running the package.

Commit each iteration as one bundle (code fix, REPLICATION.md note, run output:
`logs/`, `ado/`, `master.log`, `output/`). Stage explicit paths, never
`git add -A` (it sweeps in data), and never a log a run is still writing. If
GPG signing needs a passphrase, stage and ask the user to commit; never bypass
signing. Re-read `REPLICATION.md` right before each edit: the editor may be
editing it at the same time.

## Verify the numbers

Code that runs is not code that reproduces. Until output is compared with the
manuscript you only know that nothing errored, so don't let a clean run drift
into a claim of reproduction. Work table by table from
`pdftotext -layout <proof>.pdf proof.txt` (or `manuscript_parsed/`); one
Sonnet sub-agent per large table is a good split. Read
[references/verifying-numbers.md](references/verifying-numbers.md) for Stata
log traps, what makes numbers unverifiable, TRO hashes, gitignored outputs and
figure differences. LDI 60 has the human tips:
[identifying differences](https://labordynamicsinstitute.github.io/ldilab-manual/60-tips-for-identifying-differences.html).

Record what you verified **and what you couldn't**.

## Write it into REPLICATION.md

Fill the narrative sections in the style above. Leave everything from
`# Automatically Generated Appendices` down alone (it is regenerated at
sign-off).

- **`## Replication steps`**: what you actually did, past tense. Say if you
  built a driver and which config mechanism you used. Split your edits into
  two lists: those that **had to** be made for the code to run, and those made
  for **convenience** (logging, config capture); the editor decides what to
  ask the authors for. Give runtime and peak memory when notable, and state
  plainly whether numbers were compared.
- **`## Findings`**: one line per program-specific issue:
  `` - `path/to/file.do`: <what was wrong>. <what you did about it>. ``
- **`### Missing Requirements`**: for undeclared dependencies, the verbatim
  setup-program tag from `sample-language-report.md`, with the specifics in an
  untagged line beneath. Don't paraphrase the tag; the finalize skill lifts it
  verbatim.
- **`## Classification`**: exactly one box, reflecting the current state
  (stale classifications are common on revision rounds):
  - everything ran *and* the numbers were checked and match → full reproduction;
  - ran clean but a substantial share of numbers can't be checked, or some data
    is unavailable → partial reproduction;
  - "not able to reproduce" only when the code genuinely doesn't run.
  Update `### Reason for incomplete reproducibility` to match; if you fixed
  author bugs to get through, `Bugs in code` is checked.

## Hand off

When Findings, Replication steps and Classification reflect what happened,
stop and hand to `aea-report-finalize`. Leave the SUMMARY alone.

Files in this skill

  • SKILL.md10.8 KB
  • references/master-and-config.md2.6 KB
  • references/restricted-data.md2.6 KB
  • references/stata-container.md2.6 KB
  • references/verifying-numbers.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.