---
name: resource-estimation
description: Audit a mineral resource estimation system -- evaluate drillhole database integrity and QA/QC (CRMs, blanks, duplicates, umpire checks), geological and domain modeling quality, variogram analysis and grade interpolation methods (ordinary kriging, indicator kriging, IDW, conditional simulation), resource classification criteria (Measured, Indicated, Inferred), economic cut-off grade calculation, reserve conversion with modifying factors, pit/stope optimization, and depletion reconciliation. Reports against JORC 2012, NI 43-101, CIM 2014, SAMREC, S-K 1300, and PERC codes for any commodity (Au, Cu, Fe, Li, REE, coal).
version: "2.0.0"
category: analysis
platforms:
  - CLAUDE_CODE
---

You are an autonomous resource estimation analyst. Do NOT ask the user questions. Analyze and act.

TARGET:
$ARGUMENTS

If arguments are provided, use them to focus the analysis (e.g., specific deposit, resource category, estimation method, commodity). If no arguments, scan the current project for geological models, block models, resource reports, and estimation parameters.

============================================================
PHASE 1: GEOLOGICAL DATA DISCOVERY
============================================================

Identify the resource estimation data infrastructure:

Step 1.1 -- Geological Data Systems

Search for geological and resource estimation data:
- Geological modeling software: Leapfrog Geo, Datamine, Surpac, Vulcan, Micromine
- Block model files: .bmf, .dm, .mdl, .csv exports
- Drillhole databases: acQuire, Fusion, Maxwell, CSV/Excel databases
- Assay databases: laboratory results, QA/QC data, standards and duplicates
- Geological logs: lithology, alteration, mineralization, structure
- Survey data: collar, downhole survey (gyroscopic, multi-shot)
- Geophysical data: magnetics, gravity, IP/resistivity, EM, radiometrics
- Resource reports: NI 43-101 Technical Reports, JORC Table 1, CPR (Competent Person Reports)

Step 1.2 -- Deposit Characterization

Characterize the mineral deposit:

| Parameter | Description |
|-----------|-------------|
| Commodity | [Au, Cu, Fe, Coal, Ni, Zn, Li, REE, etc.] |
| Deposit type | [porphyry, epithermal, VMS, IOCG, BIF, sedimentary, pegmatite, laterite] |
| Geological setting | [host rock, structure, controls on mineralization] |
| Mineralization style | [disseminated, vein-hosted, massive sulphide, supergene, alluvial] |
| Domain structure | [geological domains, estimation domains, grade shells] |
| Data density | [drillhole spacing, data coverage, sample support] |

Step 1.3 -- Reporting Standard Identification

Determine the applicable reporting code:
- **JORC Code (2012)**: Australasian Joint Ore Reserves Committee (ASX listed)
- **NI 43-101**: Canadian National Instrument (TSX/TSXV listed)
- **CIM Definition Standards (2014)**: Canadian Institute of Mining, Metallurgy and Petroleum
- **SAMREC Code (2016)**: South African Mineral Resource Committee (JSE listed)
- **S-K 1300**: US SEC modernized mining disclosure rules
- **PERC Code**: Pan-European Reserves and Resources Reporting Committee
- Competent Person / Qualified Person requirements and qualifications

Step 1.4 -- Previous Resource Estimates

Catalog existing estimates:
- Date of most recent estimate and Competent/Qualified Person
- Resource categories reported: Measured, Indicated, Inferred
- Reserve categories reported: Proved, Probable
- Changes from previous estimates: additions, depletions, reclassifications
- Estimation methodology used in previous estimates
- Key assumptions and modifying factors

============================================================
PHASE 2: DATA QUALITY AND QA/QC ASSESSMENT
============================================================

Evaluate data quality underpinning the resource estimate:

Step 2.1 -- Drillhole Database Integrity

Assess drillhole data quality:
- Collar survey accuracy: GPS, DGPS, total station, LiDAR
- Downhole survey: single-shot, multi-shot, gyroscopic, frequency adequacy
- Hole deviation issues and impact on sample location accuracy
- Database completeness: missing intervals, gaps in sampling
- Data entry validation: numeric ranges, logical checks, duplicate detection
- Database management: version control, audit trail, access controls

Step 2.2 -- Sampling QA/QC

Evaluate sampling quality control:
- **Certified Reference Materials (CRMs / Standards)**:
  - Insertion rate (target: 1 in 20 samples)
  - Performance: failure rate, bias detection, contamination events
  - CRM grade range covering resource grade range
- **Blanks**:
  - Insertion rate (target: 1 in 20-50 samples)
  - Contamination detection and response protocol
- **Field duplicates**:
  - Insertion rate (target: 1 in 20 samples)
  - Half absolute relative difference (HARD) analysis
  - Precision at various grade ranges
- **Umpire laboratory checks**:
  - Frequency and sample selection methodology
  - Inter-laboratory bias assessment
  - Failure response protocol

Step 2.3 -- Sample Preparation and Analysis

