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 Customs Valuation Exception and Consignee Clarification Assistant

Format
Code-aware
Lines
78
Sections
11
Linked challenge
Build a Cross-Border Customs Valuation Exception and Consignee Clarification Assistant

Prompt source

Original prompt text with formatting preserved for inspection.

78 lines
11 sections
No variables
1 code block
## Build
Detect declared customs valuation discrepancies between cross-border commercial invoices and freight rate baselines. Generate structured TradeTrust evidentiary packages and draft formal consignee clarification queries.

## User
Customs Compliance Broker

## Workflow
1. Extract declared CIF prices, incoterms, and currency conversion rates from normalized trade permits.
2. Compare declared values against historical benchmark price bands for identical HS codes.
3. Bundle anomalous valuation records into an OpenAttestation wrapped compliance dossier.
4. Draft a structured clarification notice to the consignee requesting proof of payment and contracts.

## Interface
A compliance analyst audit workbench showing price deviation percentiles, HS code benchmark comparisons, and notice generation tools.

## Data
Use open-attestation npm tools with synthetic customs declaration files containing deliberate valuation anomalies.
Starter examples below are synthetic. They are not downloaded records.

## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Apply OpenAttestation wrapDocuments and obfuscateDocument to protect sensitive counterparty pricing while preserving proofs.

## Tools
anthropic-claude, @govtechsg/open-attestation, pydantic.
Anthropic Claude delivers high-precision document comparison and clear regulatory correspondence drafting.
Hosted Claude API with system prompt enforcement for objective document analysis.

## 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
- Detects CIF declared values deviating more than 35% from historical HS code medians.
- Generates an OpenAttestation wrapped evidence record with cryptographic salt fields.
- Supports selective obfuscation of trade counterparty names before sharing audit files.
- Produces compliant consignee clarification letters requesting purchase contracts and wire receipts.

## Starter Examples
```json
[
  {
    "input": {
      "declaration_id": "DEC-SG-2025-401",
      "hs_code": "8471.30.10",
      "cargo_description": "Laptops and portable processors",
      "declared_cif_sgd": 120,
      "historical_median_cif_sgd": 850,
      "deviation_percent": -85.8,
      "consignee_entity": "Apex Electronics SG Pte Ltd"
    },
    "expected_output": {
      "risk_tier": "high_undervaluation_suspect",
      "oa_wrapped": true,
      "obfuscated_preview_available": true,
      "clarification_request": {
        "recipient": "Apex Electronics SG Pte Ltd",
        "subject": "Inquiry: Declared Value Discrepancy for HS 8471.30.10",
        "mandatory_documents": [
          "Original commercial sales contract",
          "Proof of overseas wire remittance",
          "Manufacturer price confirmation"
        ]
      }
    }
  },
  {
    "input": {
      "declaration_id": "DEC-SG-2025-402",
      "hs_code": "8471.30.10",
      "cargo_description": "Enterprise micro-servers",
      "declared_cif_sgd": 920,
      "historical_median_cif_sgd": 850,
      "deviation_percent": 8.2,
      "consignee_entity": "CloudTech Solutions Pte Ltd"
    },
    "expected_output": {
      "risk_tier": "nominal",
      "oa_wrapped": false,
      "obfuscated_preview_available": false,
      "clarification_request": null
    }
  }
]
```

## Safety
Prepares compliance clarification drafts; does not submit binding customs reassessments or impose administrative penalties.
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.