Skill Tracer
Skills › Scientific Agent Skills › citation-management › core_workflow.md

core_workflow.md

564 lines · skills/citation-management/references/core_workflow.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Core Workflow
2
3The five phases in full: paper discovery, metadata extraction, the mandatory
4web-search enrichment pass, BibTeX formatting, validation, and integration with the
5writing workflow. Every command variant and option lives here.
6

Core Workflow

The five phases in full: paper discovery, metadata extraction, the mandatory web-search enrichment pass, BibTeX formatting, validation, and integration with the writing workflow. Every command variant and option lives here.

Raw lines 1 to 6
7## Core Workflow
8
9Citation management follows a systematic process:

Core Workflow

Citation management follows a systematic process:

Raw lines 7 to 10
11### Phase 1: Paper Discovery and Search
13**Goal**: Find relevant papers using academic search engines.
15#### Google Scholar Search
17Google Scholar provides the most comprehensive coverage across disciplines.
19**Basic Search**:
20```bash
21# Search for papers on a topic
22python scripts/search_google_scholar.py "CRISPR gene editing" \
23 --limit 50 \
24 --output results.json
26# Search with year filter
27python scripts/search_google_scholar.py "machine learning protein folding" \
28 --year-start 2020 \
29 --year-end 2024 \
30 --limit 100 \
31 --output ml_proteins.json
32```
34**Advanced Search Strategies** (see `references/google_scholar_search.md`):
35- Use quotation marks for exact phrases: `"deep learning"`
36- Search by author: `author:LeCun`
37- Search in title: `intitle:"neural networks"`
38- Exclude terms: `machine learning -survey`
39- Use citation counts to inspect the retrieved sample, not as a global Scholar sort
40- Filter by date ranges to get recent work
42**Best Practices**:
43- Use specific, targeted search terms
44- Include key technical terms and acronyms
45- Filter by recent years for fast-moving fields
46- Check "Cited by" to find seminal papers
47- Export top results for further analysis
49#### PubMed Search
51PubMed specializes in biomedical and life sciences literature (35+ million citations).
53**Basic Search**:
54```bash
55# Search PubMed
56python scripts/search_pubmed.py "Alzheimer's disease treatment" \
57 --limit 100 \
58 --output alzheimers.json
60# Search with MeSH terms and filters
61python scripts/search_pubmed.py \
62 --query '"Alzheimer Disease"[MeSH] AND "Drug Therapy"[MeSH]' \
63 --date-start 2020 \
64 --date-end 2024 \
65 --publication-types "Clinical Trial,Review" \
66 --output alzheimers_trials.json
67```
69**Advanced PubMed Queries** (see `references/pubmed_search.md`):
70- Use MeSH terms: `"Diabetes Mellitus"[MeSH]`
71- Field tags: `"cancer"[Title]`, `"Smith J"[Author]`
72- Boolean operators: `AND`, `OR`, `NOT`
73- Date filters: `2020:2024[Publication Date]`
74- Publication types: `"Review"[Publication Type]`
75- Combine with E-utilities API for automation
77**Best Practices**:
78- Use MeSH Browser to find correct controlled vocabulary
79- Construct complex queries in PubMed Advanced Search Builder first
80- Include multiple synonyms with OR
81- Retrieve PMIDs for easy metadata extraction
82- Export to JSON or directly to BibTeX

Phase 1: Paper Discovery and Search

Goal: Find relevant papers using academic search engines.

Google Scholar Search

Google Scholar provides the most comprehensive coverage across disciplines.

Basic Search:

# Search for papers on a topic
python scripts/search_google_scholar.py "CRISPR gene editing" \
  --limit 50 \
  --output results.json

# Search with year filter
python scripts/search_google_scholar.py "machine learning protein folding" \
  --year-start 2020 \
  --year-end 2024 \
  --limit 100 \
  --output ml_proteins.json

Advanced Search Strategies (see references/google_scholar_search.md):

  • Use quotation marks for exact phrases: "deep learning"
  • Search by author: author:LeCun
  • Search in title: intitle:"neural networks"
  • Exclude terms: machine learning -survey
  • Use citation counts to inspect the retrieved sample, not as a global Scholar sort
  • Filter by date ranges to get recent work

Best Practices:

  • Use specific, targeted search terms
  • Include key technical terms and acronyms
  • Filter by recent years for fast-moving fields
  • Check "Cited by" to find seminal papers
  • Export top results for further analysis

PubMed Search

PubMed specializes in biomedical and life sciences literature (35+ million citations).

Basic Search:

# Search PubMed
python scripts/search_pubmed.py "Alzheimer's disease treatment" \
  --limit 100 \
  --output alzheimers.json

# Search with MeSH terms and filters
python scripts/search_pubmed.py \
  --query '"Alzheimer Disease"[MeSH] AND "Drug Therapy"[MeSH]' \
  --date-start 2020 \
  --date-end 2024 \
  --publication-types "Clinical Trial,Review" \
  --output alzheimers_trials.json

Advanced PubMed Queries (see references/pubmed_search.md):

  • Use MeSH terms: "Diabetes Mellitus"[MeSH]
  • Field tags: "cancer"[Title], "Smith J"[Author]
  • Boolean operators: AND, OR, NOT
  • Date filters: 2020:2024[Publication Date]
  • Publication types: "Review"[Publication Type]
  • Combine with E-utilities API for automation

