zotero-agent AGENTS.md

zotero-agent AGENTS.md is an instructions file for Codex, OpenCode from psiQAQ/zotero-agent. It costs 3,307 tokens per session, scanned A, original, MIT.

A development guide for Zotero Agent, a Zotero plug-in with an MCP server that lets local AI tools connect to Zotero’s libraries and data.

In plain words
What is it for?
Use it when developing, building, deploying, or testing the Zotero Agent plug-in.
Why use it?
It explains the plug-in’s architecture, local connection details, repository layout, build process, deployment, and tests.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md; mentions Codex.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/psiqaq/zotero-agent/agents-md
Clone the repo
git clone --depth 1 https://github.com/psiQAQ/zotero-agent

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for zotero-agent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/psiqaq/zotero-agent/agents-md.svg)](https://agentmods.dev/instructions/psiqaq/zotero-agent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/psiqaq/zotero-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/psiqaq/zotero-agent/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,307 This file is loaded in full into every session.
When invoked 3,307 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03307 $0.03307
Opus 5 $0.01654 $0.01654
Sonnet 5 $0.00661 $0.00661
Haiku 4.5 $0.00331 $0.00331

Measured 5d ago against content hash 168f37d8efa9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

zotero-agent AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- 验证官方读通路:`curl -sD - http://127.0.0.1:23119/api/users/<library-id>/items?limit=1` → 200
AGENTS.md · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

本仓库 = Zotero Agent(zotero-agent:从 cookjohn/zotero-mcp fork 二次开发后独立的发布仓库,插件目录即仓库根。完整变更史见 CHANGELOG.md(从上游 v1.5.0 起)。本文件是给未来会话的开发 / 发布上下文。


1. 架构

  • 本插件 = 一个内嵌 MCP server 的 Zotero 插件:插件在 Zotero 进程内起 HTTP server(手写 nsIServerSocket),端口 23120,只绑 127.0.0.1
  • 常规用法:插件装在本地 Zotero,AI 客户端(Codex 等)本地直连 http://127.0.0.1:23120/mcp,用 Authorization: Bearer <PSK> 认证
  • 读还可走 Zotero 官方只读 API(127.0.0.1:23119,仅服务浏览器 Connector 的读请求)
  • 关键区别:Zotero 进程内 Zotero.Libraries.userLibraryID = 1,与 web 账号那个数字 library ID 不同;写 run_javascript 时用进程内的 1,调官方 API 路径 /api/users/<library-id>/ 时才用 web library ID

2. 仓库结构(插件为根)

  • src/ addon/ — 插件 TS 源码 + 资源(manifest / locale / 偏好 UI)
  • test/ — 纯函数单测(*.test.cjs,node 直跑)
  • scripts/deploy-live.mjs(本地 xpi → 目标 Zotero 部署)、prepare-release.js(生成 update.json)、unit-test.mjs
  • .github/workflows/ — release CI(在,GitHub 才会触发)
  • refs/ — 17 个调研参考 submodule,声明保留、内容按需:用哪个再 git submodule update --init refs/<path>
  • CHANGELOG.md — 变更史(人写、提交);update.json — 更新清单(机器生成、不提交,见 §4)

3. 开发循环(build + 部署)

改代码 → npm run buildzotero-plugin build + tsc --noEmit,产物 .scaffold/build/zotero-agent.xpi)→ node scripts/deploy-live.mjs(xpi base64 经 run_javascript 写入 Zotero 端临时路径 + 自升级,~5s 断连后即新版)。

  • deploy-live.mjs 也能装任意 xpi:node scripts/deploy-live.mjs 路径/xxx.xpi(如使用者下载的 xpi)。它依赖 zotero MCP 通道(PSK),是"已装本插件后换版 / 升级"的工具;首次裸装仍需手动把 xpi 拖进 Zotero

测试

  • 本地单测npm run test:unit —— test/*.test.cjs 纯函数单测(node 直跑,无框架,runner scripts/unit-test.mjs),覆盖 auth / eval / HTTP 字节读取 / MCP 协议 / 元数据合并 / PDF 识别与解析器 / 标题相似度 / hybrid search 等模块
  • 部署后全栈回归src/modules/selfTest.ts,startup 时挂载为 Zotero.ZoteroAgentSelfTest。约 32 场景:协议层(initialize 版本协商、401/403、-32601/-32602、isError 语义)+ 工具层(import 幂等、WoS 工具显隐、批量导入 dry-run、preprint 升级、DOI repair、伴生插件桥接、写类工具 dry-run 默认、搜索降级级联、CJK mojibake 回归、pdf resolvers 往返等)。版本更新部署后跑:run_javascriptreturn await Zotero.ZoteroAgentSelfTest.run('protocol').list() 列可用套件

Read the full file on GitHub · 126 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 126 lines · 3,307 tokens per session scan A 168f37d8efa9

Subscribe to this mod's changes

zotero-agent AGENTS.md is an instructions file published in the GitHub repository psiQAQ/zotero-agent (7 stars, last pushed 1mo ago), licensed MIT. It adds 3,307 tokens to every session, about $0.0165 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

AI-Powered-Literature-Review-Skills AGENTS.md

Instructions for stephenlzc/AI-Powered-Literature-Review-Skills, covering agents.md - literature reviewer skill, 项目概述, 核心特性, 技术栈 and 项目结构.

stephenlzc/AI-Powered-Literature-Review-Skills · 4,040 tokens

iktinah AGENTS.md

AGENTS.md instructions for dralkh/iktinah, covering agents.md, project overview, commands, mcp server (separate package) and tech stack.

dralkh/iktinah · 11,896 tokens

orm CLAUDE.md

Claude Code instructions for prisma/orm, a project described as: Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB.

prisma/orm · 3 tokens

wasp CLAUDE.md

Claude Code instructions for wasp-lang/wasp, a project described as: The batteries-included full-stack framework for the AI era. Develop JS/TS web apps (React, Node.js, and Prisma) using declarative code that abstracts away complex full-stack features like auth, background jobs, RPC, email sending, end-to-end type…

wasp-lang/wasp · 3 tokens

vespertide AGENTS.md

AGENTS.md instructions for dev-five-git/vespertide, covering vespertide knowledge base, structure, where to look, data flow and conventions.

dev-five-git/vespertide · 10,783 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens