Intelligently read large PDFs using page ranges. Analyzes PDF structure and returns relevant pages for queries. Uses Claude Code v2.1.30+ pages parameter.
From opspal-corenpx claudepluginhub revpalsfdc/opspal-commercial --plugin opspal-coreThis skill is limited to using the following tools:
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
This skill helps you efficiently read large PDF documents by analyzing their structure and selecting relevant page ranges.
/pdf-read <path-to-pdf> [query]
This skill leverages the new pages parameter:
pages="1-5,10-15"The optimizer auto-detects document types from filename/path:
| Type | Patterns | Example Sections |
|---|---|---|
| Salesforce | sfdc, salesforce | Objects, Validation Rules, Flows, Permissions |
| HubSpot | hubspot, hs | Workflows, Properties, Contacts, Forms |
| Audit | audit, assessment | Executive Summary, Findings, Recommendations |
| Report | report | Overview, Metrics, Analysis, Appendix |
| Section | Keywords |
|---|---|
| validation_rules | validation rule, vr, formula field |
| flows | flow, process builder, automation, trigger |
| permissions | permission, profile, role, sharing, access |
| objects | object, field, relationship, lookup |
| cpq | cpq, quote, pricing, product, bundle |
# Analyze PDF structure
node plugins/opspal-core/scripts/lib/pdf-context-optimizer.js analyze ./report.pdf
# Get relevant pages for a query
node plugins/opspal-core/scripts/lib/pdf-context-optimizer.js pages ./audit.pdf "validation rules"
# Get chunking strategy for large PDFs
node plugins/opspal-core/scripts/lib/pdf-context-optimizer.js chunks ./large-doc.pdf
# Clear PDF structure cache
node plugins/opspal-core/scripts/lib/pdf-context-optimizer.js clear-cache
User: /pdf-read ./acme-audit.pdf "what are the CPQ findings"
System: Analyzing PDF structure...
- Document type: audit
- Total pages: 45
- Detected sections: executive_summary (1-5), findings (6-25), recommendations (26-35), appendix (36-45)
Relevant sections for "CPQ findings":
- findings (pages 6-25) - Primary match
- recommendations (pages 26-35) - Secondary match
Recommended Read command:
Read(file_path="./acme-audit.pdf", pages="6-25")
[Claude then reads those specific pages]
Cache: PDF structure is cached for 24 hours in .claude/data/pdf-cache/
Environment Variables:
| Variable | Default | Description |
|---|---|---|
PDF_CACHE_TTL_HOURS | 24 | Cache time-to-live |
PDF_MAX_PAGES_PER_READ | 20 | Max pages per Read call |
plugins/opspal-core/scripts/lib/pdf-context-optimizer.js.claude/data/pdf-cache/