arxiv
Search, download, and summarize academic papers from arXiv. Use when user says "search arxiv", "download paper", "fetch arxiv", "arxiv search", "get paper pdf", or wants to find and save papers from arXiv to the local paper library.
By wanshuiyin · 466 installs
npx skills add wanshuiyin/auto-claude-code-research-in-sleep --skill arxiv
Source repository · Upstream listing
arXiv Paper Search & Download
Search topic or arXiv paper ID: $ARGUMENTS
Constants
PAPER DIR Local directory to save downloaded PDFs. Default: papers/ in the current project directory.
MAX RESULTS = 10 Default number of search results.
ARXIV FETCHER — canonical name arxiv fetch.py , resolved per
[ shared references/integration contract.md ](../shared references/integration contract.md) §2
(Policy D1 — primary + fallback cascade). If unresolved (canonical
chain exhausted), fall back to the inline Python alternative
documented in Step 2.
Overrides (append to arguments):
/arxiv "attention mechanism" max: 20 return up to 20 results
/arxiv "2301.07041" download download a specific paper by ID
/arxiv "query" dir: literature/ save PDFs to a custom directory
/arxiv "query" download: all download all result PDFs
Workflow
Step 1: Parse Arguments
Parse $ARGUMENTS for directives:
Query or ID : main search term or a bare arXiv ID such as 2301.07041 or cs/0601001
max: N : override MAX RESULTS (e.g., max: 20 )
dir: PATH : override PAPER DIR (e.g., dir: literature/ )
download : download the first result's PDF after listing
download: all : download PDFs for all results
If the argument matches an arXiv ID pattern ( YYMM.NNNNN or category/NNNNNNN ), skip the search and go directly to Step 3.
Step 2: Search arXiv
Resolve $ARXIV FETCHER via the canonical strict safe chain (see
[ shared references/integration contract.md ](../shared references/integration contract.md) §2):
If $ARXIV FETCHER is non empty , run:
If $ARXIV FETCHER is empty (Policy D1 cascade), fall back to inline Python:
Present results as a table:
Step 3: Fetch Details for a Specific ID
When a single paper ID is requested (either directly or from Step 2):
Display: title, all authors, categories, full abstract, published date, PDF URL, abstract URL.
Step 4: Download PDFs
When download is requested, for each paper ID to download:
After each download:
Confirm file size 10 KB (reject smaller files likely an error HTML page)
Add a 1 second delay between consecutive downloads to avoid rate limiting
Report: Downloaded: papers/2301.07041.pdf (842 KB)
Step 5: Summarize
For each paper (downloaded or fetched by API):
Step 6: Update Research Wiki (if active)
Required when research wiki/ exists in the project ; skip silently
otherwise. When the wiki dir exists, resolve $WIKI SCRIPT per the
canonical chain at
[ shared references/wiki helper resolution.md ](../shared references/wiki helper resolution.md)
(Variant B — warn and skip), then ingest every paper returned by this
invocation:
The helper handles metadata fetch, slug, dedup, page creation, index
rebuild, and log append in a single call — do not handwrite
papers/<slug .md . See
[ shared references/integration contract.md ](../shared references/integration contract.md)
for the canonical helper rule. Missed ingests can be backfilled later
with python3 "$WIKI SCRIPT" sync research wiki/ arxiv ids <id1 ,<id2 ,...
after resolving $WIKI SCRIPT as above.
Step 7: Final Output
Summarize what was done:
Found N papers for "query"
Downloaded: papers/2301.07041.pdf (842 KB) (for each download)
Wiki ingested N papers (if research wiki/ was present)
Any warnings (rate limit hit, file too small, already exists)
Suggest follow up skills:
Key Rules
Always show the arXiv ID prominently users need it for citations and reproducibility
Verify downloaded PDFs: file must be 10 KB; warn and delete if smaller
Rate limit: wait 1 second between consecutive PDF downloads; retry once after 5 seconds on HTTP 429
Never overwrite an existing PDF at the same path skip it and report "already exists"
Handle both arXiv ID formats: new ( 2301.07041 ) and old ( cs/0601001 )
PAPER DIR is created automatically if it does not exist
If the arXiv API is unreachable, report the error clearly and suggest using /research lit with sources: web as a fallback