Przejdź do treści
Biblioteka skilli
Prawo i compliance · Analiza

scan-document

/scan-document

Czyta zdjęcia lub PDF umowy, najmu albo regulaminu, wyjaśnia zapisy i wskazuje niekorzystne klauzule. Przydaje się, gdy ktoś chce wiedzieć, co podpisuje.

Licencja
MIT
Ostatnia zmiana repozytorium
31.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
4
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 31.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ą
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/scan_to_pdf.py

Co robi i kiedy

Czyta zdjęcia lub PDF umowy, najmu albo regulaminu, wyjaśnia zapisy i wskazuje niekorzystne klauzule. Przydaje się, gdy ktoś chce wiedzieć, co podpisuje.

Wyzwalacze z opisu

scan this documentturn these photos into a PDFmake a clean PDF from these picturesread the fine printwhat am I signingis there anything bad in this contractcheck this lease for red flagssummarize this agreement
Oryginalny opis (EN)

This skill should be used when the user shares photos or a file of a legal document (lease, rental agreement, loan, credit card terms, employment contract, offer letter, terms of service, insurance policy) and wants to understand it, or asks to "scan this document", "turn these photos into a PDF", "make a clean PDF from these pictures", "read the fine print", "what am I signing", "is there anything bad in this contract", "check this lease for red flags", or "summarize this agreement". It produces a clean cropped PDF, a plain-language summary, and a list of risky clauses with exact quotes and r

Jak działa

  1. Workflow
  2. Safeguards
Sekcje z nagłówków SKILL.md, w oryginale · 177 linii, 1 256 słów
Podgląd SKILL.md
---
name: scan-document
description: >
  This skill should be used when the user shares photos or a file of a legal
  document (lease, rental agreement, loan, credit card terms, employment
  contract, offer letter, terms of service, insurance policy) and wants to
  understand it, or asks to "scan this document", "turn these photos into a
  PDF", "make a clean PDF from these pictures", "read the fine print", "what
  am I signing", "is there anything bad in this contract", "check this lease
  for red flags", or "summarize this agreement". It produces a clean cropped
  PDF, a plain-language summary, and a list of risky clauses with exact
  quotes and risk levels.
metadata:
  version: "0.1.0"
---

# Scan Document

Turn photos of a legal document into a clean PDF, a plain-language summary,
and a list of risky clauses. The user needs no legal knowledge. Write
everything the user sees in short, plain sentences.

Bundled files:

- `scripts/scan_to_pdf.py`: crops, straightens, and cleans photos into one PDF.
- `references/red-flag-checklist.md`: the clause categories, risk levels, and
  rules for judging them. Read it in full before flagging anything.
- `references/report-template.md`: the fixed report layout. Follow it exactly.

## Workflow

### 1. Receive

Collect the document from the user.

- **Photos:** treat the order they were sent as the page order. If the order
  is unclear (file names out of sequence, page numbers visible in the wrong
  order), say which order will be used and fix it if the user objects.
- **A PDF or text file** that is already digital: skip steps 2 and 3 and go
  to step 4. The user still gets the summary and flags.
- **Images shown in chat with no file on disk:** the script needs files. Read
  the images directly for the report, and tell the user that attaching the
  photos as files will also produce the clean PDF.

If there is no document yet, ask the user to send clear photos of every page,
taken flat, in good light, with the whole page in the frame.

### 2. Crop and clean

Run the script on all page photos in one call, in page order:

```bash
python3 "${CLAUDE_PLUGIN_ROOT}/skills/scan-document/scripts/scan_to_pdf.py" \
  page1.jpg page2.jpg page3.jpg \
  -o "<output folder>/<short-name>-clean.pdf" \
  --pages-dir "<temp folder>/pages"
```

- Save the PDF to the session's outputs folder if one exists, otherwise to
  the current working directory. Name it after the document, for example
  `lease-clean.pdf`.
- Put `--pages-dir` in a temporary folder. The cleaned page PNGs are for the
  quality check in step 3.
- If `${CLAUDE_PLUGIN_ROOT}` is not set, use the directory this SKILL.md is
  in: the script is at `scripts/scan_to_pdf.py` next to it.
- If Python packages are missing, the script says so. Install them with
  `python3 -m pip install opencv-python-headless pillow numpy`, then run it
  again.

Options:

| Option | When to use |
|---|---|
| `--mode gray` | Default. Best for most documents. |
| `--mode bw` | Very dark or shadowy photos, or when the smallest file is wanted. Gives pure black text on white. |
| `--mode color` | The document has color that matters: stamps, signatures, highlights, colored forms. |
| `--no-crop` | The photos are already cropped scans or screenshots. |
| `--ocr` | Also write a `.txt` file of the text. Needs Tesseract. Optional backup only. |

The script prints JSON with one entry per page: `cropped` (page edges found
or not), `deskew_deg` (how much it straightened the page), and `sharpness`.
Warnings go to stderr:

- `page edges not found; kept the full image.` The page is still in the PDF,
  uncropped. Check it in step 3; this is fine when the page fills the photo.
- `low sharpness`: the photo may be blurry. Check it closely in step 3.

### 3. Check quality

