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 Disaster Declaration County Portfolio Tracker
Format
Code-aware
Lines
67
Sections
11
Linked challenge
Build a Disaster Declaration County Portfolio Tracker
Prompt source
Original prompt text with formatting preserved for inspection.
67 lines
11 sections
No variables
1 code block
## Build
Cross-reference municipal commercial building inventories against historical OpenFEMA disaster declarations to track portfolio inclusion in county-level disaster events. Generate administrative asset dossiers highlighting declared hazard history.
## User
Municipal Climate Resilience Officer
## Workflow
1. Fetch county disaster history using OpenFEMA DisasterDeclarationsSummaries endpoint filters.
2. Ingest municipal commercial asset locations and map to corresponding county administrative boundaries.
3. Tally historical county-level flood declarations during the lifespan of each asset.
4. Synthesize structured portfolio inclusion profiles and export administrative review dossiers.
## Interface
CLI tool that ingests asset CSVs and outputs a Markdown administrative dossier.
## Data
Download public DisasterDeclarationsSummaries from OpenFEMA API endpoint `https://www.fema.gov/api/open/v2/DisasterDeclarationsSummaries` with `$filter=state eq 'VA'` and local synthetic municipal asset county mappings.
Starter examples below are synthetic. They are not downloaded records.
## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Queries the OpenFEMA API endpoint v2/DisasterDeclarationsSummaries using `$filter` with state and incidentType parameters.
## Tools
pydantic-ai, requests, pandas.
Pydantic AI enforces type-safe parsing of FEMA records and structured administrative portfolio exports.
Fast hosted model or local small model with reliable structured JSON output support.
## 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
- Filters OpenFEMA records for matching state, county, and disaster type correctly.
- Calculates county declaration inclusion count strictly from matched historical records.
- Outputs valid structured JSON containing asset identifier and county declaration tally.
## Starter Examples
```json
[
{
"input": {
"county": "Fairfax (County)",
"state": "VA",
"asset_id": "COMM-001",
"fema_records": [
{
"disasterNumber": 4042,
"incidentType": "Flood",
"designatedArea": "Fairfax (County)"
}
]
},
"expected_output": {
"asset_id": "COMM-001",
"county_exposure_count": 1,
"record_type": "simplified synthetic app record"
}
},
{
"input": {
"county": "UnknownCounty",
"state": "VA",
"asset_id": "COMM-002",
"fema_records": []
},
"expected_output": {
"asset_id": "COMM-002",
"county_exposure_count": 0,
"record_type": "simplified synthetic app record"
}
}
]
```
## Safety
Simulates administrative hazard inclusion scores; produces no real property underwriting or legally binding coverage assessments.
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.