| name | anomaly-detection |
| description | Use when the user asks about fraud detection, three-way matching anomalies, duplicate invoices, unusual payment patterns, or supplier concentration risk |
Anomaly Detection Skill
How to Run Detection (CRITICAL)
Call the Python detection modules instead of raw mcporter CLI:
python3 -m anomaly_detection.lib.detect three-way --po-id "PO-2026-001"
python3 -m anomaly_detection.lib.detect duplicate-invoices --supplier-id "S001"
python3 -m anomaly_detection.lib.detect unusual-payments --days 90
python3 -m anomaly_detection.lib.detect supplier-concentration --category "IT"
Detection Patterns
Pattern definitions and thresholds are in lib/patterns.py.
Implementation is in lib/detect.py.
Three-Way Matching (PO vs Receipt vs Invoice)
- Tolerance: Invoice > PO x 1.10 -> WARNING
- Alert: Invoice > PO x 1.30 -> ALERT
Duplicate Invoice Detection
- Flag: groups with count > 1
Unusual Payment Patterns
- Warning: payment > 2x historical average
- Alert: payment > 3x historical average
Supplier Concentration Risk
- Warning: supplier > 60% of category spend
- Alert: supplier > 80% of category spend
Execution Flow
- Identify which detection pattern matches the question
- Call the corresponding Python module
- Review returned anomalies (already deduplicated by AnomalyTracker)
- Present findings with severity levels
- Audit log is written by the detection module
CRITICAL
- Thresholds are in
lib/patterns.py -- do not hardcode in prompts
- Never state "fraud detected" -- only flag anomalies for human review
- Always show the specific data that triggered each flag