/sd-search:sd-search [search keywords]from sd-search
Searches ScienceDirect, parses paper details, browses journals, and navigates results. Handles keyword and advanced search, result pagination, and anti-bot detection.
Ships in sd-search. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
一个技能覆盖 ScienceDirect 站内全部动作。基础检索在本文件;其余场景按路由表进入对应子流程文档。
| 用户想做什么 | 进入哪个流程 |
|---|---|
| 关键词检索(本文件主流程) | 下文 Steps |
| 高级检索(多字段过滤) | references/advanced-search.md |
| 打开/解析某篇论文详情页 | references/paper-detail.md |
| 解析当前结果页 | references/parse-results.md |
| 结果翻页 | references/navigate-pages.md |
| 浏览某期刊的卷期与文章 | references/journal-browse.md |
| 下载/导出/推送 Zotero | 条目交给 scansci-pdf 技能 |
Before the first operation, check the current browser page URL to determine which ScienceDirect domain the user is accessing. Store it as BASE_URL. Common patterns:
https://www.sciencedirect.comsciencedirect in the hostname (e.g. WebVPN or EZProxy)Use whatever origin the user's browser is currently on. If no ScienceDirect page is open, ask the user which URL to use.
If the page title is Just a moment... with heading Are you a robot?, Elsevier's Cloudflare wall has fingerprinted the browser context. Automated/embedded webviews (Electron in-app browsers, headless) hit this immediately; the user's daily Chrome driven via chrome-devtools (bundled .mcp.json already passes --disable-blink-features=AutomationControlled) usually does not. Do NOT retry the same context: either hand the visible browser to the user to pass the challenge once, or switch to chrome-devtools on the user's Chrome. Full signature table: docs/PLAYBOOK.md.
Use navigate_page to go to:
{BASE_URL}/search?qs={QUERY}&show=25
Where {QUERY} is the URL-encoded search keywords from $ARGUMENTS.
Important: Always include initScript to prevent bot detection:
initScript: "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
After navigation, verify the page loaded correctly:
sciencedirect or search, the user may have been redirected to a login/authentication page. Tell the user: "页面被重定向,请在浏览器中完成登录或认证后告知我。" Then wait.When a captcha page is detected (title "请稍候…" or body contains "Are you a robot"):
evaluate_script to poll for #captcha-box (up to 8s).take_snapshot to get the a11y tree. The checkbox is inside a cross-origin iframe but Chrome DevTools MCP can see it:
Iframe "包含 Cloudflare 安全质询的小组件"
checkbox "确认您是真人" ← target uid
click(uid) on the checkbox element.document.contentType changed or the page URL changed (indicating success). If still on captcha, retry once or fall back to asking the user.Use evaluate_script with built-in waiting. Do NOT use wait_for — it returns the full page snapshot which can exceed token limits (250K+ chars) on ScienceDirect pages.
async () => {
// Wait for results to load (up to 10s)
for (let i = 0; i < 20; i++) {
if (document.querySelector('li.ResultItem') || document.querySelector('.search-body-results-text')) break;
await new Promise(r => setTimeout(r, 500));
}
const items = document.querySelectorAll('li.ResultItem');
const papers = [];
for (let i = 0; i < items.length; i++) {
const item = items[i];
const titleLink = item.querySelector('a.result-list-title-link');
const journal = item.querySelector('a.subtype-srctitle-link');
const dateSpans = item.querySelectorAll('.srctitle-date-fields > span');
const date = dateSpans.length > 1 ? dateSpans[dateSpans.length - 1].textContent.trim() : '';
const authors = [...item.querySelectorAll('.Authors .author')].map(a => a.textContent.trim());
const doi = item.getAttribute('data-doi');
const pii = titleLink?.href?.match(/pii\/(\w+)/)?.[1] || '';
const articleType = item.querySelector('.article-type')?.textContent?.trim() || '';
const isOpenAccess = !!item.querySelector('.access-label');
papers.push({
rank: i + 1,
title: titleLink?.textContent?.trim() || '',
pii,
doi: doi || '',
journal: journal?.textContent?.trim() || '',
date,
authors,
articleType,
openAccess: isOpenAccess,
});
}
const totalText = document.querySelector('.search-body-results-text')?.textContent?.trim() || '';
const pageInfo = document.querySelector('.Pagination li:first-child')?.textContent?.trim() || '';
return { papers, totalResults: totalText, pageInfo };
}
Format results as a numbered list:
Found {totalResults}. {pageInfo}
1. {title}
Authors: {authors}
Journal: {journal} | {date}
DOI: {doi} | PII: {pii}
Type: {articleType} | Open Access: {yes/no}
2. ...
| Element | Selector |
|---|---|
| Result items | li.ResultItem |
| Title link | a.result-list-title-link |
| Journal link | a.subtype-srctitle-link |
| Authors | .Authors .author |
| Date | .srctitle-date-fields > span (last span) |
| DOI | data-doi attribute on li.ResultItem |
| Article type | .article-type |
| Open access indicator | .access-label |
| Total results | .search-body-results-text |
| Checkbox (for batch ops) | .checkbox-input (id = PII) |
| Next page link | .next-link a |
| Param | Description | Example |
|---|---|---|
qs | Query string | deep learning |
show | Results per page | 25, 50, 100 |
offset | Pagination offset | 0, 25, 50 |
sortBy | Sort order | date (omit for relevance) |
id equals the PII, used for batch export/download.navigate_page + evaluate_script.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub yuanyuanma03/academic-research-skills --plugin sd-searchOther plugins' skills for the same job