Skip to content

Guide · Agent skill

How to use the Marine Carbonate Chemistry agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The marine-carbonate-chemistry skill lets an AI agent solve seawater carbonate chemistry from two independent measurements, using the PyCO2SYS library. It is aimed at chemical oceanographers, ocean acidification researchers, and students who need reproducible carbonate calculations with a written record of the assumptions. By the end of this guide you will know what the skill does, how to install it, how to phrase a request that triggers it, and which safety and scope limits to check before trusting a result.

Marine Carbonate ChemistryK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  2. 2Create the Python environment. Use uv to create a Python 3.13 environment and install PyCO2SYS 1.8.3.4 and NumPy 2.5.3 into it.
  3. 3Prepare a validated input table. Build a CSV with one row per sample and a unique sample_id, using the required units and scales.
  4. 4Choose the carbonic-acid constant set. Pick option 10 or 15 as the convention established for your study, since the solver requires this choice.
  5. 5Ask the agent in plain language. Describe the two measured parameters, their units and the outputs you need, and let the agent run the solver.
  6. 6Review flags and report. Check calibration-range flags, carbonate balance and gas-pressure caveats, then report the pair, scale, constants and versions with the results.

What the skill makes the agent do

Given two independent seawater carbonate measurements, such as total alkalinity (TA) and dissolved inorganic carbon (DIC), the agent calculates a speciation table. The outputs include total-scale pH, seawater pCO2 or fCO2, carbonate ion levels, and aragonite and calcite saturation states, using the PyCO2SYS library version 1.8.3.4.

The skill can also convert results from laboratory temperature and pressure to specified ocean conditions, and propagate stated measurement uncertainties into the results. It is scoped to seawater carbonate equilibria. It is not designed for freshwater, porewater with uncharacterized alkalinity, or estimating air-sea CO2 flux.

Install the skill

Download the skill ZIP from this page and unzip it into one of two locations. For a personal install, use ~/.claude/skills/. For a single project, use the .claude/skills/ folder inside that project.

If you use the Claude apps instead, upload the skill under Settings → Capabilities → Skills.

Set up the Python environment

The skill requires Python 3.13, PyCO2SYS 1.8.3.4, and NumPy 2.5.3. The skill recommends uv for creating the environment. Run these commands in your working directory:

  • On Windows, the interpreter is at .venv/Scripts/python.exe instead of the POSIX path shown here.
  • Set the shell variable SKILL_DIR to the installed skill's directory before running the solver.
  • Keep your input files and generated outputs in the working directory.
uv venv --python 3.13 .venv uv pip install --python .venv/bin/python "PyCO2SYS==1.8.3.4" "numpy==2.5.3"

Prepare your measurements in the right units

Most errors come from units and scales, not from the arithmetic. The skill expects TA and DIC in micromol per kg of seawater, salinity as Practical Salinity, temperature as in-situ temperature in degrees Celsius, and pressure as sea pressure in dbar, where a surface sample is 0. pCO2 and fCO2 are in microatm and are different quantities. pH must declare its scale, and a column named only pH is not enough.

Use two independent carbonate parameters. pCO2 plus fCO2 is not an independent pair. Supply phosphate and silicate explicitly; zero is an assumption you must justify, not a placeholder for missing data. Do not convert missing values or rejected measurements to zero.

  • Keep a separate source table with station, depth, timestamps, methods, reference materials and original QC codes, joined by sample ID.
  • Convert source missing-value codes such as -999 before creating the input file.

Trigger the skill with a natural request

You do not need special syntax. Describe the measurements and the result you want, and name the chemistry if you know it. The agent should pick the skill from its description when your request mentions seawater carbonate work. Include the two measured parameters, their units, the salinity and temperature basis, and the outputs you need.

  • "I have TA and DIC for six bottle samples in micromol/kg. Calculate total-scale pH, pCO2 and aragonite saturation at the sample conditions."
  • "Check whether my measured TA and pH are internally consistent, using total pH scale."
  • "Convert these lab-measured carbonate results to 10 C and 1000 dbar and report the aragonite saturation state."

Run a worked example

The skill includes a synthetic example with two samples that differ only in DIC. Save the table as samples.csv in your working directory. Both samples are measured at 25 C and 0 dbar, and results are requested at 10 C and 1000 dbar. Run the solver from that directory.

For the baseline sample, the tested version gives total pH 8.045886, pCO2 396.958 microatm and aragonite saturation 3.386201 at input conditions. At the output conditions, total pH is 8.241241 and aragonite saturation is 2.605691. These are regression checks for this exact setup, not universal seawater benchmarks. The solver writes carbonate.csv and provenance.json into the output directory.

bash .venv/bin/python "$SKILL_DIR/scripts/solve_carbonate.py" samples.csv --par1-type alkalinity --par2-type dic --k-carbonic 10 --output-dir carbonate-results

Review flags and the gas pressure caveat

A successful solve does not validate your sample, constants or method. Check calibration-range and gas-pressure flags, carbonate balance, and residuals against any third measured parameter. The worked example's rows carry gas_pressure_correction_disabled_output, which means output pH and mineral saturation include pressure effects, but the reported pCO2 and fCO2 do not include hydrostatic corrections. Do not compare those gas values directly with a pressure-corrected subsurface sensor.

  • Results ending in _out describe the output temperature and pressure; unsuffixed results describe input conditions.
  • Report the parameter pair, pH scale, units, constants, nutrient assumptions, software versions and any excluded samples with the results.

What people use it for

  • Calculating pH, pCO2 and aragonite saturation for bottle samples from a research cruise.
  • Checking whether a set of measured TA and pH values agrees with a chosen constant set before publishing.
  • Converting laboratory carbonate results to specified ocean temperature and pressure for comparison.
  • Teaching a class how alkalinity, DIC and pH relate, with a reproducible calculation and recorded assumptions.

Frequently asked questions

How do I install the marine carbonate chemistry skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.

What does the marine carbonate chemistry skill require?

It requires Python 3.13, PyCO2SYS 1.8.3.4 and NumPy 2.5.3. uv is recommended for creating the environment, and no API keys or credentials are needed.

Is the marine carbonate chemistry skill free and what is its licence?

The skill is listed under the MIT licence. This page does not state pricing, so check the source repository for any terms beyond the licence.

Does the skill run code and use the network?

Yes on both counts. It runs scripts, including scripts/solve_carbonate.py, and uses the network only to install packages or fetch external data. Review the scripts before running them on sensitive systems.

Can I use it for freshwater or air-sea CO2 flux?

No. The skill is scoped to seawater carbonate equilibria. Freshwater, porewaters with uncharacterized alkalinity, and air-sea flux or atmospheric carbon removal estimates are outside its scope.

Why does my result differ from the example numbers?

The example values are regression checks for one exact setup with the same inputs, constants and output conditions. Changes in units, pH scale, salinity, temperature basis or the carbonic-acid option will change the results.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits chemical oceanography and ocean acidification researchers, and students, who work with paired seawater carbonate measurements and want a reproducible calculation with recorded assumptions. It is a poor choice for freshwater or porewater work, for air-sea flux estimates, or for anyone who cannot check units and pH scales. It does not validate your data, so the scientific judgement stays with you.

Download the skill