$npx -y skills add scdenney/open-science-skills --skill replication-packageScaffold or audit a social-science replication package at a target directory. Generates folder structure, README, master.R, figure/table crosswalk, codebook template, LICENSE placeholder, .gitignore, and pre-release checklist. Adapted from Yusaku Horiuchi's replication-package-gu
| 1 | # Replication Package Scaffold |
| 2 | |
| 3 | ## Heritage and attribution |
| 4 | |
| 5 | 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](https://github.com/yhoriuchi/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." |
| 6 | |
| 7 | This skill is a **modification**, not a copy. |
| 8 | |
| 9 | - Repackaged as procedural guidance for Codex (frontmatter, step-by-step instructions, quality checks). |
| 10 | - Folded in the FAIR principles (Findable, Accessible, Interoperable, Reusable; [Wilkinson et al. 2016](https://doi.org/10.1038/sdata.2016.18); [GO FAIR](https://www.go-fair.org/fair-principles/)) so the scaffolded package is platform-neutral. |
| 11 | - Dropped platform-specific upload mechanics. This skill builds and audits the local package. Uploading to Harvard Dataverse, OSF, Zenodo, a journal repository, or an institutional archive is left to the user and the platform's tools. |
| 12 | - Reorganized templates and checklists into a single self-contained skill. |
| 13 | |
| 14 | 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. |
| 15 | |
| 16 | If you publish a package built with this skill, cite Horiuchi's guide as the methodological source. |
| 17 | |
| 18 | ## Standard |
| 19 | |
| 20 | 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. |
| 21 | |
| 22 | Minimum standard: |
| 23 | |
| 24 | - One public entry point (`master.R` by convention; `run_replication.R` acceptable when that is the project convention). |
| 25 | - One authoritative `README.md`. |
| 26 | - Relative paths only. |
| 27 | - Public data inputs, or clear restricted-data instructions. |
| 28 | - Codebook or data dictionary for every analysis-ready dataset. |
| 29 | - Figure/table crosswalk in paper order. |
| 30 | - Logs that record inputs, sample sizes, warnings, and session information. |
| 31 | - Public scripts that are numbered or otherwise ordered. |
| 32 | - No personal files, caches, credentials, or obsolete exploratory scripts in the public path. |
| 33 | |
| 34 | ## Instructions |
| 35 | |
| 36 | ### Step 1. Resolve the target directory |
| 37 | |
| 38 | Treat the path supplied with the invocation as the replication folder, whether relative or absolute. If no path is supplied, ask once; if the user declines, default to `./replication` relative to the current working directory. |
| 39 | |
| 40 | Normalize the path. Confirm whether the directory exists and whether it is empty. |
| 41 | |
| 42 | ### Step 2. Decide on structure |
| 43 | |
| 44 | Ask the user one question. Is data construction complex (restricted sources, scraping, API pulls, or expensive upstream work that produces analysis-ready data)? |
| 45 | |
| 46 | - **No** → use **compact**. |
| 47 | - **Yes** → use **build/analyze**. |
| 48 | |
| 49 | When in doubt, choose compact. Build/analyze is justified only when the build stage creates real complexity for users. |
| 50 | |
| 51 | ### Step 3. Decide between scaffold and audit |
| 52 | |
| 53 | - If the target directory is empty or does not exist → **scaffold mode**. Create the directory if needed, write the full skeleton. |
| 54 | - If the target directory contains files → **audit mode**. Read everything, compare against the pre-release checklist, report what is present, partial, or missing. Offer to fill in only the missing scaffolding (files that do not yet exist). Never overwrite an existing file without explicit user confirmation. |
| 55 | |
| 56 | ### Step 4. Scaffold the tree |
| 57 | |
| 58 | **Compact structure** (default): |
| 59 | |
| 60 | ```text |
| 61 | <root>/ |
| 62 | |-- README.md |
| 63 | |-- master.R |
| 64 | |-- LICENSE |
| 65 | |-- .gitignore |
| 66 | |-- data/ |
| 67 | |-- code/ |
| 68 | |-- docs/ |
| 69 | | |-- crosswalk.md |
| 70 | | `-- codebook.md |
| 71 | `-- outputs/ |
| 72 | |-- figures/ |
| 73 | |-- tables/ |
| 74 | `-- logs/ |
| 75 | ``` |
| 76 | |
| 77 | **Build/analyze structure**: |
| 78 | |
| 79 | ```text |
| 80 | <root>/ |
| 81 | |-- README.md |
| 82 | |-- master.R |
| 83 | |-- LICENSE |
| 84 | |-- .gitignore |
| 85 | |-- build/ |
| 86 | | |-- data/ |
| 87 | | |-- scripts/ |
| 88 | | `-- output/ |
| 89 | `-- analyze/ |
| 90 | |-- data/ |
| 91 | |-- scripts/ |
| 92 | |-- figures/ |
| 93 | |-- tables/ |
| 94 | |-- docs/ |
| 95 | | |-- crosswalk.md |
| 96 | | `-- codebook.md |
| 97 | `-- logs/ |
| 98 | ``` |
| 99 | |
| 100 | Create the directories first, then write the template files in Step 5. Leave `data/`, `code/`, `scripts/`, `figure |