Extracts construction plan PDFs into page PNGs, reads the sheet index to build a sheet-to-page manifest, and enables targeted viewing of specific sheets. This skill should be used when a corrections letter references specific plan sheets (e.g., "Sheet A3", "Detail 2/S3.1") and those sheets need to be located and analyzed within the PDF binder. Much faster than full plan extraction — builds the sheet manifest in under 2 minutes, then individual sheet lookups are instant. Triggers when a plan PDF needs to be navigated by sheet reference, or when the corrections interpreter needs to look at specific pages.
Extract a construction plan PDF into page PNGs and build a JSON manifest mapping sheet IDs to page numbers. This enables fast, targeted viewing of specific sheets referenced in corrections letters — without doing deep content extraction of every page.
Speed: Under 2 minutes for the manifest. Individual sheet lookups are instant after that.
Key difference from full extraction: This skill only identifies WHICH page is WHICH sheet. It does not extract content, dimensions, materials, or structural details from each page. That analysis happens on-demand when a specific sheet is requested.
pdftoppm / pdfinfo (from poppler) are provided by the server runtime image.ImageMagick is provided by the server runtime image.Check first: PNGs may already be pre-extracted. Look for pages-png/page-01.png in the project files directory. If PNGs already exist, skip this step entirely — go straight to Step 2.
If PNGs don't exist, run scripts/extract-pages.sh to split the PDF into individual page PNGs:
scripts/extract-pages.sh <input.pdf> <output-dir>
This produces output-dir/pages-png/page-01.png, page-02.png, etc. at 200 DPI (full resolution, no resize). Takes ~5 seconds for a 26-page set. The script is idempotent — if PNGs already exist it exits immediately.
Read pages-png/page-01.png visually. The sheet index is typically in the top-right or right-side area of the cover sheet.
Extract the index as a list of entries:
CS → Cover Sheet
A1 → Site Plan
A2 → Floor Plan
A3 → Elevations & Roof Plan
S1.0 → Structural Notes
S2.0 → Foundation Plan
...
This gives the list of expected sheets and their descriptions.
If the index is not on page 1, check page 2 — some sets have a separate title page before the cover sheet.
The sheet index order generally matches the PDF page order, but there can be mismatches — the index might list 12 sheets while the PDF has 15 pages (extra city forms, checklists, etc.).
To resolve the mismatch, read the title blocks:
title-blocks/title-block-01.png. If they do, skip the cropping step. Otherwise, run scripts/crop-title-blocks.sh to crop the bottom-right corner of each page:scripts/crop-title-blocks.sh <output-dir>/pages-png <output-dir>/title-blocks
Read each title block image to extract the sheet ID. Title blocks are small crops, so this is fast — the sheet ID is prominently displayed.
Match each page's sheet ID against the index entries.
Optimization: If the page count matches the index count exactly, skip the title block reading — the index order IS the page order. Only do title block reading when there's a mismatch.
Parallel processing: When reading title blocks, launch parallel subagents (3-5 at a time) to read batches of title block crops. Each crop is tiny, so reading is fast.
Output a JSON manifest file:
{
"source_pdf": "plans.pdf",
"total_pages": 15,
"indexed_sheets": 12,
"sheets": [
{
"sheet_id": "CS",
"page_number": 1,
"file": "page-01.png",
"description": "Cover Sheet"
},
{
"sheet_id": "A1",
"page_number": 5,
"file": "page-05.png",
"description": "(E) & (N) Site Plan"
},
{
"sheet_id": "S2.0",
"page_number": 11,
"file": "page-11.png",
"description": "Foundation Plan"
}
],
"unindexed_pages": [
{
"page_number": 2,
"file": "page-02.png",
"title_block_text": "City of Long Beach Forms"
}
]
}
Save this as output-dir/sheet-manifest.json.
When a corrections letter references a specific sheet:
See references/plan-sheet-conventions.md for how to navigate construction plan sheets — where title blocks are, how detail callouts work, and the sheet numbering system.
The corrections interpreter extracts sheet references from the corrections letter during its Phase 1 (reading the letter). It passes those references to this skill:
Corrections interpreter: "I need sheets A1, A3, S1.0, and S2.0"
↓
This skill: "A1 = page-05.png, A3 = page-07.png, S1.0 = page-09.png, S2.0 = page-11.png"
↓
Corrections interpreter reads those PNGs and produces targeted findings:
"On Sheet A3 (page 7), Detail 2 in the lower-right shows a standard soffit.
The patio is within 5' of the property line — replace with 1-hour fire-rated
assembly detail showing 5/8" Type X gypsum on the underside."
| Script | Purpose | Runtime |
|---|---|---|
scripts/extract-pages.sh | PDF → page PNGs at 200 DPI (full res, no resize). Idempotent. | ~5 sec for 26 pages |
scripts/crop-title-blocks.sh | Crop bottom-right title block from each page. Idempotent. | ~2 sec for 26 pages |
| File | Contents |
|---|---|
references/plan-sheet-conventions.md | Sheet numbering system, title block locations, detail callout conventions, common ADU plan set sizes |