Tariff Doc Extractor Skill
SU-OSPO/tariff-claude-skill
Converte PDFs de tarifas históricas em dados estruturados
Ver no GitHubSkill para Claude que digitaliza PDFs históricos de tarifas Schedule A dos EUA em planilhas estruturadas em Excel e CSV. Extrai conteúdo tabular de documentos escaneados e converte em dados estruturados e legíveis por máquina, com suporte a descrições hierárquicas, metadados e notas de rodapé.
Instalação
npx convez-ai SU-OSPO/tariff-claude-skill1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Digitalizar documentos tarifários históricos em massa
- Extrair dados comerciais e classificações de commodities de PDFs escaneados
- Converter tabelas complexas de documentos legados em planilhas estruturadas
Veredito

Ferramenta especializada e bem-documentada para um caso de uso específico (tarifas históricas). Implementação sólida com exemplos reais, mas nicho limitado — ideal para pesquisadores e analistas trabalhando com documentos tarifários legados dos EUA.
README
A tradução para o português deste README ainda está na fila.
Tariff Doc Extractor Skill
A Claude skill for digitizing historical U.S. Schedule A tariff PDFs into structured Excel and CSV spreadsheets.
This repository packages an instruction file plus training data that teaches Claude how to read scanned Schedule A tariff documents and extract their tabular contents into a machine-readable output.
Example
The examples/ folder contains a sample input PDF and the spreadsheet Claude produces from it.
Input: examples/1937_Schedule_A_Example.pdf — 8 pages from Group 00 (Animals and Animal Products, Edible) of the 1937 Schedule A.
Output: examples/1937_Schedule_A_Example.xlsx — a Tariff Data sheet, one row per commodity. First rows:
| Economic Class | Schedule A Commodity Number | Commodity Description | Unit of Quantity | Rate of Duty | Tariff Paragraph |
|---|---|---|---|---|---|
| 2 | 0010 000 | Cattle: Weighing less than 175 pounds each | No......20; Lb.......1 | 2½¢ lb.; 1¼¢ lb. Canada | 701 |
| 2 | 0010 100 | Cattle: Weighing 175 pounds and less than 700 pounds each | No......20; Lb.......1 | 2½¢ lb. | 701 |
| 2 | 0012 000 | Sheep and lambs | No......20 | $3 each | 702 |
Hierarchical descriptions in the source PDF are flattened with : so each row is self-contained, and multiple values within a cell (rates, paragraphs) are joined with ;.
Requirements
- A Claude account with skills enabled. See the Claude help center for plan-specific setup.
- A Schedule A tariff PDF to digitize. The skill has been calibrated on the 1939 and 1950 editions and works on similar yearly schedules.
Installation
- Download the latest
tariff-doc-skill.skill. - In claude.ai, go to Customize → Skills in the left sidebar and click Add skill (
+button) → Create skill → Upload a skill. - Select the
tariff-doc-skill.skillfile. It will appear in your skills list and become available in all conversations.
Usage
- Start a new conversation at claude.ai.
- Upload your tariff PDF via the attachment icon.
- Ask Claude to extract it by using the
/tariff-doc-skillcommand or with natural language. - Wait for processing — a few minutes, depending on page count.
- Download the output files Claude presents.
Tips: Process one document per conversation for best results. For PDFs over 30 pages, split into smaller chunks. If you know the edition, tell Claude (e.g., "This is a 1939 Schedule A"). Always spot-check the output against the source PDF, which is included in the output for that purpose.
Output Format
Each run produces:
- An Excel (
.xlsx) workbook with three sheets:Tariff Data,Metadata, andFootnotes - A matching CSV of the
Tariff Datasheet - A matching CSV of the
Metadatasheet - A copy of the original PDF for verification
Tariff Data sheet
One row per commodity.
| Column | Description |
|---|---|
| Economic Class | Numeric code from the PDF's leftmost column |
| Schedule A Commodity Number | Normalized commodity number (e.g., 0010 000) |
| Commodity Description | Full hierarchical description, flattened with : |
| Unit of Quantity | Reporting unit and code |
| Rate of Duty | One or more duty rates, joined with ;; footnote markers preserved as superscript Unicode (¹, ², etc.) |
| Tariff Paragraph | One or more paragraph numbers, joined with ; |
Metadata sheet
A two-column key-value table (Field, Value) intended as a provenance record so downstream users can audit how the data was produced. Fields include:
- Source document identifiers (filename, title, edition, groups and sections covered)
- Processing statistics (pages processed, total rows extracted, extraction date, extraction method)
- Per-column transformation rules (e.g., how period notation was converted to the spaced
XXXX XXXformat) - Notes on edge cases (bilateral bound rates, compound paragraph references, footnote-handling caveats, ALL CAPS section headers excluded as hierarchy resets)
Footnotes sheet
Captures footnotes from the source PDF separately so they can be joined back to Tariff Data rows by marker.
| Column | Description |
|---|---|
| Page Number | Page in the source PDF where the footnote appears |
| Footnote Marker | Marker as printed in the source (e.g., 1, 2) |
| Footnote Text | Full text of the footnote |
The same marker may appear on multiple pages with different meanings, so joins typically need both Page Number and Footnote Marker.
Troubleshooting
- Claude doesn't recognize the skill — Make sure you uploaded the
tariff-doc-skill.skillfile (not justSKILL.md) through Settings → Skills. Refresh the page and start a new conversation. - Training data not found — The training data must be inside the
tariff-doc-skill.skillfile. If you edited and re-uploaded onlySKILL.md, the training data was lost. Repackage the fulltariff-doc-skill.skillfile with thereferences/folder. - Processing stops on a large document — Split the PDF into 10–20 page chunks and process each in a separate conversation.
Repository Structure
tariff-doc-skill/
├── LICENSE
├── README.md
├── SKILL.md
├── examples/
│ ├── 1937_Schedule_A_Example.pdf
│ └── 1937_Schedule_A_Example.xlsx
└── references/
├── training_data.csv
└── training_data.pdf
The references/ folder contains the training data Claude uses at runtime to calibrate extraction — description formats, commodity-number conventions, and tariff-paragraph styles. It must remain bundled inside the tariff-doc-skill.skill file.
The examples/ folder contains the sample input and output referenced in the Example section.
Each release contains a tariff-doc-skill.skill file, which is a zip archive that bundles SKILL.md together with the references/ folder — this is what users upload to Claude.
Modifying the Skill
To edit the skill manually:
- Rename
tariff-doc-skill.skilltotariff-doc-skill.zipand unzip it. - Edit
SKILL.mdin any text editor. - Re-zip the folder, keeping
references/inside. - Rename the result back to
tariff-doc-skill.skill. - Upload the updated
tariff-doc-skill.skillfile in Settings → Skills to apply the changes.
Alternatively, ask Claude to revise the skill in a conversation; it will produce an updated SKILL.md for download. You will still need to repackage the tariff-doc-skill.skill file to include the references/ folder.
License
This project is licensed under the MIT License. See LICENSE for the full text.
Support
Developed and maintained by the Open Source Program Office at Syracuse University. Reach out for feedback and suggested improvements:
Credits
The historical Schedule A PDFs used as examples and training data are U.S. federal government works in the public domain (17 U.S.C. § 105). The example PDF was digitized by Google and made available via HathiTrust from a Penn State library copy.
This project was supported as part of a grant (#G2023-20946) from the Alfred P. Sloan Foundation.