# Refactoring 03 Config Reproducibility

> Use when improving run configuration, seeding, and reproducibility for Python research code.

- Skill: `majiayu000/refactoring-03-config-reproducibility` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/refactoring-03-config-reproducibility`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/refactoring-03-config-reproducibility/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Research & Search
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/refactoring-03-config-reproducibility

---


# Refactoring 03: Config and Reproducibility

## Goal

Make experiments reproducible by centralizing configuration, controlling randomness, and recording run metadata.

## Sequence

- Order: 03
- Previous: refactoring-02-dependencies-env
- Next: refactoring-04-data-io-validation

## Workflow

- Centralize runtime parameters into a config object or file (YAML/TOML/argparse).
  - Success: All run parameters are set through a single config surface.
- Seed all RNGs (Python, NumPy, framework) and make the seed a first class parameter.
  - Success: Runs are repeatable with the same seed.
- Record metadata: config snapshot, git commit hash, and environment info with outputs.
  - Success: Each run output includes config and environment metadata.
- Create a consistent output directory layout for artifacts and metrics.
  - Success: Outputs follow a documented directory structure.
- Remove hidden global state and implicit defaults where possible.
  - Success: Behavior is driven by explicit parameters.

## Guardrails

- Keep config changes backward compatible when possible.
- Do not add heavy config frameworks unless required.
- Favor explicit parameters over environment variables.