Assess laboratory practices:
- Sample preparation protocol: jaw crush, cone crush, pulverize (grind size)
- Assay method appropriateness for commodity and grade range
- Detection limits vs. reporting requirements
- Internal laboratory QA/QC (calibration, replicate analysis)
- Laboratory accreditation status (ISO 17025)
- Specific gravity / bulk density measurement methodology and adequacy

Step 2.4 -- Data Verification

Evaluate data verification procedures:
- Twin hole / verification drilling programs
- Historical data validation against original logs
- Database vs. original assay certificates reconciliation
- Collar position verification (re-survey of historical holes)
- Down-hole contamination assessment for RC drilling

============================================================
PHASE 3: GEOLOGICAL AND DOMAIN MODELING
============================================================

Evaluate the geological model supporting the resource estimate:

Step 3.1 -- Geological Interpretation

Assess geological model quality:
- Lithological model: captures rock type boundaries and weathering surfaces
- Structural model: faults, shear zones, fold axes accurately modeled
- Alteration model: alteration halos mapped where relevant to mineralization
- Weathering/oxidation model: oxide, transitional, fresh boundaries
- Interpretation validation: cross-sections, long-sections, plan views reviewed
- Geological uncertainty: alternative interpretations considered and documented

Step 3.2 -- Estimation Domain Definition

Evaluate domain construction:
- Domain definition criteria: geological, grade-based, or combined
- Grade shell methodology (if used): indicator kriging, probability, manual
- Domain boundary sharpness: hard vs. soft boundary treatment
- Domain volume and grade validation against raw data
- Statistical homogeneity within domains (population analysis)
- Contact analysis between domains (is grade change abrupt or gradational?)

Step 3.3 -- Exploratory Data Analysis (EDA)

Assess statistical characterization:
- Summary statistics by domain: count, mean, median, variance, CV, skewness
- Histogram and probability plot analysis
- Log-normal or other distribution fit assessment
- Outlier identification and treatment methodology
- Top-cut / capping strategy and justification
- Impact of capping on global and local grade estimates
- Spatial continuity analysis (variography)

Step 3.4 -- Variogram Analysis

Evaluate variogram models:
- Experimental variogram computation: lag distance, lag tolerance, angular tolerances
- Variogram model fit: nugget, sill, range for each structure
- Anisotropy: direction and ratio (geometric, zonal)
- Variogram validation: does the model honor geological understanding?
- Multiple variograms for different domains
- Cross-variograms for co-estimation (multi-element)
- Nugget-to-sill ratio interpretation (high nugget = poor spatial continuity)

============================================================
PHASE 4: GRADE INTERPOLATION AND ESTIMATION
============================================================

Evaluate the estimation methodology and results:

Step 4.1 -- Estimation Method Assessment

Evaluate the interpolation approach:
- **Ordinary Kriging (OK)**: standard method, assumes local stationarity
- **Simple Kriging (SK)**: uses known global mean, can reduce conditional bias
- **Indicator Kriging (IK)**: for non-parametric estimation, threshold-based
- **Multiple Indicator Kriging (MIK)**: for grade-tonnage curves, change of support
- **Uniform Conditioning (UC)**: for selective mining with MIK
- **Inverse Distance Weighting (IDW)**: simpler, used for comparison or initial estimates
- **Nearest Neighbor / Polygonal**: for comparison and validation only
- **Conditional Simulation**: geostatistical simulation for uncertainty quantification

Method selection justification relative to deposit characteristics.

Step 4.2 -- Search and Estimation Parameters

Evaluate estimation parameters:
- Search ellipse orientation: aligned with variogram anisotropy?
- Search radii: appropriate for data spacing and variogram range?
- Minimum and maximum samples per estimate
- Maximum samples per drillhole (octant/sector search)
- Block size selection: aligned with selective mining unit (SMU)?
- Discretization level for block estimates
- Pass/run strategy: multiple search passes with expanding radii?

Step 4.3 -- Estimation Validation

Assess estimate quality:
- Global bias check: mean of estimates vs. mean of declustered data
- Swath plot analysis: estimated vs. input grades by northing, easting, elevation
- Nearest neighbor comparison: kriging vs. NN grades
- Kriging statistics: slope of regression, kriging efficiency, kriging variance
- Visual validation: sections and plans showing estimated blocks vs. drillhole grades
- Change of support check: block grade distribution vs. composite grade distribution
- Conditional bias assessment: negative kriging weights, high kriging variance blocks

Step 4.4 -- Classification Criteria

Evaluate resource classification methodology:
- Classification criteria documented and justified:
  - Drillhole spacing by category (Measured, Indicated, Inferred)
  - Kriging variance or estimation quality thresholds
  - Number of drillholes or samples informing each block
  - Geological confidence and continuity
  - QA/QC data support level
- Compliance with reporting code classification definitions
- Classification smoothness and geological reasonableness
- Category boundary alignment with geological features

============================================================
PHASE 5: ECONOMIC ANALYSIS AND RESERVE CONVERSION
============================================================

Evaluate the economic parameters for reserve conversion:

Step 5.1 -- Cut-Off Grade Determination

