audit-xml-pdf-link

Audit PDF-to-XML linking strategies in factura_index.py and pdf_cache.py.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/ElPoot/contabilidad --skill audit-xml-pdf-link
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-xml-pdf-link
Source: https://github.com/ElPoot/contabilidad/tree/main/.agents/skills/audit-xml-pdf-link
Command: npx skills add https://github.com/ElPoot/contabilidad --skill audit-xml-pdf-link

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you catch mis-linking between a PDF and the correct XML so invoices and accounting classifications are not corrupted by missing or incorrect associations.

Core Features & Use Cases

  • Links integrity audit: Checks the PDF→XML linking strategy implemented across the project (including filename key matching, PDF text key extraction, raw PDF bytes key matching, consecutive-based fallback, and the final decision to mark as sin_xml).
  • Multiple-key handling verification: Confirms that PDFs containing multiple keys (notas de crédito) follow the intended rule for selecting which key to use (specifically verifying the “always last key” behavior).
  • Omission reason audit: Verifies how omission reasons are assigned (e.g., non_invoice, timeout, extract_failed) to ensure the system records failures accurately and consistently.

Quick Start

Ask the AI to run an audit of the current linking logic in gestor_contable/core/factura_index.py for all five strategies and produce a verdict with any real findings, otherwise report “SIN PROBLEMAS”.

Frequently Asked Questions about audit-xml-pdf-link

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

FAQPage Schema
How do I audit PDF to XML linking logic for 50-digit fiscal keys?

To audit PDF to XML linking logic, the Skill inspects key extraction and fallback strategies in factura_index.py and pdf_cache.py, validating 50-digit key matching to prevent incorrect invoice associations. It reports verified issues found in each code path.

Why are my PDFs marked as sin_xml when an XML file exists in the directory?

PDFs marked as sin_xml occur when filename key matching, raw bytes extraction, and consecutive-based fallback strategies fail. The Skill audits these exact code paths in factura_index.py to identify why the linking pipeline cannot find a valid match.

How does multiple key handling work for notas de credito PDFs?

Multiple-key handling for notas de credito verifies that the indexing pipeline follows the intended rule of always selecting the last extracted key. The Skill confirms this specific behavior is correctly implemented within the PDF text key extraction logic.

How do I verify omission reasons like non_invoice and extract_failed in an indexing pipeline?

To verify omission reasons, the Skill audits how failures like non_invoice, timeout, and extract_failed are assigned during the linking process. It ensures the system records these omissions accurately and consistently across all matching strategies.

What is the best way to prevent false matches when linking orphan PDFs to XML files?

The best way to prevent false matches is auditing the consecutive-based fallback logic and duplicated candidate handling. The Skill inspects these specific strategies to ensure only verified 50-digit key matches are accepted before linking.

Does the audit-xml-pdf-link Skill work with dependencies or external components?

No, the audit-xml-pdf-link Skill operates entirely independently without external dependencies or components. It directly inspects your existing Python codebase files like factura_index.py and pdf_cache.py to report verified linking issues.