skills/54-scdenney-open-science-skills/skills/replication-package/SKILL.md
Scaffold or audit a social-science replication package at a target directory. Generates folder structure, README, master.R, figure/table crosswalk, codebook template, LICENSE placeholder, and pre-release checklist. Adapted from Yusaku Horiuchi's replication-package-guide with FAIR-principle integration; platform-neutral (Harvard Dataverse, OSF, Zenodo, GitHub releases, institutional archives).
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research replication-packageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The structural conventions in this skill (single-entry-point principle, compact vs. build/analyze layouts, figure/table crosswalk, paper-consistency check, correction workflow, pre-release checklist) come from Yusaku Horiuchi's replication-package-guide. Horiuchi's repository README explicitly authorizes AI consumption: it is "designed to be read by humans and by coding agents such as Codex or Claude Code before they prepare, audit, or repair a replication package."
This skill is a modification, not a copy.
Horiuchi's own caveat applies: "AI is useful for checking, reorganizing, documenting, and catching inconsistencies, but it should not be treated as a substitute for the author's judgment about which files, scripts, data sources, and results are actually part of the replication record." Use this skill as an assistant, not as a substitute for the author's judgment about what belongs in the public package.
If you publish a package built with this skill, cite Horiuchi's guide as the methodological source.
A replication package is ready when a competent reader can download it, open the package root, run one documented command, and regenerate the published results without hidden manual steps.
Minimum standard:
master.R by convention; run_replication.R acceptable when that is the project convention).README.md.Use $ARGUMENTS if provided. Treat the argument as the path to the replication folder (relative or absolute). If the argument is empty, ask the user once for a path. If they decline, default to ./replication relative to the current working directory.
Normalize the path. Confirm whether the directory exists and whether it is empty.
Ask the user one question. Is data construction complex (restricted sources, scraping, API pulls, or expensive upstream work that produces analysis-ready data)?
When in doubt, choose compact. Build/analyze is justified only when the build stage creates real complexity for users.
Compact structure (default):
<root>/
|-- README.md
|-- master.R
|-- LICENSE
|-- .gitignore
|-- data/
|-- code/
|-- docs/
| `-- crosswalk.md
`-- outputs/
|-- figures/
|-- tables/
`-- logs/
Build/analyze structure:
<root>/
|-- README.md
|-- master.R
|-- LICENSE
|-- .gitignore
|-- build/
| |-- data/
| |-- scripts/
| `-- output/
`-- analyze/
|-- data/
|-- scripts/
|-- figures/
|-- tables/
|-- docs/
| `-- crosswalk.md
`-- logs/
Create the directories first, then write the template files in Step 5. Leave data/, code/, scripts/, figures/, tables/, and logs/ empty (the user fills them with project content).
Use the templates in the Templates section below. Fill in placeholder fields (<paper title>, <authors>, etc.) with values the user provides; if a placeholder cannot be resolved from context, leave it as written and flag it in the final report so the user knows what to edit.
After scaffolding, output a short report with:
data/, add scripts under code/ or build/scripts/ and analyze/scripts/).README.md# <paper title>
**Authors.** <author 1>, <author 2>, ...
**Journal.** <journal name>, <year>. DOI: <article DOI>
**Data DOI.** <data archive DOI>
**Verified.** <YYYY-MM-DD>
## What this package reproduces
<one paragraph: which figures, tables, and in-text numbers this package generates from which data.>
## How to run
From a fresh R session in the package root:
```r
source("master.R")
master.R runs the full public path end-to-end and writes session information and per-script logs to outputs/logs/ (compact) or analyze/logs/ (build/analyze).
A session_info.log is written by master.R on a successful run and records the exact package versions used.
<paste the actual tree from tree -L 2 or list manually>
If any input is restricted, document how a reader with access can obtain it and which files in this package depend on it.
master.R — public entry point.code/01_*.R — <what it does>.code/02_*.R — <what it does>.data/<file>.csv — <one-line description; see docs/codebook.md for variables>.docs/crosswalk.md — paper-order map from figures/tables to scripts and outputs.outputs/figures/, outputs/tables/, outputs/logs/ — generated by master.R.See docs/crosswalk.md. Every figure and table in the paper and its appendix appears there with the script that generates it and the output path.
See LICENSE. <one sentence: data license, code license, any restrictions>.
This package follows the structural conventions in Yusaku Horiuchi's replication-package-guide and the FAIR principles (Wilkinson et al. 2016, doi:10.1038/sdata.2016.18).
### `master.R`
```r
# master.R — public entry point for <paper title> replication package.
# Running this script regenerates every figure, table, and reported number
# from the public input data.
# Reproducibility
set.seed(20260101) # change to the seed used in the paper
options(stringsAsFactors = FALSE)
# Capture the start time and prepare the log directory
.start_time <- Sys.time()
log_dir <- "outputs/logs" # change to "analyze/logs" if build/analyze
if (!dir.exists(log_dir)) dir.create(log_dir, recursive = TRUE)
# Run scripts in order. Add or remove as the project grows.
source("code/01_load.R") # load and validate inputs
source("code/02_clean.R") # clean and recode
source("code/03_analysis.R") # estimate models
source("code/04_figures.R") # produce figures
source("code/05_tables.R") # produce tables
# Session info
writeLines(
capture.output(sessionInfo()),
file.path(log_dir, "session_info.log")
)
# Runtime
.end_time <- Sys.time()
cat(
sprintf("Replication complete. Elapsed: %s.\n",
format(round(.end_time - .start_time, 2)))
)
docs/crosswalk.md# Figure and Table Crosswalk
In paper order. Every figure and table in the article and supplementary information must appear in this table. Mark conceptual or hand-made items explicitly.
| # | Type | Label / Caption (short) | Script | Output path |
|---|------|-------------------------|--------|-------------|
| 1 | Figure | <short caption> | `code/04_figures.R` | `outputs/figures/fig01.pdf` |
| 2 | Table | <short caption> | `code/05_tables.R` | `outputs/tables/tab01.tex` |
| 3 | Figure (conceptual) | <short caption> | — | `docs/concept_fig.pdf` (hand-drawn; not generated) |
docs/codebook.md# Codebook
One entry per public analysis-ready dataset. List every variable.
## `data/<dataset>.csv`
Source: <where this dataset comes from; raw input, derived, or restricted>.
N rows: <count>.
N cols: <count>.
| Variable | Type | Values / range | Description |
|----------|------|----------------|-------------|
| `id` | integer | 1–N | Respondent identifier. Anonymized. |
| `treatment` | factor | control / T1 / T2 | Experimental assignment. |
| `outcome` | numeric | 0–100 | Primary outcome (see paper §2.1). |
LICENSE# LICENSE — fill this in before publishing.
#
# Common choices for replication materials:
# - Code: MIT, BSD-3-Clause, or Apache-2.0.
# - Data: CC0 (waiver) for fully public data, or CC BY 4.0 for attribution-required.
# - Whole package: CC BY 4.0 is a common single-license choice when code and data ship together.
#
# Restricted-data files cannot be licensed here. Document them in the README.
#
# Replace this file with the chosen license text. Update the README's License section to match.
.gitignore# OS
.DS_Store
Thumbs.db
# Editors
.vscode/
.idea/
*~
# R
.Rhistory
.RData
.Ruserdata
.Rproj.user/
*.Rcheck/
*.tar.gz
# Python
__pycache__/
*.pyc
.venv/
venv/
# Secrets and local config
.env
.env.*
*.pem
*.key
# Logs from local runs that should not be committed
*.tmp
# Large generated artifacts; comment out if outputs should be tracked
# outputs/figures/*.pdf
# outputs/tables/*.tex
Run this after scaffolding is done and the user has filled in placeholders, dropped in data, and written scripts.
master.R) runs the full public path with one command.README.md is current and matches the files on disk.docs/codebook.md match the public datasets.docs/crosswalk.md is complete and in paper order.session_info.log are produced by master.R on a successful run.LICENSE is filled in.The repository copy is the truth. A local run is necessary but not sufficient.
When the manuscript source or final PDF is available, verify:
docs/crosswalk.md.If paper source files cannot be included publicly, document whether they were used during package preparation.
replication-package (this) — scaffold or audit a replication package at a target directory before upload to any repository.fair-check — audit a finished manuscript and its accompanying package against the FAIR principles end-to-end. Use after this skill, before submission.methods-reporting — check that the manuscript's methods section reports what the package documents (CONSORT, JARS, DA-RT).README.md template includes every required section: paper title, authors, journal and DOI, data DOI, verification date, what the package reproduces, run instructions, software requirements, folder structure, data sources, file descriptions, crosswalk reference, citation, license, attribution.master.R skeleton writes session_info.log and a runtime line on success.docs/crosswalk.md template is in paper order with separate columns for number, type, short caption, generating script, and output path.docs/codebook.md template includes one entry per analysis-ready dataset..gitignore excludes .env, *.pem, *.key, editor caches, R session artifacts, Python caches, and OS metadata files.README.md and is visible in this skill's heritage section.tools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.