// agent_skill for refhub.io
agent skill for operating refhub through its public api (v2). agents load SKILL.md to discover workflows and consult docs/ for exact route contracts and behavioral rules. no implementation code — the skill is the contract.
with a scoped refhub api key for normal runtime work, an agent can:
- manage vaults (create, update, delete, visibility, collaborators)
- add, update, delete, search, and bulk-upsert papers
- import references from a doi, bibtex string, or url
- manage tags and relations as first-class objects
- sync incrementally via the changes feed
- export vaults as json or bibtex
- read audit logs
- enrich incomplete publication metadata from semantic scholar (api key)
- upload pdfs to google drive and link them to vault items (api key after Drive is connected)
SKILL.md ← skill entry point
AGENTS.md ← instructions for cursor, windsurf, codex, and others
docs/
api-mapping.md ← endpoint/scope/constraint reference
spec.md ← per-workflow behavioral contracts
two modes — use the right one for the right route:
api key — all data routes (vaults, items, tags, relations, import, export, audit):
REFHUB_API_KEY=rhk_<publicId>_<secret>
session jwt — setup/admin routes only (google drive link management, key management, global audit). These are normally handled through the RefHub UI; do not require a session JWT for ordinary CLI agent workflows.
the refhub cli is the recommended execution layer:
npm i -g @refhub/cliwhen available, agents use it instead of making http calls directly. the cli handles authentication, error formatting, and consistent output.
export REFHUB_API_KEY=rhk_<publicId>_<secret> # data routes
refhub vaults list
refhub enrich --vault <id> # semantic scholar enrichment
refhub pdf upload --vault <id> --item <id> --file <f> # pdf → google drive
refhub --help # discover all commandsexit codes: 0 success · 1 api error · 2 bad arguments · 3 auth error.
the cli covers all data routes plus enrich and pdf upload. for other management routes (google drive, key management) fall back to direct http as documented in docs/.
claude plugin marketplace add refhub-io/refhub-marketplace
claude plugin install refhub-skill@refhub-marketplaceavailable in the next session. automatically invoked when you ask claude to work with refhub vaults or papers.
mkdir -p ~/.gemini/skills/refhub-skill
curl -o ~/.gemini/skills/refhub-skill/SKILL.md \
https://raw.githubusercontent.com/refhub-io/refhub-skill/main/SKILL.mdmkdir -p ~/.config/opencode/skills/refhub-skill
curl -o ~/.config/opencode/skills/refhub-skill/SKILL.md \
https://raw.githubusercontent.com/refhub-io/refhub-skill/main/SKILL.mdrestart opencode to load the skill.
mkdir -p ~/.codex/skills/refhub-skill
curl -o ~/.codex/skills/refhub-skill/SKILL.md \
https://raw.githubusercontent.com/refhub-io/refhub-skill/main/SKILL.mdcopy AGENTS.md to your project root:
curl -O https://raw.githubusercontent.com/refhub-io/refhub-skill/main/AGENTS.mdor add it globally via your agent's rules/settings ui.
refhub api → refhub-skill → refhub cli → mcp server (planned)
the api is canonical. the skill adapts its surface into agent-friendly workflows without inventing behavior the api does not support.
Normal agent runtime is API-key-only:
- Semantic Scholar:
POST /api/v1/semantic-scholar/lookup,/doi-metadata,/search,/recommendations,/related,/references,/citations,/cited-by; all requirevaults:read. CLI:refhub discover ...andrefhub enrich --vault <id> [--item <id>] [--dry-run]. - Item PDF upload:
POST /api/v1/vaults/:vaultId/items/:itemId/pdfwith rawapplication/pdfbytes; requiresvaults:writeand a Google Drive account already linked in the RefHub web UI. CLI:refhub pdf upload --vault <vaultId> --item <itemId> --file <path.pdf>. - Google Drive connect/disconnect, API-key lifecycle, legacy
/publications/:publicationId/pdf, and global audit remain session-JWT/browser account-management flows. - Search/list accepts canonical
per_pageandtag; backend also accepts compatibility aliaseslimitandtag_id. DOI filtering is supported.