Automatically find references for academic paper Markdown files. Reads full paper text, identifies each knowledge point requiring citation (epidemiological data, mechanism descriptions, existing research conclusions, etc.), searches PubMed for 3-5 most relevant articles per kn...
68
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Scripts are located in the scripts/ subdirectory of this skill:
batch_search.py — Main entry point: accepts all queries at once, parallel search, batch esummary fetch, typical runtime 10-20sremap_refs.py — Converts [PMID:XXXXXXXX] markers to [1][2] numbering and generates formal references (not called by this skill — handled by subsequent endnote/zotero skill)convert_to_docx.py — Converts .md to .docx (not called by this skill)┌─────────────────────────────────────────────────────┐
│ find-paper-references │
│ ───────────────────────────────────────────────── │
│ Step 0-3: Identify knowledge points → Build PubMed search JSON │
│ Step 4: batch_search.py batch search │
│ Step 5: Select articles → Insert [PMID:xxxxxxxx] markers │
│ Step 6: Write to .md file │
│ Step 7: Generate _candidates.md candidate reference list │
│ Step 8: Prompt user to choose EndNote / Zotero to continue │
│ ──────────────── Workflow ends ──────────────────────────────── │
│ │
│ Formatting → format-references-endnote (EndNote) │
│ → format-references-zotero (Zotero) │
└─────────────────────────────────────────────────────┘Before starting any search, check and ask:
Do you have an NCBI API key? If so, search speed increases from 3 req/s to 10 req/s.
No worries if not — just skip and we'll proceed.User provides key: Before all script calls in this session, execute:
# Windows
$env:NCBI_API_KEY = "user_provided_key"
# Mac/Linux
export NCBI_API_KEY="user_provided_key"Then continue the workflow normally. Key is valid only for this session, not written to any file.
User doesn't have one / skips: Proceed to Step 1. The script automatically uses the conservative 3 req/s rate.
Read the full file content, then determine article type — can be auto-detected or confirmed with the user:
Auto-detection rules:
## Materials and Methods / ## Methods section → Research ArticleBased on the detected type, this workflow must follow the corresponding rules:
Citation zones: Introduction and Discussion only
Materials/Methods and Results → skip entirely, insert no citations
Per knowledge point: max 2 articles (top 2 by relevance, no padding)
Total target: at least 30 unique PMIDs in the textCitation zones: All paragraphs except Conclusion
Conclusion paragraphs → skip
Per knowledge point: max 5 articles
Total target: approximately 1 citation per 100 words, +/- 20%
Target range = [word_count*0.8/100, word_count*1.2/100] (rounded)
Example: 5000 words → target 40-60 articles; 8000 words → target 64-96 articlesRead through the paper, strictly following the citation zone rules for the current article type, skip sections that don't need citations.
Within allowed citation zones, identify all knowledge points requiring literature support:
Needs citation (applicable to allowed sections):
Never needs citation:
After identification, estimate total knowledge points:
Organize identified knowledge points into a list, each containing:
Organize all knowledge points into the following format, write to %TEMP%\ref_queries.json (or /tmp/ref_queries.json):
[
{"id": 1, "description": "global lung cancer incidence", "query": "global cancer statistics 2020 GLOBOCAN lung cancer Sung", "method": "pubmed"},
{"id": 2, "description": "ferroptosis definition", "query": "Ferroptosis iron-dependent nonapoptotic cell death Dixon 2012", "method": "pubmed"},
{"id": 3, "description": "TRIM3 structure and function", "query": "TRIM3 ubiquitin ligase RING domain substrate degradation", "method": "litsense"},
...
]Method options:
"pubmed" — Keyword-based precise search (recommended for most knowledge points)"litsense" — Semantic search (suitable for descriptive sentences, specific protein functions, etc.)"auto" — Try LitSense first; if results < 2 articles, automatically fall back to PubMedQuery writing guidelines:
python "SKILL_DIR/scripts/batch_search.py" "%TEMP%\ref_queries.json" --max 5Script searches all queries in parallel, batch-fetches esummary, typical runtime 10-20 seconds (vs. minutes for sequential searching).
Output JSON format:
[
{"id": 1, "description": "...", "results": [{pmid, title, authors, journal, year, doi}, ...]},
...
]If any result is empty, create a new JSON file with adjusted keywords and re-run batch_search.py.
For each sentence requiring citation:
[PMID:XXXXXXXX] at end of original sentence; for multiple: [PMID:111][PMID:222]After insertion, count current unique PMIDs:
Example (before/after):
Before: Ferroptosis is a form of regulated cell death driven by iron-dependent lipid peroxidation.
After: Ferroptosis is a form of regulated cell death driven by iron-dependent lipid peroxidation[PMID:25789077].Flexible formats supported by remap_refs.py (all handled correctly):
[PMID:123] [pmid:123] [Pmid:123][PMID: 123] [ PMID : 123 ][PMID:123, PMID:456] → [1][2] (spaces and comma variants accepted)Do not overwrite the original file. Write the full text with [PMID:XXXXXXXX] markers to a new file:
paper.md → New file paper_refs.md (generated in same directory)Naming rule: remove .md suffix from original filename, add _refs.md. Examples:
TRIM3_ferroptosis.md → TRIM3_ferroptosis_refs.mdmanuscript → manuscript_refs.mdKeep the original file unchanged — no modifications.
Do not append the reference candidate section to the original .md file — it will interfere with subsequent formatting.
Instead, generate a separate candidate file originalfilename_candidates.md in the same directory:
## Reference Candidates
> Below are PubMed search results for each knowledge point. Those selected for the text are marked with checkmark.
> Next step: Use format-references-endnote or format-references-zotero skill for formatting.
### Knowledge Point 1: [brief description]
- ✓ **[PMID:25789077]** Dixon SJ et al. "Ferroptosis: an iron-dependent form of nonapoptotic cell death." *Cell* 2012;149(5):1060-72.
- [PMID:26593993] Stockwell BR et al. "Ferroptosis: a regulated cell death nexus linking metabolism, redox biology, and disease." *Cell* 2017;171(2):273-285.
- [PMID:31634899] ...
### Knowledge Point 2: [brief description]
...Step 7 completion ends this workflow. Do not run remap_refs.py or convert_to_docx.py.
After Step 7, must proactively ask the user to choose next step:
All citation markers have been inserted (N unique references total). Ready to format and export to Word?
Do you use EndNote or Zotero for reference management?format-references-endnote skill to continueformat-references-zotero skill to continueDo not end silently — this reminder is mandatory.
After the [PMID:xxxxxxxx]-marked .md file is generated, choose based on user's reference manager:
Use format-references-endnote skill. It will:
[PMID:xxxx] markers to EndNote CWYW-recognized {Author, Year, Title} placeholders.ris file for automatic import to local EndNote library.docx file — user clicks "Update Citations" once in Word to complete formattingUse format-references-zotero skill. It will:
[PMID:xxxx] markers to native Zotero field codes.docx file — click "Refresh" once in Word to completeNCBI provides free API keys. With a key, rate limit increases from 3 req/s to 10 req/s, concurrent workers increase from 4 to 8, making searches faster and less likely to trigger rate limiting.
How to get one:
How to use:
# Temporary (current session only)
set NCBI_API_KEY=your_key # Windows
export NCBI_API_KEY=your_key # Mac/Linux
# Permanent (recommended: add to system env vars or .env file)Works fine without a key — script automatically uses conservative 3 req/s rate and auto-retries on 429 errors.
This skill accepts requests that match the documented purpose of find-paper-references and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
find-paper-referencesonly handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
63c61d3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.