/dsm-soil:soil-fertility-mappingfrom dsm-soil
Produces national/regional soil fertility maps and a composite Soil Fertility Index (SFI) with propagated uncertainty from legacy data using machine learning. For multi-property nutrient assessments and soil quality indices.
Ships in dsm-soil. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Forged from the DSM knowledge wiki. Anchor source: Abbruzzini et al. 2026 (first national nutrient maps for Mexico, FAO GSNmap). This is a specialization of digital-soil-mapping-workflow — do the general DSM steps there; this skill adds the multi-property + fertility-index layer. Validation defers to soil-map-validation.
STATUS: v0 (Phase 2). All three pillars grounded, including a national DSM-SFI worked example (Hounkpatin 2022, Benin). Pillar B (soil-fertility-index) now has four cited integration routes. Pillar C now carries the epistemic-coverage layer — AOA/DI + LPD via CAST (Meyer & Pebesma 2021, Schumacher 2025) — the "where is this map even applicable?" tools that QRF intervals can't provide, under the two-axis frame predictive-uncertainty. Propagating per-pixel property uncertainty into the fertility class is now grounded as a method (monte-carlo-uncertainty-propagation via spup) — even Hounkpatin only classifies from the mean maps; the ⏳ left is a worked national example.
Predictability splits by property, and the model can't fix it (inherent-vs-management-properties).
This triangulates across three continents and three methods: Mexico (Abbruzzini, QRF), France (Suleymanov; Vaysse) and Africa (Hengl, ensemble ML — pH CCC 0.90, extractable P CCC 0.654). pH always near the top, extractable P always near the bottom. It is a general law, not a dataset quirk. Set per-property confidence tiers up front. Don't burn effort tuning models to rescue N/P — the ceiling is signal, not fit. Fix it (if at all) with denser management-stratified sampling + fine parent-material covariates.
The DSM papers map the properties but don't build an index — this is the composite step you add. Pick one of three cited integration routes (soil-fertility-index):
SFI = Σ Wᵢ·Sᵢ. Transparent and weight-explicit. Down-weight or exclude
the low-confidence nutrients (N, P) so the index doesn't inherit their uncertainty (inherent-vs-management-properties).
Runnable end-to-end via soilquality (pca_select_mds → score_indicators → compute_sqi_properties):
it adds AHP weighting with a consistency check (ahp_weights, CR<0.10 — weights on ecological priority, not
just PCA variance) and explicit scoring functions (score_optimum linear/quadratic for pH, score_threshold
for nutrient classes). Point/compensatory — use it to derive the weights/scores/MDS (and a validation SFI), then
apply the rule pixelwise; for a national map prefer the non-compensatory threshold route below.The upgrade — propagate uncertainty into the fertility class (now grounded as a method).
Hounkpatin quantifies national per-pixel property uncertainty (QRF model
spread + data sensitivity from repeated holdout refits) but still classifies from the mean maps — so the
fertility class carries no probability. The step: Monte-Carlo
propagation — draw each property from its QRF/ensemble
distribution, re-run the SFI/classification each draw → map the class probability + entropy. Do it
rigorously: model the spatial autocorrelation of each property's errors and the cross-correlation
between properties, or the class uncertainty is understated. The operational tool is spup
(defineUM→defineMUM→genSample→propagate; the C/N-ratio vignette is a near-exact template — swap the C/N
function for your SFI rule). Propagate inside the AOA and carry the mask
onto the class map. ⏳ remaining: a worked national example — no corpus paper completes it.
Uncertainty has two axes (predictive-uncertainty) — report both, because they answer different questions and one is blind to the other:
Axis 1 — aleatoric / distributional ("how variable is the outcome here?")
Axis 2 — epistemic / coverage ("has the model even seen anything like here?") — the layer QRF intervals and RF ensemble SD cannot see (Meyer & Pebesma: their spatial patterns disagree with the true error under extrapolation). For clustered national legacy data this is the decisive layer. The full engine for both axes is spatial-prediction-uncertainty — use it for the uncertainty product; the essentials:
aoa()): mask every property map to
where the model is applicable — outside the AOA the CV error simply does not hold. The AOA
threshold depends on the CV design — compute it under kNNDM/spatial CV, never random CV on clustered data.aoa(..., LPD = TRUE)): grade
reliability inside the AOA by how many training points support each pixel — it predicts error better than
DI alone and exposes thinly-supported zones a low DI would wave through.Into the index: Monte-Carlo propagation via spup (Pillar B) — a fertility index without an uncertainty layer is half a product. Mask/annotate the final SFI with the AOA + LPD so the class map states where it is applicable, not only what it predicts.
Anchor: Abbruzzini et al. 2026 (national QRF nutrient maps, Mexico, GSNmap; property-differentiated
predictability; harmonization; metric panel). National/continental companions: Hengl et al. 2021 (Africa,
30 m, ensemble ML, spatial CV, per-pixel error) and Vaysse & Lagacherie 2017 (foundational QRF-for-uncertainty
vs RK under sparse data; accuracy plots). Pillar B (index) grounded in soil-fertility-index via Hounkpatin 2022 (⭐ national DSM-SFI by
pixelwise expert-threshold classification, Benin), Supriyadi 2025 (PCA-MDS weighted-additive SFI),
Valera 2025 (FKCN fuzzy clustering), and Abdullah 2025 (supervised ensemble classification); runnable via the
soilquality R package (Carbajal — PCA-MDS + AHP weighting with consistency check +
scoring functions → compute_sqi_properties). Reuses the DSM
machinery from the wiki (scorpan, quantile-regression-forests,
ensemble-machine-learning, feature-selection, sampling-design,
accuracy-metrics, spatial-cross-validation, scale-dependence,
landscape-heterogeneity) and the DSM and
validation skills. Remaining ⏳: uncertainty propagation into the
index at scale (Monte-Carlo) — chase Hounkpatin 2022 (Benin). Full citations in the wiki sources/.
Portable build from the DSM knowledge wiki (the source of truth). Obsidian cross-references were flattened for standalone use; regenerate with build.ps1.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
dsm, soil-nutrients, fertility-index, uncertainty-propagation, qrf
npx claudepluginhub ccarbajal16/soil-dsm-skills --plugin dsm-soil12 skills in this plugin
/digital-soil-mapping-workflowRun a digital soil mapping (DSM) project end to end — from framing the target and assembling scorpan covariates, through sampling design, model selection, handling spatial autocorrelation, training, and producing a map with calibrated uncertainty. Use when planning or reviewing any project that predicts a soil property (SOC, texture, pH, …) across space (and optionally time) from environmental covariates. Triggers: "digital soil mapping", "DSM", "predict soil property from covariates", "soil map", "scorpan", "which model for soil mapping", "covariates for soil", "map SOC / soil carbon"./ensemble-ml-for-soilDecide whether to combine machine-learning models at all, and if so how — by measuring the gain available before building any combiner. Covers the ambiguity/diversity ceiling, the weighting spectrum (simple average, R²-weighted, Bates–Granger, AIC/BIC, NNLS/SuperLearner, Granger–Ramanathan, learned meta-models, attention, per-pixel selection), out-of-fold stacking under spatial CV, cross-fitting the combiner, voting for classification, and significance testing of the margin. Use when someone proposes an ensemble, reports an ensemble gain, or asks whether their averaging scheme is "too simple". Triggers: "ensemble machine learning", "model stacking", "stacked generalisation", "SuperLearner", "meta-learner", "meta-model", "weighted average ensemble", "R2-weighted ensemble", "simple average ensemble", "Bates-Granger", "Granger-Ramanathan", "NNLS weights", "non-negative least squares", "caretStack", "mlr3pipelines stacking", "voting ensemble", "hard voting", "soft voting", "blending", "bagging vs boosting vs stacking", "ensemble gain", "does stacking help", "combine RF and XGBoost", "which model to combine", "base learner diversity", "error correlation", "out-of-fold predictions", "level-one dataset", "landmap", "MACHISPLIN", "spatial ensemble", "per-pixel model selection", "combine my model with SoilGrids"./hybrid-process-ml-socDesign and build hybrid soil-organic-carbon models that fuse a process-oriented model (RothC / CENTURY / Millennial) with machine learning (Random Forest / QRF) to predict SOC stock in space AND time — getting ML's spatial accuracy together with the process model's physically-plausible temporal dynamics. Use when a task needs SOC *change* over time (not just a static map), when pure ML gives implausible temporal trends, or when integrating mechanistic knowledge into data-driven soil mapping. Triggers: "hybrid soil carbon model", "process + machine learning", "POML", "space-time SOC", "RothC + random forest", "physically plausible SOC prediction", "knowledge-guided ML for soil"./ml-for-soil-predictionChoose, tune, and reason about machine-learning models for predicting soil properties (SOC, texture, pH, …) — Random Forest, Quantile Regression Forests, gradient boosting, and deep learning — including per-pixel uncertainty and interpretability. Use when the task is the ML modelling craft itself: which algorithm, how to tune it, how to get honest uncertainty, whether deep learning is worth it, why an ML model underperforms. Triggers: "random forest for soil", "QRF", "which ML model", "deep learning soil", "CNN / ANN soil carbon", "hyperparameters", "feature importance / SHAP", "prediction interval", "ML model gives bad R²"./rothc-temporal-modellingSet up, initialize, calibrate, validate, and interpret the RothC (Rothamsted Carbon) model — and CENTURY-family process models — for simulating soil organic carbon stock and its change over time. Use when modelling SOC dynamics under management or climate scenarios, initializing RothC pools (spin-up), calibrating decay constants, choosing carbon inputs, adapting RothC to a region/practice, or judging whether a RothC result is trustworthy. Triggers: "RothC", "CENTURY / CenW", "soil carbon model", "carbon pools DPM/RPM/BIO/HUM/IOM", "spin-up / initialize SOC pools", "calibrate RothC", "SOC under climate change", "carbon input estimation", "first-order decay"./soc-stock-mrvQuantify, report, and verify soil-organic-carbon stock and its change over time for carbon markets / MRV (Monitoring, Reporting, Verification) — computing SOC stock, estimating change and its uncertainty at the field/project support, and applying the uncertainty deduction that determines creditable tons. Use when a task involves soil carbon crediting, an MRV framework (VM0042, VT0014), SOC stock-change detectability, or reporting SOC with defensible uncertainty. Triggers: "SOC MRV", "soil carbon credits", "carbon farming verification", "SOC stock change", "uncertainty deduction", "how much SOC can we credit", "monitoring reporting verification soil carbon".Other plugins' skills for the same job