Pdf2qa
by Matteo Pozzi
Turn a PDF into a question-answer CSV with Claude, OpenAI, Gemini or any OpenAI-compatible server. Includes a PDF merge tool.
Free
Pdf2qa
Example session with this skill installed
I have 5 technical manuals in the /docs folder. Merge them into manuals.pdf, then generate 50 Q&A pairs into a file called training_data.csv. Run a dry run first.
- Read your context and instructions
- Compiled the pdf2qa
- Generated the data export
I have merged the PDFs and performed a dry run. The document has been split into 4 chunks of approximately 10,000 characters each. Based on your request for 50 questions, I will target 12-13 questions per chunk using claude-haiku-5-5.
Dry Run Summary:
- Total Chunks: 4
- Target Questions: 50
- Est. Input Tokens: 12,500
- Est. Output Tokens: 8,000
- Model: claude-haiku-5-5
training_data.csv
question,answer
"What is the primary safety protocol for high-voltage maintenance?","Technicians must engage the dual-lockout system and verify zero voltage with a calibrated meter before touching any internal components."
"How often should the intake filters be replaced according to section 4.2?","Filters must be inspected monthly and replaced every 3,000 operating hours or sooner if the pressure differential exceeds 15psi."
"Which command initializes the system diagnostics mode?","The system is placed in diagnostics mode by holding the 'Reset' button for five seconds during the boot sequence."
"What is the maximum operating temperature for the cooling unit?","The unit is rated for continuous operation up to 45 degrees Celsius (113 degrees Fahrenheit)."
Next steps
- Review the token estimates and confirm if you want to proceed with the API calls.
- Grant permission to overwrite
training_data.csvif it already exists. - Once finished, I will spot-check three random rows to ensure the answers match the source text.
training_data.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Manually extracting training data or study questions from long PDFs is tedious and error-prone. This skill automates the extraction of structured question-answer pairs directly from PDF text into a clean CSV format.
What it does
- Q&A Generation: Converts PDF text into structured
questionandanswercolumns. - PDF Merging: Combines a folder of multiple PDF files into a single document before processing.
- Dry Run Validation: Calculates chunks and token estimates to prevent unexpected API costs.
- Dataset Preparation: Formats output for fine-tuning LLMs or creating educational flashcards.
- Automatic Escaping: Prefixes spreadsheet-sensitive characters to prevent CSV injection.
How it works
- Source Selection: Point the tool to a single PDF or a directory of PDFs to be merged.
- Pre-processing: Run the merge script if multiple files are present and perform a dry run to verify chunking logic.
- Approval: Review the estimated token count and question density provided by the dry run.
- Extraction: Execute the generator to call the selected LLM provider (Anthropic, OpenAI, Google Gemini, or an OpenAI-compatible server) and write the results to a local CSV file.
Frameworks & tools
This skill uses Python 3.10+, pdfplumber and pypdf for document handling, and the official SDK of the provider you choose: anthropic, openai or google-genai. It uses no other frameworks.
Why this beats prompting it yourself
Standard prompting often loses track of context in large files or hits context window limits. This skill splits the text into chunks sized for the model and asks for a JSON answer per chunk. Responses that are cut off or cannot be parsed are reported and skipped, so you can see exactly which parts of the document are missing.
Use cases
- Build fine-tuning datasets from technical documentation.
- Create practice exams from academic textbooks.
- Consolidate fragmented reports into a single Q&A knowledge base.
- Generate FAQ lists from product manuals.
Requires a text-searchable PDF (no OCR support). Requires Python 3.10+ and an API key for at least one provider (Anthropic, OpenAI or Gemini) set as an environment variable, or an OpenAI-compatible server. Install the SDK for the provider you use. The document text is sent to the chosen provider. Output quality depends on the chosen model: smaller models may return invalid JSON more often, and those chunks are skipped.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 4 days ago
- Free with an Agensi account
- Software
Python
Permissions
What's inside
Creator
Matteo Pozzi
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.