| name | citation-ris-downloader |
| description | Download, audit, and organize native RIS citation files for EndNote/Zotero/Mendeley from publisher or DOI metadata. Use when Codex is asked to fetch RIS/ENW/EndNote citation files for a bibliography, prioritize official paper or publisher sources over Google Scholar, mark unavailable records, avoid edited/generated citation files, or clean a citation-file folder so only native downloaded RIS files remain. |
Citation RIS Downloader
Core Rule
Prefer native RIS from the publisher article page or DOI content negotiation. If the user asks for native/original files, do not edit RIS contents, normalize tags, convert ENW, merge records, or generate missing files. Rename files only if helpful.
After native RIS download or cleanup, ask whether the user wants RIS format normalization. Explain that normalization changes file internals and should only happen after explicit user confirmation.
When a work exists both as a formally published journal/conference paper and as an arXiv/preprint/working-paper version, download the RIS for the journal or conference version by default. Use preprint or working-paper RIS only when no formal publication exists, or when the user explicitly asks for that version.
Verify that each cited work is real and credible before downloading or reporting success. Confirm that the title, authors, venue, year, volume/issue/pages, and DOI or publisher page correspond to an actual publication. Watch for fake, hallucinated, predatory, or mismatched records; mark suspicious items instead of silently downloading a questionable citation.
Workflow
-
Parse the bibliography into one record per paper: authors, year, title, journal, volume, issue, pages.
-
Resolve DOI from official publisher pages, Crossref, DOI.org, JSTOR, AEA, Elsevier, Wiley, OUP, MIT Press, or RePEc only when publisher/DOI metadata is unavailable. Do not use Google Scholar as the primary source.
-
Prefer the version of record: journal or conference proceedings over arXiv, SSRN, NBER working paper, institutional working paper, repository, or preprint records. If multiple versions exist, compare title, authors, year, venue, and DOI before choosing.
-
Check credibility before download success: verify the venue is a real journal/conference/proceedings series, the DOI resolves to the expected work, and metadata matches the user-provided citation closely enough to avoid importing the wrong record.
-
For each DOI, request RIS with content negotiation:
Invoke-WebRequest -Uri "https://doi.org/<doi>" -Headers @{ Accept = "application/x-research-info-systems" } -UseBasicParsing -OutFile "<id>.ris"
-
Preserve the downloaded RIS bytes exactly when the user requests native/original files. Use -OutFile instead of reading response content into a string, because PowerShell may decode bytes, collapse line endings, or change encoding.
-
Validate without modifying: confirm the file begins with a RIS record such as TY - or TY -, contains ER - or ER -, and is not an HTML error page.
-
Store one paper per .ris file unless the user explicitly asks for a combined file.
-
Create a status report listing successful native downloads and unavailable records. Keep the report separate from the RIS files if the user asks the folder to contain only citation files.
-
Before any normalization, ask the user for confirmation and state the exact planned changes.
File Naming
By default, rename downloaded files as:
number_first-author-or-first-two-authors_year.ris
Examples:
01_Stolper_Samuelson_1941.ris
02_Rybczynski_1955.ris
Renaming files must not modify RIS file contents. If the user asks to keep original downloaded filenames, preserve the source filenames instead.
Use the Script
Use scripts/download_native_ris.ps1 when the task has multiple DOI-known records and the user wants native RIS only.
Input CSV columns:
id,doi,title
01_Stolper_Samuelson_1941,10.2307/2967638,Protection and Real Wages
Run:
powershell -ExecutionPolicy Bypass -File scripts/download_native_ris.ps1 -InputCsv refs.csv -OutputDir "C:\path\to\folder"
The script downloads exact RIS responses to <id>.ris, validates structure without editing the RIS, and writes native_ris_status.csv.
Pitfalls From Prior Runs
- DOI content negotiation commonly provides RIS but not ENW. If the user only needs one import format, keep RIS.
- Generated ENW is not native downloaded content. Disclose it clearly or avoid it.
- RePEc/IDEAS RIS is useful for older economics papers without DOI/publisher RIS, but it is not the same as publisher/DOI-native RIS. Mark it separately or omit it if the user requires native RIS only.
- arXiv, SSRN, NBER, and repository pages often represent preprint or working-paper versions. Do not choose them over the journal/conference version unless asked or no formal publication exists.
- Search results can surface comments, replies, book chapters, working papers, or unrelated papers with similar titles. Do not rely only on title similarity; cross-check authors, year, venue, volume/issue/pages, and DOI.
- If a citation appears to be fake, predatory, non-existent, or metadata cannot be reconciled, mark it as suspicious/unverified rather than manufacturing a RIS.
- PowerShell
Invoke-WebRequest | Select-Object -ExpandProperty Content can return bytes or strings depending on MIME type. Saving that content yourself may alter line endings, encoding, or RIS tag spacing. Use -OutFile for native downloads.
- Some DOI RIS records contain awkward punctuation or extra lines from deposited metadata. Do not clean them if the user asks for original/native files; instead report that the native file contains publisher-deposited quirks.
- If a cleanup request says "keep only native downloaded RIS files for each paper", delete generated ENW, combined files, status sheets if not wanted, and any RIS that came from RePEc/manual generation rather than DOI/publisher download.
- Do not silently normalize. Normalization may be useful for EndNote import, but it changes the RIS file contents and provenance should be described accurately.
Optional Normalization
At the end of a native-download task, ask whether the user wants further RIS format normalization. Explain that normalization changes file internals and the result is no longer a byte-for-byte original download.
Explain the likely changes before doing them:
- standardize RIS tag spacing, such as
TY - JOUR to TY - JOUR;
- normalize line endings and UTF-8 encoding;
- remove obvious non-RIS junk lines or duplicated terminators that can interfere with import;
- optionally create a combined RIS file if the user wants one;
- optionally convert to ENW if the user explicitly requests it.
Also explain what normalization must not change unless the user explicitly asks:
- authors;
- title;
- journal;
- year;
- volume, issue, pages;
- DOI or URL.
Reporting
In the final answer, state:
- total records requested;
- number of native RIS files retained;
- exact unavailable records and why;
- output folder path;
- whether RIS contents were preserved unchanged or were normalized/generated;
- whether the user was asked about optional normalization, and their decision if they answered.
Be precise about provenance. Do not say "downloaded" for generated, converted, normalized, or RePEc-exported files unless the distinction is explicit.