mktero: Instructions file for Codex

AGENTS.md

mktero AGENTS.md is an instructions file for Codex, OpenCode from tenglvjun/mktero. It costs 3,020 tokens per session, scanned A, original, MIT.

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

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

This is tenglvjun/mktero's own configuration. It tells Codex and OpenCode how to work on mktero itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mktero configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tenglvjun/mktero. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tenglvjun/mktero/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/tenglvjun/mktero

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 mktero AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tenglvjun/mktero/agents-md/github.svg)](https://agentmods.dev/instructions/tenglvjun/mktero/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tenglvjun/mktero/agents-md"><img src="https://agentmods.dev/badge/instructions/tenglvjun/mktero/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mktero AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tenglvjun/mktero/agents-md"><img src="https://agentmods.dev/badge/instructions/tenglvjun/mktero/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,020 This file is loaded in full into every session.
When invoked 3,020 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.03020 $0.03020
Opus 5.5 $0.01208 $0.01208
Sonnet 5.5 $0.00604 $0.00604
Haiku 4.5 $0.00302 $0.00302

Measured 6d ago against content hash 54e8885698ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 6d 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 · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 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 it to the selected OCR provider (MinerU or Mistral OCR) when needed, and opens the resulting Markdown, figures, citations, annotations, and optional AI translation in a session-only, reading-first Zotero tab.

The project is plain JavaScript, not TypeScript. Source files use ES modules, while esbuild bundles the runtime entry points as browser IIFEs for Firefox 115 (the bootstrap, the preferences UI, and the figure render worker), plus the bundled pdf.js worker. 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/ai/: Vercel AI SDK gateway, translation service, and request tracking.
  • src/cache/: content-addressed Markdown, figure, translation, citation-graph, and reading-position stores under the active Zotero profile.
  • src/citations/: citation-graph building and the Semantic Scholar, OpenCitations, and OpenAlex clients.
  • src/config/: preference keys, preference-pane registration, and the session-only models.dev reasoning catalog used by the AI reasoning menu.
  • src/core/: provider-independent conversion orchestration and progress.
  • src/extractors/: adapters from Zotero items or provider results to the core document shape.
  • src/figures/: figure region resolution, panel/label recovery, reading-order reunion, and the worker-based restoration pipeline.
  • src/i18n/: English and Simplified Chinese user-facing copy.
  • src/icons/: bundled lucide icon helpers.
  • src/mineru/: MinerU API client, parsing profile, ZIP extraction, binary helpers, and the raw result archive.
  • src/mineru/document/: the MinerU reading document. It ingests layout.json (or the content list) into a block IR, classifies page chrome, repairs reading order, stitches paragraphs across pages, columns and floats, and serializes Markdown with its exact source map and figure-pipeline input.
  • src/mistral/: Mistral OCR client, parsing profile, and result normalization.
  • src/pdf/: PDF.js text engine, page crops, annotation location, and outlines.
  • src/platform/: Zotero/runtime adapters for aborting requests and Zotero APIs.
  • src/markdown/: pure Markdown parsing, analysis, normalization, rendering, and safety logic.
  • src/editor/: CodeMirror 6 presentation, inline correction editing, 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.
  • docs/: README-linked user documentation. The directory is gitignored except for an explicit allowlist in .gitignore; see the cross-file checklist.
  • preview/: browser preview of the reader for the website and browser compatibility checks (npm run build:preview). Fixture data only; not part of the XPI. See docs/development.md.
  • scripts/: build, figure validation harnesses, the figure-corpus check, and the browser preview build, packaging, and validation.
  • test/: Node test runner coverage, with jsdom or linkedom where DOM behavior is needed.

Read the full file on GitHub · 230 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. 6d ago Changed · +2 lines · +29 tokens per session 54e8885698ce
  2. 10d ago Changed · +21 lines · +352 tokens per session 7c3d4bf1620a
  3. 13d ago Changed · +10 lines · +178 tokens per session 969d20885e79
  4. 15d ago Changed · +10 lines · +159 tokens per session f9a2583452da
  5. 1mo ago Changed · +1 lines · +17 tokens per session e33dca6a54e8
  6. 1mo ago Changed · +34 lines · +574 tokens per session 5ac39e93bed8
  7. 2mo 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 (89 stars, last pushed today), licensed MIT. It adds 3,020 tokens to every session, about $0.0121 per session on Opus 5.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.

Related

mktero AGENTS.md compared with instructions from other repositories

mktero AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mktero AGENTS.mdtenglvjun/mkteroInstructions file89todayMITA3,020Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k3d agoMITA4,313Codex, OpenCode