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 Port Corridor Congestion and Truck Slot Dispatcher

Format
Code-aware
Lines
66
Sections
11
Linked challenge
Build a Port Corridor Congestion and Truck Slot Dispatcher

Prompt source

Original prompt text with formatting preserved for inspection.

66 lines
11 sections
No variables
1 code block
## Build
Analyze Singapore port corridor traffic congestion and Expressway camera alerts. Rebalance heavy prime mover gate pickup slots to prevent terminal road gridlock.

## User
Container Fleet Dispatcher

## Workflow
1. Query real-time traffic incident endpoints from Singapore data.gov.sg.
2. Estimate transport travel times across primary port logistics corridors.
3. Identify impending gate slot misses caused by unexpected road congestion.
4. Formulate adjusted pickup appointment schedules and alert transport coordinators.

## Interface
Dispatch kanban board displaying live hauler route progress, corridor congestion heatmaps, and gate status.

## Data
Query Singapore Land Transport traffic incident feeds on data.gov.sg or use static historical fixtures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Singapore open data API](https://guide.data.gov.sg/developer-guide/api-overview)
Utilizes data.gov.sg real-time traffic camera and incident notification API endpoints.

## Tools
crewai, pydantic, fastapi.
CrewAI facilitates coordinated agent roles for corridor monitoring, slot management, and dispatch drafting.
Local fast model to synthesize driver dispatch instructions in plain concise English.

## 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
- Ingest Singapore Expressway camera and incident feeds from open APIs.
- Correlate port gate reservation slots with live traffic congestion indices along transit corridors.
- Synthesize dynamic hauler departure buffer schedules to avoid peak terminal queues.
- Generate real-time gate slot rescheduling recommendations for logistics dispatchers.

## Starter Examples
```json
[
  {
    "input": {
      "corridor": "West Coast Highway",
      "gate_slot": "14:30",
      "hauler_id": "TRUCK-441",
      "traffic_incident": true,
      "travel_time_min": 55
    },
    "expected_output": {
      "delay_estimate_min": 25,
      "recommended_action": "RESCHEDULE_SLOT",
      "reroute_corridor": "AYE via Pioneer Road",
      "revised_slot": "15:00"
    }
  },
  {
    "input": {
      "corridor": "AYE",
      "gate_slot": "10:00",
      "hauler_id": "TRUCK-442",
      "traffic_incident": false,
      "travel_time_min": 20
    },
    "expected_output": {
      "delay_estimate_min": 0,
      "recommended_action": "PROCEED_AS_PLANNED",
      "reroute_corridor": null,
      "revised_slot": "10:00"
    }
  }
]
```

## Safety
Advisory dispatch suggestions only; drivers and operators retain full control over vehicle routing.
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.