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

example_workflows.md

126 lines · skills/citation-management/references/example_workflows.md at 5f2bc03

Open on GitHub

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

1# Example Workflows
2
3Four end-to-end worked examples: building a bibliography for a paper, converting a
4list of DOIs, cleaning an existing BibTeX file, and finding and citing seminal papers.
5

Example Workflows

Four end-to-end worked examples: building a bibliography for a paper, converting a list of DOIs, cleaning an existing BibTeX file, and finding and citing seminal papers.

Raw lines 1 to 5
6## Example Workflows
7

Example Workflows

Raw lines 6 to 7
8### Example 1: Building a Bibliography for a Paper
9
10```bash
11# Step 1: Find key papers on your topic
12python scripts/search_google_scholar.py "transformer neural networks" \
13 --year-start 2017 \
14 --limit 50 \
15 --output transformers_gs.json
17python scripts/search_pubmed.py "deep learning medical imaging" \
18 --date-start 2020 \
19 --limit 50 \
20 --output medical_dl_pm.json
22# Step 2: Extract metadata from search results
23python scripts/extract_metadata.py \
24 --input transformers_gs.json \
25 --output transformers.bib
27python scripts/extract_metadata.py \
28 --input medical_dl_pm.json \
29 --output medical.bib
31# Step 3: Add specific papers you already know
32python scripts/doi_to_bibtex.py 10.1038/s41586-021-03819-2 >> specific.bib
33python scripts/doi_to_bibtex.py 10.1126/science.aam9317 >> specific.bib
35# Step 4: Combine all BibTeX files
36cat transformers.bib medical.bib specific.bib > combined.bib
38# Step 5: Format and deduplicate
39python scripts/format_bibtex.py combined.bib \
40 --deduplicate \
41 --sort year \
42 --descending \
43 --output formatted.bib
45# Step 6: Validate
46python scripts/validate_citations.py formatted.bib \
47 --report validation.json
49# Step 7: Review any issues
50cat validation.json | grep -A 3 '"errors"'
52# Step 8: Use in LaTeX
53# \bibliography{final_references}
54```

Example 1: Building a Bibliography for a Paper

# Step 1: Find key papers on your topic
python scripts/search_google_scholar.py "transformer neural networks" \
  --year-start 2017 \
  --limit 50 \
  --output transformers_gs.json

python scripts/search_pubmed.py "deep learning medical imaging" \
  --date-start 2020 \
  --limit 50 \
  --output medical_dl_pm.json

# Step 2: Extract metadata from search results
python scripts/extract_metadata.py \
  --input transformers_gs.json \
  --output transformers.bib

python scripts/extract_metadata.py \
  --input medical_dl_pm.json \
  --output medical.bib

# Step 3: Add specific papers you already know
python scripts/doi_to_bibtex.py 10.1038/s41586-021-03819-2 >> specific.bib
python scripts/doi_to_bibtex.py 10.1126/science.aam9317 >> specific.bib

# Step 4: Combine all BibTeX files
cat transformers.bib medical.bib specific.bib > combined.bib

# Step 5: Format and deduplicate
python scripts/format_bibtex.py combined.bib \
  --deduplicate \
  --sort year \
  --descending \
  --output formatted.bib

# Step 6: Validate
python scripts/validate_citations.py formatted.bib \
  --report validation.json

# Step 7: Review any issues
cat validation.json | grep -A 3 '"errors"'

# Step 8: Use in LaTeX
# \bibliography{final_references}
Raw lines 8 to 55
Runs code python scripts/search_google_scholar.py :12
Runs code python scripts/search_pubmed.py :17
Runs code python scripts/extract_metadata.py :23
Runs code python scripts/doi_to_bibtex.py :32
Runs code python scripts/format_bibtex.py :39
Runs code python scripts/validate_citations.py :46
56### Example 2: Converting a List of DOIs
58```bash
59# You have a text file with DOIs (one per line)
60# dois.txt contains:
61# 10.1038/s41586-021-03819-2
62# 10.1126/science.aam9317
63# 10.1016/j.cell.2023.01.001
65# Convert all to BibTeX
66python scripts/doi_to_bibtex.py --input dois.txt --output references.bib
68# Validate the result
69python scripts/validate_citations.py references.bib --verbose
70```

