neqsim-in-writing
Skill167 starsChanged 7 months agoApache-2.0View on GitHub
Author scientifically rigorous chapters and papers where every quantitative claim is backed by a NeqSim simulation, regression test, or notebook. Covers the dual-boot setup cell, claim → test linkage, equation → Java method cross-references, units enforcement against `nomenclature.yaml`, and notebook-driven figure / results-table injection.
In this repository140 other files it gives its agents.
- AGENTS.mdAGENTS.md
- 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-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 skill into the rules it gives an agent
17 rules. About 0 are common, 5 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Every chapter notebook must start with the dual-boot cell.
- Distinctive: line 67
Every assertion in prose that contains a number, equation, or qualitative behavioral statement *that depends on simulation* MUST carry a …
- Distinctive: line 88
When asked to write a new claim:
- Very specific: line 90
Search for an existing test that already validates the claim (grep_search on the formula or expected behavior).
- Very specific: line 92
If none exists, generate a new JUnit 5 test under src/test/java/...
- Very specific: line 100
When introducing an equation that NeqSim implements numerically, attach a pointer to the Java method so readers can audit the numerics:
- Very specific: line 173
When introducing a new symbol, add it to nomenclature.yaml BEFORE writing the prose.
- Very specific: line 191
When a chapter walks through a worked example, capture its output as a regression baseline so that EOS code changes that break the example …
- Distinctive: line 213
If the example is dropped or rewritten, the test must be retired in the same PR — orphan baselines fail the consistency gate.
- Very specific: line 220
When citing a NeqSim-computed value in prose:
- Distinctive: line 222
If the value is generated *for this manuscript*, cite the chapter's notebook by its DOI-able artifact path (e.g., a Zenodo deposit) or the …
- Very specific: line 225
If the value is reproduced from an earlier NeqSim publication, cite the paper, *not* the code repository.
- Very specific: line 227
Never cite "NeqSim software" without specifying version and EOS.
- Very specific: line 240
Run the notebook (paperflow.py book-run-notebooks <book_dir> --chapter <slug>).
- Very specific: line 241
Write prose in chapter.md, inserting figure/table/claim markers.
- Very specific: line 242
Run the consistency + accessibility checks (paperflow.py book-check <book_dir>).
- Distinctive: line 248
Add a JUnit baseline test for every worked example.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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 integration for scientific writing
This skill is loaded by book_author.agent and solve.task.agent whenever a
chapter or paper section must defend a numerical statement with a NeqSim
artifact. It complements book-creation (which handles structural authoring)
and journal-formatting (which handles paper layout).
The objective is traceability: a reader (or reviewer) following any number, table, or figure in the manuscript must be able to land on a runnable NeqSim artifact in the repo within one click.
1. Standard chapter setup cell (Jupyter)
Every chapter notebook must start with the dual-boot cell. It tries the
local devtools build first (so an editor sees fresh code) and falls back to
the published neqsim PyPI package on Colab / external readers.
import importlib, subprocess, sys
try:
from neqsim_dev_setup import neqsim_init, neqsim_classes
ns = neqsim_init(recompile=False)
ns = neqsim_classes(ns)
NEQSIM_MODE = "devtools"
except Exception:
try:
import neqsim
except ImportError:
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "neqsim"])
from neqsim import jneqsim
NEQSIM_MODE = "pip"
print(f"NeqSim loaded via {NEQSIM_MODE}")Canonical imports inside the chapter body:
from neqsim import jneqsim
SystemSrkEos = jneqsim.thermo.system.SystemSrkEos
SystemSrkCPAstatoil = jneqsim.thermo.system.SystemSrkCPAstatoil
ThermodynamicOperations = jneqsim.thermodynamicoperations.ThermodynamicOperations
ProcessSystem = jneqsim.process.processmodel.ProcessSystemNever instantiate JPype classes ad-hoc with
JClass("...")inside book chapters — readers cannot easily spot the class. Use the named bindings above.
2. Claim → test linkage
Every assertion in prose that contains a number, equation, or qualitative behavioral statement that depends on simulation MUST carry a comment marker linking it to a JUnit test or a regression baseline.
The pressure dependency of the SRK alpha function is monotonic in T_r
between 0.7 and 1.3 [^claim1].
<!-- @neqsim:claim
test: src/test/java/neqsim/thermo/component/AlphaFunctionMonotonicityTest.java
baseline: src/test/resources/baselines/srk_alpha_envelope.json
-->The book-check accessibility/consistency gate parses these blocks and warns
when:
- the referenced test file is missing,
- the baseline JSON is missing,
- the test does not contain the claim's numeric tolerance.
When asked to write a new claim:
- Search for an existing test that already validates the claim
(
grep_searchon the formula or expected behavior). - If none exists, generate a new JUnit 5 test under
src/test/java/...and add the baseline tosrc/test/resources/baselines/<topic>.json. - Insert the
@neqsim:claimblock immediately after the sentence.
3. Equation → Java method cross-references
When introducing an equation that NeqSim implements numerically, attach a pointer to the Java method so readers can audit the numerics:
The Soave alpha function
$$ \alpha(T_r, \omega) = [1 + m(\omega)(1 - \sqrt{T_r})]^2 $$
<!-- @neqsim:eq method=neqsim.thermo.component.ComponentSrk#calcAlpha -->These markers are NOT rendered visibly. They are picked up by the
book-render-html post-processor to attach a small source-link footnote in
the HTML/EPUB output and to populate the back-of-book "Index of NeqSim
methods" appendix.
4. Notebook-driven figures and tables
4a. Figures
Generate every chapter figure inside the chapter notebook, save to
<chapter_dir>/figures/, and insert into chapter.md with non-empty alt
text (the accessibility gate enforces this):

