Skip to content
/

Claude for Reservoir Engineering

reservoir-engineering-claude · gabrielserrao/Claude-for-reservoir-engineering · ★ 28 · last commit 2026-05-21

Teaches petroleum engineers to use Claude Code through domain-authentic exercises, with a reviewer subagent that checks unit consistency, correlation applicability, and pyResToolbox parameter naming.

Best whenEngineering AI workflows require domain-specific review criteria — unit consistency and correlation applicability are higher-stakes than code style, and must…
Skip ifHand-rolling PVT, VLP, material balance, or DCA formulas, Skipping unit documentation in engineering answers
vs seeds
superpowers(skills + subagent, no commands), but the reservoir-reviewer subagent's review criteria are domain-specific: unit system…
Primitive shape 4 total
Skills 2 Subagents 1 MCP tools 1
00

Summary

reservoir-engineering-claude — Summary

Claude-for-reservoir-engineering is a structured course teaching reservoir and petroleum engineers how to use Claude Code through domain-authentic exercises: production data QA, PVT unit bugs, decline curve analysis, material balance, nodal analysis, simulation preparation, and parallel sensitivity studies. The repo ships a reservoir-engineering skill, a run-tests skill, and a reservoir-reviewer subagent that checks unit consistency, correlation applicability, pyResToolbox parameter naming mistakes, and engineering sanity. Course modules (01–09) map directly to Claude Code features: explore/plan/code/verify loop, specific context, TDD, CLAUDE.md, skills, subagents, CLI workflow, MCP integration, and parallel fan-out. The project explicitly cites pyResToolbox and pyrestoolbox-mcp as the preferred library/MCP for calculations, prohibiting hand-rolled PVT formulas. Adapted from claude-code-for-hydrology by lorenliu13.

Differs from seeds: No seed addresses scientific/engineering domains. Closest to superpowers (skills + subagent, no commands) but the reservoir-reviewer agent's review criteria are domain-specific (units, correlation applicability, mass balance) rather than general code quality, and the course structure itself is the primary artifact — not just the skills.

01

Overview

reservoir-engineering-claude — Overview

Origin

Created by Gabriel Serrao, a reservoir engineering data scientist. Adapted from claude-code-for-hydrology (lorenliu13), which used the same exercise structure for hydrology workflows. Licensed MIT.

Philosophy

"The goal is not to make Claude 'do engineering' blindly. The goal is to teach engineers how to direct Claude like a disciplined technical assistant: give it context, constrain assumptions, require units, verify results, use tests, and prefer proven libraries or MCP tools over invented formulas."

The course emphasizes that AI tools accelerate reservoir engineering work only when the engineer:

  • Supplies domain context explicitly (units, parameter names, correlation ranges)
  • Demands verification (known-value tests, monotonicity checks, physical bounds)
  • Prefers proven libraries (pyResToolbox, pyrestoolbox-mcp) over hand-rolled correlations

Target Audience

  • Reservoir engineers learning AI-assisted coding
  • Production engineers working with CSV exports and decline curves
  • Petroleum engineering students who know the domain but want better coding workflows
  • Data scientists supporting subsurface teams

Course Structure

9 modules mapping directly to Claude Code capabilities:

  1. Explore/plan/code/verify loop
  2. Specific context (PVT unit bugs)
  3. Verify your work (DCA sanity checks)
  4. CLAUDE.md project memory
  5. Claude skills
  6. Subagent review
  7. CLI workflow for production CSV QA
  8. MCP + pyResToolbox
  9. Parallel fan-out for sensitivity studies
02

Architecture

reservoir-engineering-claude — Architecture

Distribution

Standalone repository — clone and use as a course. No plugin, no npm package.

Install

git clone https://github.com/gabrielserrao/Claude-for-reservoir-engineering
pip install -r requirements.txt  # Python deps for exercises

Directory Tree

.
├── .claude/
│   ├── agents/
│   │   └── reservoir-reviewer.md         # Subagent: unit/correlation reviewer
│   └── skills/
│       ├── reservoir-engineering/
│       │   └── SKILL.md                  # Reservoir engineering skill
│       └── run-tests/
│           └── SKILL.md                  # Test runner skill
├── 01_explore_plan_code/                 # Production analysis exercises
├── 02_specific_context/                  # PVT conversion bug exercises
├── 03_verify_your_work/                  # DCA sanity check exercises
├── 04_init_claude_md/                    # CLAUDE.md project memory exercises
├── 05_skills/                            # Skills exercises
├── 06_subagent_review/                   # Subagent reviewer workflow exercises
├── 07_cli_workflow/                      # Shell + Python QA exercises
├── 08_mcp_pyrestoolbox/                  # pyResToolbox MCP exercises
├── 09_parallel_fanout/                   # Parallel sensitivity exercises
├── assets/                               # Generated plots and result tables
├── references/pyrestoolbox-workflows.md  # Workflow reference
├── scripts/generate_course_figures.py    # Figure generation
├── CLAUDE.md                             # Project memory file
├── requirements.txt
└── README.md

