Przejdź do treści
Biblioteka skilli
Dokumenty i biuro · Konwersja i formaty

receipt-compiler

/receipt-compiler

Składa zdjęcia paragonów z telefonu w pakiet PDF A4 do rozliczenia wydatków: prostuje, nadaje wygląd czarno-białego skanu, dodaje opcjonalnie okładkę, numerację i podpisy.

Repozytorium
agent-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
22.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
2
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/receipt_compiler.py, tests/receipt_compiler_selftest.py

Co robi i kiedy

Składa zdjęcia paragonów z telefonu w pakiet PDF A4 do rozliczenia wydatków: prostuje, nadaje wygląd czarno-białego skanu, dodaje opcjonalnie okładkę, numerację i podpisy.

Oryginalny opis (EN)

Use when compiling phone-camera photos of receipts into an A4 PDF expense-claim pack — straighten, B&W scan look, optional cover/numbering/captions.

Jak działa

  1. Overview
  2. When to Use
  3. Prerequisites
  4. Workflow (agent must follow the gate)
  5. Layout rules (how receipts line up)
  6. Common Pitfalls
  7. Verification Checklist
Sekcje z nagłówków SKILL.md, w oryginale · 124 linii, 842 słów
Podgląd SKILL.md
---
name: receipt-compiler
description: "Use when compiling phone-camera photos of receipts into an A4 PDF expense-claim pack — straighten, B&W scan look, optional cover/numbering/captions."
license: MIT
metadata:
  version: 1.0.0
  author: moonlight-lupin
  platforms: [linux]
  tags: [receipts, expense-claims, pdf, ocr, scanify]
  related_skills: [pdf, document-toolkit]
---

# Receipt Compiler

## Overview

Receipt Compiler turns a folder of phone-camera receipt photos into one A4 PDF that looks like a
photocopied expense-claim pack: each receipt is straightened (perspective warp,
deskew), converted to a B&W "scanned" look, tiled on A4 with uniform visual scale,
numbered, and summarised on an optional cover page.

Four subcommands with an enforced **confirmation gate**:

1. `scan` — straighten + scanify + OCR each photo → `manifest.json`
2. `review` — print the extracted expense table
3. `confirm` — stamp user approval + bind the reviewed data (digest)
4. `pack` — build the A4 PDF (refuses to run until `confirm` has run)

## When to Use

- "Compile my receipts into a PDF for expense claim"
- "Make a claim pack from these receipt photos"
- "Straighten and B&W these receipts and line them up on A4"
- Not for: scanning via flatbed scanner, or PDFs of invoices (use `pdf` skill).

## Prerequisites

```
pip install opencv-python-headless pillow pillow-heif pytesseract reportlab numpy
# PyMuPDF is needed only to run the self-test (tests/), not the script itself
```
Plus system `tesseract-ocr` on PATH. Check with `tesseract --version`.

## Workflow (agent must follow the gate)

### Step 1 — scan

```bash
python3 ~/.hermes/skills/productivity/receipt-compiler/scripts/receipt_compiler.py \
    scan <photos_dir> -o <workdir> [--mode bw|photo]
```

Default `--mode bw` gives the photocopy look the user asked for. Use `--mode photo`
for grayscale. Completion criterion: manifest exists with one entry per photo;
`ocr_confidence` and `needs_review` flags set.

### Step 2 — review + confirm (MANDATORY, user in the loop)

```bash
python3 .../receipt_compiler.py review <workdir>
# ... apply any corrections to manifest.json, THEN re-run review so the user
# ... sees the corrected table ...
python3 .../receipt_compiler.py review <workdir>
# ... after the user approves the corrected table ...
python3 .../receipt_compiler.py confirm <workdir>
```

Present the printed table to the user in chat. Ask:
1. Are the extracted dates/merchants/amounts right? Fix `manifest.json` fields.
2. Optional requirements — ask every time, do not assume:
   - cover page (with claimant/period/notes)
   - per-receipt numbering badges
   - per-receipt captions (date · merchant · amount)
   - currency symbol on totals
3. Exclusions — any receipt to drop (`"include": false`)?
4. Purpose/notes text for the cover.

Only after the user approves: run `confirm <workdir>`. This sets
`confirmed: true` AND binds a `review_digest` of the exact reviewed fields at
approval time. Any edit after `confirm` (dates, amounts, currency, inclusion)
makes `pack` refuse until you re-run `confirm` — which means showing the user
the changed table again. There is no bypass flag. Apply user corrections to
`manifest.json` BEFORE running `confirm`.

