conciliar-inventario

Reconciles official DCAM and OTCA inventory PDFs into the Armado en México catalog data files.

Updated Jun 10, 2026
One-click install
npx skills add https://github.com/saulo-fl/armado-en-mexico --skill conciliar-inventario-saulo-fl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: conciliar-inventario
Source: https://github.com/saulo-fl/armado-en-mexico/tree/main/.claude/skills/conciliar-inventario
Command: npx skills add https://github.com/saulo-fl/armado-en-mexico --skill conciliar-inventario-saulo-fl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyMuPDF, @babel/standalone, and includes scripts (resource) components.

What problem does it solve? Official firearms inventory and price lists from DCAM (SEDENA) and OTCA arrive as PDFs with inconsistent layouts, and manually mapping hundreds of rows to catalog entries produces visible pricing errors. This Skill parses those PDFs positionally, maps rows to catalog items by brand, model, and caliber, and applies price, stock, and history updates under strict data invariants. ## Core Features & Use Cases - Positional PDF parsing: Extracts name, quantity, price, and long description from DCAM tabular layouts and OTCA stacked layouts using PyMuPDF, with a self-test script that pins known row counts. - Verified mapping and application: Builds an explicit catalog-to-PDF row dictionary, updates priceExact and price history, registers new inventory sources, and handles out-of-stock items, new models, accessories, and ammunition under fixed product conventions. - Integrity auditing and publishing: Runs auditar.js to enforce invariants (priceExact equals last history record, chronological histories, valid source inventory IDs, existing image paths) before opening draft PRs to main and develop. - Use Case: A user uploads the September DCAM inventory PDFs and asks to reconcile them; the Skill parses the three files, maps 204 firearm rows, updates prices and stock, audits the result, and opens two draft pull requests. ## Quick Start Upload the latest DCAM or OTCA inventory PDF and ask the assistant to reconcile it into the catalog, updating prices and stock.

Frequently Asked Questions about conciliar-inventario

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract tables from a PDF inventory in Python?▼

Use PyMuPDF (fitz) to read words with positional coordinates, then cluster them into rows by y-position and assign columns by x-offsets taken from the page headers. This Skill's parse_pdf.py auto-detects DCAM versus OTCA layouts by checking for a dollar sign in the text.

How to match PDF rows to a product catalog reliably?▼

Match by brand, model, and caliber rather than fuzzy string similarity, because difflib-style matching mis-maps similar models like TH380 to PT58. Build an explicit dictionary of catalog ID to PDF row index and review each row with a semantic token check.

Does the parser handle quantities with commas like 17,700?▼

Yes, the parser uses a regex allowing commas for stock quantities instead of isdigit(), which previously caused quantities to be dropped or borrowed from neighboring rows. Prices are matched with a strict decimal pattern and commas are stripped before conversion.

Why does fuzzy string matching fail on firearm model names?▼

Short normalized names collide across variants and finishes, so similarity scores map P-07 to P-09 or GX4 to GX4XL. The Skill mandates manual brand-model-caliber mapping with a printed review table and delta-percentage checks to catch mis-maps.

What happens when the audit script finds inconsistencies?▼

auditar.js exits with a non-zero code and lists findings such as priceExact mismatches, non-chronological histories, or missing images. In headless mode, a failed audit blocks pull request creation entirely and reports the failure reason as JSON.