--- name: paper-reader description: Fetch and read academic papers by DOI. Use when (1) the user mentions a DOI (e.g., 10.1038/nature12373), asks to read/summarize/analyze a research paper, or references a paper they want to work with, or (2) Claude needs to consult a specific paper as part of research — e.g., a web search returns a relevant DOI, or a cited paper would help answer the user's question. Converts PDFs to markdown so the paper content can be read and discussed. --- # Paper Reader Fetch academic papers by DOI using the `paper` CLI, which downloads PDFs and converts them to markdown via `marker_single`. ## Usage ```bash # Fetch a paper and save to a temp file, then read it paper > /tmp/paper.md # Bypass cache to re-download paper --no-cache > /tmp/paper.md ``` Output goes to stdout (markdown). Progress/status goes to stderr. DOIs can be passed with or without the `https://doi.org/` prefix. ## Workflow 1. Extract the DOI from the user's message (look for patterns like `10.xxxx/...`) 2. Run `paper > /tmp/paper-.md` via Bash 3. Read the resulting markdown file 4. Respond to what the user asked (summarize, explain, answer questions, etc.) ## Caching Results are cached at `~/.cache/paper/.md`. Subsequent requests for the same DOI return instantly. Use `--no-cache` only when the user explicitly wants a fresh conversion. ## Download Sources The tool tries LibGen first (free, no authentication), then falls back to Anna's Archive fast download API if `ANNAS_ARCHIVE_KEY` is set. ## Errors - **"marker_single not found"**: The `marker_single` Python tool is not installed. Run `pip install marker-pdf` or use the nix devshell in `~/proj/paper`. - **"no results found on LibGen"**: The DOI may not be in LibGen's collection. Verify the DOI is correct. - **"all download sources failed"**: Neither LibGen nor Anna's Archive had the paper. The user may need to find it manually.