agentleFS
jskhermanjskherman/engg-skills/skills/material-energy-balances/SKILL.md

material-energy-balances

Skill7 starsChanged 6 months agoApache-2.0View on GitHub

Compute simple component totals and reaction conversion / yield metrics for steady-state process calculations. Use when summing stream component amounts or sanity-checking reaction metrics. Don't use for full inlet/outlet balance residuals, degree-of-freedom analysis, dynamic / transient balances, or as a substitute for a flowsheet simulator's rigorous closure.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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
  1. Distinctive:

    Keep all values on a consistent molar or mass basis.

    line 59
  2. Distinctive:

    Not propagating measurement uncertainty when judging closure ("looks closed at 0.5%" might be within instrument noise).

    line 79
  3. Distinctive:

    If the residual is large but the data is suspect, suggest data reconciliation (Crowe's method or similar).

    line 84
  4. Very specific:

    Run the listed script with representative inputs and an --output file when a deterministic calculation is available.

    line 90
  5. Distinctive:

    Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Material and Energy Balances

Overview

Steady-state helper calculations:

  • Component totals from one or more NAME=amount entries.
  • Conversion and yield from supplied limiting-reactant and product amounts.
  • JSON envelopes that make the basis and assumptions explicit.

Prerequisites

  1. uv available.

When to Use

  • Summing component amounts from a hand-built stream table.
  • Sanity-checking a single stream or component set on a consistent basis.
  • Computing rough conversion and yield metrics from known feed/reacted/product amounts.

Don't use for

  • Transient (dynamic) balances; the math involves dC/dt and requires a state-space approach.
  • Rigorous flowsheet convergence; use a simulator.
  • Detailed equilibrium / reactor design; this skill is balance-only.
  • Full node closure with separate inlet and outlet stream tables.
  • Degree-of-freedom counting.
  • Selectivity calculations; only conversion and yield are exposed by the CLI.

Utility Scripts

  • uv run scripts/balance_solver.py component-total --stream A=10 --stream B=5 --output /tmp/total.json
  • uv run scripts/balance_solver.py reaction-metrics --feed-limiting 10 --reacted-limiting 8 --desired-product 7.2 --theoretical-product 8 --output /tmp/reaction.json

Procedure

  1. Identify the stream, component set, or reaction metric you need.
  2. Keep all values on a consistent molar or mass basis.
  3. For totals, pass each component amount as a repeated --stream NAME=amount.
  4. For conversion/yield, supply limiting-reactant feed, reacted amount, desired product amount, and theoretical product amount.
  5. Inspect the JSON assumptions before using the result in a larger balance.

Pitfalls

  • Mixing mass and molar basis silently.
  • Forgetting recycle streams.
  • Reporting "conversion 97%" without naming the key reactant and the basis (per pass vs overall).
  • Using yield where you mean selectivity (yield is mol product / mol reactant fed; selectivity is mol product / mol reactant reacted).
  • Computing residuals only in absolute terms; relative residuals (residual / inlet) are usually more useful.
  • Using mass balance closure to justify a doubtful instrument when energy balance also fails to close.
  • Counting equations without subtracting redundant ones (a total-balance plus all-component balances over-counts).
  • Not propagating measurement uncertainty when judging closure ("looks closed at 0.5%" might be within instrument noise).

Fallback Strategies

  • If the residual is large but the data is suspect, suggest data reconciliation (Crowe's method or similar).
  • For dynamic balances, surface that this skill does not cover them.

Verification

  • Run the listed script with representative inputs and an --output file when a deterministic calculation is available.
  • Confirm the JSON result contains ok: true, expected units, and no unhandled warnings.
  • Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

References

  • references/workflow.md — detailed checklist for a node closure.

Anti-Patterns

  • Reporting a balance that does not close as if it does.
  • Hiding the basis in the report.
  • Using component balances to detect bias without ruling out leakage, recycle, or unmeasured purge.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.