Required Runtime

  • Python (for exercises)
  • Claude Code
  • pyRestoolbox Python package
  • pyrestoolbox-mcp (optional, for Module 08)

Target AI Tools

  • Claude Code (primary, .claude/ directory structure)
03

Components

reservoir-engineering-claude — Components

Skills (2)

Skill Purpose
reservoir-engineering Guides use of pyResToolbox/pyrestoolbox-mcp for PVT, DCA, material balance, nodal analysis, relperm, simulation input. Lists parameter pitfall warnings (sg vs sg_g, psd vs pwf, etc.). Defines output standard: inputs/units, method, result, sanity check, applicability limits.
run-tests Test runner skill for the course exercises

Agents (1)

Agent Purpose
reservoir-reviewer Reviews reservoir engineering code for: (1) unit consistency (field vs metric, pressure, temperature, rate, GOR, permeability, depth), (2) correlation applicability (API, gas gravity, pressure/temperature range), (3) pyResToolbox parameter naming mistakes, (4) engineering sanity checks (monotonicity, mass balance, nonnegative rates/properties), (5) test coverage. Returns findings ordered by severity with file/line references.

Hooks (0)

None.

Course Modules (9)

Module Topic Key Skill Taught
01_explore_plan_code Production data analysis Explore/plan/code/verify loop
02_specific_context PVT unit conversion bug Precise context (file, function, expected behavior)
03_verify_your_work DCA sanity checks Tests with known values, monotonicity checks
04_init_claude_md Project memory CLAUDE.md for reservoir-specific standards
05_skills Reservoir skills Creating and using Claude skills
06_subagent_review Reviewer subagent Dispatching reservoir-reviewer agent
07_cli_workflow CSV QA with shell Shell + Python for production CSV quality checks
08_mcp_pyrestoolbox MCP integration Using pyResToolbox via MCP server
09_parallel_fanout Parallel sensitivity Fan-out for independent sensitivity cases

MCP Server Referenced

pyrestoolbox-mcp — an MCP server wrapping pyResToolbox, allowing agents to call reservoir engineering calculations as MCP tools.

05

Prompts

reservoir-engineering-claude — Prompt Excerpts

Excerpt 1: reservoir-engineering SKILL.md — Parameter pitfalls

Technique: Explicit enumeration of common API mistakes as domain-specific guard rails.

## Parameter Pitfalls

- Oil tools use `sg_g` for gas gravity.
- Gas tools use `sg` for gas gravity.
- Inflow tools use `psd`, not `pwf`.
- Gas Z-factor uses `method`; many other gas property tools use `zmethod`.
- Oil bubble point methods include `STAN`, `VALMC`, and `VELAR`.
- Gas Z-factor methods include `DAK`, `HY`, `WYW`, and `BUR`.
- Relative permeability table types include `SWOF`, `SGOF`, and `SGWFN`.

Excerpt 2: reservoir-engineering SKILL.md — Output standard

Technique: Mandatory output format ensures engineering rigor in every response.

## Output Standard

Every answer should include:

- Inputs and units.
- Correlation or method used.
- Result table or scalar result.
- Engineering sanity check.
- Any applicability limits or assumptions.

Excerpt 3: reservoir-reviewer agent — Review order

Technique: Severity-ordered review checklist; prioritizes consequential engineering errors.

Review in this order:

1. Unit consistency: field vs metric, pressure, temperature, rate, GOR, permeability, depth.
2. Correlation applicability: API, gas gravity, pressure/temperature range, unconventional vs conventional use.
3. pyResToolbox or MCP parameter naming mistakes.
4. Engineering sanity checks: monotonicity, mass balance, nonnegative rates/properties, plausible bounds.
5. Tests: known-value tests, edge cases, and scenario/sensitivity coverage.

Return findings first, ordered by severity, with file and line references when available.
09

Uniqueness

reservoir-engineering-claude — Uniqueness

Differs from Seeds

No seed addresses engineering science domains. Closest to superpowers (skills + subagent review, no commands), but the reservoir-reviewer agent's criteria are domain-specific: unit system consistency (psia vs barsa, degF vs degC), correlation applicability ranges (API gravity, gas gravity, pressure/temperature bounds), pyResToolbox parameter naming (sg vs sg_g by tool family), and engineering sanity (monotonicity of decline curves, mass balance, non-negative rates). This is the only entry in the corpus that treats physical unit consistency and correlation applicability as first-class review dimensions.

Positioning

An onboarding course for petroleum engineers, not a ready-to-use plugin. The primary value is pedagogical — mapping Claude Code concepts to engineering workflows engineers recognize. The skills and reviewer agent are secondary deliverables.

