Skip to content

Commit e827850

Browse files
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

File tree

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
| `minimax-xlsx` | 打开、创建、读取、分析、编辑或验证 Excel/电子表格文件(.xlsx、.xlsm、.csv、.tsv)。支持通过 XML 模板从零创建 xlsx、使用 pandas 读取分析、零格式损失编辑现有文件、公式重算与验证、专业财务格式化。 | Official |
2424
| `minimax-docx` | 基于 OpenXML SDK(.NET)的专业 DOCX 文档创建、编辑与排版。三条流水线:从零创建新文档、填写/编辑现有文档内容、应用模板格式并通过 XSD 验证门控检查。 | Official |
2525
| `vision-analysis` | 使用视觉 AI 模型分析、描述和提取图像信息。支持描述、OCR 文字识别、UI 界面审查、图表数据提取和物体检测。基于 MiniMax VL API,OpenAI GPT-4V 作为备选。 | Community |
26+
| `pdf-reader` | 自动检测 Agent 无法读取 PDF 的情况,并使用命令行工具(pdftotext/poppler-utils)提供文本提取后备方案。支持自动检测、用户确认后安装、多平台支持(macOS、Linux、Windows)。 | Community |
2627
| `minimax-multimodal-toolkit` | 通过 MiniMax API 生成语音、音乐、视频和图片内容 — MiniMax 多模态使用场景的统一入口。涵盖 TTS(文字转语音、声音克隆、声音设计、多段合成)、音乐(带词歌曲、纯音乐)、视频(文生视频、图生视频、首尾帧、主体参考、模板、长视频多场景)、图片(文生图、图生图含角色参考),以及基于 FFmpeg 的媒体处理(格式转换、拼接、裁剪、提取)。 | Official |
2728

2829
## 安装

0 commit comments

Comments
 (0)