Skip to content

DavidCho1999/archaiflow-skills / bundles/construction-admin/skills/drawing-diff

drawing-diff

Verified

Compares two revisions of the same sheet or drawing set and reports what actually changed. Trigger on "what changed between these revisions", "compare Rev C and Rev D", "diff these drawings", "did they change anything", "check this against the last issue", or two pasted PDF paths of the same sheet or set. Matches pages by the sheet number printed in the title block rather than by page order, diffs extracted text to catch dimension, note, and tag edits, overlays the rendered pages to find linework that moved, then reads the changed regions to describe them. Flags changes carrying no revision cloud, and clouds carrying no change. Writes one report per comparison to `docs/drawing-diffs/`.

references/diff_methods.md

View on GitHub
# What each engine sees, and what it misses

Two engines run against every sheet pair. They fail in different directions, and
neither one's silence is an answer on its own. This file exists so the report
always says which one produced a finding and which one could not have.

## Text extraction

Pulls every text line out of both PDFs with its position, then compares by
position.

**Sees:** dimension values, room names and numbers, door and window tags, general
and keyed notes, fire ratings, spec section references, keynote legends, title
block fields, revision block entries, anything typed into a schedule cell.

**Misses:**

- Any change with no text in it. A wall that moved, a door swing reversed, a
  hatch pattern swapped, a detail bubble relocated, a line weight changed.
- Text baked into an image. A scanned sheet, a screenshot pasted into a detail,
  a flattened consultant background.
- Text that reflowed. A note re-wrapped from two lines to three reads as three
  changes, not one.

**Turns itself off when either side has no extractable text.** Diffing a vector
sheet against a scan of the same sheet would report every line on the vector
side as deleted: a large, confident, entirely false finding. One unreadable side
means no text comparison for that pair, and the report names the side.

**Reports as `edited`** when text at the same spot reads differently. This is the
highest-value output of the engine, because that is the shape a dimension change
takes.

**Normalises the sheet before comparing.** Two things move every line at once
and neither is a change: a re-plot that shifts the sheet a few points, and a
re-issue at a different paper size. The engine measures both from the lines that
read the same on both sides, takes them out, and records them as
`sheet_shift_pt` and `sheet_scale`. Without that step a shifted sheet reports
every note as moved and scatters a real dimension change into one addition plus
one removal, which is the finding you most wanted to see.

**Position tolerance is 3 points by default.** Above about 6 points, two
adjacent notes start collapsing onto one spot. Raise it with `--text-tol` only
when a sheet comes back with many paired add/remove findings that are plainly
the same line.

## Rendered overlay

Renders both pages to grayscale at 50 DPI, finds the whole-sheet offset a
re-plot introduced, removes it, then compares tile by tile.

**Sees:** anything that changed the printed image. Geometry, hatches, line
weights, symbols, clouds, and text, though text is better read by the other
engine.

**Misses:**

- Changes smaller than the tile threshold. At 50 DPI a tile is about 0.64 inch
  square, and a change has to move at least 1% of its pixels. A dimension line
  extended by an eighth of an inch can fall under that.
- Anything outside the search inset. The outermost 6 pixels of the sheet are not
  compared, because that band is what the offset search needs.

**Handles a different paper size** when it is one ratio applied to the whole
sheet, which is what a half-size print is. The new page renders at a DPI
carrying the ratio, so both land on the same pixel grid. A changed aspect ratio
is not a re-scale, and the run stops with `aspect-mismatch`.

**Gives false positives on:**

- A sub-pixel shift the whole-pixel offset search cannot remove. The symptom is
  `residual_pct` above about 40 with regions scattered evenly over the sheet.
  That is not a set of changes, it is a misalignment, and the report has to say
  so instead of listing them.
- A re-plot from a different CAD version, where every line rebuilds slightly
  differently.

## Revision clouds

Compared in both directions, never used as the change list.

Consultants forget to cloud, and the sheets where they forgot are the reason
this comparison is worth running. Clouds also survive into the next revision
when nobody clears them, so a cloud with nothing inside it is its own finding.

## Methods note to paste into the report

Edit to match the run. Do not ship it unedited.

> Two engines ran on each sheet: text extraction, which reports exact values but
> sees nothing that is not typed, and a rendered overlay at 50 DPI, which sees
> printed geometry but cannot read intent. On {{SHEETS}} the text engine was
> skipped because the {{SIDE}} side carries no extractable text (a scan), so any
> note or dimension change on those sheets is not in this report. On {{SHEETS}}
> the overlay was skipped because the two revisions are different shapes.
> {{SHEETS}} did not align well enough to trust the geometry findings. Region
> lists on {{SHEETS}} were capped at {{N}}, so there are more changes than are
> listed. Revision clouds were compared against detected changes and were not
> used as the source of this list.
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall