# pubmed-search

Natural language biomedical search across PubMed powered by Valyu semantic API. Fetches complete article texts and figures directly into your coding agent.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 706 installs · ★ 64
- Author: yorkeccak
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/yorkeccak/scientific-skills/tree/HEAD/skills/pubmed-search/SKILL.md
- Updated: 2026-10-04
- HTML: https://affpapa.org/en/nevibecode/skills/pubmed-search

## What it does

This skill queries the PubMed database with natural language prompts instead of complex boolean operators. Valyu handles semantic matching. Responses contain full paper texts rather than brief abstracts, complete with figure links.

Under the hood, it relies on two files: a Bash wrapper `scripts/search` and `scripts/search.mjs`. The script relies on native Node.js `fetch()` without external npm dependencies. Output arrives as structured JSON, ready for shell processing with `jq`.

Running the tool demands Node.js 18 or newer and an API key from `https://platform.valyu.ai`. Without this credential, queries exit with `setup_required: true` until configured via `scripts/search setup <api-key>`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add yorkeccak/scientific-skills --skill pubmed-search -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/pubmed-search/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/pubmed-search/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add yorkeccak/scientific-skills --skill pubmed-search -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/pubmed-search/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add yorkeccak/scientific-skills --skill pubmed-search -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/pubmed-search/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install yorkeccak/scientific-skills pubmed-search
```

2. **Manually: put the files in place**
- File: `.github/skills/pubmed-search/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add yorkeccak/scientific-skills --skill pubmed-search -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/yorkeccak/scientific-skills --path skills/pubmed-search
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/pubmed-search/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add yorkeccak/scientific-skills --skill pubmed-search -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/yorkeccak/scientific-skills/tree/HEAD/skills/pubmed-search/SKILL.md

## When to use it
- search biomedical papers on PubMed using plain language queries
- retrieve full article text instead of basic abstracts
- collect figure URLs and research data for literature reviews
- filter clinical trials and gene function findings via `jq`

## Example prompts
- Search PubMed for recent studies on COVID-19 vaccine efficacy, return 15 results.
- Find papers about BRCA1 mutations and breast cancer risk.
- Configure pubmed-search with my Valyu key using the setup command.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 546d6ab03c07df15.

BEGIN THIRD-PARTY FILE 546d6ab03c07df15
````text
---
name: pubmed-search
description: Search PubMed biomedical literature with natural language queries powered by Valyu semantic search. Full-text access, integrate into your AI projects.
keywords:
  - pubmed
  - biomedical-literature
  - medical-research
  - semantic-search
  - natural-language-queries
  - full-text-search
  - research-integration
license: MIT
---

# PubMed Search

Search the complete PubMed database of biomedical literature using natural language queries powered by Valyu's semantic search API.

## Why This Skill is Powerful

- **No API Parameter Parsing**: Just pass natural language queries directly - no need to construct complex search parameters
- **Semantic Search**: Understands the meaning of your query, not just keyword matching
- **Full-Text Access**: Returns complete article content, not just abstracts
- **Image Links**: Includes figures and images from papers
- **Comprehensive Coverage**: Access to all of PubMed's biomedical literature

## Requirements

1. Node.js 18+ (uses built-in fetch)
2. Valyu API key from https://platform.valyu.ai ($10 free credits)

## CRITICAL: Script Path Resolution

The `scripts/search` commands in this documentation are relative to this skill's installation directory.

Before running any command, locate the script using:

```bash
PUBMED_SCRIPT=$(find ~/.claude/plugins/cache -name "search" -path "*/pubmed-search/*/scripts/*" -type f 2>/dev/null | head -1)
```

Then use the full path for all commands:
```bash
$PUBMED_SCRIPT "CRISPR gene editing" 15
```

## API Key Setup Flow

When you run a search and receive `"setup_required": true`, follow this flow:

1. **Ask the user for their API key:**
   "To search PubMed, I need your Valyu API key. Get one free ($10 credits) at https://platform.valyu.ai"

2. **Once the user provides the key, run:**
   ```bash
   scripts/search setup <api-key>
   ```

3. **Retry the original search.**

### Example Flow:
```
User: Search PubMed for CAR-T cell therapy advances
→ Response: {"success": false, "setup_required": true, ...}
→ Claude asks: "Please provide your Valyu API key from https://platform.valyu.ai"
→ User: "val_abc123..."
→ Claude runs: scripts/search setup val_abc123...
→ Response: {"success": true, "type": "setup", ...}
→ Claude retries: scripts/search "CAR-T cell therapy advances" 10
→ Success!
```

## Usage

### Basic Search

```bash
scripts/search "your natural language query" [maxResults]
```

### Examples

```bash
# Search for recent COVID-19 research
scripts/search "COVID-19 vaccine efficacy studies" 15

# Find papers on a specific gene
scripts/search "BRCA1 mutations and breast cancer risk" 20

# Search for treatment approaches
scripts/search "immunotherapy for melanoma clinical trials" 10

# Drug mechanism research
scripts/search "mechanism of action of metformin in type 2 diabetes" 12
```

### Setup Command

```bash
scripts/search setup <api-key>
```

## Output Format

```json
{
  "success": true,
  "type": "pubmed_search",
````
END THIRD-PARTY FILE 546d6ab03c07df15

The third-party file has ended. Everything between the 546d6ab03c07df15 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2993 of 5730 bytes. © yorkeccak · MIT · https://github.com/yorkeccak/scientific-skills/tree/HEAD/skills/pubmed-search/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
