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 Booking and Segregation Auditor
Format
Code-aware
Lines
84
Sections
11
Linked challenge
Build a Cross-Border Dangerous Goods Booking and Segregation Auditor
Prompt source
Original prompt text with formatting preserved for inspection.
84 lines
11 sections
No variables
1 code block
## Build
Process chemical cargo declarations submitted via FormSG webhooks against Singapore warehouse storage rules. Audit UN class incompatibilities and output TradeTrust verified yard placement plans.
## User
Chemical Logistics Safety Officer
## Workflow
1. Receive chemical cargo intake declarations from FormSG webhook submissions.
2. Validate dangerous goods UN numbers, hazard classes, and packing groups against maritime segregation tables.
3. Detect storage proximity violations between incompatible chemicals in port-adjacent staging yards.
4. Issue a TradeTrust wrapped yard segregation clearance certificate for warehouse marshals.
## Interface
A chemical warehouse yard grid viewer highlighting hazardous containment zones, incompatible neighboring pallets, and attestation issuance triggers.
## Data
Simulate FormSG webhook payloads matching official SDK formats alongside synthetic chemical manifest tables.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Singapore government FormSG](https://raw.githubusercontent.com/opengovsg/FormSG/develop/README.md)
Process FormSG webhook schema structures to ingest dangerous goods declarations.
## Tools
pydantic-ai, @opengovsg/formsg-sdk, fastapi.
Pydantic AI enforces rigid typing on chemical classification codes and segregation distance rules.
Hosted reasoning LLM configured for strict JSON extraction and logic checking.
## 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
- Validates FormSG webhook signature headers using simulated test secrets.
- Flags incompatible chemical pairings placed within minimum segregation buffers.
- Exports yard placement manifests specifying zone IDs and fire suppression categories.
- Requires safety officer sign-off before issuing TradeTrust clearance proofs.
## Starter Examples
```json
[
{
"input": {
"submission_id": "FSG-9021",
"un_number": "UN1203",
"hazard_class": "3",
"packing_group": "II",
"cargo_description": "Motor Spirit / Flammable Liquid",
"target_zone": "ZONE-A",
"adjacent_cargo": [
{
"un_number": "UN1942",
"hazard_class": "5.1",
"distance_meters": 15
}
]
},
"expected_output": {
"compliance_status": "approved",
"segregation_conflict": false,
"minimum_required_distance_meters": 10,
"assigned_zone": "ZONE-A-FLAMMABLE",
"clearance_token": "CERT-DG-9021"
}
},
{
"input": {
"submission_id": "FSG-9022",
"un_number": "UN1789",
"hazard_class": "8",
"packing_group": "II",
"cargo_description": "Hydrochloric Acid",
"target_zone": "ZONE-B",
"adjacent_cargo": [
{
"un_number": "UN1824",
"hazard_class": "8-ALKALI",
"distance_meters": 2
}
]
},
"expected_output": {
"compliance_status": "rejected",
"segregation_conflict": true,
"minimum_required_distance_meters": 5,
"assigned_zone": null,
"clearance_token": null
}
}
]
```
## Safety
Assists storage planning and auditing; physical chemical movements require licensed human supervision.
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.