Extract PDF Map
Treat PDF extraction as evidence collection.
Follow ../../references/interaction-contract.md.
Process
- Read
references/pdf-evidence.md.
- Select an available Python 3.11+ executable that provides
pdfplumber. If the
dependency is unavailable, report it and stop instead of installing software during
extraction.
- Record the source hash, physical page indexes, and printed page labels separately.
- Run
<selected-python> <skill-dir>/scripts/run.py --input <manual.pdf> --output <directory>. Add --pages <page-or-range> only when the user already supplied a bounded range.
- For scanned pages, add a local
modbus-ocr-evidence/v1 file with --ocr-evidence <ocr.json>.
- Automatically check source coverage, record counts, stable source-row identities,
source locations, rejected rows, and cross-page consistency.
- Keep uncertain rows as candidates and group them by exception type.
- When source confirmation is still required, present the bounded extraction once
with its source hash, page range, record count, checks, and exceptions. Never ask
for page-by-page confirmation; one scoped confirmation covers the full range.
Output files
pdf-extraction.json - Open this only when reviewing extraction. It contains the candidate rows, source locations, automated checks, rejected rows, and grouped exceptions. It does not contain page images or full OCR text.
Completion requires traceable candidate rows, a compact automated-check summary, and
explicit holds only for actual exceptions or one batch source-confirmation scope.
Stop
- Stop on an unreadable or rights-restricted PDF.
- Stop if
pdfplumber is missing; report the dependency and do not install it.
- Stop for OCR of an entire unbound manual, writes, broadcasts, or scans.
- Do not copy full page images or complete OCR text into the output.
Handoff
- The user wants organized user-map outputs from the OEM PDF: suggest
compile-user-map.
- The user wants end-to-end source-map review: suggest
review-map.
- Candidate rows exist and extraction evidence is the requested outcome: suggest
review-evidence only when exception groups remain.
- When the user supplies a structured map instead, route to
parse-map.
Keep the source manual local. Output bounded evidence, not full OCR text or page images.
1---2name: extract-pdf-map3description: Extract traceable Modbus register candidates, source coverage, and page evidence from a PDF manual or bounded page range. Use when the source is a PDF register manual and the user wants extraction evidence before normalization or compilation.4license: Apache-2.05---67# Extract PDF Map89Treat PDF extraction as evidence collection.1011Follow `../../references/interaction-contract.md`.1213## Process14151. Read `references/pdf-evidence.md`.162. Select an available Python 3.11+ executable that provides `pdfplumber`. If the17 dependency is unavailable, report it and stop instead of installing software during18 extraction.193. Record the source hash, physical page indexes, and printed page labels separately.204. Run `<selected-python> <skill-dir>/scripts/run.py --input <manual.pdf> --output <directory>`. Add `--pages <page-or-range>` only when the user already supplied a bounded range.215. For scanned pages, add a local `modbus-ocr-evidence/v1` file with `--ocr-evidence <ocr.json>`.226. Automatically check source coverage, record counts, stable source-row identities,23 source locations, rejected rows, and cross-page consistency.247. Keep uncertain rows as candidates and group them by exception type.258. When source confirmation is still required, present the bounded extraction once26 with its source hash, page range, record count, checks, and exceptions. Never ask27 for page-by-page confirmation; one scoped confirmation covers the full range.2829## Output files3031- `pdf-extraction.json` - Open this only when reviewing extraction. It contains the candidate rows, source locations, automated checks, rejected rows, and grouped exceptions. It does not contain page images or full OCR text.3233Completion requires traceable candidate rows, a compact automated-check summary, and34explicit holds only for actual exceptions or one batch source-confirmation scope.3536## Stop3738- Stop on an unreadable or rights-restricted PDF.39- Stop if `pdfplumber` is missing; report the dependency and do not install it.40- Stop for OCR of an entire unbound manual, writes, broadcasts, or scans.41- Do not copy full page images or complete OCR text into the output.4243## Handoff4445- The user wants organized user-map outputs from the OEM PDF: suggest `compile-user-map`.46- The user wants end-to-end source-map review: suggest `review-map`.47- Candidate rows exist and extraction evidence is the requested outcome: suggest `review-evidence` only when exception groups remain.48- When the user supplies a structured map instead, route to `parse-map`.4950Keep the source manual local. Output bounded evidence, not full OCR text or page images.