Import — XLSX Processing via Anthropic
What it does
This import connector reads .xlsx workbooks — a ubiquitous format in legal operations for matter lists, contract registers, clause libraries, fee schedules, and compliance matrices — and maps their contents into the Louis data model using the Anthropic Claude API for intelligent column interpretation and content normalization.
The connector goes beyond dumb CSV parsing: it uses Claude to infer column semantics (e.g., "Effective Date" vs "Commencement Date" → same field), detect jurisdiction references from free-text cells, and generate draft SKILL.md bodies from clause-text columns. Every run produces a dry-run preview before writing anything.
When to use this
- A law firm exports its standard clause library from a spreadsheet tracker into Louis skills.
- A legal ops team imports a contract register (columns: counterparty, jurisdiction, expiry, key obligations) to feed [[review-contract-batch]].
- Bulk onboarding of fee schedules, compliance checklists, or regulatory thresholds maintained in Excel.
- One-time migration of legacy matter data from Excel into the skills store.
- Periodic sync (e.g., updated rate cards, new clauses added by the firm's know-how team).
Setup / auth
| Requirement |
Detail |
| Anthropic API key |
Required; set as ANTHROPIC_API_KEY env var |
| Model |
claude-3-5-sonnet or claude-3-haiku (haiku for cost-sensitive bulk runs) |
| xlsx library |
Node.js xlsx / exceljs, or Python openpyxl / pandas depending on runtime |
| Target directory |
Writable path within skills/ hierarchy or a structured JSON store |
Use a least-privilege Anthropic key scoped to read-only if the import pipeline is automated.
Capabilities
- Multi-sheet workbook parsing (each sheet can map to a different target schema)
- Intelligent column header normalization via Claude (handles synonyms, abbreviations, mixed languages including Arabic headers)
- Row-to-skill mapping: each data row can become a skill, a matter entry, or a structured JSON record
- Variable extraction: detects
{{placeholder}} patterns in clause-text cells
- Jurisdiction detection: infers jurisdiction from free-text (e.g., "DIFC", "KSA", "الإمارات")
- Dry-run diff: shows new records, updates, conflicts, and unmapped columns before committing
- PII detection: flags cells containing email addresses, phone numbers, or ID numbers
Usage patterns
Basic dry-run on a clause library
import source="xlsx" file="firm-clause-library-2024.xlsx" schema="skill" dry_run=true
Output: per-row mapping table, unmapped column warnings, proposed skill names and target paths.
Confirmed bulk import
import source="xlsx" file="clause-library.xlsx" schema="skill" dry_run=false overwrite=false
Contract register import (structured JSON, not SKILL.md)
import source="xlsx" file="contract-register.xlsx" schema="contract_record" target="data/contracts/" dry_run=true
Multi-sheet workbook
import source="xlsx" file="legal-ops-master.xlsx" sheet_map='{"Clauses": "skill", "Matters": "matter_record", "Rates": "fee_schedule"}' dry_run=true
Column mapping reference
The importer uses Claude to resolve column semantics. Common mappings:
| Excel column (examples) |
Louis field |
Notes |
| Title, Name, Clause Name |
name |
Hyphenated on write |
| Jurisdiction, Country, Governing Law |
jurisdictions |
ISO-normalized |
| Practice Area, Department, Type |
practice_area |
Mapped to Louis taxonomy |
| Clause Text, Body, Content |
SKILL.md body |
Claude structures into sections |
| Tags, Keywords, Labels |
intent |
Comma-split; __import__ appended |
| Effective Date, Start Date |
effective_date |
ISO 8601 normalized |
| Expiry, Renewal Date |
expiry_date |
ISO 8601; flags expired |
| Notes, Comments, Drafting Notes |
## Drafting standards |
Preserved verbatim |
Unmapped columns are logged as warnings; the run proceeds unless strict_mode=true.
Claude API integration detail
The importer sends column headers + a sample of up to 5 rows to Claude with a structured prompt requesting:
- Column-to-field mapping JSON
- Confidence score per mapping (low-confidence columns flagged in dry-run)
- Detected language(s) in the data
- PII risk flags
Claude's response is parsed and applied to the full workbook locally — full row data is not sent to the API by default. Set send_full_data=true only for small workbooks (<500 rows) where per-row enrichment is desired.
Permissions & safety
- Dry-run is mandatory before any write. The system blocks confirmed writes if dry-run has not completed in the same session.
- PII scrubbing: cells flagged as containing personal data are masked in the imported output and logged separately. Do not import client-identifying matter data into public skill repositories.
- API cost control: default model is
claude-haiku for column-mapping inference. Override with model=claude-sonnet for more complex schema resolution.
- No auto-overwrite:
overwrite=false by default. Existing skills are skipped; set overwrite=true only after reviewing the dry-run diff.
Failure modes
| Failure |
Cause |
Resolution |
column_mapping_confidence_low |
Claude cannot reliably map headers |
Add manual column map in config; check header language |
schema_conflict |
Row data doesn't fit target schema |
Review dry-run output; use schema=raw_json as fallback |
pii_detected_blocked |
PII found and block_pii=true |
Sanitize source file; or set block_pii=false with explicit acknowledgment |
anthropic_rate_limit |
Too many API calls in bulk run |
Add rate_limit_delay=2s to config; or batch in smaller chunks |
xlsx_parse_error |
Corrupted or password-protected file |
Decrypt/repair source file first |
empty_sheet |
Sheet has headers but no data rows |
Logged as warning; import continues for other sheets |
Related skills
- [[import-vscode-extension-builder-lawvable]]
- [[connector-document-upload]]
- [[review-contract-batch]]
- [[draft-clause-library-standard]]
1---2name: import-xlsx-processing-anthropic3description: Use when ingesting legal data, clause libraries, matter lists, contract schedules, or bulk templates stored in Excel (.xlsx) format into the Louis/mini-claude-for-legal data model via the Anthropic Claude API. Handles column detection, header normalization, multi-sheet parsing, and mapping of spreadsheet rows to SKILL.md or structured JSON entries, with a mandatory dry-run preview before any write. Relevant any time a law firm or legal ops team wants to migrate Excel-based legal data into the open-source skill ecosystem.4license: MIT5metadata:6 id: import.xlsx-processing-anthropic7 category: import8 jurisdictions: [__multi__]9 priority: P310 intent: [__import__, xlsx, excel, spreadsheet, bulk-import, anthropic]11 related: [import-vscode-extension-builder-lawvable, connector-document-upload, review-contract-batch]12 source: https://skillmd.com/skills/sboghossian-mini-claude-for-legal/import-xlsx-processing-anthropic13 upstream: Louis — HAQQ Legal AI (github.com/sboghossian/mini-claude-for-legal)14 version: "1.0"15---1617# Import — XLSX Processing via Anthropic1819## What it does2021This import connector reads `.xlsx` workbooks — a ubiquitous format in legal operations for matter lists, contract registers, clause libraries, fee schedules, and compliance matrices — and maps their contents into the Louis data model using the **Anthropic Claude API** for intelligent column interpretation and content normalization.2223The connector goes beyond dumb CSV parsing: it uses Claude to infer column semantics (e.g., "Effective Date" vs "Commencement Date" → same field), detect jurisdiction references from free-text cells, and generate draft SKILL.md bodies from clause-text columns. Every run produces a **dry-run preview** before writing anything.2425---2627## When to use this2829- A law firm exports its standard clause library from a spreadsheet tracker into Louis skills.30- A legal ops team imports a contract register (columns: counterparty, jurisdiction, expiry, key obligations) to feed [[review-contract-batch]].31- Bulk onboarding of fee schedules, compliance checklists, or regulatory thresholds maintained in Excel.32- One-time migration of legacy matter data from Excel into the skills store.33- Periodic sync (e.g., updated rate cards, new clauses added by the firm's know-how team).3435---3637## Setup / auth3839| Requirement | Detail |40|---|---|41| Anthropic API key | Required; set as `ANTHROPIC_API_KEY` env var |42| Model | `claude-3-5-sonnet` or `claude-3-haiku` (haiku for cost-sensitive bulk runs) |43| xlsx library | Node.js `xlsx` / `exceljs`, or Python `openpyxl` / `pandas` depending on runtime |44| Target directory | Writable path within `skills/` hierarchy or a structured JSON store |4546Use a **least-privilege** Anthropic key scoped to read-only if the import pipeline is automated.4748---4950## Capabilities5152- Multi-sheet workbook parsing (each sheet can map to a different target schema)53- Intelligent column header normalization via Claude (handles synonyms, abbreviations, mixed languages including Arabic headers)54- Row-to-skill mapping: each data row can become a skill, a matter entry, or a structured JSON record55- Variable extraction: detects `{{placeholder}}` patterns in clause-text cells56- Jurisdiction detection: infers jurisdiction from free-text (e.g., "DIFC", "KSA", "الإمارات")57- Dry-run diff: shows new records, updates, conflicts, and unmapped columns before committing58- PII detection: flags cells containing email addresses, phone numbers, or ID numbers5960---6162## Usage patterns6364### Basic dry-run on a clause library6566```67import source="xlsx" file="firm-clause-library-2024.xlsx" schema="skill" dry_run=true68```6970Output: per-row mapping table, unmapped column warnings, proposed skill names and target paths.7172### Confirmed bulk import7374```75import source="xlsx" file="clause-library.xlsx" schema="skill" dry_run=false overwrite=false76```7778### Contract register import (structured JSON, not SKILL.md)7980```81import source="xlsx" file="contract-register.xlsx" schema="contract_record" target="data/contracts/" dry_run=true82```8384### Multi-sheet workbook8586```87import source="xlsx" file="legal-ops-master.xlsx" sheet_map='{"Clauses": "skill", "Matters": "matter_record", "Rates": "fee_schedule"}' dry_run=true88```8990---9192## Column mapping reference9394The importer uses Claude to resolve column semantics. Common mappings:9596| Excel column (examples) | Louis field | Notes |97|---|---|---|98| Title, Name, Clause Name | `name` | Hyphenated on write |99| Jurisdiction, Country, Governing Law | `jurisdictions` | ISO-normalized |100| Practice Area, Department, Type | `practice_area` | Mapped to Louis taxonomy |101| Clause Text, Body, Content | SKILL.md body | Claude structures into sections |102| Tags, Keywords, Labels | `intent` | Comma-split; `__import__` appended |103| Effective Date, Start Date | `effective_date` | ISO 8601 normalized |104| Expiry, Renewal Date | `expiry_date` | ISO 8601; flags expired |105| Notes, Comments, Drafting Notes | `## Drafting standards` | Preserved verbatim |106107Unmapped columns are logged as warnings; the run proceeds unless `strict_mode=true`.108109---110111## Claude API integration detail112113The importer sends column headers + a sample of up to 5 rows to Claude with a structured prompt requesting:1141. Column-to-field mapping JSON1152. Confidence score per mapping (low-confidence columns flagged in dry-run)1163. Detected language(s) in the data1174. PII risk flags118119Claude's response is parsed and applied to the full workbook locally — full row data is **not** sent to the API by default. Set `send_full_data=true` only for small workbooks (<500 rows) where per-row enrichment is desired.120121---122123## Permissions & safety124125- **Dry-run is mandatory** before any write. The system blocks confirmed writes if dry-run has not completed in the same session.126- **PII scrubbing**: cells flagged as containing personal data are masked in the imported output and logged separately. Do not import client-identifying matter data into public skill repositories.127- **API cost control**: default model is `claude-haiku` for column-mapping inference. Override with `model=claude-sonnet` for more complex schema resolution.128- **No auto-overwrite**: `overwrite=false` by default. Existing skills are skipped; set `overwrite=true` only after reviewing the dry-run diff.129130---131132## Failure modes133134| Failure | Cause | Resolution |135|---|---|---|136| `column_mapping_confidence_low` | Claude cannot reliably map headers | Add manual column map in config; check header language |137| `schema_conflict` | Row data doesn't fit target schema | Review dry-run output; use `schema=raw_json` as fallback |138| `pii_detected_blocked` | PII found and `block_pii=true` | Sanitize source file; or set `block_pii=false` with explicit acknowledgment |139| `anthropic_rate_limit` | Too many API calls in bulk run | Add `rate_limit_delay=2s` to config; or batch in smaller chunks |140| `xlsx_parse_error` | Corrupted or password-protected file | Decrypt/repair source file first |141| `empty_sheet` | Sheet has headers but no data rows | Logged as warning; import continues for other sheets |142143---144145## Related skills146147- [[import-vscode-extension-builder-lawvable]]148- [[connector-document-upload]]149- [[review-contract-batch]]150- [[draft-clause-library-standard]]