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.
- 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. - 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 and validates the snapshot, then commits changed output back to same-repository PR branches andmasterwhen permissions and branch protection allow. Fork PRs remain validation-only. 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.
- 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.
- 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).
- 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.
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.1485827954.workers.dev/.../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.
- 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.
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.
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.