Communitygithub.com

pubmed-database

直接使用PubMed和NCBI E-utilities进行生物医学文献搜索、MeSH查询、PMID查找、引文检索和API支持的文献监控。当任务需要PubMed生物医学文献而非通用网络搜索时使用。

pubmed-database 是什么?

该技能专为需要直接从PubMed和NCBI E-utilities进行生物医学文献检索的场景设计。它支持构建复杂查询,包括MeSH术语、字段标签、日期范围和文章类型,以及通过PMID查找、获取摘要和引用信息。技能提供完整的E-utilities工作流演示,涵盖esearch、esummary、efetch和elink接口,并包含Python示例代码,展示如何设置电子邮件和API密钥以避免速率限制。该技能还强调搜索日志的记录规范,包括搜索字符串、数据库、日期、过滤器和结果数量,确保系统评价或重复性搜索的可追溯性。支持的平台包括通过HTTP客户端(如Python的requests库)进行编程访问以及直接shell命令操作。它适用于药物研发、临床研究和学术综述写作等需要高精度生物医学信息检索的任务。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/scientific-db-pubmed-database

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

PubMed 数据库

当任务需要 PubMed 的生物医学文献而非通用网络搜索时,请使用此技能。

使用场景

  • 检索 MEDLINE 或生命科学文献。
  • 使用 MeSH 术语、字段标签、日期或文章类型构建 PubMed 查询。
  • 查找 PMID、摘要、出版元数据或相关引文。
  • 执行系统评价的检索轮次,需要可重复的检索字符串。
  • 直接从 Python、Shell 或其他 HTTP 客户端使用 NCBI E-utilities。

查询构建

从研究问题开始,将其拆分为概念,然后使用布尔运算符组合概念。

concept_1 AND concept_2 AND filter
synonym_a OR synonym_b
NOT exclusion_term

有用的 PubMed 字段标签:

  • [ti]:标题
  • [ab]:摘要
  • [tiab]:标题或摘要
  • [au]:作者
  • [ta]:期刊名称缩写
  • [mh]:MeSH 术语
  • [majr]:主要 MeSH 主题
  • [pt]:出版物类型
  • [dp]:出版日期
  • [la]:语言

示例:

diabetes mellitus[mh] AND treatment[tiab] AND systematic review[pt] AND 2023:2026[dp]
(metformin[nm] OR insulin[nm]) AND diabetes mellitus, type 2[mh] AND randomized controlled trial[pt]
smith ja[au] AND cancer[tiab] AND 2026[dp] AND english[la]

MeSH 和副主题词

当概念具有稳定的受控词汇术语时,优先使用 MeSH。当主题较新或术语多样化时,将 MeSH 与标题/摘要术语结合使用。

正确的副主题词语法应将副主题词放在字段标签之前:

diabetes mellitus, type 2/drug therapy[mh]
cardiovascular diseases/prevention & control[mh]

仅当主题必须是论文的核心内容时才使用 [majr]。虽然可以提高精确度,但可能遗漏相关研究。

过滤器

出版物类型:

  • clinical trial[pt]
  • meta-analysis[pt]
  • randomized controlled trial[pt]
  • review[pt]
  • systematic review[pt]
  • guideline[pt]

日期过滤器:

2026[dp]
2020:2026[dp]
2026/03/15[dp]

可用性过滤器:

free full text[sb]
hasabstract[text]

E-utilities 工作流

NCBI E-utilities 支持可重复的 API 工作流:

  1. esearch.fcgi:搜索并返回 PMID。
  2. esummary.fcgi:返回轻量级文章元数据。
  3. efetch.fcgi:以 XML、MEDLINE 或文本格式获取摘要或完整记录。
  4. elink.fcgi:查找相关文章和链接资源。

在生产脚本中使用电子邮件和 API 密钥。将 API 密钥存储在环境变量中,切勿保存在提交的文件或命令历史记录中。

import os
import time
import requests

BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"


def esearch(query: str, retmax: int = 20) -> list[str]:
    params = {
        "db": "pubmed",
        "term": query,
        "retmode": "json",
        "retmax": retmax,
        "tool": "ecc-pubmed-search",
        "email": os.environ.get("NCBI_EMAIL", ""),
    }
    api_key = os.environ.get("NCBI_API_KEY")
    if api_key:
        params["api_key"] = api_key

    response = requests.get(f"{BASE}/esearch.fcgi", params=params, timeout=30)
    response.raise_for_status()
    time.sleep(0.35)
    return response.json()["esearchresult"]["idlist"]


pmids = esearch("hypertension[mh] AND randomized controlled trial[pt] AND 2024:2026[dp]")
print(pmids)

对于批量操作,优先使用 NCBI 历史服务器参数(usehistory=y、WebEnv、query_key),而不是通过 URL 传递非常长的 PMID 列表。

输出规范

对于每次检索轮次,记录:

  • 确切的检索字符串
  • 检索的数据库
  • 检索日期
  • 使用的过滤器
  • 结果数量
  • 导出格式
  • 任何手动排除项

示例:

| 数据库 | 检索日期 | 查询 | 过滤器 | 结果 |
| --- | --- | --- | --- | ---: |
| PubMed | 2026-05-11 | `sickle cell disease[mh] AND CRISPR[tiab]` | 2020:2026[dp], English | 42 |

审查清单

  • 字段标签是否是有效的 PubMed 标签?
  • 对于较新的主题,MeSH 术语是否与自由文本同义词配对?
  • 日期范围是否明确且适当?
  • 检索日志是否包含足够细节以重现查询?
  • API 密钥是否从环境加载?
  • HTTP 代码在解析之前是否调用了 raise_for_status() 或处理了非 200 响应?
  • 是否遵守了速率限制?

参考文献

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能