Intellectual Frontiers

A Companion Repository Can Fit in Seven Folders and Files

An example layout

This layout implements "A companion repository holds six parts" in the program "Companion Executable Code Repositories". It is one way to do it, not the only one. Any layout works if a stranger can find the six parts without asking.

my-study-companion/
  README.md              what the study is, and the one entry point: how to go from data to results
  CITATION.cff           how to cite this release, with the paper's DOI and the data's DOI
  codemeta.json          what the software is, its licence and what it needs to run
  ro-crate-metadata.json which file makes which table and figure (the declared outputs)
  LICENSE                the licence the code is shared under
  environment/           the exact software versions: a lockfile, a container definition, or both
  data/                  the data, if its rules allow it here; otherwise a synthetic copy and a link to the governed record
  code/                  the scripts, notebooks or spreadsheets, numbered in the order they run
  outputs/               empty until the entry point runs; then it holds every table and figure

The README’s first section says which command to run, or which steps to follow, and how long it takes. The README’s second section lists each table and figure in the paper and the file in outputs/ that holds it.

A spreadsheet analysis uses the same layout: the workbook goes in code/ with its formulas intact, and the README says the order of the sheets.