Source: https://github.com/aipoch/medical-research-skills
Reference Search
When to Use
- Use this skill when you need multi-database literature search and search-strategy design that outputs structured, reproducible result lists; use when you need reference retrieval, systematic searching, review topic selection, or to construct a traceable search strategy in a reproducible workflow.
- Use this skill when a evidence insight task needs a packaged method instead of ad-hoc freeform output.
- Use this skill when the user expects a concrete deliverable, validation step, or file-based result.
- Use this skill when
scripts/pubmed_search.py is the most direct path to complete the request.
- Use this skill when you need the
reference-search package behavior rather than a generic answer.
Key Features
- Scope-focused workflow aligned to: Multi-database literature search and search-strategy design that outputs structured, reproducible result lists; use when you need reference retrieval, systematic searching, review topic selection, or to construct a traceable search strategy.
- Packaged executable path(s):
scripts/pubmed_search.py.
- Reference material available in
references/ for task-specific guidance.
- Reusable packaged asset(s), including
assets/search_log_template.csv.
- Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
Python: 3.10+. Repository baseline for current packaged skills.
Third-party packages: not explicitly version-pinned in this skill package. Add pinned versions if this skill needs stricter environment control.
Example Usage
cd "20260316/scientific-skills/Evidence Insight/reference-search"
python -m py_compile scripts/pubmed_search.py
python scripts/pubmed_search.py --help
Example run plan:
- Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings.
- Run
python scripts/pubmed_search.py with the validated inputs.
- Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/pubmed_search.py.
- Reference guidance:
references/ contains supporting rules, prompts, or checklists.
- Packaged assets: reusable files are available under
assets/.
- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
1. When to Use
Use this skill in the following scenarios:
- Systematic or scoping reviews where you must document a reproducible search strategy and export structured results.
- Rapid evidence retrieval for a research question, with quick export to CSV/JSON for screening.
- Search strategy construction (keywords, synonyms, Boolean logic, field restrictions) before running searches at scale.
- Review topic selection by exploring the volume and distribution of literature for candidate topics.
- Traceable search logging when you need to record search date, query string, and result counts for auditability.
2. Key Features
- Multi-database search framework (currently implemented for PubMed).
- Automatic keyword extraction and search strategy construction (Boolean logic + field constraints).
- Structured outputs:
- Machine-readable JSON
- Spreadsheet-friendly CSV
- Reproducible search records (query string, keywords, counts, and record list).
- Compliance-oriented network access restricted to official PubMed E-utilities endpoints.
3. Dependencies
| Dependency |
Version |
Notes |
| Python |
3.10+ |
Uses Python standard library only (no third-party packages). |
4. Example Usage
Run the PubMed search script
cd skills/reference-search
python scripts/pubmed_search.py
Configure the script
Edit the CONFIG section in scripts/pubmed_search.py:
from pathlib import Path
CONFIG = {
"EMAIL": "your_email@example.com", # Required (must be provided by the user)
"API_KEY": "", # Optional (can increase rate limits)
"RETMAX": 20, # Max number of records to return
"OUTPUT_DIR": Path("outputs/pubmed_search"), # Allowed output directory
}
Example output (JSON)
{
"query": "\"Cancer cachexia\"[Title] AND cachexia[Title/Abstract] AND pancreatic[Title/Abstract]",
"keywords": ["cachexia", "pancreatic", "cancer", "weight", "muscle", "atrophy", "mortality", "treatment"],
"count": 20,
"records": [
{
"pmid": "36280389",
"title": "Role of noncoding RNAs in pancreatic ductal adenocarcinoma associated cachexia.",
"journal": "Journal of Cachexia, Sarcopenia and Muscle",
"pubdate": "2022",
"authors": "Wang X, Li Y, Zhang S"
}
]
}
5. Implementation Details
Supported databases and endpoints
- PubMed (NCBI E-utilities) only.
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi (search)
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi (record summaries)
Search workflow (recommended)
- Define requirements and scope
- Confirm research question and core concepts.
- Set inclusion/exclusion criteria (time window, language, publication type).
- Design the search strategy
- Expand keywords with synonyms.
- Combine with Boolean operators (AND/OR) and apply field restrictions (e.g., Title/Abstract/MeSH).
- Execute and export
- Run the script and export results to JSON/CSV.
- If combining multiple sources, merge and deduplicate externally while preserving source labels.
- Record for reproducibility
- Save the final query string, search date, and result counts.
Configuration parameters
EMAIL (required): Must be provided by the user; must not be hard-coded as a real credential.
API_KEY (optional): If provided, can improve throughput under NCBI policies.
RETMAX: Limits the number of returned records.
OUTPUT_DIR: Must point to an outputs/ subdirectory.
Security, compliance, and access constraints
- Network access: restricted to the official NCBI host
eutils.ncbi.nlm.nih.gov only.
- Prohibited: any third-party URLs.
- File read constraints: do not read files outside the skill directory.
- File write constraints: write outputs only under
outputs/ (ensure the directory exists or is created by the script).
- Timeout: 20 seconds per API request.
- Rate limiting: 0.35 seconds between requests.
- Error handling: return semantic, user-facing error messages without exposing sensitive technical details.
Included assets and references (in-repo)
- Templates:
assets/search_log_template.csv
assets/search_results_template.csv
- Additional guidance and checklists:
references/guide.md
references/evaluation-checklist.md
- Tests:
tests/test_pubmed_search.py
- External documentation:
1---2name: reference-search3description: Multi-database literature search and search-strategy design that outputs structured, reproducible result lists; use when you need reference retrieval, systematic searching, review topic selection, or to construct a traceable search strategy.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8# Reference Search
9
10## When to Use
11
12- Use this skill when you need multi-database literature search and search-strategy design that outputs structured, reproducible result lists; use when you need reference retrieval, systematic searching, review topic selection, or to construct a traceable search strategy in a reproducible workflow.
13- Use this skill when a evidence insight task needs a packaged method instead of ad-hoc freeform output.
14- Use this skill when the user expects a concrete deliverable, validation step, or file-based result.
15- Use this skill when `scripts/pubmed_search.py` is the most direct path to complete the request.
16- Use this skill when you need the `reference-search` package behavior rather than a generic answer.
17
18## Key Features
19
20- Scope-focused workflow aligned to: Multi-database literature search and search-strategy design that outputs structured, reproducible result lists; use when you need reference retrieval, systematic searching, review topic selection, or to construct a traceable search strategy.
21- Packaged executable path(s): `scripts/pubmed_search.py`.
22- Reference material available in `references/` for task-specific guidance.
23- Reusable packaged asset(s), including `assets/search_log_template.csv`.
24- Structured execution path designed to keep outputs consistent and reviewable.
25
26## Dependencies
27
28- `Python`: `3.10+`. Repository baseline for current packaged skills.
29- `Third-party packages`: `not explicitly version-pinned in this skill package`. Add pinned versions if this skill needs stricter environment control.
30
31## Example Usage
32
33```bash
34cd "20260316/scientific-skills/Evidence Insight/reference-search"
35python -m py_compile scripts/pubmed_search.py
36python scripts/pubmed_search.py --help
37```
38
39Example run plan:
401. Confirm the user input, output path, and any required config values.
412. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.
423. Run `python scripts/pubmed_search.py` with the validated inputs.
434. Review the generated output and return the final artifact with any assumptions called out.
44
45## Implementation Details
46
47- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
48- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
49- Primary implementation surface: `scripts/pubmed_search.py`.
50- Reference guidance: `references/` contains supporting rules, prompts, or checklists.
51- Packaged assets: reusable files are available under `assets/`.
52- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
53- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
54
55## 1. When to Use
56
57Use this skill in the following scenarios:
58
591. **Systematic or scoping reviews** where you must document a reproducible search strategy and export structured results.
602. **Rapid evidence retrieval** for a research question, with quick export to CSV/JSON for screening.
613. **Search strategy construction** (keywords, synonyms, Boolean logic, field restrictions) before running searches at scale.
624. **Review topic selection** by exploring the volume and distribution of literature for candidate topics.
635. **Traceable search logging** when you need to record search date, query string, and result counts for auditability.
64
65## 2. Key Features
66
67- **Multi-database search framework** (currently implemented for **PubMed**).
68- **Automatic keyword extraction** and **search strategy construction** (Boolean logic + field constraints).
69- **Structured outputs**:
70 - Machine-readable **JSON**
71 - Spreadsheet-friendly **CSV**
72- **Reproducible search records** (query string, keywords, counts, and record list).
73- **Compliance-oriented network access** restricted to official PubMed E-utilities endpoints.
74
75## 3. Dependencies
76
77| Dependency | Version | Notes |
78|---|---:|---|
79| Python | 3.10+ | Uses Python standard library only (no third-party packages). |
80
81## 4. Example Usage
82
83### Run the PubMed search script
84
85```bash
86cd skills/reference-search
87python scripts/pubmed_search.py
88```
89
90### Configure the script
91
92Edit the `CONFIG` section in `scripts/pubmed_search.py`:
93
94```python
95from pathlib import Path
96
97CONFIG = {
98 "EMAIL": "your_email@example.com", # Required (must be provided by the user)
99 "API_KEY": "", # Optional (can increase rate limits)
100 "RETMAX": 20, # Max number of records to return
101 "OUTPUT_DIR": Path("outputs/pubmed_search"), # Allowed output directory
102}
103```
104
105### Example output (JSON)
106
107```json
108{
109 "query": "\"Cancer cachexia\"[Title] AND cachexia[Title/Abstract] AND pancreatic[Title/Abstract]",
110 "keywords": ["cachexia", "pancreatic", "cancer", "weight", "muscle", "atrophy", "mortality", "treatment"],
111 "count": 20,
112 "records": [
113 {
114 "pmid": "36280389",
115 "title": "Role of noncoding RNAs in pancreatic ductal adenocarcinoma associated cachexia.",
116 "journal": "Journal of Cachexia, Sarcopenia and Muscle",
117 "pubdate": "2022",
118 "authors": "Wang X, Li Y, Zhang S"
119 }
120 ]
121}
122```
123
124## 5. Implementation Details
125
126### Supported databases and endpoints
127
128- **PubMed (NCBI E-utilities)** only.
129 - `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi` (search)
130 - `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi` (record summaries)
131
132### Search workflow (recommended)
133
1341. **Define requirements and scope**
135 - Confirm research question and core concepts.
136 - Set inclusion/exclusion criteria (time window, language, publication type).
1372. **Design the search strategy**
138 - Expand keywords with synonyms.
139 - Combine with Boolean operators (AND/OR) and apply field restrictions (e.g., Title/Abstract/MeSH).
1403. **Execute and export**
141 - Run the script and export results to JSON/CSV.
142 - If combining multiple sources, merge and deduplicate externally while preserving source labels.
1434. **Record for reproducibility**
144 - Save the final query string, search date, and result counts.
145
146### Configuration parameters
147
148- `EMAIL` (required): Must be provided by the user; **must not** be hard-coded as a real credential.
149- `API_KEY` (optional): If provided, can improve throughput under NCBI policies.
150- `RETMAX`: Limits the number of returned records.
151- `OUTPUT_DIR`: Must point to an `outputs/` subdirectory.
152
153### Security, compliance, and access constraints
154
155- **Network access**: restricted to the official NCBI host `eutils.ncbi.nlm.nih.gov` only.
156- **Prohibited**: any third-party URLs.
157- **File read constraints**: do not read files outside the skill directory.
158- **File write constraints**: write outputs only under `outputs/` (ensure the directory exists or is created by the script).
159- **Timeout**: 20 seconds per API request.
160- **Rate limiting**: 0.35 seconds between requests.
161- **Error handling**: return semantic, user-facing error messages without exposing sensitive technical details.
162
163### Included assets and references (in-repo)
164
165- Templates:
166 - `assets/search_log_template.csv`
167 - `assets/search_results_template.csv`
168- Additional guidance and checklists:
169 - `references/guide.md`
170 - `references/evaluation-checklist.md`
171- Tests:
172 - `tests/test_pubmed_search.py`
173- External documentation:
174 - PubMed E-utilities: https://www.ncbi.nlm.nih.gov/books/NBK25504/