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 Coastal Flood Defense Maintenance Grant Reconciler

Format
Code-aware
Lines
69
Sections
11
Linked challenge
Build a Coastal Flood Defense Maintenance Grant Reconciler

Prompt source

Original prompt text with formatting preserved for inspection.

69 lines
11 sections
No variables
1 code block
## Build
Cross-reference municipal stormwater asset maintenance histories against OpenFEMA disaster declarations. Synthesize administrative compliance schedules and contractor audit tickets to satisfy federal grant reporting requirements and funding declaration cycles.

## User
Public Works Compliance Manager

## Workflow
1. Ingest municipal drainage asset maintenance histories and funding source tags.
2. Retrieve historical disaster frequency logs from OpenFEMA v2 DisasterDeclarationsSummaries.
3. Score assets by administrative compliance requirements linked to FEMA funding declaration cycles.
4. Generate prioritized audit work orders and administrative reporting rosters.

## Interface
Municipal compliance console displaying asset grant status, historical FEMA declarations, and ready-to-print audit tickets.

## Data
Query OpenFEMA API endpoint v2/DisasterDeclarationsSummaries filtering by coastal county FIPS codes, with cached JSON responses.
Starter examples below are synthetic. They are not downloaded records.

## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Applies OpenFEMA API query strings ($filter, $select, and $orderby) to extract administrative disaster declaration events.

## Tools
crewai, requests, pydantic.
Coordinates distinct agents specializing in API data extraction, compliance rules mapping, and audit ticket formatting.
Local or cloud LLM with strong instruction adherence for administrative logic and JSON ticket formatting.

## 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
- Correlates drainage asset locations with regional historical flood declarations from OpenFEMA.
- Calculates compliance priority scores based on funding cycles and previous audit intervals.
- Produces actionable audit work orders specifying reporting requirements and documentation checks.

## Starter Examples
```json
[
  {
    "input": {
      "asset_id": "VALVE-TIDAL-08",
      "type": "duckbill_tide_gate",
      "fips": "12086",
      "last_audit_months": 18,
      "fema_declaration_count_5yr": 4
    },
    "expected_output": {
      "asset_id": "VALVE-TIDAL-08",
      "priority_level": "urgent",
      "audit_ticket": {
        "task": "administrative_grant_compliance_audit",
        "recommended_completion_days": 14,
        "assigned_crew": "compliance_ops"
      },
      "justification": "Asset falls under 4 FEMA declarations requiring annual compliance auditing."
    }
  },
  {
    "input": {
      "asset_id": "VALVE-TIDAL-15",
      "type": "flap_gate",
      "fips": "12086",
      "last_audit_months": 4,
      "fema_declaration_count_5yr": 1
    },
    "expected_output": {
      "asset_id": "VALVE-TIDAL-15",
      "priority_level": "routine",
      "audit_ticket": null,
      "justification": "Audit within acceptable operational window and low reporting requirement."
    }
  }
]
```

## Safety
Audit work orders represent municipal compliance drafts; final reporting submissions require departmental legal sign-off. Examples are simplified synthetic app records.
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.