Reference retrieval skill

From aipoch/medical-research-skills · View interactive version

Reference retrieval skill is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Based on user input, directly find relevant literature or automatically construct PubMed Boolean search queries to retrieve and filter references suitable for citation. Applicable for quickly finding high-quality evidence on specific topics and completing reference lists.

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

Reference Retrieval Skill

Core Function

This skill helps users quickly retrieve and filter high-quality, highly relevant references from PubMed based on natural language descriptions.

Workflow

Step 1: Construct Boolean Query

  1. Analyze intent: Understand user semantics, extract core medical keywords (MeSH Terms preferred).
  2. Construct Boolean query:

[!TIP]

About Escaping:

If the query contains double quotes " (e.g., phrase search), you must wrap the entire query in single quotes or escape internal double quotes with \" to avoid command-line parsing errors.

- Correct: python scripts/pubmed_search.py 'Metformin AND "Type 2 Diabetes"'

- Correct: python scripts/pubmed_search.py "Metformin AND \"Type 2 Diabetes\""

Step 2: Execute Search

Prefer LitSense for semantic search; only use PubMed Boolean search when precise control or complex Boolean logic is needed.

Scenario A: Semantic/Natural Language Search (LitSense) [Preferred]

Suitable for direct natural language queries or finding literature related to complex statements.

python scripts/litsense_search.py "natural language query"

Scenario B: Basic Boolean Search (PubMed)

Suitable when a precise Boolean query has been constructed.

python scripts/pubmed_search.py "YOUR_BOOLEAN_QUERY"

Step 3: Evaluation & Iteration

If initial results are inadequate (too few, low relevance, or empty), must automatically iterate, up to 5 rounds.

  1. Analyze cause:
  1. Refine query:
  1. Iterate:

Step 4: Filter & Present

After the script returns JSON results, filter 3-5 best references based on these criteria:

  1. Selection criteria:
  1. Output format:

Present results strictly in the following structure:

I. Citation Marking

Add citation markers at key points in the response content (or in user-provided text).

II. References

List references in citation order, format as follows:

```markdown

[1] PMID: 34479503 | Title. Journal. https://pubmed.ncbi.nlm.nih.gov/34479503/

Citation rationale: Briefly explain why this reference supports the stated point.

[2] ...

```

PubMed link generation rules:

> [!NOTE]

> Example:

> [1] The augment of regulatory T cells undermines the efficacy of anti-PD-L1 treatment in cervical cancer. BMC Immunol. https://pubmed.ncbi.nlm.nih.gov/34479503/

Important Notes

When to Use

When Not to Use

Required Inputs

| Field | Required | Format/Source | Example | If Missing |

|---|---|---|---|---|

| User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide |

| Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing |

| Output preference | No | Text | Language, format, target journal, template | Use skill default format |

Output Contract

Failure Handling

User Checkpoints

Input Validation

This skill accepts requests that match the documented purpose of reference-retrieval-skill 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:

reference-retrieval-skill only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

Quick Validation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.