neqsim
AGENTS.md167 starsChanged 7 months agoApache-2.0View on GitHub
Read automatically by VS Code Copilot, OpenAI Codex, Claude Code and other agents. This file is kept short on purpose because it is resent on every model call. It is already in your context — do not read_file it. Detail lives in: - docs/development/AGENT_REFERENCE.md — full workflow, results.json schema, Automation API, code patterns, key paths, JavaDoc and documentation rules. Search it for the heading you need; never read it whole. - Skills in .github/skills/ (find them with uv run --project…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository140 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyze-convergenceSkill
- analyze-gibbs-convergenceSkill
- book-creationSkill
- design-flash-benchmarkSkill
- design-reactor-benchmarkSkill
- figure-discussionSkill
- generate-publication-figuresSkill
- journal-formattingSkill
- neqsim-acid-gas-treatingSkill
- neqsim-advanced-control-mpc-and-virtual-sensingSkill
- neqsim-agent-handoffSkill
- neqsim-agentic-process-optimizationSkill
- neqsim-api-patternsSkill
- neqsim-autonomous-investigationSkill
- neqsim-capability-mapSkill
- neqsim-capacity-and-utilization-analysisSkill
- neqsim-capacity-increase-screeningSkill
- neqsim-ccs-hydrogenSkill
- neqsim-code-healthSkill
- neqsim-code-hygieneSkill
- neqsim-code-reviewSkill
- neqsim-column-internals-and-rate-basedSkill
- neqsim-compressor-antisurge-recycleSkill
- neqsim-consequence-analysisSkill
- neqsim-continuous-task-improvementSkill
- neqsim-controllability-operabilitySkill
- neqsim-cooling-waterSkill
- neqsim-cpa-water-boundariesSkill
- neqsim-depressurization-mdmtSkill
- neqsim-distillation-designSkill
- neqsim-document-intelligence-extractionSkill
- neqsim-dynamic-equipment-implementationSkill
- neqsim-dynamic-simulationSkill
- neqsim-electrolyte-systemsSkill
- neqsim-emulsion-separationSkill
- neqsim-energy-systems-and-electrificationSkill
- neqsim-engineering-design-packageSkill
- neqsim-eos-regressionSkill
- neqsim-equipment-cost-estimationSkill
- neqsim-exploration-strategy-selectionSkill
- neqsim-field-developmentSkill
- neqsim-field-economicsSkill
- neqsim-firewater-deluge-designSkill
- neqsim-flow-accelerated-corrosionSkill
- neqsim-flow-assuranceSkill
- neqsim-flow-assurance-study-reportSkill
- neqsim-forward-separator-trainSkill
- neqsim-future-operation-studySkill
- neqsim-hazid-fmea-eta-ftaSkill
- neqsim-heat-integrationSkill
- neqsim-hydrogen-productionSkill
- neqsim-input-validationSkill
- neqsim-integrated-production-and-lifecycleSkill
- neqsim-in-writingSkill
- neqsim-java8-rulesSkill
- neqsim-jurisdiction-regulatory-basisSkill
- neqsim-literature-searchSkill
- neqsim-lng-liquefactionSkill
- The first 60 shown.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 6 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 14
Java 8 everywhere, tests included: Never var, List.of/Set.of/Map.of, String.repeat (use StringUtils.repeat), isBlank/strip/lines (use …
- Very specific: line 19
Spotless: after creating or editing ANY .java file run .\mvnw.cmd spotless:apply (Linux/Mac ./mvnw), then git add.
- Distinctive: line 34
Read the discovery guide before declaring functionality absent.
- Very specific: line 36
Code health is a default Java coding gate: before publishing Java source/test or Maven changes, run the current source, PMD and SpotBugs …
- Distinctive: line 46
Never hand-merge its JSON or combine branch copies.
- Distinctive: line 54
Follow .github/WORKFLOWS.md.
- Very specific: line 56
Documentation code must be test-verified: every Java/Python snippet in docs gets a JUnit test (e.g.
- Distinctive: line 67
Never install/elevate, switch contexts or container modes, or stop Docker automatically.
- Very specific: line 76
Use @code-health for measured debt triage, @refactor for bounded source changes, and @code-review for independent code review.
- Very specific: line 86
Python: use the selected interpreter, else C:\appl\neqsim-venv\Scripts\python.exe.
- Very specific: line 103
EJML-only numerical code: Use primitive arrays at public numerical boundaries and EJML or LinearAlgebraOperations for calculations.
- Very specific: line 109
Always setMixingRule(...) (numeric for CPA).
- Very specific: line 111
After any flash call fluid.initProperties() before reading density/viscosity/conductivity.
- Very specific: line 129
Use the solve-task agent; its workflow is the neqsim-task-workflow skill (load per phase).
- Very specific: line 139
Search the optional document root (neqsim documents PATTERN, read-only) and run neqsim fetch-docs <task> before calling a standard, …
- Distinctive: line 154
Never commit task output or company data to a code repo.
- Distinctive: line 155
Close the loop upstream: Prefer the connected GitHub capability when available or required.
- Very specific: line 170
Search before reading: grep/grep_search then read the matching range.
- Very specific: line 175
Keep tool output small (counts, Select-Object -First, no full JSON/notebook dumps).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.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
NeqSim — Agent Instructions
Read automatically by VS Code Copilot, OpenAI Codex, Claude Code and other agents. This file is kept short on purpose because it is resent on every model call. It is already in your context — do not
read_fileit. Detail lives in:
- docs/development/AGENT_REFERENCE.md — full workflow,
results.jsonschema, Automation API, code patterns, key paths, JavaDoc and documentation rules. Search it for the heading you need; never read it whole.- Skills in
.github/skills/(find them withuv run --project devtools --locked devtools/skill_search.py "<topic>").- CONTEXT.md — 60-second repo map.
docs/development/CODE_PATTERNS.md— starters.
Hard constraints (CI fails otherwise)
- Java 8 everywhere, tests included. Never
var,List.of/Set.of/Map.of,String.repeat(useStringUtils.repeat),isBlank/strip/lines(usetrim()), text blocks, records, pattern-matchinginstanceof,Optional.isEmpty(). - Logging: Log4j2 only (
private static final Logger logger = LogManager.getLogger(X.class);, parameterizedlogger.info("{}", v)). NeverSystem.out/err.println, also not in tests or examples. - Spotless: after creating or editing ANY
.javafile run.\mvnw.cmd spotless:apply(Linux/Mac./mvnw), thengit add. CI runsspotless:check. Never--no-verify. - JavaDoc on every class and method, private included: description,
@paramfor each parameter,@return,@throwsfor every declared exception, class@author/@version. HTML5:<table>needs<caption>, nosummary=;@seeonly with Java references; no</p>after</ul>/</ol>; no->or raw>in JavaDoc (>). Check withmvnw javadoc:javadoc. Spotless/Checkstyle/JavaDoc failures:neqsim-code-hygieneskill. - Serializable classes: non-serializable fields (
Function,Consumer,Thread, JDBC, interpolators) must beprivate transient(SpotBugs SE_BAD_FIELD). - Verify APIs before use: find the class, read constructor/method signatures, never assume convenience overloads, enum locations or getter arguments.
- Discover across all functionality: in a source checkout use
uv run --project devtools --locked devtools/capability_search.py "<task or API>" --json. It returns current source types, workflow agents/skills, guides and test references; load only the relevant skill sections. In plugin/MCP-only sessions use runtime discovery. Read the discovery guide before declaring functionality absent. Routing coverage and test references do not establish qualification. - Code health is a default Java coding gate: before publishing Java source/test or Maven changes,
run the current source, PMD and SpotBugs checks in
docs/development/CODE_HEALTH.mdwith the workflow-pinned analysis JDK and reviewed base-branch baseline. Generate fresh reports; missing input, runtime mismatch or new findings are not a pass. Keeppom.xmlandpomJava8.xmlcoordinated and test dependency changes on actual Java 8. Never refresh the baseline merely to make a PR green. Record commands and exact-head results. - Agent/MCP coverage:
src/main/resources/neqsim/mcp/engineering-coverage.jsonis a generated snapshot, not a source of truth. After Java formatting or agent/skill mapping changes, regenerate it withuv run --project devtools --locked devtools/build_engineering_coverage.pyand stage the output. For merge conflicts, resolve source and registry conflicts first, then regenerate andgit addthis file. Never hand-merge its JSON or combine branch copies; neither produces a valid inventory of the merged sources. CI rebuilds, validates and retains the snapshot as an artifact. It commits changed output back to eligible same-repository PR branches when permissions and branch protection allow. Default-branch runs, fork PRs and Dependabot PRs validate and retain output without pushing. Register new engineering operations with routes and evidence; source presence is not validation. - AI workflow names: GitHub Actions workflows for agent, skill, MCP, task, or research
tooling MUST use
ai-<purpose>.ymlin lowercase kebab-case, directly in.github/workflows/. Categorize by primary responsibility: publishing MCP artifacts still usespublish-. Follow .github/WORKFLOWS.md; update filename references when renaming and preserve required-check names unless their consumers have been reviewed. - Documentation code must be test-verified: every Java/Python snippet in docs gets a JUnit
test (e.g.
DocExamplesCompilationTest) that is run and passes before the doc is done. - Notebooks must be executed end to end (NeqSim Runner by default); unexecuted = incomplete.
- Every flow diagram must pass
pfd-layout-reviewbefore it is used (PFD/BFD/P&ID sketch/flow network in a report, paper or figure folder):neqsim pfd-check <svg|layout.json>must give PASS (no overlaps, labels on lines, crossings, missing arrowheads/tags; WARNs fixed or explained), then view the picture; fix the generator (devtools/pfd_diagram.py), never the PNG. Skillneqsim-pfd-layout-review. - Linux-only engines (FluidMagic, OpenFOAM, OPM Flow) need Docker Desktop/WSL2 on Windows;
run
neqsim docker ensure --linuxbefore container work to start installed Docker automatically and wait for readiness (source checkout:uv run --project devtools --locked devtools/docker_runtime.py ensure --linux). Never install/elevate, switch contexts or container modes, or stop Docker automatically. Report missing installations, startup timeouts and denied access as blockers, never skip silently. - FluidMagic is Equinor-internal, not on PyPI (enterprise agents/skills only): running it needs the
private repo
equinor/FluidMagic(own GitHub SSO;gh repo clone equinor/FluidMagic,pip install -e FluidMagic/fluidmagic). Neverpip install fluidmagic; ifimport fluidmagicfails, tell the user how to get it and fall back to the offline hand-off.
Maintaining source code
Use @code-health for measured debt triage, @refactor for bounded source changes,
and @code-review for independent code review. Commands and baseline policy live in
docs/development/CODE_HEALTH.md.
Running calculations
- MCP first: for a single flash/PVT/process/standards/sizing calculation use a curated
mcp_neqsim_*tool (confirm fields withgetSchema/validateInput), thenrunCapability(search→inspectApi→ invoke). Write Python/Java only for loops, plotting, state, notebooks, reports, or inside/solve-task. If NeqSim lacks a capability, add it in Java + tests. - Python: use the selected interpreter, else
C:\appl\neqsim-venv\Scripts\python.exe. Never barepython/pip/pytest, never create/activate/select environments; children reusesys.executable. Missing package or interpreter = report the blocker. - Task notebooks load workspace classes through
devtools/neqsim_dev_setup.py(ns = neqsim_init(project_root=...), thenns.*/ns.JClass); neverfrom neqsim import jneqsim. Java not found →uv run --project devtools --locked devtools/java_locator.py/ensure_java_home()before declaring it missing. - Build/test:
mvnw.cmd install; single testmvnw.cmd test -Dtest=Class#method; static analysischeckstyle:check spotbugs:check pmd:check. - "Package and update python":
.\mvnw.cmd package -DskipTests, then copytarget\neqsim-<version>.jarinto...\site-packages\neqsim\lib\(flat, not a java11 subfolder).
Physics and API gotchas
- Extend the existing equipment class for transient behavior; execution mode alone must never
introduce a separate
Dynamic*unit operation. Preserve stream/tag/DEXPI identity and steady defaults. See.github/skills/neqsim-dynamic-simulation/SKILL.mdfor mode-transition and rollback checks. - EJML-only numerical code: Use primitive arrays at public numerical boundaries and EJML or
LinearAlgebraOperationsfor calculations. Do not restore a JAMA dependency or reference backend. Former matrix-specific hooks and accessors now use EJMLSimpleMatrix; downstream callers must migrate. Preserve dimensions, orientation, ownership and subclass-hook dispatch. EJML LUsetAcan accept a singular matrix: reject non-finite results. Pure-component phase-envelope points must satisfy the EOS pressure equation for both volume roots as well as fugacity equilibrium; a spinodal-stalled volume is not a saturation root. - Always
setMixingRule(...)(numeric for CPA);createDatabase(true)for new components. Temperatures in K and pressures in bara by default.clone()fluids before branching. - After any flash call
fluid.initProperties()before reading density/viscosity/conductivity;init(3)alone leaves transport properties at zero. Choosinginit(...)levels in Java:neqsim-thermodynamic-initializationskill. - Phase envelopes: classify branches physically (the branch holding the cricondentherm is the dew
curve); do not trust getter/label names alone — see
neqsim-phase-envelope. - Multi-area plants: one
ProcessSystemper area, combined in aProcessModel(plant.add("area", ps)); never add aProcessModel/ProcessModuleto aProcessSystem. - Loops: prefer
process.makeRecycles()/setAutoRecycles(true)to hand-written tears.runUntilConverged(n)self-tunes tolerances — do not set a tolerance "to be helpful". - Agents drive models through
process.getAutomation()(cached facade): string addresses,getVariableValueSafe/setVariableValueSafe,evaluate(...)as the never-throwing optimizer step gated onfeasible,getUtilizationSnapshot()as the observation,newOptimizer()forAgenticProcessOptimizer. Details:neqsim-agentic-process-optimizationskill. - Separator/vessel geometry and internals go through
SeparatorMechanicalDesign, notSeparator. - New equipment extends
ProcessEquipmentBaseClass, implementsvalidateSetup()with remediation hints.
Solving engineering tasks
Use the solve-task agent; its workflow is the neqsim-task-workflow skill (load per phase).
Non-negotiables:
- Create the task folder first:
neqsim new-task "title" --type X --author "Name" --prompt "<verbatim request>"(neqsimnot found →<python> -m neqsim_cli ..., same arguments). Root:neqsim --show-task-root(explicit >NEQSIM_TASK_ROOT>~/.neqsim/task_defaults.json>task_solve/). Pass the absolute task path to every child agent/tool; resume existing tasks in place; never fall back silently. - All output and downloaded documents stay in the task folder — documents under
step1_scope_and_research/references/<source>/; runuv run --project devtools --locked devtools/generate_sources_md.py <task> --organizeforSOURCES.md+ manifest. Search the optional document root (neqsim documents PATTERN, read-only) and runneqsim fetch-docs <task>before calling a standard, datasheet or P&ID unavailable. - Standard/Comprehensive:
capability_assessment.md,analysis.md, skill + agent discovery (devtools/skill_search.py,devtools/agent_search.py), benchmark validation against independent data, Monte Carlo P10/P50/P90 + tornado, ISO 31000 risk register,devtools/consistency_checker.pybefore the report. results.jsonpassesTaskResultValidator/devtools/validate_task_results.py, withassumptionsanddata_gapsalways filled (schema: AGENT_REFERENCE.md Part A).- Report:
neqsim report <task>(Word+HTML,--pdfoptional). Title fromstudy.title, language fromreport.language. Hand-written prose goes instep3_report/report_sections.json— never open, edit or copygenerate_report.py(~320 KB). The report run also writesWORK_RECORD.md; fill its narrative blocks. - Improve the tooling every task (Java + JUnit for NeqSim gaps,
SKILL.md/*.agent.mdfor tooling gaps), commit and push each fix to the repo that owns it, and record it inneqsim_improvements.mdandresults.jsonimprovements(or state that nothing was needed). Never commit task output or company data to a code repo. - Close the loop upstream. Prefer the connected GitHub capability when available or required.
Honor existing user/campaign authorization for issues and PRs; otherwise ask once whether
to file it on
equinor/neqsimnow:neqsim file-issue <task>(--listto preview,--prto also propose opening a PR for an already-implemented gap). Every issue and PR is confirmed interactively (or needs--yes) and--dry-runnever callsgh/git— never file or push without authorization.--yescan reuse existing authorization. Remove private task data. Without a connector, nogh/no local checkout (the common case for plugin users) falls back to a pre-filledgithub.com/.../issues/newlink opened in a browser — a form is not a filed issue. Details:neqsim-task-workflow§6.4. - Close with a privacy-safe
docs/development/TASK_LOG.mdentry.
Quick tasks skip the ceremony: answer with units, assumptions and a validation note.
Token budget (every call resends the whole context)
- Search before reading: grep/
grep_searchthen read the matching range. Never read wholeTASK_LOG.md,AGENT_REFERENCE.md,generate_report.pyor large skills end to end. - Load a skill only when its topic is in play; load
neqsim-task-workflowsections per phase. - Documents: metadata first (STID
get_doc_references()gives titles/types), extract text/OCR in a script, write a small JSON summary, read that. Useview_imageonly on cropped regions. - Keep tool output small (counts,
Select-Object -First, no full JSON/notebook dumps). - Bulk work goes to scripts or subagents that write files; read only their summaries.
Documentation
Docs in docs/ need YAML front matter (title, description; quote values with colons),
KaTeX $...$ / $$...$$ (never \( \[), no markdown inside HTML blocks, verified relative
links, and entries in docs/REFERENCE_MANUAL_INDEX.md plus the section index.md.
Full rules: AGENT_REFERENCE.md Part B.
Continuous improvement
Improving the agents and skills used — and their hand-offs — is part of every task. Fix missing
patterns, API signatures and gotchas in the owning SKILL.md/*.agent.md, add cross-references
both ways, and keep site-specific detail in the enterprise repos.
Does 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.