<!-- @neqsim:figure source=01_phase_envelope.ipynb cell=12 -->The alt text must describe what the figure shows scientifically, not just "phase envelope". A blind reviewer should be able to grasp the conclusion from alt text alone.
4b. Auto-injected results tables
Tag a notebook cell that produces a pandas DataFrame for direct inclusion
into the chapter. The book-build pipeline will replace the matching
marker in chapter.md on each run:
In the notebook:
results_df # last expression in the cell
# tag the cell metadata: { "neqsim": { "table_id": "srk_validation" } }In chapter.md:
<!-- @neqsim:table id=srk_validation source=01_phase_envelope.ipynb -->
<!-- @neqsim:table-end -->Everything between the markers is regenerated from the notebook output. Hand edits inside the block will be silently overwritten — put narrative outside the block.
5. Units enforcement
Each book has a nomenclature.yaml listing every symbol with its SI unit.
Whenever a chapter writes T = 300 K or P = 60 bar, a build-time linter
checks that:
- the symbol appears in
nomenclature.yaml, - the unit is consistent with the SI base unit declared there,
- NeqSim getter/setter calls in the chapter notebook use the matching unit
string (e.g.,
fluid.getDensity("kg/m3"),setFlowRate(value, "kg/hr")).
When introducing a new symbol, add it to nomenclature.yaml BEFORE writing
the prose. NeqSim default units are documented in
docs/development/CODE_PATTERNS.md.
Common defaults:
| Quantity | NeqSim API default | Allowed strings |
| Temperature (constructor) | K | "K", "C" |
| Pressure (constructor) | bara | "bara", "barg", "Pa", "MPa" |
| Flow rate | mol/sec | "kg/hr", "kg/sec", "Sm3/hr", "MSm3/day" |
| Density | kg/m³ | "kg/m3", "mol/m3" |
| Viscosity | kg/(m·s) | "kg/msec", "cP" |
6. Regression baselines tied to chapter examples
When a chapter walks through a worked example, capture its output as a
regression baseline so that EOS code changes that break the example
will fail CI. The corresponding test goes in
src/test/java/neqsim/book/<book_slug>/:
// src/test/java/neqsim/book/cpa_eos_2026/Chapter03Example2Test.java
@Test
void chapter3Example2_methaneEthaneEnvelope_matchesBaseline() {
SystemSrkEos fluid = new SystemSrkEos(298.15, 60.0);
fluid.addComponent("methane", 0.7);
fluid.addComponent("ethane", 0.3);
fluid.setMixingRule("classic");
ThermodynamicOperations ops = new ThermodynamicOperations(fluid);
ops.calcPTphaseEnvelope(true, 1.0);
BaselineComparator.assertMatch(
"src/test/resources/baselines/book/cpa_eos_2026/ch03_ex2_envelope.json",
ops, tolerance(0.5, "K"), tolerance(2.0, "%"));
}If the example is dropped or rewritten, the test must be retired in the same PR — orphan baselines fail the consistency gate.
7. Citation hygiene for NeqSim-derived results
When citing a NeqSim-computed value in prose:
- If the value is generated for this manuscript, cite the chapter's notebook by its DOI-able artifact path (e.g., a Zenodo deposit) or the repo commit hash.
- If the value is reproduced from an earlier NeqSim publication, cite the paper, not the code repository.
- Never cite "NeqSim software" without specifying version and EOS.
The book-enrich-bib command validates external DOIs via Crossref but
does not invent DOIs for software. For software citations use the
CITATION.cff file at the repo root.
8. Workflow summary (per chapter)
paperflow.py book-add-chapter <book_dir> --title "..."- Author the notebook in
<chapter_dir>/notebooks/. Tag figure/table cells withneqsimmetadata. - Run the notebook (
paperflow.py book-run-notebooks <book_dir> --chapter <slug>). - Write prose in
chapter.md, inserting figure/table/claim markers. - Run the consistency + accessibility checks
(
paperflow.py book-check <book_dir>). - Live-preview iteratively:
paperflow.py book-preview <book_dir>. - Validate citations:
paperflow.py book-enrich-bib <book_dir>. - Render the final formats:
paperflow.py book-render <book_dir> --format pdf(and--format epub,--format docxas required by the publisher). - Add a JUnit baseline test for every worked example.
9. Anti-patterns (will fail review)
- Numbers without provenance — every numeric in prose must trace to a notebook cell or a JUnit test.
var,List.of, text blocks in any Java snippet shown in the book (Java 8 only — seeneqsim-java8-rules).- Bare
JClass("...")calls in book code — readers will not find the class. Use named bindings (§1). - Editing inside
@neqsim:tableblocks — overwritten on next build. - Generic alt text ("Figure 3", "Plot of results") — fails accessibility gate.
- Citing software without a version — both reviewers and CI will reject.
10. Hand-off to other agents
book_author.agent— owns chapter prose; calls this skill to insert claim markers and to choose units.solve.task.agent— owns notebook code; produces tagged figure/table cells whose markers this skill consumes.journal-formatting— for journal articles instead of books, the same@neqsim:*markers apply but the renderer is the paper pipeline.
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.