Example 2: Converting a List of DOIs

# You have a text file with DOIs (one per line)
# dois.txt contains:
# 10.1038/s41586-021-03819-2
# 10.1126/science.aam9317
# 10.1016/j.cell.2023.01.001

# Convert all to BibTeX
python scripts/doi_to_bibtex.py --input dois.txt --output references.bib

# Validate the result
python scripts/validate_citations.py references.bib --verbose
Raw lines 56 to 71
Runs code python scripts/doi_to_bibtex.py :66
Runs code python scripts/validate_citations.py :69
72### Example 3: Cleaning an Existing BibTeX File
74```bash
75# You have a messy BibTeX file from various sources
76# Clean it up systematically
78# Step 1: Format and standardize
79python scripts/format_bibtex.py messy_references.bib \
80 --output step1_formatted.bib
82# Step 2: Remove duplicates
83python scripts/format_bibtex.py step1_formatted.bib \
84 --deduplicate \
85 --output step2_deduplicated.bib
87# Step 3: Check what is still wrong before sorting
88python scripts/validate_citations.py step2_deduplicated.bib \
89 --report step3_validation.json
91# Step 4: Sort by year
92python scripts/format_bibtex.py step2_deduplicated.bib \
93 --sort year \
94 --descending \
95 --output clean_references.bib
97# Step 5: Final validation report
98python scripts/validate_citations.py clean_references.bib \
99 --report final_validation.json \
100 --verbose
102# Review report
103cat final_validation.json
104```

Example 3: Cleaning an Existing BibTeX File

# You have a messy BibTeX file from various sources
# Clean it up systematically

# Step 1: Format and standardize
python scripts/format_bibtex.py messy_references.bib \
  --output step1_formatted.bib

# Step 2: Remove duplicates
python scripts/format_bibtex.py step1_formatted.bib \
  --deduplicate \
  --output step2_deduplicated.bib

# Step 3: Check what is still wrong before sorting
python scripts/validate_citations.py step2_deduplicated.bib \
  --report step3_validation.json

# Step 4: Sort by year
python scripts/format_bibtex.py step2_deduplicated.bib \
  --sort year \
  --descending \
  --output clean_references.bib

# Step 5: Final validation report
python scripts/validate_citations.py clean_references.bib \
  --report final_validation.json \
  --verbose

# Review report
cat final_validation.json
Raw lines 72 to 105
Runs code python scripts/format_bibtex.py :79
Runs code python scripts/validate_citations.py :88
106### Example 4: Finding and Citing Seminal Papers
108```bash
109# Find highly cited papers on a topic
110python scripts/search_google_scholar.py "AlphaFold protein structure" \
111 --year-start 2020 \
112 --year-end 2024 \
113 --sort-by citations \
114 --limit 20 \
115 --output alphafold_seminal.json
117# Sort within the retrieved sample; this is not a global most-cited ranking
118# (the script includes citation counts in JSON)
120# Convert to BibTeX
121python scripts/extract_metadata.py \
122 --input alphafold_seminal.json \
123 --output alphafold_refs.bib
125# Verify the selected records and their metadata before citing them
126```

Example 4: Finding and Citing Seminal Papers

# Find highly cited papers on a topic
python scripts/search_google_scholar.py "AlphaFold protein structure" \
  --year-start 2020 \
  --year-end 2024 \
  --sort-by citations \
  --limit 20 \
  --output alphafold_seminal.json

# Sort within the retrieved sample; this is not a global most-cited ranking
# (the script includes citation counts in JSON)

# Convert to BibTeX
python scripts/extract_metadata.py \
  --input alphafold_seminal.json \
  --output alphafold_refs.bib

# Verify the selected records and their metadata before citing them
Raw lines 106 to 126
Runs code python scripts/search_google_scholar.py :110
Runs code python scripts/extract_metadata.py :121