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 Wildfire Defensible Space STAC Asset Verifier

Format
Code-aware
Lines
134
Sections
11
Linked challenge
Build a Wildfire Defensible Space STAC Asset Verifier

Prompt source

Original prompt text with formatting preserved for inspection.

134 lines
11 sections
No variables
1 code block
## Build
Inspect commercial real estate parcels against high-resolution STAC Item metadata and visual assets. Identify vegetation encroachment within defensible perimeter zones to formulate property adaptation plans.

## User
Wildfire Hazard Specialist

## Workflow
1. Load facility boundary GeoJSON and buffer zones at 30 and 100 feet.
2. Query a STAC catalog endpoint for post-dry-season multispectral imagery items.
3. Extract asset URLs and compute vegetative fuel cover within buffer zones.
4. Assemble a defensible space compliance report with prioritized mitigation tasks.

## Interface
Web dashboard showing parcel aerial views overlaid with STAC bounding boxes and calculated buffer vegetation scores.

## Data
Query public Earth search STAC API (e.g., AWS Earth STAC) for Sentinel-2 or NAIP items, or load mock STAC Item JSON fixtures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[STAC specification](https://raw.githubusercontent.com/radiantearth/stac-spec/master/README.md)
Parses STAC Item specifications including properties, assets, and bbox geometry structures defined in the STAC core schema.

## Tools
pydantic-ai, shapely, rasterio.
Pydantic AI enforces type-safe parsing of STAC Item JSON structures and validates structured compliance outputs.
Fast hosted model or local Ollama instance capable of schema-constrained JSON extraction.

## 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
- Accurately constructs 30ft and 100ft buffer geometries around asset footprints.
- Filters STAC Items by bounding box intersection and acquisition date.
- Generates structured hazard ratings conforming to predefined fuel proximity categories.

## Starter Examples
```json
[
  {
    "input": {
      "_record_type": "simplified synthetic app record",
      "facility_id": "FAC-CA-889",
      "footprint": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              0,
              0
            ],
            [
              0,
              10
            ],
            [
              10,
              10
            ],
            [
              10,
              0
            ],
            [
              0,
              0
            ]
          ]
        ]
      },
      "stac_item": {
        "id": "NAIP-2022-CA-01",
        "type": "Feature",
        "bbox": [
          -1,
          -1,
          11,
          11
        ],
        "properties": {
          "datetime": "2022-08-15T00:00:00Z"
        },
        "assets": {
          "visual": {
            "href": "https://example.com/item.tif"
          }
        }
      },
      "canopy_cover_30ft": 0.45
    },
    "expected_output": {
      "facility_id": "FAC-CA-889",
      "defensible_space_compliant": false,
      "risk_tier": "HIGH_ENCROACHMENT",
      "recommended_action": "Clear canopy within 30ft zone"
    }
  },
  {
    "input": {
      "_record_type": "simplified synthetic app record",
      "facility_id": "FAC-CA-890",
      "footprint": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              0,
              0
            ],
            [
              0,
              10
            ],
            [
              10,
              10
            ],
            [
              10,
              0
            ],
            [
              0,
              0
            ]
          ]
        ]
      },
      "stac_item": null,
      "canopy_cover_30ft": 0.05
    },
    "expected_output": {
      "facility_id": "FAC-CA-890",
      "defensible_space_compliant": true,
      "risk_tier": "DATA_DEFICIENT_LOW_CANOPY",
      "recommended_action": "Verify imagery availability"
    }
  }
]
```

## Safety
Outputs are non-binding adaptation guidelines; users must verify physical clearance with local municipal fire marshals.
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.