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 Climate Grant Administrative Evidence Assembler

Format
Code-aware
Lines
96
Sections
11
Linked challenge
Build a Climate Grant Administrative Evidence Assembler

Prompt source

Original prompt text with formatting preserved for inspection.

96 lines
11 sections
No variables
1 code block
## Build
Cross-reference municipal stormwater asset profiles against historical OpenFEMA disaster declarations to assemble structured grant application administrative histories. Synthesize organized administrative justification packages linking assets to past federal declaration cycles.

## User
Municipal resilience planners preparing climate adaptation grant submissions for stormwater infrastructure hardening.

## Workflow
1. Query historical OpenFEMA DisasterDeclarationsSummaries for target county administrative disaster counts.
2. Ingest municipal drainage asset inventories and map geographical coordinates to declared incident jurisdictions.
3. Synthesize structured administrative justification packages linking assets to past federal declaration cycles.
4. Generate verifiable grant evidence dossiers containing asset jurisdiction mapping and administrative references.

## Interface
Browser-based project configuration workbench with asset geo-table preview, FEMA disaster query builder, and grant dossier export panel.

## Data
Fetch OpenFEMA v2 DisasterDeclarationsSummaries endpoint using $filter on state and incidentType, or load bundled synthetic county disaster records.
Starter examples below are synthetic. They are not downloaded records.

## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Utilizes OpenFEMA API endpoint v2/DisasterDeclarationsSummaries with OData $filter syntax (state eq and incidentType eq) to retrieve disaster declarations.

## Tools
pydantic-ai, httpx, jinja2.
Pydantic AI enforces type-safe parsing and strict schema validation across heterogeneous municipal asset tables and OpenFEMA JSON responses.
Local small LLM or hosted general LLM API for synthesizing narrative adaptation administrative summaries.

## 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
- Constructs valid OpenFEMA API query URLs using ISO-8601 timestamps and OData filter parameters.
- Correctly maps asset locations to declared county disaster administrative incidents.
- Outputs structured JSON administrative evidence packages containing asset IDs and administrative declaration counts.
- Flags unverified asset jurisdictions or missing disaster declaration history for manual review.

## Starter Examples
```json
[
  {
    "input": {
      "county_fips": "12086",
      "state_code": "FL",
      "assets": [
        {
          "asset_id": "PUMP-STA-04",
          "name": "Bayfront Lift Station"
        }
      ],
      "declared_events": [
        {
          "disasterNumber": 4337,
          "incidentType": "Hurricane"
        },
        {
          "disasterNumber": 4673,
          "incidentType": "Hurricane"
        }
      ]
    },
    "expected_output": {
      "application_id": "GRANT-FL-12086-PUMP-STA-04",
      "administrative_declaration_count": 2,
      "primary_designation": "Hurricane",
      "evidence_package": {
        "record_type": "simplified synthetic app record",
        "asset_id": "PUMP-STA-04",
        "declared_disaster_references": [
          4337,
          4673
        ],
        "ready_for_submission": true
      }
    }
  },
  {
    "input": {
      "county_fips": "48001",
      "state_code": "TX",
      "assets": [
        {
          "asset_id": "CULV-R-12",
          "name": "Pine Creek Culvert"
        }
      ],
      "declared_events": []
    },
    "expected_output": {
      "application_id": "GRANT-TX-48001-CULV-R-12",
      "administrative_declaration_count": 0,
      "primary_designation": "UNKNOWN",
      "evidence_package": {
        "record_type": "simplified synthetic app record",
        "asset_id": "CULV-R-12",
        "declared_disaster_references": [],
        "ready_for_submission": false
      }
    }
  }
]
```

## Safety
Simulates grant application administrative packages for review only. Does not disburse public funds or create binding municipal 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.