rseng-legacy-codelisted
Install: claude install-skill fdiblen/rseng-agent-skills
# Working with legacy research code
Research software outlives its authors' contracts. The typical legacy
situation is a working but untested codebase whose author has left,
whose behavior IS the specification, and whose results current papers
still depend on. The prime directive: preserve today's behavior first,
improve structure second, change behavior only deliberately and
visibly. In research code a silent behavior change is worse than a
crash - it can corrupt published results downstream.
## First contact with an inherited codebase
Before changing anything:
1. Get it running. Capture the exact environment that works (versions,
OS, data paths) in a lockfile or container while it still runs
anywhere (rseng-reproducible-environments) - the running environment
is itself endangered knowledge.
2. Snapshot everything: commit the code as-is to version control,
including generated files and local tweaks, before any cleanup
(rseng-version-control-review). Tag it as the reference state.
3. Recover intent from what exists: papers that used the code, commit
messages, variable names, comments in any language, old emails or
READMEs. Write down what you learn as documentation NOW
(rseng-documentation) - you are the next person who will forget.
4. Map the danger zones: which outputs feed publications, which parts
are dead code, which parts everyone fears. Effort goes where
published results depend on correctness.
## Characterization tests: the safety ne