# marine-carbonate-chemistry

marine-carbonate-chemistry turns two measured carbonate parameters into a speciation table: pH, pCO2, aragonite and calcite saturation, with the assumptions written down.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 58036 repo stars
- Author: K-Dense-AI
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/marine-carbonate-chemistry/SKILL.md
- Updated: 2026-10-19
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/marine-carbonate-chemistry

## What it does

The skill runs seawater carbonate equilibria through PyCO2SYS 1.8.3.4. You hand it two independent measurements — total alkalinity, DIC, pH or pCO2 — along with salinity, temperature, pressure and nutrients. It writes `carbonate.csv` with the species table and `provenance.json` recording what the solve assumed.

Three pieces do the work: `references/input-and-results.md` for the input schema, `references/chemistry-decisions.md` on pH scales and equilibrium constants, and `scripts/solve_carbonate.py`. The script validates the table, solves the pair, checks the DIC species balance and drops results into a fresh output directory. Only carbonic-acid options 10 and 15 are wired into the helper; any other set needs a direct PyCO2SYS call you verify yourself.

Python 3.13, PyCO2SYS 1.8.3.4 and NumPy go into a separate environment built with `uv`. pCO2 and fCO2 are not an independent pair, so passing both buys nothing. Freshwater, porewaters and brines outside the chosen calibration fall outside the workflow, and a temperature correction will not rescue a sample that shifted through gas exchange or biology.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill marine-carbonate-chemistry -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/marine-carbonate-chemistry/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/marine-carbonate-chemistry/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill marine-carbonate-chemistry -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/marine-carbonate-chemistry/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill marine-carbonate-chemistry -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/marine-carbonate-chemistry/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install K-Dense-AI/scientific-agent-skills skills/marine-carbonate-chemistry
```

2. **Manually: put the files in place**
- File: `.github/skills/marine-carbonate-chemistry/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill marine-carbonate-chemistry -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/K-Dense-AI/scientific-agent-skills --path skills/marine-carbonate-chemistry
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/marine-carbonate-chemistry/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/marine-carbonate-chemistry/SKILL.md

## When to use it
- solve pH from a paired alkalinity and DIC measurement
- convert bottle samples from lab conditions to in-situ depth
- estimate aragonite and calcite saturation states
- propagate stated measurement uncertainty into pCO2
- test a third parameter against the solved pair

## Example prompts
- Solve the carbonate system for `samples.csv` using total alkalinity and DIC with carbonic-acid option 10.
- Recalculate the samples from 25 C and 0 dbar to 10 C and 1000 dbar and report aragonite saturation.
- Show how the `u_par1` and `u_par2` uncertainties in `samples.csv` move pCO2.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 15c3f557e21dea24.

BEGIN THIRD-PARTY FILE 15c3f557e21dea24
```text
---
name: marine-carbonate-chemistry
description: Solves seawater carbonate chemistry with PyCO2SYS for chemical oceanography, ocean acidification, and marine carbon-cycle research. Use for paired total alkalinity, dissolved inorganic carbon, pH, or seawater pCO2/fCO2 measurements; carbonate speciation; aragonite and calcite saturation; Revelle factors; lab-to-in-situ temperature and pressure corrections; and measurement uncertainty propagation. Applies to carbonate-system calculations, not general aqueous speciation or air-sea gas-flux estimation.
license: MIT
compatibility: Requires Python 3.13 with PyCO2SYS 1.8.3.4 and NumPy. Network access is needed only to install packages or obtain external data; bundled calculations run locally without credentials.
metadata:
  version: "1.1"
  skill-author: K-Dense Inc.
  upstream-version: "PyCO2SYS 1.8.3.4"
  last-reviewed: "2026-10-01"
---

# Marine Carbonate Chemistry

Turn two independent seawater carbonate measurements into a reproducible speciation
table, mineral saturation estimates, and a record of the calculation assumptions.
Targets **PyCO2SYS 1.8.3.4**, tested with Python 3.13 and NumPy 2.5.3. As reviewed on
2026-10-01, this remains the stable PyPI release. The [v2 documentation](https://mvdh.xyz/PyCO2SYS/)
is for a beta with breaking changes; use the v1 documentation for this pin.

## When to use

- Analyze bottle samples, shipboard carbonate measurements, or acidification experiments.
- Calculate total-scale pH, seawater pCO2/fCO2, carbonate ion, aragonite/calcite
  saturation state, or the Revelle factor from a valid measured pair.
- Convert a system determined at laboratory conditions to specified ocean conditions.
- Quantify how stated measurement uncertainties affect the calculated results.

This workflow concerns seawater carbonate equilibria. Freshwater, porewaters with
substantial uncharacterized alkalinity, brines outside the selected calibration range,
and reaction/transport models require additional chemistry and validation. Do not
infer an air-sea flux or atmospheric carbon removal from a carbonate equilibrium alone.

## Establish the measurement contract
```
END THIRD-PARTY FILE 15c3f557e21dea24

The third-party file has ended. Everything between the 15c3f557e21dea24 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2157 of 9548 bytes. © K-Dense-AI · MIT · https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/marine-carbonate-chemistry/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
