razshy/wiggle/file-reading
Claude Code and agent skill by razshy/wiggle
- community
Checking that the SKILL.md file is still in the repository.
Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about a…
Install
npx vskill@latest install razshy/wiggle/file-readingSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry/file-reading.
Reading Uploaded Files
Why this skill exists
When a user uploads a file in claude.ai, Claude Desktop, or Cowork, the file is written to /mnt/user-data/uploads/<filename> and you are told the path in an <uploaded_files> block. The content is not in your context. You must go read it.
The naive thing — cat /mnt/user-data/uploads/whatever — is wrong for most files:
- On a PDF it prints binary garbage.
- On a 100MB CSV it floods your context with rows you will never use.
- On a DOCX it prints the raw ZIP bytes.
- On an image it does nothing useful at all.
This skill tells you the right first move for each type, and when to hand off to a deeper skill.
General protocol
- Look at the extension. That is your dispatch key.
- Stat before you read. Large files need sampling, not slurping.
``bash stat -c '%s bytes, %y' /mnt/user-data/uploads/report.pdf file /mnt/user-data/uploads/report.pdf ``
- Read just enough to answer the user's question. If they asked
"how many rows are in this CSV", don't load the whole thing into pandas — wc -l gives a fast approximation (it counts newlines, not CSV records, so it may over-count if quoted fields contain embedded newlines).
- If a dedicated skill exists, go read it. The table below tells
you when. The dedicated skills cover editing, creating, and advanced operations that this skill does not.
extract-text
For docx, odt, epub, xlsx, pptx, rtf, and ipynb the first move is extract-text <file>. It emits markdown for docx/odt/epub (headings, bold, lists, links, tables), tab-separated rows under ## Sheet: headers for xlsx, text under ## Slide N headers for pptx, fenced code cells for ipynb, and plain text for rtf. Pass --format <fmt> when the extension is wrong or absent (e.g., --format xlsx on an .xlsm). If it errors on a file, pandoc <file> -t plain is a fallback; for xlsx/pptx, fall back to the dedicated skill's Python-based approach (openpyxl / python-pptx).
Dispatch table
Where a dedicated skill is named below, invoke it by name if you have a Skill tool, or Read its SKILL.md (listed in your available skills, or in the same skills directory as this file).
| Extension | First move | Dedicated skill | ||
|---|---|---|---|---|
.pdf | Content inventory (see PDF section) | pdf-reading | ||
.docx | extract-text | docx | ||
.doc (legacy) | Convert to .docx first | docx | ||
.xlsx | extract-text | xlsx | ||
.xlsm | extract-text --format xlsx | xlsx | ||
.xls (legacy) | pd.read_excel(engine="xlrd") — openpyxl rejects it | xlsx | ||
.ods | pd.read_excel(engine="odf") — openpyxl rejects it | xlsx | ||
.pptx | extract-text | pptx | ||
.ppt (legacy) | Convert to .pptx first | pptx | ||
.csv, .tsv | pandas with nrows | — (below) | ||
.json, .jsonl | jq for structure | — (below) | ||
.jpg, .png, .gif, .webp | Already in your context as vision input | — (below) | ||
.zip, .tar, .tar.gz | List contents, do not auto-extract | — (below) | ||
.gz (single file) | `zcat \ | head` — no manifest to list | — (below) | |
.epub, .odt | extract-text | — (below) | ||
.rtf | extract-text | — (below) | ||
.ipynb | extract-text | — (below) | ||
.txt, .md, .log, code files | wc -c then head or full cat | — (below) | ||
| Unknown | file then decide | — |
Never cat a PDF — it prints binary garbage.
Quick first move — get the page count and determine whether the PDF has an extractable text layer:
pdffonts tells you whether text extraction will work before you try it:
- No fonts listed (empty table, just the header) → the PDF is a
scan or raster export. pdftotext and PdfReader.extract_text() will return nothing useful. Go straight to page rasterization or OCR — see the pdf-reading skill → "Scanned documents".
- Fonts listed → there is a text layer; extract it:
``bash pdftotext -f 1 -l 1 /mnt/user-data/uploads/report.pdf - | head -20 ``
The reason to check pdffonts first is user-facing: running pdftotext on a scan produces an empty result, and in a visible transcript that reads as a failed first attempt before you fall back to OCR. The two-line diagnostic above costs one tool call and avoids that — you arrive at the right method on the first try, which is what a user perceives as "it just read my file."
That also shapes how to open your reply. The diagnostic commands are plumbing, not content; lead with what the user asked about. On a scanned receipt that might be "This is a 3-page scanned invoice; the amount due on page 2 is $1,845.00," and on a digitally-authored report it might be "The Q3 report runs 28 pages; revenue on p. 4 is $12.3M, up 9% YoY." What you're steering away from is the "I'll examine the PDF" / "Let me check if this is extractable" preamble — the answer to their question is the first thing they should see.
For anything beyond a quick peek — figures, tables, attachments, forms, scanned PDFs, visual inspection, or choosing a reading strategy — go read the pdf-reading skill. It covers content inventory, text extraction vs. page rasterization, embedded content extraction, and document-type-aware reading strategies.
For PDF form filling, creation, merging, splitting, or watermarking, go read the pdf skill.
DOCX / DOC
The docx skill covers editing, creating, tracked changes, images. Read it if you need any of those. For a quick look:
Legacy .doc (not .docx) must be converted first — see the docx skill.
XLSX / XLS / spreadsheets
The xlsx skill covers formulas, formatting, charts, creating. Read it if you need any of those. For a quick look at an .xlsx:
For .xlsm, add --format xlsx (same zip structure; only the extension differs). When you need a structured preview in Python:
read_only=True matters — without it, openpyxl loads the entire workbook into memory, which breaks on large files. Do not trust ws.max_row in read-only mode: many non-Excel writers omit the dimension record, so it comes back None or wrong. If you need a row count, iterate or use pandas.
Legacy `.xls` — openpyxl raises InvalidFileException. Use:
`.ods` (OpenDocument) — openpyxl also rejects this. Use:
PPTX
Legacy `.ppt` — convert to .pptx first via LibreOffice; see the pptx skill for the sandbox-safe scripts/office/soffice.py wrapper (bare soffice hangs here because the seccomp filter blocks the AF_UNIX sockets LibreOffice uses for instance management).
For anything beyond reading, go to the pptx skill.
CSV / TSV
Do not cat or head these blindly. A CSV with a 50KB quoted cell in row 1 will wreck your head -5. Use pandas with nrows:
Approximate row count without loading (over-counts if the file has RFC-4180 quoted newlines — the same quoted-cell case this section warned about above):
Full analysis only after you know the shape:
TSV: same, with sep="\t".
JSON / JSONL
Structure first, content second:
(keys errors on scalar JSON roots — a bare "hello" or 42 is valid JSON per RFC 7159 — so guard the branch.)
Then drill into what the user actually asked about.
JSONL (one object per line) — do not jq the whole file; work line by line:
Images (JPG / PNG / GIF / WEBP)
You can already see uploaded images. They are injected into your context as vision inputs alongside the <uploaded_files> pointer. You do not need to read them from disk to describe them.
The disk copy is only needed if you are going to process the image programmatically:
For OCR on an image (text extraction, not description):
Note: the client resizes images larger than 2000×2000 down to that bound and re-encodes as JPEG before upload, so the disk copy may not be the user's original bytes. For most processing this doesn't matter; if the user is asking about original-resolution pixel data, flag it.
Archives (ZIP / TAR / TAR.GZ)
List first. Extract never — unless the user explicitly asks. Archives can be huge, contain path traversal, or nest forever.
GNU tar auto-detects compression — tar -tf works on .tar, .tar.gz, .tar.bz2, .tar.xz alike. Don't hard-code -z.
If the user wants one file from inside, extract just that one:
Standalone `.gz` (not a tar) compresses a single file — there is no manifest to list. Just peek at the decompressed content:
EPUB / ODT
For long ebooks, pipe through head — you rarely need the whole thing to answer a question.
RTF / IPYNB
Plain text / code / logs
Check the size first:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmnt-skills/public/file-reading/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/razshy/wiggle/file-reading)