### Step 3 — pack

```bash
python3 .../receipt_compiler.py pack <workdir> -o claim.pdf \
    [--cover --number --captions] \
    --title "Expense Claim — <purpose>" --claimant "MH" --period "..." --notes "..."
```

Completion criterion: PDF exists, page count reported in JSON output.
Then send the PDF to the user as a document/file on the active channel.

## Layout rules (how receipts line up)

- A4 portrait, 15 mm margins, 5 mm gaps.
- Very tall receipts (aspect ≥ 2.2) are packed 3-per-row full-height;
  normal receipts 2-per-row, capped at 52% of content height (≈47% of the
  page). Scale is per-cell
  (each receipt fills its cell); rows with fewer receipts get wider cells.
- Every image is scaled to preserve aspect ratio — no distortion, no cropping.
- Receipts flow across pages; 30+ receipts pack fine.
- Tall receipts print before normal ones; re-order via the manifest if needed.

## Common Pitfalls

1. **Skipping the confirmation gate** — `pack` hard-fails on `confirmed: false`,
   non-boolean confirmation values, and post-confirmation edits (digest check).
   There is no bypass flag; the user must see the table first.
2. **Dark/shadowed photos** — the 2/98 percentile stretch handles most; if OCR
   confidence is < 55, or no amount was extracted, the entry is flagged
   `needs_review`; surface these to the user.
3. **Perspective warp failure** — glossy/wrinkled receipts may not produce a clean
   quad; the script falls back to small-angle deskew of the full frame. Check
   `method` in the manifest; if `deskew` on a receipt that clearly needs
   cropping, fix the crop manually with PIL or accept the framing.
4. **HEIC photos** — iPhone photos arrive as .heic; `pillow-heif` handles them if
   installed. If missing, ask the user for JPGs or install `pillow-heif`.
5. **Multiple currencies** — totals are grouped per currency (review output and
   cover page print one line per currency, no combined total). For a cleaner
   claim, keep one currency per pack; never zero or edit valid amounts to force
   a combined total.
6. **Long descriptions in cover table** — descriptions truncate at 70 chars; keep
   cover notes short or put detail in `notes`.

## Verification Checklist

- [ ] `scan` produced manifest.json with an entry per photo
- [ ] `review` table shown to user; corrections applied to manifest
- [ ] Optional requirements asked each time (cover/numbering/captions)
- [ ] `confirm` run only after user approval (never hand-edit `confirmed`)
- [ ] `pack` output PDF exists, page count matches expectation
- [ ] PDF sent to the user with the correct output path
Pliki w paczce (3)
  • SKILL.md 6 KB
  • scripts/receipt_compiler.py 40 KB
  • tests/receipt_compiler_selftest.py 17 KB

Wersje

W bazie nie ma innych skilli o nazwie receipt-compiler.

Migawka bazy z 13.11.2026 · wersja paczki 7b403fe867a9 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100receipt-organizer
    Rozpoznaje zbiorczo zdjęcia paragonów i faktur w folderze, wyciąga pozycję, datę i kwotę i tworzy Excel ze zdjęciami.
  • 90receipts-to-expenses
    Czyta partię zdjęć paragonów bezpośrednio wizyjnie, klasyfikuje je do kategorii wydatków, opcjonalnie uzgadnia z wyciągiem bankowym CSV i tworzy wielozakładkowy skoroszyt Excel oraz podsumowanie PDF.
  • 100receipt-processing
    Wyciąga ustrukturyzowane dane z paragonów i faktur (e-mail, zdjęcia, skany, PDF) do księgowości, śledzenia wydatków i podatków: sprzedawca, data, kwota, podatek i pozycje w tabeli, CSV lub JSON.
  • 100auto-deskew
    Automatycznie prostuje przechylone obrazy, takie jak skany dokumentów, zdjęcia stron i paragonów, wykrywając dominujący kąt pochylenia (ImageMagick lub OpenCV) i opcjonalnie przycinając puste trójkąty.
  • 95paper-scan
    Wykrywa kartki formatu A na zdjęciu, prostuje perspektywę, usuwa cienie i tworzy kolorowy lub czarno-biały skan.
  • 100pdf-look-scanned
    Nadaje dokumentom PDF wygląd skanu: skala szarości, szum, lekkie obrócenie, rozmycie i cienie krawędzi, opcjonalnie z podmianą podpisów cyfrowych na wyodrębnione odręczne.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.