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 Cross-Border Dangerous Goods Webhook Intake and Segregation Planner

Format
Code-aware
Lines
74
Sections
11
Linked challenge
Build a Cross-Border Dangerous Goods Webhook Intake and Segregation Planner

Prompt source

Original prompt text with formatting preserved for inspection.

74 lines
11 sections
No variables
1 code block
## Build
Process chemical import declarations submitted through FormSG webhooks against Singapore port warehouse segregation guidelines. Formulate compliant warehouse yard staging slots and generate verifiable intake receipts.

## User
Logistics hub safety compliance manager

## Workflow
1. Ingest encrypted or standard FormSG webhook submissions containing chemical cargo manifests.
2. Validate UN dangerous goods class declarations against warehouse physical compatibility limits.
3. Synthesize safe yard staging slot allocations ensuring mandatory physical buffer distances.
4. Wrap the approved staging plan into an OpenAttestation verifiable certificate of inspection.

## Interface
Multi-column warehouse zoning table displaying pending intake webhooks, yard occupancy heatmaps, and approval controls.

## Data
Use mock FormSG submission JSON payloads representing chemical safety declarations for import via Singapore checkpoints.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Singapore government FormSG](https://raw.githubusercontent.com/opengovsg/FormSG/develop/README.md)
Adopts the FormSG webhook payload architecture and field schema to ingest trade declarations submitted by SME freight forwarders.

## Tools
agno, @opengovsg/formsg-sdk, @govtechsg/open-attestation.
Agno provides lightweight agent workflows to coordinate payload extraction, regulatory checks, and staging plan generation.
Local or hosted LLM with strong tabular comprehension and rule-based constraint matching.

## 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
- Parses FormSG format webhook payloads containing chemical UN numbers and classes.
- Flags incompatible Class 3 (flammable liquids) and Class 5.1 (oxidizers) stored in adjacent staging zones.
- Generates an OpenAttestation document certifying safety segregation before container yard gate-in.

## Starter Examples
```json
[
  {
    "input": {
      "form_id": "formsg_chemical_intake_001",
      "submission_timestamp": "2025-04-12T10:00:00Z",
      "carrier_uen": "201509876C",
      "un_number": "UN1203",
      "hazard_class": "3",
      "container_count": 2,
      "target_zone": "YARD_ZONE_NORTH"
    },
    "expected_output": {
      "status": "APPROVED_WITH_CONDITIONS",
      "assigned_slot": "NZ-BAY-04",
      "buffer_required_meters": 15,
      "incompatible_classes": [
        "5.1",
        "2.3"
      ],
      "attestation_ready": true
    }
  },
  {
    "input": {
      "form_id": "formsg_chemical_intake_002",
      "submission_timestamp": "2025-04-12T10:05:00Z",
      "carrier_uen": "201509876C",
      "un_number": "UNKNOWN",
      "hazard_class": "99",
      "container_count": 1,
      "target_zone": "YARD_ZONE_NORTH"
    },
    "expected_output": {
      "status": "REJECTED_INVALID_HAZARD_CLASS",
      "assigned_slot": null,
      "buffer_required_meters": 0,
      "incompatible_classes": [],
      "attestation_ready": false
    }
  }
]
```

## Safety
Simulates yard slot allocations without updating real-world physical terminal gate access barriers.
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.