mktero AGENTS.md

A project guide for AI coding agents working on Mktero, a Zotero extension that sends local PDF attachments to MinerU and opens the returned Markdown and images in Zotero. Zotero is software for managing research sources, and MinerU is the PDF-processing service used by this project.

In plain words
What is it for?
Setting up the project, running checks and tests, building the extension package, and understanding its JavaScript modules and Zotero-provided runtime interfaces.
Why use it?
It explains the repository structure, supported runtime, commands, and browser-extension rules an agent must follow. This reduces the risk of using an unsupported Node.js version or breaking the build and release files.

Instructions file for CodexOpenCode

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/tenglvjun/mktero/agents-md
Clone the repo
git clone --depth 1 https://github.com/tenglvjun/mktero

Made for: Codex, OpenCode.

Per session 1,711 This file is loaded in full into every session.
When invoked 1,711 The same file — it is already loaded in full.
Security scan A 0 findings. 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 $0.01711 $0.01711
Opus 5 $0.00856 $0.00856
Sonnet 5 $0.00342 $0.00342
Haiku 4.5 $0.00171 $0.00171

Measured 3d ago against content hash 7bdf747e336d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mktero AGENTS.md scanned grade A with 0 findings 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 152 lines

How it starts

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

AGENTS.md

This file applies to the entire repository.

Project overview

Mktero is a restartless Zotero extension for Zotero 7 through 10. It reads a local PDF attachment, sends the PDF to MinerU, and opens the returned Markdown and images in a read-only Zotero tab.

The project is plain JavaScript, not TypeScript. Source files use ES modules, while esbuild bundles the two runtime entry points as browser IIFEs for Firefox 115. Zotero supplies the privileged runtime globals used by the extension, including Zotero, IOUtils, PathUtils, Components, ChromeUtils, and Services.

Commands

Use the Node.js version in .node-version (currently 24.15.0); it is the shared local and CI version source. Do not use Node.js 25, which is outside the supported dependency engine range.

npm ci
npm run check
npm test
npm run build
  • Run one test file with node --test test/<name>.test.js while iterating.
  • npm run check syntax-checks every source module explicitly. Add new source files to the check script in package.json.
  • npm run build recreates build/package, the reproducible build/mktero-<version>.xpi, its .sha256 checksum, and build/updates.json. Both build/ and node_modules/ are generated and ignored; never edit or commit them.
  • scripts/build.mjs has an explicit list of copied runtime assets. Update it when adding a non-imported file required by the packaged extension.

Before handing off a change, run the narrow tests for the touched behavior, then npm run check, npm test, and npm run build unless the change is documentation-only. Report any command that could not be run.

Repository map

  • manifest.json: Zotero compatibility, extension ID, version, and update URL.
  • prefs.js: defaults for every Zotero preference.
  • src/bootstrap.js: extension lifecycle and dependency composition. It owns startup/shutdown, conversion cancellation, tabs, toolbar actions, context menus, preferences, and cache.
  • src/config/: preference keys and preference-pane registration.
  • src/core/: provider-independent conversion orchestration and progress.
  • src/extractors/: adapters from Zotero items or MinerU results to the core document shape.
  • src/mineru/: MinerU API client, parsing profile, ZIP extraction, binary helpers, and Markdown normalization.
  • src/cache/: content-addressed Markdown and image cache under the active Zotero profile.
  • src/platform/: Zotero/runtime adapters for aborting requests.
  • src/markdown/: pure Markdown parsing, analysis, normalization, rendering, and safety logic.
  • src/editor/: CodeMirror 6 read-only presentation, image previews, and citation/table/figure interactions.
  • src/ui/: Zotero toolbar, item menu, tab presenter/view, loading state, and preference controller.
  • ui/: packaged XHTML, CSS, and icons.
  • test/: Node test runner coverage, with jsdom or linkedom where DOM behavior is needed.

Read the full file on GitHub · 152 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. 3d ago First seen · 152 lines · 1,711 tokens per session scan A 7bdf747e336d

Subscribe to this mod's changes

mktero AGENTS.md is an instructions file published in the GitHub repository tenglvjun/mktero (26 stars, last pushed 3d ago), licensed MIT. It adds 1,711 tokens to every session, about $0.0086 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.