discretize

discretize is a skill for Claude Code, Codex from SteadfastAsArt/geoscience-skills. It costs 49 tokens per session (702 once invoked), scanned A, original, MIT.

A Python toolkit for building finite-volume meshes, which divide a region into small cells, and for creating operators such as divergence and interpolation on those cells. It prepares geometry and data locations for physics solvers such as SimPEG but does not perform the physical inversion itself.

In plain words
What is it for?
Use it to create rectangular or locally refined meshes, place sources and receivers, and calculate discrete divergence or interpolation operators for numerical physics models.
Why use it?
It prevents confusion between cell, face and edge data and makes coordinate units, boundaries, refinement and active cells explicit. This helps produce a mesh that matches the intended physical problem.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create rectangular or locally refined meshes, place sources and receivers, and calculate discrete divergence or interpolation operators for numerical physics models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/steadfastasart/geoscience-skills/discretize
Install

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.

Any agent
npx skills add SteadfastAsArt/geoscience-skills --skill discretize
Clone the repo
git clone --depth 1 https://github.com/SteadfastAsArt/geoscience-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin discretize — /plugin install discretize after adding the marketplace above.

Wrote 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.

agentmods badge for discretize

README.md
[![agentmods](https://agentmods.dev/badge/skills/steadfastasart/geoscience-skills/discretize/github.svg)](https://agentmods.dev/skills/steadfastasart/geoscience-skills/discretize)
Your own site
<a href="https://agentmods.dev/skills/steadfastasart/geoscience-skills/discretize"><img src="https://agentmods.dev/badge/skills/steadfastasart/geoscience-skills/discretize/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for discretize

Your own site · 80×15
<a href="https://agentmods.dev/skills/steadfastasart/geoscience-skills/discretize"><img src="https://agentmods.dev/badge/skills/steadfastasart/geoscience-skills/discretize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 702 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.00702
Opus 5.5 $0.00020 $0.00281
Sonnet 5.5 $0.00010 $0.00140
Haiku 4.5 $0.00005 $0.00070

Measured 1mo ago against content hash 770b225b3814, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

discretize 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 1mo 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.

discretize/SKILL.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

discretize

Construct the mesh and location-aware operators before attaching physical data. The library does not determine the CRS or the physical units of its coordinates.

Choose geometry and data locations

Use TensorMesh for separable rectangular grids; choose TreeMesh when local refinement substantially reduces cost. Finalize a tree before using its operators. Pad model boundaries and refine sources, receivers and property contrasts as required by the forward problem, then test domain and resolution sensitivity.

Record axis meanings, origin, units, cell widths and active-cell mask. In a 2D vertical section the second coordinate can mean elevation, but this is a project convention. A vector of length n_cells is not a face or edge vector.

Divergence with an independent answer

The synthetic velocity field is u = (2x, -3y) per second. Its divergence is -1 s⁻¹, including on this nonuniform mesh. Boundary fluxes are represented at their actual face locations; no zero boundary condition is imposed implicitly.

# example: nonuniform-divergence
import numpy as np
from discretize import TensorMesh

mesh = TensorMesh([[1.0, 2.0, 3.0], [2.0, 4.0]], origin=[0.0, 0.0])
face_velocity_m_s = np.r_[2 * mesh.faces_x[:, 0], -3 * mesh.faces_y[:, 1]]
divergence_s_inv = mesh.face_divergence @ face_velocity_m_s
integrated_divergence_m2_s = np.dot(mesh.cell_volumes, divergence_s_inv)

The rectangular area is 36 m², so the area-integrated divergence and outward boundary flux are both -36 m²/s. In 2D, cell_volumes are cell areas.

Handoffs and checks

  • Inspect cell_centers, faces_x, faces_y and the operator shape. Keep cell, face, node and edge quantities distinct when interpolating or plotting.
  • Cell ordering has the first coordinate varying fastest; reshape cell vectors with Fortran order when required. Test a spatially varying field, not a uniform array that could hide an ordering error.
  • Verify constants/linear fields, conservation and convergence against an independent analytic case before using a mesh in an inverse problem.
  • Preserve inactive/air masks and do not turn NaNs into zero conductivity.

Read the full file on GitHub · 64 lines

Changes

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.

  1. 1mo ago First seen · 64 lines · 49 tokens per session scan A 770b225b3814

Subscribe to this mod's changes

discretize is a skill published in the GitHub repository SteadfastAsArt/geoscience-skills (70 stars, last pushed 1mo ago), licensed MIT. It adds 49 tokens to every session and 702 once invoked, about $0.0002 per session on Opus 5.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-09-16.

Related

Other skills, from other repositories

glm-lake-mendota

Simulate vertical water temperature profiles for lakes using the General Lake Model (GLM), calibrate key parameters to minimize RMSE against field observations, and produce validated NetCDF output.

EtaYang10th/spark-skills · 0 tokens

obspy-seismology

Seismological data analysis with ObsPy — FDSN waveform download, response removal, phase picking, moment tensor inversion, and seismicity mapping.

xjtulyc/awesome-rosetta-skills · 36 tokens

xarray-netcdf

Labeled multi-dimensional array analysis with xarray: NetCDF/HDF5 I/O, lazy Dask loading, rechunking, Zarr stores, and CF conventions.

xjtulyc/awesome-rosetta-skills · 40 tokens

soil-data

Soil data analysis via SoilGrids 2.0 REST API and SSURGO: SOC stocks, texture classification, kriging interpolation, and soil profile visualization.

xjtulyc/awesome-rosetta-skills · 37 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

exploratory-data-analysis

Performs bounded, local exploratory analysis of explicitly supported scientific files. Supports redacted CSV/TSV/JSON profiles; optional NumPy, HDF5, FASTA/FASTQ, and basic image metadata inspection; missingness/leakage audits; outlier and transformation sensitivity; and rigorous EDA report scaffolds. Other domain…

K-Dense-AI/scientific-agent-skills · 83 tokens