Best Practices:

  • Use MeSH Browser to find correct controlled vocabulary
  • Construct complex queries in PubMed Advanced Search Builder first
  • Include multiple synonyms with OR
  • Retrieve PMIDs for easy metadata extraction
  • Export to JSON or directly to BibTeX
Raw lines 11 to 83
Runs code python scripts/search_google_scholar.py :22
Runs code python scripts/search_pubmed.py :56
84### Phase 2: Metadata Extraction
86**Goal**: Convert paper identifiers (DOI, PMID, arXiv ID) to complete, accurate metadata.
88#### Quick DOI to BibTeX Conversion
90For single DOIs, use the quick conversion tool:
92```bash
93# Convert single DOI
94python scripts/doi_to_bibtex.py 10.1038/s41586-021-03819-2
96# Convert multiple DOIs from a file
97python scripts/doi_to_bibtex.py --input dois.txt --output references.bib
99# Different output formats
100python scripts/doi_to_bibtex.py 10.1038/nature12345 --format json
101```
103#### Comprehensive Metadata Extraction
105For DOIs, PMIDs, arXiv IDs, or URLs:
107```bash
108# Extract from DOI
109python scripts/extract_metadata.py --doi 10.1038/s41586-021-03819-2
111# Extract from PMID
112python scripts/extract_metadata.py --pmid 34265844
114# Extract from arXiv ID
115python scripts/extract_metadata.py --arxiv 2103.14030
117# Extract from URL
118python scripts/extract_metadata.py --url "https://www.nature.com/articles/s41586-021-03819-2"
120# Batch extraction from file (mixed identifiers)
121python scripts/extract_metadata.py --input identifiers.txt --output citations.bib
122```
124**Metadata Sources** (see `references/metadata_extraction.md`):
1261. **CrossRef API**: Primary source for DOIs
127 - Comprehensive metadata for journal articles
128 - Publisher-provided information
129 - Includes authors, title, journal, volume, pages, dates
130 - Free, no API key required
1322. **PubMed E-utilities**: Biomedical literature
133 - Official NCBI metadata
134 - Includes MeSH terms, abstracts
135 - PMID and PMCID identifiers
136 - Free, API key recommended for high volume
1383. **arXiv API**: Preprints in physics, math, CS, q-bio
139 - Complete metadata for preprints
140 - Version tracking
141 - Author affiliations
142 - Free, open access
1444. **DataCite API**: Research datasets, software, other resources
145 - Metadata for non-traditional scholarly outputs
146 - DOIs for datasets and code
147 - `doi_to_bibtex.py` retrieves BibTeX through DOI content negotiation; `extract_metadata.py --doi` is Crossref-only
149**Fields to verify after extraction** (availability differs by source; not all are emitted by every script):
150- **Required fields**: author, title, year
151- **Journal articles**: journal, volume, number, pages, DOI
152- **Books**: publisher, ISBN, edition
153- **Conference papers**: booktitle, conference location, pages
154- **Preprints**: repository (arXiv, bioRxiv), preprint ID
155- **Additional**: abstract, keywords, URL

Phase 2: Metadata Extraction

Goal: Convert paper identifiers (DOI, PMID, arXiv ID) to complete, accurate metadata.

Quick DOI to BibTeX Conversion

For single DOIs, use the quick conversion tool:

# Convert single DOI
python scripts/doi_to_bibtex.py 10.1038/s41586-021-03819-2

# Convert multiple DOIs from a file
python scripts/doi_to_bibtex.py --input dois.txt --output references.bib

# Different output formats
python scripts/doi_to_bibtex.py 10.1038/nature12345 --format json

Comprehensive Metadata Extraction

For DOIs, PMIDs, arXiv IDs, or URLs:

# Extract from DOI
python scripts/extract_metadata.py --doi 10.1038/s41586-021-03819-2

# Extract from PMID
python scripts/extract_metadata.py --pmid 34265844

# Extract from arXiv ID
python scripts/extract_metadata.py --arxiv 2103.14030

# Extract from URL
python scripts/extract_metadata.py --url "https://www.nature.com/articles/s41586-021-03819-2"

# Batch extraction from file (mixed identifiers)
python scripts/extract_metadata.py --input identifiers.txt --output citations.bib

Metadata Sources (see references/metadata_extraction.md):

  1. CrossRef API: Primary source for DOIs
  2. Comprehensive metadata for journal articles
  3. Publisher-provided information
  4. Includes authors, title, journal, volume, pages, dates
  5. Free, no API key required
  1. PubMed E-utilities: Biomedical literature
  2. Official NCBI metadata
  3. Includes MeSH terms, abstracts
  4. PMID and PMCID identifiers
  5. Free, API key recommended for high volume
  1. arXiv API: Preprints in physics, math, CS, q-bio
  2. Complete metadata for preprints
  3. Version tracking
  4. Author affiliations
  5. Free, open access
  1. DataCite API: Research datasets, software, other resources
  2. Metadata for non-traditional scholarly outputs
  3. DOIs for datasets and code
  4. doi_to_bibtex.py retrieves BibTeX through DOI content negotiation; extract_metadata.py --doi is Crossref-only

