HistorianSim
CLAUDE.md19 starsChanged 15 days agoMITView on GitHub
This repo generates realistic chemical-plant historian datasets: a dynamic simulation of one process unit, its control loops and its instruments, with the data corrupted the way a real DCS and historian corrupt it. Each dataset is 90 days of data with these properties: - a clean 14-day baseline, then 9 different fault events, each diagnosable from the data and the process description; - 2 deliberate operator moves; - a fault answer key; - a conceptual PFD of the unit (PFD.svg,…
- Installs packages
In this repositoryOne other file it gives its agents.
- simulateSkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Create a virtual environment in the repo and install the package:
- Very specific: line 45
Run the historiansim command through the venv: .venv/Scripts/historiansim (Windows) or .venv/bin/historiansim.
- Distinctive: line 51
Never emit numeric data yourself: Write or change the simulator, then run it.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
HistorianSim
This repo generates realistic chemical-plant historian datasets: a dynamic simulation of one process unit, its control loops and its instruments, with the data corrupted the way a real DCS and historian corrupt it.
Each dataset is 90 days of data with these properties:
- a clean 14-day baseline, then 9 different fault events, each diagnosable from the data and the process description;
- 2 deliberate operator moves;
- a fault answer key;
- a conceptual PFD of the unit (
PFD.svg,PFD.png), drawn with the copy of the PFD generator skill in.claude/skills/simulate/pfd-generator/. It is stored inplants/<name>/pfd/, andgeneratecopies it into each dataset.
The people using this repo are mostly process and chemical engineers, not software developers. Talk to them in engineering terms, run every command yourself, and never ask them to edit code.
When the user asks for a dataset
Any request to simulate a process, build a dataset or recommend a process
goes through the /simulate skill (.claude/skills/simulate/). Follow it
step by step. If the user just wants a shipped process, run it:
historiansim list # processes, scenarios, recipes
historiansim generate cstr-rca --seed 7 --out output # R-201 reactor, 90 days, about 20 min
historiansim generate tank-rca --seed 42 # TK-101 tank, 90 days
historiansim generate cstr-rca --profile quick # 7-day version, about 2 minFirst-run setup (do this yourself if it is missing)
- Python 3.11 or newer is required: check with
python --version. If it is missing, ask the user to install it from python.org, ticking "Add python.exe to PATH" on Windows. - Create a virtual environment in the repo and install the package:
python -m venv .venv .venv/Scripts/python -m pip install -e ".[dev]" # Windows .venv/bin/python -m pip install -e ".[dev]" # macOS / Linux - Run the
historiansimcommand through the venv:.venv/Scripts/historiansim(Windows) or.venv/bin/historiansim. - Smoke test:
historiansim check-plant exothermic_cstr --stage 1.
Hard rules
- Never emit numeric data yourself. Write or change the simulator, then run it.
- Process faults are parameter modifiers inside the integration loop
(
ProcessFault,DisturbanceFault,ControlFault). Only instrument faults (InstrumentFault) act on a reading. Never add a fault to a finished signal. - The controller sees the transmitter, not the truth. Transmitter faults on a controlled tag are applied inside the loop automatically.
- Coloured noise only, and never global
np.random: every random draw comes from a namedSeedBankstream. PROCESS_DESCRIPTION.md,tags.csvand the PFD describe the plant, never its faults. OnlyFAULT_ANSWER_KEY.mdandmetadata/may name a cause.historiansim auditchecks this.- Text the user reads is for process engineers. Plain sentences, no em dashes, no rhetorical "it's not X, it's Y" phrasing.
- Don't change shared engine code to make one plant work unless the change
is generic. Plants live entirely in
src/historiansim/plants/<name>/.
Layout
src/historiansim/
plants/<name>/ one folder per process: model, tags, loops, faults, description
plants/_template/ scaffold copied by `historiansim new-plant`
core/ integration loop, PID, valves, deadtime, RNG
measurement/ instrument classes, noise, drift, freezes, dropouts
historian/ swinging-door compression, exports
faults/ fault primitives, catalog types, episode scheduler
truth/ ground truth and labels
validation/ checks, catalog sweep, plant gates
layout.py file names of a written dataset
scenarios.py profiles and recipes (rca-benchmark)The reference plants are heated_stirred_tank (TK-101, the HistorianRCA
unit) and exothermic_cstr (R-201). When writing a new plant, read both.
Tests
python -m pytest tests -q -m "not slow" # about 8 minutes
python -m pytest tests -q # adds the per-cause sweep for every plantDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