Observable Failure Modes

  1. pyResToolbox API drift: Parameter naming pitfalls are pinned to a specific version of pyResToolbox; API changes break the documented patterns.
  2. No automation: The reservoir-reviewer agent must be manually dispatched; there are no hooks to auto-trigger review.
  3. Course vs production gap: The exercises are toy problems; real reservoir engineering workflows (large datasets, full-physics simulators) are not covered.

Explicit Antipatterns

  • Hand-rolling PVT, VLP, material balance, or DCA formulas (use pyResToolbox)
  • Skipping unit documentation in answers
  • Trusting decline curve forecasts without monotonicity checks
  • Using gas tool parameter names (sg) with oil tool APIs
04

Workflow

reservoir-engineering-claude — Workflow

Core Pattern

The course teaches the Explore → Plan → Code → Verify loop (Module 01) applied to engineering scripts.

Per-Module Workflow

Module 02: Specific Context (PVT Bug)

  1. Identify file, function, failing behavior, units, expected engineering relationship
  2. Ask Claude to add tests with known values
  3. Fix the bug with test verification

Module 03: Verify Your Work (DCA)

  1. Write tests with known values before implementing
  2. Add monotonicity checks (rates should decrease)
  3. Add physical bounds checks (non-negative rates, positive EUR)

Module 06: Subagent Review

  1. Implement reservoir engineering script
  2. Dispatch reservoir-reviewer agent
  3. Review findings by severity, fix issues
  4. Re-run reviewer if needed

Module 09: Parallel Fan-out

  1. Identify independent sensitivity parameters
  2. Dispatch parallel agents for each sensitivity case
  3. Aggregate results carefully (avoid correlation artifacts)

Artifacts

Module Artifact
All Python scripts
04 CLAUDE.md with reservoir standards
All Test files with known-value assertions
09 Aggregated sensitivity result tables

Approval Gates

No automated gates. All gates are pedagogical — the human engineer reviews results.

06

Memory Context

reservoir-engineering-claude — Memory & Context

State Storage

CLAUDE.md at project root — taught in Module 04. Used to encode reservoir-specific standards (unit conventions, preferred correlations, parameter naming rules for pyResToolbox).

Context Injection

  • reservoir-engineering skill loaded on demand for engineering calculations
  • references/pyrestoolbox-workflows.md provides workflow reference for Module 08
  • Module-specific exercise files provide grounding data (CSVs, Python scripts)

Cross-Session Handoff

CLAUDE.md provides cross-session persistence of project-specific conventions.

Compaction Handling

None.

Domain Knowledge Encoding

The reservoir-engineering skill encodes domain knowledge as:

  1. Common tool families (oil PVT, gas PVT, DCA, material balance, nodal/IPR/VLP, simulation)
  2. Parameter pitfalls (exact API differences between tool families)
  3. Output standard (mandatory format for all answers)

This makes the skill a precision filter that reduces hallucinated parameter names and wrong unit assumptions.

07

Orchestration

reservoir-engineering-claude — Orchestration

Multi-Agent Pattern

Hierarchical (Module 06 + 09):

  • Module 06: Main agent dispatches reservoir-reviewer for code review
  • Module 09: Parallel fan-out — multiple independent agents for sensitivity cases

Execution Mode

Interactive-loop — course exercises are user-driven. No automation.

Isolation Mechanism

None.

Multi-Model

No. Single model session.

Auto-Validators

None via hooks. The reservoir-reviewer agent is a manually dispatched validator.

Prompt Chaining

Module 09 aggregation: parallel sensitivity outputs are manually aggregated.

MCP Integration

pyrestoolbox-mcp server (Module 08) — wraps pyResToolbox functions as MCP tools. The skill instructs using MCP over hand-rolled formulas.

08

Ui Cli Surface

reservoir-engineering-claude — UI / CLI Surface

CLI Binary

None.

Local UI

None.

CLI Workflow

Module 07 teaches shell + Python QA for production CSV files — this is a course topic, not a built-in tool.

Observability

None.

Target Surface

Claude Code (.claude/ directory structure).

Related frameworks

same archetype · same primary tool · same memory type

Context-Engineering Handbook ★ 9.0k

Provides a first-principles, research-grounded vocabulary and learning path for context engineering — the discipline of designing…

walkinglabs/learn-harness-engineering ★ 6.6k

Teach harness engineering from first principles (12 lectures + 6 projects) and provide a scaffolding skill (harness-creator) that…

Awesome Harness Engineering (walkinglabs) ★ 2.7k

Curate the authoritative reference list of articles, benchmarks, and tools for harness engineering — the practice of shaping the…

cline-memory-bank (nickbaumann98) ★ 581

Custom instructions + 6-file hierarchical Markdown memory bank so Cline maintains full project context across sessions, with a…

FPF (First Principles Framework) ★ 372

Provides a formal pattern language for making reasoning explicit, traceable, and publishable in mixed human/AI engineering work —…

nexu-io/harness-engineering-guide ★ 134

Provide a practical, code-first reference guide to harness engineering — from first principles to production patterns —…