Fields to verify after extraction (availability differs by source; not all are emitted by every script):

  • Required fields: author, title, year
  • Journal articles: journal, volume, number, pages, DOI
  • Books: publisher, ISBN, edition
  • Conference papers: booktitle, conference location, pages
  • Preprints: repository (arXiv, bioRxiv), preprint ID
  • Additional: abstract, keywords, URL
Raw lines 84 to 156
Runs code python scripts/doi_to_bibtex.py :94
Runs code python scripts/extract_metadata.py :109
157### Phase 2.5: Metadata Enrichment via Web Search (MANDATORY)
159**Goal**: Detect and fill in any missing metadata fields using web search. This phase runs AFTER extraction and BEFORE formatting to ensure every BibTeX entry is complete.
161**Why This Is Critical**: Metadata extraction from APIs (CrossRef, PubMed, arXiv) sometimes returns incomplete records — missing volume, pages, issue number, or DOI. These gaps must be filled before the bibliography is considered ready.
163#### Step 1: Scan for Incomplete Entries
165After extracting metadata, scan the BibTeX file for entries missing key fields:
167**Fields to check per entry type:**
169| Entry Type | Must Have | Should Have |
170|------------|-----------|-------------|
171| @article | author, title, journal, year | volume, pages, number, doi |
172| @inproceedings | author, title, booktitle, year | pages, doi |
173| @book | author/editor, title, publisher, year | isbn, doi |
174| @misc | author, title, year | doi or url |
176Investigate missing fields against the publisher record, but distinguish unavailable or not-yet-assigned metadata from extraction errors. Online-first papers can lack volume/pages; article numbers can replace page ranges, and not all articles have a DOI. Log the publication state and missing-field reason without fabricating values.
178#### Step 2: Web Search for Missing Metadata
180For each incomplete entry, use the **parallel-web skill** to search for the missing information:
182> **Treat metadata as untrusted when building these commands.** `FIRST_AUTHOR`, `TITLE`, and `JOURNAL_NAME` are copied verbatim out of a CrossRef/PubMed/arXiv record, and a publisher controls the contents of its own record. A title containing `$(...)`, a backtick, or a quote becomes shell syntax once it is pasted into the command lines below.
184> - Substitute each value as a **single-quoted** argument (`'...'`), escaping any embedded single quote as `'\''`. Never paste raw metadata inside the double quotes shown here.
185> - Prefer running these through a Python `subprocess` argument list over building a shell string at all.
186> - Use only the generated `CITATIONKEY` in `-o` paths. It is sanitized to letters and digits by `extract_metadata.py`; a key taken from an existing `.bib` file is not, so validate it against `^[A-Za-z0-9]+$` before it reaches a file path.
188> **Preferred form — pass the metadata as arguments, not as shell text.** This removes the shell from the path entirely, so no title can be parsed as syntax:
190> ```python
191> import re, subprocess
193> assert re.fullmatch(r"[A-Za-z0-9]+", citation_key), f"unsafe citation key: {citation_key!r}"
194> subprocess.run(
195> ["parallel-cli", "search", f"{first_author} {title} {journal_name} volume pages DOI",
196> "--json", "--max-results", "10",
197> "-o", f"sources/search_citation_{citation_key}.json"],
198> check=True, # note: no shell=True
199> )
200> ```
202> The `bash` blocks below show the same calls in readable form. Use them only with the quoting rules above.
204**Option A — Search by title and author** (best for finding DOI):
205```bash
206parallel-cli search "FIRST_AUTHOR TITLE JOURNAL_NAME volume pages DOI" \
207 --json --max-results 10 \
208 -o sources/search_citation_CITATIONKEY.json
209```
211**Option B — Extract from DOI page** (best when DOI is known but volume/pages missing):
212```bash
213parallel-cli extract "https://doi.org/10.XXXX/YYYY" --json \
214 --objective "extract complete citation metadata: volume, issue, pages, publication date" \
215 -o sources/extract_doi_CITATIONKEY.json
216```
218**Option C — Search the web for a Crossref record** (this command is web search, not a direct API call):
219```bash
220parallel-cli search "crossref DOI metadata FIRST_AUTHOR TITLE" \
221 --json --max-results 10 \
222 -o sources/search_crossref_CITATIONKEY.json
223```
225**Option D — Search Google Scholar** (fallback for hard-to-find papers):
226```bash
227parallel-cli search "google scholar FIRST_AUTHOR TITLE YEAR complete citation" \
228 --json --max-results 10 \
229 -o sources/search_scholar_CITATIONKEY.json
230```
232#### Step 3: Update BibTeX Entries
234After finding the missing metadata:
2361. Open `references.bib`
2372. Add the missing fields to the incomplete entry
2383. Verify the found metadata is consistent with existing fields (same author, title, year)
2394. Log each fix:
240 ```
241 [HH:MM:SS] METADATA ENRICHED: [CitationKey] - added volume={X}, pages={Y--Z}, doi={10.XXX/YYY} ✅
242 ```
244#### Step 4: Handle Unfindable Metadata
246If metadata genuinely cannot be found after web search (very old paper, obscure conference, etc.):
2481. Add a `note` field to the BibTeX entry explaining the gap:
249 ```bibtex
250 note = {Volume and pages not available — published online only}
251 ```
2522. Log the exception:
253 ```
254 [HH:MM:SS] METADATA INCOMPLETE: [CitationKey] - pages unavailable (online-only publication) ⚠️
255 ```
2563. These exceptions should be rare — most modern papers have complete metadata findable via web search.
258#### Quick Reference: Common Missing Fields and Where to Find Them
260| Missing Field | Best Search Strategy |
261|---------------|---------------------|
262| DOI | Search "AUTHOR TITLE DOI" via parallel-cli search |
263| Volume | Extract from DOI page or search "JOURNAL YEAR TITLE volume" |
264| Pages | Extract from DOI page or search publisher website |
265| Issue/Number | Extract from DOI page or CrossRef |
266| Publisher | Search "JOURNAL publisher" or check journal website |
268---