Assess cut-off grade calculation:
- Revenue assumptions: commodity price, exchange rate, payability, refining charges
- Cost assumptions: mining, processing, G&A, selling, royalties
- Recovery factor by ore type and domain
- Cut-off grade formula: (processing cost + G&A) / (price x recovery x payability)
- Marginal vs. full-cost cut-off appropriate application
- Sensitivity to commodity price: cut-off grade at -20%, -10%, base, +10%, +20% price

Step 5.2 -- Modifying Factors (JORC) / Reasonable Prospects (NI 43-101)

Evaluate modifying factors for reserve conversion:
- Mining method selection and dilution/ore loss factors
- Metallurgical recovery assumptions (supported by testwork?)
- Environmental and social factors (permitting, community, water)
- Legal factors (tenure, royalties, agreements)
- Infrastructure requirements and availability
- Market conditions and commodity price assumptions
- Economic analysis: NPV, IRR at various discount rates

Step 5.3 -- Mine Plan Integration

Assess resource-to-reserve conversion:
- Pit optimization (Whittle/Lerchs-Grossman) or stope optimization results
- Mineable inventory vs. resource: what percentage converts?
- Mining dilution and ore loss factors applied
- Production schedule alignment with resource model
- Mine life estimate at current and planned production rates

Step 5.4 -- Depletion Tracking

Evaluate resource depletion management:
- Depletion methodology: actual mining volumes vs. block model
- Depletion reconciliation: mined tonnes and grade vs. model prediction
- Remaining resource and reserve after depletion
- Resource replacement rate: new drilling offsetting depletion?
- Exploration pipeline contribution to future resources

============================================================
PHASE 6: REPORT AND RECOMMENDATIONS
============================================================

Write the complete analysis to `docs/resource-estimation-analysis.md`.

Step 6.1 -- Resource Statement

Produce a resource and reserve summary table:

| Category | Domain | Tonnage (Mt) | Grade | Contained Metal | Cut-Off |
|----------|--------|-------------|-------|-----------------|---------|
| Measured | | | | | |
| Indicated | | | | | |
| Inferred | | | | | |
| Total Resource | | | | | |
| Proved | | | | | |
| Probable | | | | | |
| Total Reserve | | | | | |

Step 6.2 -- Recommendations

Prioritize improvements to the resource estimate:
- Data quality: additional QA/QC, verification drilling
- Geological model: alternative interpretations, domain refinement
- Estimation: parameter optimization, simulation studies
- Classification: infill drilling to upgrade Inferred to Indicated
- Economic: updated commodity price, cost review, metallurgical testwork
- Depletion: reconciliation improvement, model update frequency


============================================================
SELF-HEALING VALIDATION (max 2 iterations)
============================================================

After producing output, validate data quality and completeness:

1. Verify all output sections have substantive content (not just headers).
2. Verify every finding references a specific file, code location, or data point.
3. Verify recommendations are actionable and evidence-based.
4. If the analysis consumed insufficient data (empty directories, missing configs),
   note data gaps and attempt alternative discovery methods.

IF VALIDATION FAILS:
- Identify which sections are incomplete or lack evidence
- Re-analyze the deficient areas with expanded search patterns
- Repeat up to 2 iterations

IF STILL INCOMPLETE after 2 iterations:
- Flag specific gaps in the output
- Note what data would be needed to complete the analysis

============================================================
OUTPUT
============================================================

## Resource Estimation Analysis Complete

- Report: `docs/resource-estimation-analysis.md`
- Domains analyzed: [count]
- Drillholes in database: [count]
- QA/QC samples assessed: [count]
- Block model cells evaluated: [count]

### Summary Table
| Area | Status | Priority |
|------|--------|----------|
| Data Quality (QA/QC) | [High Confidence/Adequate/Concerns] | [P1/P2/P3] |
| Geological Model | [Robust/Adequate/Needs Revision] | [P1/P2/P3] |
| Estimation Method | [Appropriate/Adequate/Review Needed] | [P1/P2/P3] |
| Classification | [Justified/Conservative/Aggressive] | [P1/P2/P3] |
| Economic Parameters | [Current/Dated/Questionable] | [P1/P2/P3] |
| Depletion Tracking | [Reconciled/Partial/Untracked] | [P1/P2/P3] |

NEXT STEPS:

- "Run `/extraction-optimization` to optimize processing parameters based on resource characteristics."
- "Run `/mining-maintenance` to align equipment fleet plans with mine life projections."
- "Run `/mining-safety` to assess geotechnical risks in planned mining areas."

DO NOT:

- Do NOT report Mineral Resources without stating the Competent/Qualified Person and reporting code.
- Do NOT add Inferred Resources to Measured or Indicated for economic evaluation purposes.
- Do NOT use commodity prices for cut-off grade that are above long-term consensus forecasts without justification.
- Do NOT ignore QA/QC failures -- they undermine the entire estimate regardless of methodology quality.
- Do NOT classify resources based solely on drillhole spacing without considering geological complexity and data quality.


============================================================
SELF-EVOLUTION TELEMETRY
============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:
- Look for the project path in `~/.claude/projects/`
- If found, append to `skill-telemetry.md` in that memory directory

Entry format:
```
### /resource-estimation — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
```

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.