Look at every cleaned page image in the `--pages-dir` folder. For each page,
confirm that:

- the whole page is there, with no text cut off at the edges;
- the text is sharp enough to read every word;
- the page is the right way up.

If a page fails, tell the user which page and what is wrong, and ask for a
new photo of just that page, with a tip (hold the phone flat, more light,
step back so all four corners show). Re-run the script with the new photo
in its place. If the user cannot retake it, continue, and list the problem
under "Unclear or unreadable parts" in the report.

Do not guess at words that cannot be read. Mark them as unreadable.

### 4. Read the text

Read the cleaned page images directly. This is the main way to get the text.
For a digital PDF or text file, read the file.

Use OCR text (from `--ocr`) only as a backup, for example to double-check a
number. If the OCR text and the image disagree, trust the image.

Keep track of which page each clause is on. Page numbers follow photo order.

If the document is not in English, tell the user that this version is built
for English documents. Still deliver the clean PDF. Offer a best-effort
summary only if the user wants it, and say clearly that the risk review may
miss things.

If the document is not a legal document at all (a receipt, a letter, a
menu), deliver the clean PDF and a short summary, and skip the flags.

### 5. Identify the document type

Decide the type from the title and content: lease, loan or credit,
employment, terms of service, insurance, or other (for example NDA, service
contract, purchase agreement, waiver). The type decides which extra checks
in `references/red-flag-checklist.md` apply. If it is unclear, pick the
closest type and say so in the report.

### 6. Summarize

Fill in the Summary and Key facts sections of the template:

- the parties;
- what each side must do;
- the money and the dates;
- how to leave the agreement.

Keep the Summary under 150 words.

### 7. Flag risks

Read `references/red-flag-checklist.md`. Go through the document clause by
clause. Compare each clause with the ten categories and the extra checks for
the document type.

For each flag, record:

1. the risk level (High, Medium, or Low), using the checklist's default level
   and its rules for moving up or down;
2. the exact quote and page number;
3. a plain explanation of what it means for the user;
4. a question the user can ask.

Then verify before writing the report:

- Re-read each quote against the page image. It must match word for word.
  If it does not, fix it or drop the flag. No quote means no flag (the only
  exception is a missing-item flag, as the checklist explains).
- Remove duplicates. If two flags quote the same clause, keep the one with
  the higher risk level and merge the explanations.
- Check the balance. A fair document should not get a long list of flags.
  Drop Low flags that would only add noise.

### 8. Deliver

1. Give the user the clean PDF.
2. Write the report in chat using `references/report-template.md` exactly.
3. Offer, in one line, to save the report as a file (Markdown, Word, or PDF)
   if the user wants to keep or share it. Do not save it unless they ask.

Delete the temporary page images when done.

## Safeguards

- **Not legal advice.** Every report ends with the disclaimer from the
  template. Tell the user to talk to a lawyer or legal aid service for
  high-value documents or High flags they do not understand.
- **Quote, do not invent.** Never put words in quotation marks that are not
  on the page.
- **State uncertainty.** Name the page and part that was hard to read.
- **Local law differs.** The disclaimer says so; repeat it next to any flag
  where enforceability depends heavily on location (non-competes, deposit
  limits, arbitration).
- **Privacy.** Do not save, upload, or share the document or report anywhere
  except the clean PDF the user asked for, unless the user asks.
- **No false comfort.** Never say a document is safe, fair, or fine to sign,
  even when no flags are found.
- **No pressure either way.** Explain risks; do not tell the user whether to
  sign.
Pliki w paczce (4)
  • SKILL.md 8 KB
  • references/red-flag-checklist.md 11 KB
  • references/report-template.md 3 KB
  • scripts/scan_to_pdf.py 14 KB

Wersje

W bazie nie ma innych skilli o nazwie scan-document.

Migawka bazy z 13.11.2026 · wersja paczki f855bf2e29fb (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

  • 90contract-risk-review
    Czyta umowy, takie jak NDA, umowy freelancerskie, najmu czy oferty pracy, prostym językiem i wskazuje ryzykowne zapisy, bez porady prawnej.
  • 100contract-review
    Przegląda umowy, regulaminy, MSA, NDA, umowy o pracę i SOW dostawców, wskazując ryzyka, brakujące warunki, nietypowe klauzule i punkty do negocjacji, w ustrukturyzowanym raporcie w markdown.
  • 100contract-review
    Analizuje umowy pod kątem ryzyk, sprawdza kompletność i podaje rekomendacje, w tym dla umów o pracę, NDA, umów usługowych i umów z dostawcami.
  • 90document-guardian
    Wyjaśnia prostym językiem umowy, formularze i pisma urzędowe, wskazuje klauzule wymagające uwagi i nie zastępuje porady prawnej.
  • 95terms-page-generator
    Tworzy i porządkuje stronę regulaminu usługi, z warunkami korzystania, umową z użytkownikiem i strukturą dokumentu.
  • 85lease-reviewer
    Przegląda umowę najmu lub dzierżawy dla wynajmującego albo najemcy: czas trwania, czynsz, kaucję, naprawy, podnajem i wypowiedzenie.

Uwagi i zgłoszenia

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