Commit e827850
committed
feat(pdf-reader): add PDF fallback skill for when agents lack PDF capability
Submitted by: https://github.com/divitkashyap
## What
Added — a skill that provides automatic fallback when an agent states it cannot read PDFs. Intercepts the limitation and extracts PDF text using command-line tools with user confirmation for installation.
## Why
When AI agents lack native PDF reading capability, they either fail or give generic responses. This skill provides a complete fallback workflow:
1. Detect when agent says 'I cannot read PDFs' (or similar phrases)
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
This skill differs from (PR #51):
- minimax-pdf-read: User explicitly asks to extract text from a PDF (active)
- pdf-reader: Agent says it can't read PDFs → fallback workflow (passive)
Both can coexist — they serve different trigger conditions.
## 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
## Key Features
- Automatic detection of agent PDF limitation
- Multi-tool fallback strategy
- User confirmation before installation
- Platform-specific installation commands
- Layout preservation (-layout flag)
- Page range extraction (-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'
## Files
- skills/pdf-reader/SKILL.md — Complete skill with workflow
- README.md, README_zh.md — Updated with new entry
## Validation
All 15 skills pass: python .claude/skills/pr-review/scripts/validate_skills.py ✅1 parent b6f6f10 commit e827850
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
0 commit comments