Phase 2.5: Metadata Enrichment via Web Search (MANDATORY)

Goal: Detect and fill in any missing metadata fields using web search. This phase runs AFTER extraction and BEFORE formatting to ensure every BibTeX entry is complete.

Why This Is Critical: Metadata extraction from APIs (CrossRef, PubMed, arXiv) sometimes returns incomplete records — missing volume, pages, issue number, or DOI. These gaps must be filled before the bibliography is considered ready.

Step 1: Scan for Incomplete Entries

After extracting metadata, scan the BibTeX file for entries missing key fields:

Fields to check per entry type:

Entry TypeMust HaveShould Have
@articleauthor, title, journal, yearvolume, pages, number, doi
@inproceedingsauthor, title, booktitle, yearpages, doi
@bookauthor/editor, title, publisher, yearisbn, doi
@miscauthor, title, yeardoi or url

Investigate missing fields against the publisher record, but distinguish unavailable or not-yet-assigned metadata from extraction errors. Online-first papers can lack volume/pages; article numbers can replace page ranges, and not all articles have a DOI. Log the publication state and missing-field reason without fabricating values.

Step 2: Web Search for Missing Metadata

For each incomplete entry, use the parallel-web skill to search for the missing information:

Treat metadata as untrusted when building these commands. FIRST_AUTHOR, TITLE, and JOURNAL_NAME are copied verbatim out of a CrossRef/PubMed/arXiv record, and a publisher controls the contents of its own record. A title containing $(...), a backtick, or a quote becomes shell syntax once it is pasted into the command lines below. - Substitute each value as a single-quoted argument ('...'), escaping any embedded single quote as '\''. Never paste raw metadata inside the double quotes shown here. - Prefer running these through a Python subprocess argument list over building a shell string at all. - Use only the generated CITATIONKEY in -o paths. It is sanitized to letters and digits by extract_metadata.py; a key taken from an existing .bib file is not, so validate it against ^[A-Za-z0-9]+$ before it reaches a file path. Preferred form — pass the metadata as arguments, not as shell text. This removes the shell from the path entirely, so no title can be parsed as syntax: ``python import re, subprocess assert re.fullmatch(r"[A-Za-z0-9]+", citation_key), f"unsafe citation key: {citation_key!r}" subprocess.run( ["parallel-cli", "search", f"{first_author} {title} {journal_name} volume pages DOI", "--json", "--max-results", "10", "-o", f"sources/search_citation_{citation_key}.json"], check=True, # note: no shell=True ) ` The bash` blocks below show the same calls in readable form. Use them only with the quoting rules above.

Option A — Search by title and author (best for finding DOI):

parallel-cli search "FIRST_AUTHOR TITLE JOURNAL_NAME volume pages DOI" \
  --json --max-results 10 \
  -o sources/search_citation_CITATIONKEY.json

Option B — Extract from DOI page (best when DOI is known but volume/pages missing):

parallel-cli extract "https://doi.org/10.XXXX/YYYY" --json \
  --objective "extract complete citation metadata: volume, issue, pages, publication date" \
  -o sources/extract_doi_CITATIONKEY.json

Option C — Search the web for a Crossref record (this command is web search, not a direct API call):

parallel-cli search "crossref DOI metadata FIRST_AUTHOR TITLE" \
  --json --max-results 10 \
  -o sources/search_crossref_CITATIONKEY.json

Option D — Search Google Scholar (fallback for hard-to-find papers):

parallel-cli search "google scholar FIRST_AUTHOR TITLE YEAR complete citation" \
  --json --max-results 10 \
  -o sources/search_scholar_CITATIONKEY.json

Step 3: Update BibTeX Entries

After finding the missing metadata:

  1. Open references.bib
  2. Add the missing fields to the incomplete entry
  3. Verify the found metadata is consistent with existing fields (same author, title, year)
  4. Log each fix: `` [HH:MM:SS] METADATA ENRICHED: [CitationKey] - added volume={X}, pages={Y--Z}, doi={10.XXX/YYY} ✅

Step 4: Handle Unfindable Metadata

If metadata genuinely cannot be found after web search (very old paper, obscure conference, etc.):

  1. Add a note field to the BibTeX entry explaining the gap: ``bibtex note = {Volume and pages not available — published online only}
  2. Log the exception: `` [HH:MM:SS] METADATA INCOMPLETE: [CitationKey] - pages unavailable (online-only publication) ⚠️
  3. These exceptions should be rare — most modern papers have complete metadata findable via web search.

Quick Reference: Common Missing Fields and Where to Find Them

Missing FieldBest Search Strategy
DOISearch "AUTHOR TITLE DOI" via parallel-cli search
VolumeExtract from DOI page or search "JOURNAL YEAR TITLE volume"
PagesExtract from DOI page or search publisher website
Issue/NumberExtract from DOI page or CrossRef
PublisherSearch "JOURNAL publisher" or check journal website

Raw lines 157 to 269
Names a skill parallel-web :180
270### Phase 3: BibTeX Formatting
272**Goal**: Generate clean, properly formatted BibTeX entries.
274#### Understanding BibTeX Entry Types
276See `references/bibtex_formatting.md` for complete guide.
278**Common Entry Types**:
279- `@article`: Journal articles (most common)
280- `@book`: Books
281- `@inproceedings`: Conference papers
282- `@incollection`: Book chapters
283- `@phdthesis`: Dissertations
284- `@misc`: Preprints, software, datasets
286**Required Fields by Type**:
288```bibtex
289@article{citationkey,
290 author = {Last1, First1 and Last2, First2},
291 title = {Article Title},
292 journal = {Journal Name},
293 year = {2024},
294 volume = {10},
295 number = {3},
296 pages = {123--145},
297 doi = {10.1234/example}
300@inproceedings{citationkey,
301 author = {Last, First},
302 title = {Paper Title},
303 booktitle = {Conference Name},
304 year = {2024},
305 pages = {1--10}
308@book{citationkey,
309 author = {Last, First},
310 title = {Book Title},
311 publisher = {Publisher Name},
312 year = {2024}
314```
316#### Formatting and Cleaning
318Use the formatter to standardize BibTeX files:
320```bash
321# Format and clean BibTeX file
322python scripts/format_bibtex.py references.bib \
323 --output formatted_references.bib
325# Sort entries by citation key
326python scripts/format_bibtex.py references.bib \
327 --sort key \
328 --output sorted_references.bib
330# Sort by year (newest first)
331python scripts/format_bibtex.py references.bib \
332 --sort year \
333 --descending \
334 --output sorted_references.bib
336# Remove duplicates
337python scripts/format_bibtex.py references.bib \
338 --deduplicate \
339 --output clean_references.bib
341# Merge sources: one key scheme, then drop duplicates
342python scripts/format_bibtex.py references.bib \
343 --rekey \
344 --deduplicate \
345 --output merged_references.bib
346```
348**Formatting Operations**:
349- Standardize field order
350- Consistent indentation and spacing
351- Proper capitalization in titles (protected with {})
352- Standardized author name format
353- Consistent citation key format
354- Remove unnecessary fields
355- Fix common errors (missing commas, braces)

Phase 3: BibTeX Formatting

Goal: Generate clean, properly formatted BibTeX entries.

Understanding BibTeX Entry Types

See references/bibtex_formatting.md for complete guide.

Common Entry Types:

  • @article: Journal articles (most common)
  • @book: Books
  • @inproceedings: Conference papers
  • @incollection: Book chapters
  • @phdthesis: Dissertations
  • @misc: Preprints, software, datasets

Required Fields by Type:

@article{citationkey,
  author  = {Last1, First1 and Last2, First2},
  title   = {Article Title},
  journal = {Journal Name},
  year    = {2024},
  volume  = {10},
  number  = {3},
  pages   = {123--145},
  doi     = {10.1234/example}
}

@inproceedings{citationkey,
  author    = {Last, First},
  title     = {Paper Title},
  booktitle = {Conference Name},
  year      = {2024},
  pages     = {1--10}
}

@book{citationkey,
  author    = {Last, First},
  title     = {Book Title},
  publisher = {Publisher Name},
  year      = {2024}
}

Formatting and Cleaning

Use the formatter to standardize BibTeX files:

# Format and clean BibTeX file
python scripts/format_bibtex.py references.bib \
  --output formatted_references.bib

# Sort entries by citation key
python scripts/format_bibtex.py references.bib \
  --sort key \
  --output sorted_references.bib

# Sort by year (newest first)
python scripts/format_bibtex.py references.bib \
  --sort year \
  --descending \
  --output sorted_references.bib

# Remove duplicates
python scripts/format_bibtex.py references.bib \
  --deduplicate \
  --output clean_references.bib

# Merge sources: one key scheme, then drop duplicates
python scripts/format_bibtex.py references.bib \
  --rekey \
  --deduplicate \
  --output merged_references.bib

Formatting Operations:

  • Standardize field order
  • Consistent indentation and spacing
  • Proper capitalization in titles (protected with {})
  • Standardized author name format
  • Consistent citation key format
  • Remove unnecessary fields
  • Fix common errors (missing commas, braces)
Raw lines 270 to 356
Runs code python scripts/format_bibtex.py :322
357### Phase 4: Citation Validation
359**Goal**: Verify all citations are accurate and complete.
361#### Comprehensive Validation
363```bash
364# Validate BibTeX file
365python scripts/validate_citations.py references.bib
367# Validate against a venue standard (e.g., Nature, NeurIPS, Literature Review)
368python scripts/validate_citations.py references.bib --venue nature
369python scripts/validate_citations.py references.bib --venue neurips
370python scripts/validate_citations.py references.bib --venue review
372# Validate with custom minimum citation count
373python scripts/validate_citations.py references.bib --min-count 40
375# Check references against a written manuscript file (detect missing or unused citations)
376python scripts/validate_citations.py references.bib --manuscript paper.md
378# Generate detailed validation report
379python scripts/validate_citations.py references.bib \
380 --venue nature \
381 --manuscript paper.md \
382 --report validation_report.json \
383 --verbose
384```
386**Validation Checks** (see `references/citation_validation.md`):
3881. **DOI Verification**:
389 - With `--check-dois`, check registration through Crossref, then DataCite and resolver fallback
390 - Failed/rate-limited lookups remain `doi_unverified` warnings
391 - Compare title/authors/year manually; the script does not perform metadata matching
3932. **Required Fields**:
394 - All required fields present for entry type
395 - No empty or missing critical information
396 - Author names properly formatted
3983. **Data Consistency**:
399 - Year is valid (4 digits, reasonable range)
400 - Review volume/issue values manually; supplements may be alphanumeric
401 - Pages formatted correctly (e.g., 123--145)
402 - Check landing URLs manually; the script does not fetch arbitrary bibliography URLs
4044. **Duplicate Detection**:
405 - Same DOI used multiple times
406 - Similar titles (possible duplicates)
407 - Same author/year/title combinations
4095. **Format Compliance**:
410 - Valid BibTeX syntax
411 - Proper bracing and quoting
412 - Citation keys are unique
413 - Special characters handled correctly
415**Validation Output**:
416```json
418 "total_entries": 150,
419 "valid_entries": 145,
420 "errors": [
421 {
422 "citation_key": "Smith2023",
423 "error_type": "missing_field",
424 "field": "journal",
425 "severity": "high"
426 },
427 {
428 "citation_key": "Jones2022",
429 "error_type": "invalid_doi",
430 "doi": "10.1234/broken",
431 "severity": "high"
432 }
433 ],
434 "warnings": [
435 {
436 "citation_key": "Brown2021",
437 "warning_type": "possible_duplicate",
438 "duplicate_of": "Brown2021a",
439 "severity": "medium"
440 }
441 ]
443```
445#### Citation Counts
447Use enough relevant, verified references to support the claims. The script's
448venue figures are editorial heuristics, not current submission requirements.
449`--venue` produces warnings; `--min-count` enforces an explicit user-specified
450floor. Check the target venue's current author instructions directly and do not
451add irrelevant citations merely to meet a numeric target.
453#### Mandatory Post-Writing Reference Checks (Non-Negotiable)
455Once the entire scientific report or paper has been drafted and written, perform a comprehensive post-writing verification of all citations before compiling the final deliverables:
4571. **Verify No Missing or Unresolved Citations**: Check the draft or compiled document to ensure that every in-text citation correctly resolves to a reference in `references.bib`. There must be ZERO broken citation keys, missing identifiers, or unresolved references (e.g., `[?]` or `[citation needed]`).
4582. **Verify No Unused (Dangling) Bibliography Entries**: Check that every entry in `references.bib` is actually cited in the body of the report. Remove any unused entries to keep the bibliography perfectly clean.
4593. **Verify Evidence Coverage**: Confirm each claim is supported by relevant evidence and any explicit reference-count requirement is met.
4604. **Verify Metadata Completeness**: Confirm that all cited entries contain verified applicable fields; record missing/not-yet-assigned fields without inventing values.
462Run all of these checks in one command:
464```bash
465python scripts/validate_citations.py references.bib \
466 --venue <venue> \
467 --manuscript paper.md \
468 --report post_writing_check.json
469```

Phase 4: Citation Validation

Goal: Verify all citations are accurate and complete.

Comprehensive Validation

# Validate BibTeX file
python scripts/validate_citations.py references.bib

# Validate against a venue standard (e.g., Nature, NeurIPS, Literature Review)
python scripts/validate_citations.py references.bib --venue nature
python scripts/validate_citations.py references.bib --venue neurips
python scripts/validate_citations.py references.bib --venue review

# Validate with custom minimum citation count
python scripts/validate_citations.py references.bib --min-count 40

# Check references against a written manuscript file (detect missing or unused citations)
python scripts/validate_citations.py references.bib --manuscript paper.md

# Generate detailed validation report
python scripts/validate_citations.py references.bib \
  --venue nature \
  --manuscript paper.md \
  --report validation_report.json \
  --verbose

Validation Checks (see references/citation_validation.md):

  1. DOI Verification:
  2. With --check-dois, check registration through Crossref, then DataCite and resolver fallback
  3. Failed/rate-limited lookups remain doi_unverified warnings
  4. Compare title/authors/year manually; the script does not perform metadata matching
  1. Required Fields:
  2. All required fields present for entry type
  3. No empty or missing critical information
  4. Author names properly formatted
  1. Data Consistency:
  2. Year is valid (4 digits, reasonable range)
  3. Review volume/issue values manually; supplements may be alphanumeric
  4. Pages formatted correctly (e.g., 123--145)
  5. Check landing URLs manually; the script does not fetch arbitrary bibliography URLs
  1. Duplicate Detection:
  2. Same DOI used multiple times
  3. Similar titles (possible duplicates)
  4. Same author/year/title combinations
  1. Format Compliance:
  2. Valid BibTeX syntax
  3. Proper bracing and quoting
  4. Citation keys are unique
  5. Special characters handled correctly

Validation Output:

{
  "total_entries": 150,
  "valid_entries": 145,
  "errors": [
    {
      "citation_key": "Smith2023",
      "error_type": "missing_field",
      "field": "journal",
      "severity": "high"
    },
    {
      "citation_key": "Jones2022",
      "error_type": "invalid_doi",
      "doi": "10.1234/broken",
      "severity": "high"
    }
  ],
  "warnings": [
    {
      "citation_key": "Brown2021",
      "warning_type": "possible_duplicate",
      "duplicate_of": "Brown2021a",
      "severity": "medium"
    }
  ]
}

Citation Counts

Use enough relevant, verified references to support the claims. The script's venue figures are editorial heuristics, not current submission requirements. --venue produces warnings; --min-count enforces an explicit user-specified floor. Check the target venue's current author instructions directly and do not add irrelevant citations merely to meet a numeric target.

Mandatory Post-Writing Reference Checks (Non-Negotiable)

Once the entire scientific report or paper has been drafted and written, perform a comprehensive post-writing verification of all citations before compiling the final deliverables:

  1. Verify No Missing or Unresolved Citations: Check the draft or compiled document to ensure that every in-text citation correctly resolves to a reference in references.bib. There must be ZERO broken citation keys, missing identifiers, or unresolved references (e.g., [?] or [citation needed]).
  2. Verify No Unused (Dangling) Bibliography Entries: Check that every entry in references.bib is actually cited in the body of the report. Remove any unused entries to keep the bibliography perfectly clean.
  3. Verify Evidence Coverage: Confirm each claim is supported by relevant evidence and any explicit reference-count requirement is met.
  4. Verify Metadata Completeness: Confirm that all cited entries contain verified applicable fields; record missing/not-yet-assigned fields without inventing values.

Run all of these checks in one command:

python scripts/validate_citations.py references.bib \
  --venue <venue> \
  --manuscript paper.md \
  --report post_writing_check.json
Raw lines 357 to 470
Runs code python scripts/validate_citations.py :365
471### Phase 5: Integration with Writing Workflow
473#### Building References for Manuscripts
475Complete workflow for creating a bibliography:
477```bash
478# 1. Search for papers on your topic
479python scripts/search_pubmed.py \
480 '"CRISPR-Cas Systems"[MeSH] AND "Gene Editing"[MeSH]' \
481 --date-start 2020 \
482 --limit 200 \
483 --output crispr_papers.json
485# 2. Extract DOIs from search results and convert to BibTeX
486python scripts/extract_metadata.py \
487 --input crispr_papers.json \
488 --output crispr_refs.bib
490# 3. Add specific papers by DOI
491python scripts/doi_to_bibtex.py 10.1038/nature12345 >> crispr_refs.bib
492python scripts/doi_to_bibtex.py 10.1126/science.abcd1234 >> crispr_refs.bib
494# 4. Format and clean the BibTeX file
495python scripts/format_bibtex.py crispr_refs.bib \
496 --deduplicate \
497 --sort year \
498 --descending \
499 --output references.bib
501# 5. Validate all citations
502python scripts/validate_citations.py references.bib \
503 --report validation.json
505# 6. Review validation report and fix any remaining issues
506cat validation.json
508# 7. Use in your LaTeX document
509# \bibliography{final_references}
510```
512#### Integration with Literature Review Skill
514This skill complements the `literature-review` skill:
516**Literature Review Skill** → Systematic search and synthesis
517**Citation Management Skill** → Technical citation handling
519**Combined Workflow**:
5201. Use `literature-review` for comprehensive multi-database search
5212. Use `citation-management` to extract and validate all citations
5223. Use `literature-review` to synthesize findings thematically
5234. Use `citation-management` to verify final bibliography accuracy
525```bash
526# After completing literature review
527# Verify all citations in the review document
528python scripts/validate_citations.py my_review_references.bib --report review_validation.json
530# Normalise formatting (venue style is chosen by the .bst at build time)
531python scripts/format_bibtex.py my_review_references.bib \
532 --output formatted_refs.bib
533```
535#### Integration with Zotero (pyzotero Skill)
537When the user already keeps references in Zotero, treat the Zotero library as the source of truth for the bibliography and use this skill for validation and formatting. The `pyzotero` skill covers the library side — reading items and collections, creating and updating references, uploading attachments, and exporting citations via the Zotero Web API v3.
539**Zotero Library (`pyzotero`)** → Library of record: storage, collections, tags, attachments
540**Citation Management Skill** → Metadata accuracy: validation, enrichment, style formatting
542**Combined Workflow**:
5431. Use `pyzotero` to pull the working set from the Zotero library, filtered by collection or tag
5442. Export it as BibTeX using the `pyzotero` skill's export workflow. `format='bibtex'` returns a `bibtexparser` object, not a text string; serialize it and handle pagination.
5453. Use `citation-management` to validate the exported entries and repair incomplete metadata
5464. Use `citation-management` to format for the target venue
5475. Optionally use `pyzotero` to write corrected fields back so the library benefits from the fixes
549```bash
550# 1-2. Export the desired collection from Zotero as BibTeX (pyzotero skill)
551# Follow the pyzotero export workflow: collect all pages, serialize the
552# returned bibtexparser object, and verify the exported item count.
554# 3. Validate the exported bibliography
555python scripts/validate_citations.py zotero_export.bib --report zotero_validation.json
557# 4. Normalise the export (venue style comes from the .bst at build time)
558python scripts/format_bibtex.py zotero_export.bib \
559 --output formatted_refs.bib
560```
562Zotero exports are only as good as what was captured — browser-connector entries in particular often carry missing DOIs, truncated author lists, or preprint metadata for papers since published. Run the validation step before submission rather than trusting the export, and prefer writing corrections back to Zotero so the same errors do not resurface in the next manuscript.
564Pyzotero export return types and pagination: [official documentation](https://pyzotero.readthedocs.io/en/latest/). The Zotero handoff is illustrative; authenticated library export was not tested in this refresh.

Phase 5: Integration with Writing Workflow

Building References for Manuscripts

Complete workflow for creating a bibliography:

# 1. Search for papers on your topic
python scripts/search_pubmed.py \
  '"CRISPR-Cas Systems"[MeSH] AND "Gene Editing"[MeSH]' \
  --date-start 2020 \
  --limit 200 \
  --output crispr_papers.json

# 2. Extract DOIs from search results and convert to BibTeX
python scripts/extract_metadata.py \
  --input crispr_papers.json \
  --output crispr_refs.bib

# 3. Add specific papers by DOI
python scripts/doi_to_bibtex.py 10.1038/nature12345 >> crispr_refs.bib
python scripts/doi_to_bibtex.py 10.1126/science.abcd1234 >> crispr_refs.bib

# 4. Format and clean the BibTeX file
python scripts/format_bibtex.py crispr_refs.bib \
  --deduplicate \
  --sort year \
  --descending \
  --output references.bib

# 5. Validate all citations
python scripts/validate_citations.py references.bib \
  --report validation.json

# 6. Review validation report and fix any remaining issues
cat validation.json

# 7. Use in your LaTeX document
# \bibliography{final_references}

Integration with Literature Review Skill

This skill complements the literature-review skill:

Literature Review Skill → Systematic search and synthesis Citation Management Skill → Technical citation handling

Combined Workflow:

  1. Use literature-review for comprehensive multi-database search
  2. Use citation-management to extract and validate all citations
  3. Use literature-review to synthesize findings thematically
  4. Use citation-management to verify final bibliography accuracy
# After completing literature review
# Verify all citations in the review document
python scripts/validate_citations.py my_review_references.bib --report review_validation.json

# Normalise formatting (venue style is chosen by the .bst at build time)
python scripts/format_bibtex.py my_review_references.bib \
  --output formatted_refs.bib

Integration with Zotero (pyzotero Skill)

When the user already keeps references in Zotero, treat the Zotero library as the source of truth for the bibliography and use this skill for validation and formatting. The pyzotero skill covers the library side — reading items and collections, creating and updating references, uploading attachments, and exporting citations via the Zotero Web API v3.

**Zotero Library (pyzotero) → Library of record: storage, collections, tags, attachments Citation Management Skill** → Metadata accuracy: validation, enrichment, style formatting

Combined Workflow:

  1. Use pyzotero to pull the working set from the Zotero library, filtered by collection or tag
  2. Export it as BibTeX using the pyzotero skill's export workflow. format='bibtex' returns a bibtexparser object, not a text string; serialize it and handle pagination.
  3. Use citation-management to validate the exported entries and repair incomplete metadata
  4. Use citation-management to format for the target venue
  5. Optionally use pyzotero to write corrected fields back so the library benefits from the fixes
# 1-2. Export the desired collection from Zotero as BibTeX (pyzotero skill)
#      Follow the pyzotero export workflow: collect all pages, serialize the
#      returned bibtexparser object, and verify the exported item count.

# 3. Validate the exported bibliography
python scripts/validate_citations.py zotero_export.bib --report zotero_validation.json

# 4. Normalise the export (venue style comes from the .bst at build time)
python scripts/format_bibtex.py zotero_export.bib \
  --output formatted_refs.bib

Zotero exports are only as good as what was captured — browser-connector entries in particular often carry missing DOIs, truncated author lists, or preprint metadata for papers since published. Run the validation step before submission rather than trusting the export, and prefer writing corrections back to Zotero so the same errors do not resurface in the next manuscript.

Pyzotero export return types and pagination: official documentation. The Zotero handoff is illustrative; authenticated library export was not tested in this refresh.

Raw lines 471 to 564
Runs code python scripts/search_pubmed.py :479
Runs code python scripts/extract_metadata.py :486
Runs code python scripts/doi_to_bibtex.py :491
Runs code python scripts/format_bibtex.py :495
Runs code python scripts/validate_citations.py :502
Names a skill literature-review :514
Names a skill pyzotero :537