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 a Drought Crop Parametric Trigger Validator

Format
Code-aware
Lines
69
Sections
11
Linked challenge
Build a Drought Crop Parametric Trigger Validator

Prompt source

Original prompt text with formatting preserved for inspection.

69 lines
11 sections
No variables
1 code block
## Build
Validate agricultural drought parametric contracts by processing ERA5 reanalysis precipitation datasets. Verify threshold breaches against regional historical disaster declaration logs.

## User
Agricultural Microinsurance Designer

## Workflow
1. Formulate precipitation deficit parametric rules for regional crop growing periods.
2. Retrieve ERA5 accumulated precipitation time series via the Copernicus CDS API.
3. Correlate dry spells with OpenFEMA drought disaster declarations in target zones.
4. Generate a parametric trigger validation report with confidence metrics.

## Interface
Interactive parameter simulator notebook with exportable PDF evaluation manifests.

## Data
Download sample precipitation data via `cdsapi` client or use local mock ERA5 monthly averages.
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)
Employs CDS API retrieve methods to fetch ERA5 reanalysis single levels for total precipitation.

## Tools
optuna, cdsapi, pandas, scipy.
Optuna optimizes parametric threshold levels to balance basis risk and trigger sensitivity across historical dry seasons.
Local statistical Python runtime; optional LLM for narrative summary generation.

## 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
- Correctly ingests daily precipitation records from ERA5 schemas.
- Identifies rolling drought windows falling below critical millimeter thresholds.
- Produces basis risk comparison scores against historical loss benchmarks.

## Starter Examples
```json
[
  {
    "input": {
      "zone": "Midwest-Zone-A",
      "monthly_precip_mm": [
        12,
        8.5,
        14.2
      ],
      "trigger_threshold_mm": 20
    },
    "expected_output": {
      "zone": "Midwest-Zone-A",
      "trigger_met": true,
      "cumulative_deficit_mm": 25.3,
      "audit_status": "TRIGGER_CONFIRMED"
    }
  },
  {
    "input": {
      "zone": "Midwest-Zone-B",
      "monthly_precip_mm": [
        35,
        42.1,
        28
      ],
      "trigger_threshold_mm": 20
    },
    "expected_output": {
      "zone": "Midwest-Zone-B",
      "trigger_met": false,
      "cumulative_deficit_mm": 0,
      "audit_status": "NO_TRIGGER"
    }
  }
]
```

## Safety
Simulates parametric triggers for policy structuring; issues no live payouts or binding coverage commitments.
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.