Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/csml-rpi/foam-agent/agents-mdgit clone --depth 1 https://github.com/csml-rpi/Foam-AgentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/csml-rpi/foam-agent/agents-md)<a href="https://agentmods.dev/instructions/csml-rpi/foam-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/csml-rpi/foam-agent/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01630 | $0.01630 |
| Opus 5 | $0.00815 | $0.00815 |
| Sonnet 5 | $0.00326 | $0.00326 |
| Haiku 4.5 | $0.00163 | $0.00163 |
Grade A, and why
Foam-Agent AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
This file helps AI agents (Codex, Cursor, Claude Code, Copilot, etc.) understand and work with this codebase.
What is Foam-Agent?
Foam-Agent is a multi-agent framework that automates CFD (Computational Fluid Dynamics) simulations in Foundation OpenFOAM v10 (openfoam.org) from natural language prompts. It uses LangChain/LangGraph for orchestration, FAISS for RAG-based tutorial retrieval, and supports multiple LLM providers (OpenAI, Anthropic, Bedrock, Ollama).
Important: All generated case files, dictionary names, and solver binaries follow Foundation OpenFOAM v10 conventions. ESI OpenFOAM (openfoam.com, e.g., v2312, v2406, v2512) is not compatible.
Build and Run
# Environment setup
conda env create -n FoamAgent -f environment.yml
conda activate FoamAgent
# Run a simulation
python foambench_main.py --output ./output --prompt_path ./user_requirement.txt
# Run with custom mesh
python foambench_main.py --output ./output --prompt_path ./user_requirement.txt --custom_mesh_path ./mesh.msh
# Run tests
pytest tests/ -v
# Start MCP server
python -m src.mcp.fastmcp_server --transport http --host 0.0.0.0 --port 7860
Requires Foundation OpenFOAM v10 (openfoam.org) at runtime ($WM_PROJECT_DIR must be set). ESI OpenFOAM (openfoam.com) is not compatible. Python 3.12.9 via Conda.
Architecture
Workflow Pipeline (LangGraph StateGraph)
Defined in src/main.py:
PLANNER -> [mesh routing] -> MESHING (if needed) -> INPUT_WRITER -> [HPC/local routing]
-> RUNNER -> [error check] -> REVIEWER -> INPUT_WRITER (retry loop, max 25 iterations)
-> VISUALIZATION (if requested) -> END
All routing decisions (mesh type, HPC vs local, visualization) are LLM calls in src/router_func.py.
Directory Structure
src/
main.py # LangGraph workflow definition and entry point
config.py # Config dataclass with env var overrides
utils.py # GraphState (TypedDict), LLMService (unified LLM interface)
models.py # Pydantic models for generated files and plans
router_func.py # LLM-based routing decisions
logger.py # Structured XML-tagged logging
nodes/ # LangGraph node functions (thin wrappers calling services)
planner_node.py
input_writer_node.py
meshing_node.py
local_runner_node.py
hpc_runner_node.py
reviewer_node.py
visualization_node.py
services/ # Business logic (where the real work happens)
plan.py # Case planning and analysis
input_writer.py # OpenFOAM file generation via LLM + RAG
mesh.py # Mesh generation (blockMesh / Gmsh conversion)
run_local.py # Local OpenFOAM execution
run_hpc.py # HPC job submission
review.py # Error diagnosis and fix planning
visualization.py # PyVista-based post-processing
mcp/ # FastMCP server exposing workflow as tools
database/
faiss/ # Pre-built FAISS vector indices (do NOT regenerate unless necessary)
raw/ # Raw OpenFOAM tutorial data
tests/ # pytest tests (service layer + MCP integration)
docker/ # Dockerfile for containerized deployment
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 134 lines · 1,630 tokens per session scan A 380e69ce8141
Foam-Agent AGENTS.md is an instructions file published in the GitHub repository csml-rpi/Foam-Agent (311 stars, last pushed 21d ago), licensed MIT. It adds 1,630 tokens to every session, about $0.0081 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
viznoir CLAUDE.md
Claude Code instructions for kimimgo/viznoir, covering claude.md, viznoir, project info, development commands and install (editable with dev deps).
tidy3d CLAUDE.md
Claude Code instructions for flexcompute/tidy3d, a project described as: fast, large scale photonic simulation platform.
vortex-funnel-gen CLAUDE.md
Instructions for hooyao/vortex-funnel-gen, covering claude.md, language, project purpose, architecture and tech stack.
agent-eve CLAUDE.md
Instructions for shehryarsaroya/agent-eve, covering claude.md — agent eve (né the compact, then agent transfer), 0. 🚨 hard rules, 1. what this is, 2. doc map and 3. state of play (2026-07-26).
bio-gene-to-reference-tree copilot-instructions.md
Copilot instructions for Hongda-Zhao/bio-gene-to-reference-tree, a project described as: Auditable agent skill for resolving protein queries, selecting references, and planning reproducible phylogenetic trees.
braina GEMINI.md
Instructions for brainets/braina, covering project: braina (brain interaction analysis), 1. project context & purpose, 2. commands, verify environment (all core dependencies) and run the verification test suite for frites + hoi.