feat(pdf-reader): add new skill for PDF text extraction fallback#61
Open
divitkashyap wants to merge 2 commits intoMiniMax-AI:mainfrom
Open
feat(pdf-reader): add new skill for PDF text extraction fallback#61divitkashyap wants to merge 2 commits intoMiniMax-AI:mainfrom
divitkashyap wants to merge 2 commits intoMiniMax-AI:mainfrom
Conversation
Submitted by: https://github.com/divitkashyap ## What Added — a skill that automatically detects when an agent cannot read PDFs and provides text extraction using command-line tools with optional installation and user confirmation. ## Why Many AI agents lack native PDF reading capability. When they encounter a PDF, they either: - Fail to help the user - Give generic responses about not being able to access PDF content This skill intercepts that situation and provides a complete fallback workflow using standard tools (pdftotext, pdfplumber, pymupdf). ## How It Works 1. **Detection**: Monitors for agent statements like 'I cannot read PDFs', 'I don't have the ability to read PDFs', etc. 2. **Tool Detection**: Checks for available tools in priority order: pdftotext → pdfplumber → pymupdf 3. **Installation**: If no tool found, asks user permission with platform-specific install commands 4. **Extraction**: Extracts PDF text to /tmp/pdf_extracted.txt 5. **Continuation**: Reads extracted text and proceeds with original user task ## Tool Priority 1. **pdftotext** (poppler-utils) — Preferred, fastest, system-level tool 2. **pdfplumber** (Python) — Fallback if poppler not available 3. **pymupdf** (Python) — Alternative Python fallback ## Platform Support - **macOS**: Homebrew (brew install poppler) or pip - **Linux (Ubuntu/Debian)**: apt-get install poppler-utils or pip - **Linux (Fedora/RHEL)**: dnf install poppler-utils or pip - **Windows**: winget/chocolatey or pip ## Key Features - Automatic detection of agent PDF limitation - Multi-tool fallback strategy - User confirmation before installation - Platform-specific installation commands - Layout preservation option (-layout flag) - Page range extraction support (-f, -l flags) - Error handling for encrypted/protected PDFs ## Example Triggers - 'I cannot read PDFs' - 'I don't have the ability to read PDFs' - 'I can't access PDF content' - 'PDF reading is not supported' ## Files - skills/pdf-reader/SKILL.md — Complete skill with workflow - README.md — Updated with new skill entry ## Validation All 15 skills pass: python .claude/skills/pr-review/scripts/validate_skills.py ✅
b50e700 to
e827850
Compare
Submitted by: https://github.com/divitkashyap ## What Added — a skill that provides automatic PDF text extraction fallback using command-line tools (pdftotext/poppler-utils) with optional installation and user confirmation. ## Why When user shares a PDF or asks to read/extract text from it, and the agent lacks native PDF capability, this skill provides a complete fallback workflow: 1. Detect PDF file in user's message 2. Check for available tools (pdftotext → pdfplumber → pymupdf) 3. If no tool found, ask user permission to install 4. Extract PDF text to temp file 5. Continue with original user task ## Complementary to minimax-pdf-read (PR MiniMax-AI#51) This skill differs from : - minimax-pdf-read: User explicitly asks to extract text from a PDF (active) - pdf-reader: Fallback when agent needs to process PDF but lacks capability Both can coexist — they serve different use cases. ## Tool Priority 1. pdftotext (poppler-utils) — Preferred, fastest, system-level 2. pdfplumber (Python) — Fallback if poppler not available 3. pymupdf (Python) — Alternative Python fallback ## Platform Support - macOS: Homebrew (brew install poppler) or pip - Linux: apt-get/dnf install poppler-utils or pip - Windows: winget/chocolatey or pip ## Validation All 15 skills pass: python .claude/skills/pr-review/scripts/validate_skills.py ✅
e827850 to
bc1b338
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submitted by: https://github.com/divitkashyap
What
Added
pdf-reader— a skill that provides automatic PDF text extraction fallback using command-line tools (pdftotext/poppler-utils) with optional installation and user confirmation.Why
When user shares a PDF or asks to read/extract text from it, and the agent lacks native PDF capability, this skill provides a complete fallback workflow:
Complementary to minimax-pdf-read (PR #51)
This skill differs from
minimax-pdf-read:Both can coexist — they serve different use cases.
Tool Priority
Platform Support
Validation
All 15 skills pass: python .claude/skills/pr-review/scripts/validate_skills.py ✅