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 Phytosanitary and Wood Packaging Evidence Synthesizer
Format
Code-aware
Lines
82
Sections
11
Linked challenge
Build a Phytosanitary and Wood Packaging Evidence Synthesizer
Prompt source
Original prompt text with formatting preserved for inspection.
82 lines
11 sections
No variables
1 code block
## Build
Evaluate wood packaging and phytosanitary inspection holds at Singapore checkpoint terminals. Assemble verifiable TradeTrust wrapped evidence packages and draft urgent consignee fumigation notices.
## User
Cross-Border Logistics Exception Manager
## Workflow
1. Parse customs inspection discrepancy logs and wood packaging fumigation flags from terminal gate exception timestamps.
2. Correlate phytosanitary incident logs with bill of lading consignee records and regional agricultural import limits.
3. Wrap incident photos and inspection receipts into a verifiable OpenAttestation document envelope.
4. Draft clear plain-language consignee exception notices with estimated fumigation delay and actionable next steps.
## Interface
An incident triage queue displaying affected container IDs, attached inspection reports, cryptographic wrapping controls, and notice dispatch drafts.
## Data
Use open-attestation npm schema libraries with JSON data. Note: The provided examples are simplified synthetic app records, not complete official schema files.
Starter examples below are synthetic. They are not downloaded records.
## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Use OpenAttestation wrapDocuments and validateSchema routines to generate verifiable evidence batches for phytosanitary holds.
## Tools
langgraph, @govtechsg/open-attestation, pydantic.
LangGraph manages stateful branch execution between document wrapping, schema validation, and consignee communication drafting.
Hosted reasoning model capable of generating structured notifications and JSON state updates.
## 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
- Wraps phytosanitary exception incident data into a valid OpenAttestation v2 schema payload.
- Computes verifiable targetHash and merkleRoot over attached inspection survey files.
- Drafts consignee notices detailing exact hold reasons and estimated fumigation delay hours.
- Requires explicit officer review before final customer communication dispatch.
## Starter Examples
```json
[
{
"input": {
"exception_id": "EX-2025-881",
"container_number": "TGHU4819201",
"bill_of_lading": "BL-SG-MY-9901",
"consignee_email": "ops@sgimporter.com",
"checkpoint": "Tuas Checkpoint",
"incident_type": "phytosanitary_hold",
"inspection_summary": "Untreated wood pallets detected; ISPM 15 stamp missing",
"estimated_delay_hours": 48
},
"expected_output": {
"status": "ready_for_notice_dispatch",
"oa_wrapped": true,
"merkle_root": "0x4f128bcde9017234567890abcdef1234567890abcdef1234567890abcdef1234",
"notice_draft": {
"recipient": "ops@sgimporter.com",
"subject": "Shipment Exception Notice: Container TGHU4819201 Phytosanitary Hold",
"delay_estimate": "48 hours",
"summary": "Your shipment was subject to mandatory phytosanitary inspection at Tuas Checkpoint due to missing ISPM 15 stamps. Fumigation required."
}
}
},
{
"input": {
"exception_id": "EX-2025-882",
"container_number": "WHLU3301928",
"bill_of_lading": "BL-SG-ID-4412",
"consignee_email": "claims@batamtransit.com",
"checkpoint": "Jurong Island Terminal",
"incident_type": "pest_detection",
"inspection_summary": "Live agricultural pests identified in dunnage material",
"estimated_delay_hours": 72
},
"expected_output": {
"status": "ready_for_notice_dispatch",
"oa_wrapped": true,
"merkle_root": "0x9a87bc1245def34567890abcdef1234567890abcdef1234567890abcdef1234",
"notice_draft": {
"recipient": "claims@batamtransit.com",
"subject": "Urgent Shipment Exception: Container WHLU3301928 Pest Detection",
"delay_estimate": "72 hours",
"summary": "Live agricultural pests recorded in container dunnage at Jurong Island Terminal. Verified evidence dossier attached."
}
}
}
]
```
## Safety
Cryptographically wraps evidence and prepares customer drafts; does not transmit unverified claims or alter customs declarations.
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.