Content
# Wanfang Skills for Claude Code
[English](#english) |
Claude Code skills that let Claude interact with Wanfang Data through Chrome DevTools MCP, modeled after cookjohn/cnki-skills.
> If you have Wanfang open-platform credentials and don't need PDF download or Zotero push, the official wfdata-open-skills is the more stable path. This repo covers the browser-side capabilities the official API doesn't expose.
### Prerequisites
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI installed
- Chrome browser (manual login or institutional IP for downloads)
- [Zotero](https://www.zotero.org/) desktop app (optional, for export)
- Python 3 (optional, for Zotero push script)
### Tool List
| Tool | Function | Invocation |
|------|----------|----------|
| `wanfang-search` | Keyword search with structured result extraction | `/wanfang-search` |
| `wanfang-advanced-search` | Filtered search: title, author, journal, year, resource type | `/wanfang-advanced-search` |
| `wanfang-parse-results` | Re-parse current results page | `/wanfang-parse-results` |
| `wanfang-navigate-pages` | Pagination & sort | `/wanfang-navigate-pages` |
| `wanfang-paper-detail` | Extract full paper metadata | `/wanfang-paper-detail` |
| `wanfang-journal-search` | Find journals by name, ISSN, or CN | `/wanfang-journal-search` |
| `wanfang-journal-index` | Check journal core indexing & impact factor | `/wanfang-journal-index` |
| `wanfang-journal-toc` | Browse issue table of contents | `/wanfang-journal-toc` |
| `wanfang-download` | Download paper PDF/CAJ | `/wanfang-download` |
| `wanfang-export` | Push to Zotero or output GB/T 7714 citation | `/wanfang-export` |
### Agent
**`wanfang-researcher`** — orchestrates all skills. Detects Geetest slider / character captchas (pauses for manual resolution), manages tabs, and runs multi-step workflows like "search → filter → export to Zotero".
### Installation
#### 1. Install Chrome DevTools MCP Server (critical: must add `--browser-url`)
⚠️ **Common pitfall**: `chrome-devtools-mcp` spawns a Chrome instance by default, **not** using your already opened Chrome. To connect MCP to your logged-in Wanfang Chrome, add `--browser-url=http://127.0.0.1:9222` to the args.
If using the marketplace plugin (`claude-plugins-official/chrome-devtools-mcp`), edit its `plugin.json`:
```json
// ~/.claude/plugins/cache/claude-plugins-official/chrome-devtools-mcp/<ver>/.claude-plugin/plugin.json
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"chrome-devtools-mcp@<ver>",
"--browser-url=http://127.0.0.1:9222"
]
}
}
}
```
Or add manually with `claude mcp add`:
```bash
claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest --browser-url=http://127.0.0.1:9222
```
Restart Claude Code (or `/reload-plugins` if your version supports hot reloading) for the new config to take effect.
#### 2. Install Wanfang Skills
Copy to Claude Code's global skills directory:
```bash
# Windows PowerShell
git clone https://github.com/<your-fork>/wanfang-skills.git
Copy-Item -Recurse skills "$env:USERPROFILE\.claude\"
Copy-Item -Recurse agents "$env:USERPROFILE\.claude\"
```
Or add to a specific project:
```bash
git clone https://github.com/<your-fork>/wanfang-skills.git /tmp/wanfang-skills
cp -r /tmp/wanfang-skills/skills/ your-project/.claude/skills/
cp -r /tmp/wanfang-skills/agents/ your-project/.claude/agents/
```
#### 3. Start Chrome Remote Debugging
```bash
# Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
# Linux
google-chrome --remote-debugging-port=9222
```
#### 4. Start Claude Code
```bash
claude
```
Skills and agents will load automatically. Test with `/wanfang-search` to verify.
### How It Works
All skills execute JavaScript asynchronously via Chrome DevTools MCP's `evaluate_script`:
- **One-shot async scripts** — replaces multi-step snapshot → click → wait_for patterns
- **Direct URL navigation preferred** — Wanfang detail links often open in new tabs; direct navigation saves 2-3 tool invocations
- **Bulk export** — fetch multiple records from result pages without entering each detail page
- **Captcha awareness** — pauses and prompts on Geetest slider or character captchas
### Selectors Verification
All skills were live-tested on on 2026-06-16 from a logged-in institutional-IP session. Each skill carries a `selectors-verified: 2026-06-16` header and a `Verified selectors` table at the end with actual selectors used, gotchas, and resource-type variants.
If Wanfang's frontend changes and selectors break, the per-skill table is your minimum diagnostic scope. After fixing, bump the `selectors-verified:` date in the frontmatter and send a PR.
### Project Structure
```
skills/
├── wanfang-search/SKILL.md # Keyword search
├── wanfang-advanced-search/SKILL.md # Advanced search
├── wanfang-parse-results/SKILL.md # Parse current results page
├── wanfang-navigate-pages/SKILL.md # Pagination & sort
├── wanfang-paper-detail/SKILL.md # Paper metadata extraction
├── wanfang-journal-search/SKILL.md # Journal search
├── wanfang-journal-index/SKILL.md # Journal indexing & impact factor
├── wanfang-journal-toc/SKILL.md # Journal TOC browsing
├── wanfang-download/SKILL.md # PDF/CAJ download
└── wanfang-export/ # Citation export / Zotero
├── SKILL.md
└── scripts/
└── push_to_zotero.py # Zotero Connector API client
agents/
└── wanfang-researcher.md # Orchestrates all skills
```
## License
MIT