# Getbib

> 用低幻觉工作流为一篇或多篇学术论文获取可靠的 BibTeX。当用户提供论文标题和可选作者信息，并希望得到：(1) 带理由的权威候选链接，(2) 通过浏览器实际获取而不是猜测生成的 BibTeX，(3) 类似 bib_link_candidates.md 这样的可审阅过程文档，或 (4) 多篇论文的批量 BibTeX 收集结果时，应使用此 skill。

- **Type:** Skill
- **Install:** `agentstack add skill-shilong20-getbib-getbib`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [shilong20](https://agentstack.voostack.com/s/shilong20)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [shilong20](https://github.com/shilong20)
- **Source:** https://github.com/shilong20/getbib

## Install

```sh
agentstack add skill-shilong20-getbib-getbib
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Getbib

## 概述

使用这个 skill，可以把论文标题转成一条可审阅的引用获取工作流：

1. 使用 agent 自带的 web search 工具为每篇论文找到最可靠的发表链接。如果用户配置了 `config.json`，也可以使用内置的 Grok 搜索脚本代替。
2. 使用由 Playwright 驱动的浏览器提取流程，从推荐链接或其站点内可推导的元数据路径中获取 BibTeX。
3. 将中间审阅文档和最终 BibTeX 文件都写入磁盘。

当用户希望尽量降低文献引用幻觉风险，并愿意在信任最终 BibTeX 之前先检查中间文档时，优先使用这个 skill。

## 工作流

### 1. 收集输入

支持以下输入形式：

- 单篇论文：
  - 仅 `title`
  - `title + author`
- 批量论文：
  - 在 prompt 中重复给出多个标题
  - 带 `title` 和可选 `author` 列的 `csv` / `tsv`
  - 形如 `{title, author}` 数组的 `json` / `jsonl`
  - 每行一个标题，或使用 `titleauthor` 格式的 `txt`

如果用户没有提供批量输入文件，就根据对话内容隐式构造输入，并用重复的 `--title` 和可选的 `--author` 调用脚本。

### 2. 搜索链接

默认使用 agent 自带的 web search 工具为每篇论文搜索最合适的发表链接。搜索时遵循来源路由章节中的优先级。

如果项目根目录下存在 `config.json`（Grok 或其他 OpenAI 兼容搜索 API 配置），则改用内置的 `scripts/grok_search.py` 自动搜索，无需 agent 手动搜索。`config.json` 中的 `base_url` 支持填写任何 OpenAI 兼容端点（不限于 Grok）。

两种搜索方式的结果都需要整理为链接 JSON 格式：

```json
[
  {"title": "Attention Is All You Need", "url": "https://dblp.org/rec/conf/nips/VaswaniSPUJGKP17.html"},
  {"title": "BERT", "url": "https://openreview.net/forum?id=..."}
]
```

### 3. 运行编排脚本

默认模式（agent 自行搜索链接后调用）：

`python3 scripts/getbib.py --title "Paper Title" --links-json links.json`

Grok 模式（有 `config.json`）：

`python3 scripts/getbib.py --title "Paper Title" [--author "Author Name"]`

批量模式：

`python3 scripts/getbib.py --input papers.csv [--links-json links.json]`

常用选项：

- `--output-dir `：将所有输出写入指定目录
- `--links-json `：使用预先准备好的链接 JSON，跳过 Grok 搜索
- `--mode links`：只生成可审阅的链接文档（仅在 Grok 模式下有意义）
- `--mode both`：同时生成链接文档和最终 BibTeX（默认）
- `--keep-cache`：保留中间 JSON 产物

### 4. 交付输出

默认会在输出目录中生成以下文件：

- `bib_link_candidates.md`：推荐链接、选择理由以及返回的来源 URL
- `playwright_route.bib`：通过浏览器驱动提取流程获取的最终 BibTeX
- `.cache/grok_bib_links/*.json`：原始 Grok 检索结果
- `.cache/playwright_results.json`：逐篇论文的提取结果
- `summary.json`：本次运行摘要

### 5. 审阅策略

在向用户总结结果时，遵循以下信任规则：

- 把中间链接文档视为第一层审阅界面。
- 将 `playwright_route.bib` 视为比模型直接生成的 BibTeX 更高置信，因为它是从推荐来源页面或其站点内元数据路径中实际提取得到的。
- 如果页面标题与站点提供的 BibTeX 标题不一致，要明确指出，尤其是 `OpenReview` 场景。
- 如果搜索没有返回可用链接，或浏览器无法从推荐来源提取 BibTeX，应明确标记失败，而不是自行按标题猜测其他来源。

## 来源路由

脚本已经实现了以下来源优先策略：

- `dblp` / `dblp.dagstuhl` -> `.bib`
- `OpenReview` -> API note 内容和 `_bibtex`，并修复标题不一致问题
- `arXiv` -> 页面元数据
- `NeurIPS` / `PMLR` -> 页面中的 BibTeX 入口
- `AMS` -> 先从页面元数据提取 DOI，再获取 DOI 对应的 BibTeX
- `IEEE` 页面 -> 当页面未直接暴露 BibTeX 时，尝试使用页面中的 DOI 元数据
- `GitHub` / 模型卡 / 发布公告页 -> `@misc`

只有在已知某个特定来源结果错误时，才应覆盖脚本默认行为。不要在搜索未提供链接时自行按标题猜测其他来源。

## 资源

### `scripts/getbib.py`

主入口脚本。单篇和批量模式都使用它。

### `scripts/grok_search.py`

基于 Grok API（或任何 OpenAI 兼容的搜索端点）的联网搜索脚本。从项目根目录的 `config.json` 读取配置。

### `scripts/playwright_fetch.mjs`

供 `scripts/getbib.py` 使用的浏览器驱动提取器。

### `config.example.json`

搜索 API 配置模板。复制为 `config.json` 并填入 API key 即可使用。

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [shilong20](https://github.com/shilong20)
- **Source:** [shilong20/getbib](https://github.com/shilong20/getbib)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-shilong20-getbib-getbib
- Seller: https://agentstack.voostack.com/s/shilong20
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
