{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-other-bibliography-b31066dd47b8","title":"Batch Literature Classification and CSV Export","summary":"Classify and organize literature files (PDF, MD, DOCX, TXT) into a structured CSV for literature reviews and analysis, with a human-readable Markdown summary generated first.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-bibliography-b31066dd47b8","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-bibliography-b31066dd47b8","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-bibliography-b31066dd47b8.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-bibliography-b31066dd47b8\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Ensure `pdf-extract` is installed and accessible, as it is required for processing PDFs. Save the Summary Markdown with UTF-8 encoding and store it under the `outputs\/` directory. The CSV is generated exclusively from this Markdown, not directly from raw files.","instructions":"---\nname: bibliography\ndescription: Classifies and organizes literature by theme, method, and conclusion; use when you need to batch-read a folder of PDF\/MD\/DOCX\/TXT files and output a structured CSV for literature reviews and annotation management.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# Bibliography\n\n## When to Use\n\n- You are conducting a literature review and need consistent summaries plus structured metadata (theme\/method\/conclusion) across many papers.\n- You have a mixed-format reading folder (`.pdf`, `.md`, `.docx`, `.txt`) and want a single CSV for downstream analysis (e.g., Excel, R, Python).\n- You need to organize annotations by **keywords (theme)**, **experimental methods (method)**, and **key conclusions (conclusion)**.\n- You want a two-step pipeline: first generate a human-readable summary Markdown, then generate a machine-friendly CSV from that Markdown.\n- You need robust handling of PDFs by converting them to Markdown first (via `pdf-extract`) and then using **only Markdown content** for extraction.\n\n## Key Features\n\n- Batch scans an input directory for `.pdf`, `.md`, `.docx`, and `.txt` literature files.\n- Converts PDFs to Markdown via `pdf-extract`, then **ignores non-Markdown artifacts** (e.g., image folders).\n- Extracts and normalizes, per document:\n  - Title\n  - Summary (prefer original abstract)\n  - Keywords (theme)\n  - Experimental Methods (method names only)\n  - Key Conclusions (single sentence)\n  - Commentary (one-sentence, tactful evaluation)\n- Produces exactly **two outputs**:\n  1. A consolidated **Summary Markdown** saved under `outputs\/`\n  2. A single **CSV** generated from that Summary Markdown\n- Enforces UTF-8 output to prevent garbled characters; fills missing fields with `\"Not recognized\"` instead of leaving blanks.\n- Uses the CSV field order and headers defined in `assets\/bibliography_template.csv`.\n\n## Dependencies\n\n- `pdf-extract` (version: not specified; required when PDFs are present)\n- Input formats supported (no external version constraints specified):\n  - PDF\n  - Markdown (`.md`)\n  - DOCX (`.docx`)\n  - Plain text (`.txt`)\n\n## Example Usage\n\n### Goal\nRead all literature files in a folder, generate a consolidated summary Markdown, then generate a CSV following `assets\/bibliography_template.csv`.\n\n### Inputs\n- Input directory (example): `.\/inputs\/literature\/`\n- Output directory: `.\/outputs\/`\n- Output CSV path (example): `.\/outputs\/bibliography.csv`\n\n### Expected Outputs (exactly two files)\n- `.\/outputs\/bibliography_summary.md`\n- `.\/outputs\/bibliography.csv`\n\n### Example Summary Markdown Structure (generated first)\n\n```md\n# Bibliography Summary\n\n## Document 1\n- Title: <Title>\n- Summary: <Prefer the original Abstract; if missing, use the closest equivalent section>\n- Keywords: keyword1 | keyword2 | keyword3\n- Experimental Methods: <method1; method2; ... (names only)>\n- Key Conclusions: <one sentence covering all main points>\n- Commentary: <one tactful sentence>\n\n## Document 2\n...\n```\n\n### Example CSV (generated from the Summary Markdown)\n\nThe CSV must follow the header order defined in:\n\n- `assets\/bibliography_template.csv`\n\nRules:\n- One row per document.\n- No empty cells; use `Not recognized` when extraction fails.\n- Save as UTF-8.\n\n## Implementation Details\n\n### 1) Input Reading and Normalization\n\n- Traverse the input directory and process files with extensions:\n  - `.pdf`, `.md`, `.docx`, `.txt`\n\n**PDF handling**\n- If PDFs exist, convert them to Markdown using `pdf-extract`.\n- Use only the generated `.md` content; ignore image directories or other byproducts.\n- Locate `pdf-extract` as follows:\n  1. First, look for a sibling skill directory containing `SKILL.md` at the same level as this skill\u2019s parent directory.\n  2. If not found, ask the user to confirm the actual `pdf-extract` path.\n\n**DOCX handling**\n- Extract body text while preserving title\/paragraph order as much as possible.\n\n**MD\/TXT handling**\n- Read text directly.\n- If garbled characters appear or key fields cannot be recognized, attempt to detect and read using the original encoding (commonly `GB18030` \/ `GBK`) before extraction.\n\n### 2) Generate the Summary Markdown First (Single Source of Truth)\n\nBefore producing the CSV, generate a consolidated Summary Markdown containing, for each document:\n\n- **Title**\n- **Summary**\n  - Prefer the original **Abstract**.\n  - If no \u201cAbstract\u201d exists, use the closest equivalent section (e.g., \u201cSummary\u201d, \u201cHighlights\u201d, or an \u201cObjective\u2013Method\u2013Result\u2013Conclusion\u201d style segment).\n- **Keywords**\n- **Experimental Methods**\n- **Key Conclusions**\n- **Commentary**\n  - Exactly one sentence.\n  - Avoid harsh criticism; if the work has low value, use tactful phrasing.\n\nThis Summary Markdown must be saved with **UTF-8** encoding and stored under `outputs\/`. The CSV must be generated **only** from this Markdown (not directly from raw files).\n\n### 3) Field Extraction Rules (Theme \/ Method \/ Conclusion)\n\n- **Keywords (theme)**\n  - Prefer the original keywords from the document.\n  - Separate multiple keywords with `|`.\n  - If no keywords are found, generate **3\u20135** keyword phrases based on the abstract and append:\n    - `(generated based on abstract)`\n- **Experimental Methods (method)**\n  - Output method names only (no long descriptions).\n- **Key Conclusions (conclusion)**\n  - One sentence that covers all main points.\n\n### 4) CSV Output Constraints\n\n- Output exactly **one** CSV file at the end.\n- CSV field order and headers must match `assets\/bibliography_template.csv`.\n- Encoding must be **UTF-8** to avoid garbled characters.\n- If any field cannot be extracted, write `Not recognized` (never leave empty).\n- Only two files may be generated in total:\n  1. Summary Markdown\n  2. CSV\n- No temporary\/intermediate\/auxiliary files may be left behind (including extracted text dumps, caches, logs, images, backups). If conversion\/extraction requires intermediate artifacts, keep them in memory or ensure all non-target files are deleted before final output.\n- Do not use PowerShell to directly write\/manipulate CSV\/Markdown to avoid encoding\/newline issues; always generate and save using UTF-8.\n\n### Reference\n\n- Detailed rules and field descriptions: `references\/guide.md`","use_cases":["Conducting a literature review with consistent summaries and metadata across multiple papers.","Organizing annotations by theme, method, and conclusion for downstream analysis.","Generating a two-step pipeline for human-readable summaries and machine-friendly CSV output."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Other\/bibliography\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T14:19:17.000000Z","updated_at":"2026-11-26T09:24:51.000000Z","seo_title":"Batch Literature Classification and CSV Export","seo_description":"Automate literature review by classifying PDF\/MD\/DOCX\/TXT files into a structured CSV for analysis, with a human-readable Markdown summary generated first.","seo_keywords":["literature review automation","batch file classification","CSV export for research","PDF to CSV conversion","document metadata extraction"]}}