Assess temperature excursion risk for cold chain transport routes. Evaluates packaging type, transit duration, and route conditions to produce a structured JSON risk score and mitigation recommendations.
bash
python -m py_compile scripts/main.py
python scripts/main.py --help
Fallback template: If scripts/main.py fails or required inputs are absent, report: (a) which parameter is missing, (b) what partial assessment is still possible, (c) the manual risk-scoring approach.
ParameterTypeRequiredDescription--route, -rstringYesTransport route description (e.g., "NYC-Boston")--duration, -dintYesTransport duration in hours (must be > 0)--packaging, -pstringNoPackaging type: dry-ice, liquid-nitrogen, gel-packs (default: dry-ice)--output, -ostringNoOutput JSON file path (default: stdout)
text
python scripts/main.py --route "NYC-Boston" --duration 48 --packaging dry-ice
python scripts/main.py --route "LAX-London" --duration 120 --packaging liquid-nitrogen --output risk_report.json
The script outputs a structured JSON object:
json
{
"route": "NYC-Boston",
"duration_hours": 48,
"packaging": "dry-ice",
"risk_score": 19.2,
"risk_level": "Medium",
"mitigation_recommendations": [
"Add temperature logger to shipment",
"Pre-condition dry ice 2h before packing",
"Notify recipient of expected arrival window"
]
}
The mitigation_recommendations field is always present and contains at least one actionable item. Recommendations are generated based on risk level and packaging type.
Risk score = duration_hours × 0.5 × packaging_factor
PackagingFactorNotesdry-ice0.8Standard for -70°C samplesliquid-nitrogen0.6Best for cryogenic samplesgel-packs1.2Suitable for 2–8°C only
Risk levels: Low (< 15), Medium (15–30), High (> 30)
Model limitations: The formula does not account for route complexity, number of transit legs, or ambient temperature variability. A 120-hour international flight may score lower than a 48-hour domestic route due to packaging factor alone. Document these assumptions in every response.
Every response must make these explicit:
This skill accepts: cold chain transport scenarios defined by a route, duration, and optional packaging type.
If the request does not involve temperature-controlled shipping risk — for example, asking to track a shipment in real time, calculate drug dosing, or assess non-temperature logistics — do not proceed. Instead respond:
"
cold-chain-risk-calculatoris designed to assess temperature excursion risk for cold chain transport. Your request appears to be outside this scope. Please provide a route, duration, and packaging type, or use a more appropriate tool for your task."
--duration is ≤ 0, print Error: --duration must be a positive integer (hours). to stderr and exit with code 1.--packaging is not one of dry-ice, liquid-nitrogen, gel-packs, reject with a clear error listing valid options.scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.