Checkpoint from Receipt Skill
Purpose
Automatically create checkpoints from receipt photos using QR scanning, e-Kasa API, and GPS extraction.
When to Activate
- User pastes image (auto-detect)
- Keywords: "refuel", "fill up", "got gas", "checkpoint", "receipt"
- File extensions: .jpg, .png, .pdf
Instructions
Workflow: 3-Stage Orchestration
QR scan (2-5s) → e-Kasa API (5-30s) → GPS extraction (2-5s) → Checkpoint creation → Gap detection
Total time: 10-40 seconds typically
Stage 1: QR Code Scanning
- When image pasted: "📷 Receipt detected. Scanning QR code..."
- Call:
ekasa-api.scan_qr_code (multi-scale: 1x, 2x, 3x)
- Progress:
- "Trying 1x scale..."
- "Trying 2x scale... Found!"
- Extract: receipt_id (e.g., "O-123456789ABC")
If QR not found:
- "QR code not detected. Try better lighting or different angle."
- Fallback: "What's the e-Kasa receipt ID? (starts with O-)"
Stage 2: e-Kasa API (SLOW - Show Progress!)
- Start: "🔄 Fetching from e-Kasa API... (may take up to 60s)"
- Call:
ekasa-api.fetch_receipt_data
- Progress updates:
- 15s: "Still fetching... (15s elapsed)"
- 30s: "Almost there... (30s elapsed)"
- 45s: "Taking longer than usual... (45s elapsed)"
If timeout (60s):
- "⏱️ e-Kasa timed out. Options:"
- "1) Retry"
- "2) Manual entry (fuel type, liters, price)"
If success:
- Parse fuel items using Slovak patterns:
- "Diesel", "Nafta", "Motorová nafta"
- "Natural 95", "BA 95", "Benzín 95"
- "Natural 98", "BA 98", "Benzín 98"
- "LPG", "Autoplyn"
- Show: "✅ 52.3L Diesel @ €1.45/L = €75.84"
If multiple fuel items:
- List all items
- Ask: "Which fuel was for your vehicle?"
Stage 3: Dashboard Photo GPS
- Ask: "📸 Now paste dashboard photo for GPS location"
- Call:
dashboard-ocr.extract_metadata
- Extract:
- GPS coordinates (latitude, longitude) from EXIF
- Timestamp from EXIF
- Odometer reading (OCR with confidence > 80%)
If GPS found:
- "📍 Location: 48.1486, 17.1077 (Bratislava)"
- Optional: Reverse geocode to show address
If no GPS:
- "📍 No GPS data found. Options:"
- "1) Enable location services and retake photo"
- "2) Enter GPS coordinates manually"
- "3) Enter address (I'll geocode it)"
If OCR odometer found:
- "📊 Detected odometer: 125,340 km (confidence: 92%)"
- "Is this correct? (yes/no)"
If OCR fails or low confidence:
- "What's the current odometer reading in kilometers?"
Stage 4: Create Checkpoint & Detect Gap
Combine data:
- Receipt: fuel_type, fuel_liters, price, vendor, receipt_id
- GPS: latitude, longitude, address (optional)
- Datetime: from receipt or dashboard photo
- Odometer: from OCR or user input
Slovak compliance check:
- Ask for driver name if missing
- Separate refuel timing from trip timing
- Note: Refuel location may differ from trip start/end
Call: car-log-core.create_checkpoint
Success: "✅ Checkpoint created at 125,340 km!"
Auto-detect gap:
- Call:
car-log-core.detect_gap
- If gap > 100km: "⚠️ Gap detected: 820 km over 7 days. Reconstruct trips?"
- If gap detected → Auto-trigger trip-reconstruction skill
Timing Breakdown
- QR scan: 2-5 seconds
- e-Kasa API: 5-30 seconds (show progress!)
- GPS extraction: 1-2 seconds
- Checkpoint creation: 1 second
- Gap detection: 1 second
- Total: 10-40 seconds typically
Error Handling
QR Scan Failed
- Try multi-scale (1x, 2x, 3x)
- If all fail: Manual receipt ID entry
e-Kasa Timeout
- Show elapsed time
- Offer retry or manual entry
- Cache successful responses
No GPS
- Fallback to address geocoding
- Manual GPS entry
- Continue without location (warn about compliance)
Multiple Fuel Items
- List all items with prices
- Ask user to select correct one
Ambiguous Geocoding
- Show alternatives with confidence
- Ask user to select correct location
Slovak Compliance
Critical Requirements
- Driver name: Mandatory for tax deduction
- Refuel timing: Separate from trip start/end timing
- Location: Refuel station may differ from trip origin/destination
- L/100km format: Always use European standard
Data Storage
- Store
refuel_datetime separately from trip timing
- Store
refuel_location separately from trip endpoints
- Link checkpoint to trips via gap detection
Related Skills
Auto-triggers
- trip-reconstruction: If gap > 100km detected
- data-validation: Automatic validation after checkpoint creation
Links to
- vehicle-setup: If no vehicle registered
- report-generation: After sufficient checkpoints collected
For detailed examples: See GUIDE.md
For MCP tools: See REFERENCE.md
For timeout troubleshooting: See ../TROUBLESHOOTING.md
1---2name: checkpoint-from-receipt3description: Create checkpoints from receipt photos using QR scanning, e-Kasa API, and GPS extraction (10-40s)4---5
6# Checkpoint from Receipt Skill
7
8## Purpose
9Automatically create checkpoints from receipt photos using QR scanning, e-Kasa API, and GPS extraction.
10
11## When to Activate
12- User pastes image (auto-detect)
13- Keywords: "refuel", "fill up", "got gas", "checkpoint", "receipt"
14- File extensions: .jpg, .png, .pdf
15
16## Instructions
17
18### Workflow: 3-Stage Orchestration
19```
20QR scan (2-5s) → e-Kasa API (5-30s) → GPS extraction (2-5s) → Checkpoint creation → Gap detection
21```
22
23**Total time:** 10-40 seconds typically
24
25---
26
27### Stage 1: QR Code Scanning
28
291. **When image pasted:** "📷 Receipt detected. Scanning QR code..."
302. **Call:** `ekasa-api.scan_qr_code` (multi-scale: 1x, 2x, 3x)
313. **Progress:**
32 - "Trying 1x scale..."
33 - "Trying 2x scale... Found!"
344. **Extract:** receipt_id (e.g., "O-123456789ABC")
35
36**If QR not found:**
37- "QR code not detected. Try better lighting or different angle."
38- Fallback: "What's the e-Kasa receipt ID? (starts with O-)"
39
40---
41
42### Stage 2: e-Kasa API (SLOW - Show Progress!)
43
441. **Start:** "🔄 Fetching from e-Kasa API... (may take up to 60s)"
452. **Call:** `ekasa-api.fetch_receipt_data`
463. **Progress updates:**
47 - 15s: "Still fetching... (15s elapsed)"
48 - 30s: "Almost there... (30s elapsed)"
49 - 45s: "Taking longer than usual... (45s elapsed)"
50
51**If timeout (60s):**
52- "⏱️ e-Kasa timed out. Options:"
53- "1) Retry"
54- "2) Manual entry (fuel type, liters, price)"
55
56**If success:**
57- Parse fuel items using Slovak patterns:
58 - "Diesel", "Nafta", "Motorová nafta"
59 - "Natural 95", "BA 95", "Benzín 95"
60 - "Natural 98", "BA 98", "Benzín 98"
61 - "LPG", "Autoplyn"
62- **Show:** "✅ 52.3L Diesel @ €1.45/L = €75.84"
63
64**If multiple fuel items:**
65- List all items
66- Ask: "Which fuel was for your vehicle?"
67
68---
69
70### Stage 3: Dashboard Photo GPS
71
721. **Ask:** "📸 Now paste dashboard photo for GPS location"
732. **Call:** `dashboard-ocr.extract_metadata`
743. **Extract:**
75 - GPS coordinates (latitude, longitude) from EXIF
76 - Timestamp from EXIF
77 - Odometer reading (OCR with confidence > 80%)
78
79**If GPS found:**
80- "📍 Location: 48.1486, 17.1077 (Bratislava)"
81- Optional: Reverse geocode to show address
82
83**If no GPS:**
84- "📍 No GPS data found. Options:"
85- "1) Enable location services and retake photo"
86- "2) Enter GPS coordinates manually"
87- "3) Enter address (I'll geocode it)"
88
89**If OCR odometer found:**
90- "📊 Detected odometer: 125,340 km (confidence: 92%)"
91- "Is this correct? (yes/no)"
92
93**If OCR fails or low confidence:**
94- "What's the current odometer reading in kilometers?"
95
96---
97
98### Stage 4: Create Checkpoint & Detect Gap
99
1001. **Combine data:**
101 - Receipt: fuel_type, fuel_liters, price, vendor, receipt_id
102 - GPS: latitude, longitude, address (optional)
103 - Datetime: from receipt or dashboard photo
104 - Odometer: from OCR or user input
105
1062. **Slovak compliance check:**
107 - Ask for driver name if missing
108 - Separate refuel timing from trip timing
109 - Note: Refuel location may differ from trip start/end
110
1113. **Call:** `car-log-core.create_checkpoint`
1124. **Success:** "✅ Checkpoint created at 125,340 km!"
113
1145. **Auto-detect gap:**
115 - Call: `car-log-core.detect_gap`
116 - If gap > 100km: "⚠️ Gap detected: 820 km over 7 days. Reconstruct trips?"
117 - If gap detected → Auto-trigger trip-reconstruction skill
118
119---
120
121## Timing Breakdown
122- **QR scan:** 2-5 seconds
123- **e-Kasa API:** 5-30 seconds (show progress!)
124- **GPS extraction:** 1-2 seconds
125- **Checkpoint creation:** 1 second
126- **Gap detection:** 1 second
127- **Total:** 10-40 seconds typically
128
129## Error Handling
130
131### QR Scan Failed
132- Try multi-scale (1x, 2x, 3x)
133- If all fail: Manual receipt ID entry
134
135### e-Kasa Timeout
136- Show elapsed time
137- Offer retry or manual entry
138- Cache successful responses
139
140### No GPS
141- Fallback to address geocoding
142- Manual GPS entry
143- Continue without location (warn about compliance)
144
145### Multiple Fuel Items
146- List all items with prices
147- Ask user to select correct one
148
149### Ambiguous Geocoding
150- Show alternatives with confidence
151- Ask user to select correct location
152
153## Slovak Compliance
154
155### Critical Requirements
156- **Driver name:** Mandatory for tax deduction
157- **Refuel timing:** Separate from trip start/end timing
158- **Location:** Refuel station may differ from trip origin/destination
159- **L/100km format:** Always use European standard
160
161### Data Storage
162- Store `refuel_datetime` separately from trip timing
163- Store `refuel_location` separately from trip endpoints
164- Link checkpoint to trips via gap detection
165
166## Related Skills
167
168### Auto-triggers
169- **trip-reconstruction:** If gap > 100km detected
170- **data-validation:** Automatic validation after checkpoint creation
171
172### Links to
173- **vehicle-setup:** If no vehicle registered
174- **report-generation:** After sufficient checkpoints collected
175
176---
177
178**For detailed examples:** See GUIDE.md
179**For MCP tools:** See REFERENCE.md
180**For timeout troubleshooting:** See ../TROUBLESHOOTING.md