Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build an Agricultural Frost Index Parametric Trigger Analyzer

Format
Code-aware
Lines
71
Sections
11
Linked challenge
Build an Agricultural Frost Index Parametric Trigger Analyzer

Prompt source

Original prompt text with formatting preserved for inspection.

71 lines
11 sections
No variables
1 code block
## Build
Simulate parametric freeze protection contracts for citrus and deciduous orchards using ERA5 2m temperature fields. Quantify hours below sub-zero thresholds during sensitive bloom windows to model basis risk.

## User
Agricultural Risk Consultant

## Workflow
1. Ingest orchard parcel coordinates, bloom calendar dates, and critical temperature limits.
2. Download ERA5 hourly 2-meter temperature reanalysis grids via cdsapi.
3. Calculate cumulative chilling hours below trigger thresholds during bloom.
4. Estimate simulated payout frequency and basis risk against synthetic crop logs.

## Interface
Terminal dashboard outputting seasonal temperature time series and threshold breach counts.

## Data
Execute cdsapi test query for 2m temperature or parse local NetCDF test grids over agricultural counties.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Copernicus Climate Data Store client](https://raw.githubusercontent.com/ecmwf/cdsapi/master/README.rst)
Queries Copernicus CDS API reanalysis-era5-single-levels for 2m_temperature time series as documented in cdsapi examples.

## Tools
mlflow, cdsapi, numpy.
MLflow tracks simulation parameter runs, trigger variations, and metric outputs across historical weather regimes.
Local or hosted LLM to produce explanatory commentary on basis risk anomalies across varied elevation gradients.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Converts Kelvin temperatures to Celsius accurately.
- Accumulates continuous hours where 2m temperature falls below designated freezing threshold.
- Generates trigger metrics without executing financial payments.

## Starter Examples
```json
[
  {
    "input": {
      "orchard_id": "ORCH-WA-09",
      "critical_temp_c": -2.2,
      "temperature_kelvin_series": [
        272.15,
        270.15,
        269.65,
        271.15,
        274.15
      ]
    },
    "expected_output": {
      "orchard_id": "ORCH-WA-09",
      "frost_hours_recorded": 3,
      "min_temperature_c": -3.5,
      "trigger_activated": true
    }
  },
  {
    "input": {
      "orchard_id": "ORCH-WA-10",
      "critical_temp_c": -3,
      "temperature_kelvin_series": [
        275.15,
        274.65,
        273.15
      ]
    },
    "expected_output": {
      "orchard_id": "ORCH-WA-10",
      "frost_hours_recorded": 0,
      "min_temperature_c": 0,
      "trigger_activated": false
    }
  }
]
```

## Safety
Strictly simulates trigger mechanisms; does not authorize payouts or replace formal agricultural loss adjusters.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.