Borrowing it
Nothing to install: this file belongs to CaicoLeung/bob-plugin-ollama-translator. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/CaicoLeung/bob-plugin-ollama-translator/main/AGENTS.mdgit clone --depth 1 https://github.com/CaicoLeung/bob-plugin-ollama-translatorWrote 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.
[](https://agentmods.dev/instructions/caicoleung/bob-plugin-ollama-translator/agents-md)<a href="https://agentmods.dev/instructions/caicoleung/bob-plugin-ollama-translator/agents-md"><img src="https://agentmods.dev/badge/instructions/caicoleung/bob-plugin-ollama-translator/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.
<a href="https://agentmods.dev/instructions/caicoleung/bob-plugin-ollama-translator/agents-md"><img src="https://agentmods.dev/badge/instructions/caicoleung/bob-plugin-ollama-translator/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02627 | $0.02627 |
| Opus 5 | $0.01314 | $0.01314 |
| Sonnet 5 | $0.00525 | $0.00525 |
| Haiku 4.5 | $0.00263 | $0.00263 |
Grade A, and why
bob-plugin-ollama-translator 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Repository Guidelines
Bob (macOS translation app) plugin exposing AI translation/interpretation over any OpenAI-compatible chat-completions endpoint. CLAUDE.md documents build commands and the provider-addition checklist — this file complements it; follow both.
Project Overview
- Single-purpose Bob plugin (identifier
bob-plugin-ollama-translator): word/text translation (translatepattern) and encyclopedia-style explanation (interpretpattern), streamed via SSE. - Supports 8 providers —
ollama,deepseek,openai,grok,claude,gemini,zhipu,other— all through the OpenAI chat-completions shape (Claude included, viaapi.anthropic.com/v1/...). - Plugin version lives in
public/info.json(manifest, currently ahead ofpackage.json— release only bumpsinfo.json).
Architecture & Data Flow
Runtime is Bob's injected JavaScriptCore globals — no Node APIs, no fetch. Two ambient globals: $option (declared locally in src/types.d.ts, ~25 keys) and $http (from @bob-translate/types).
Bob → src/main.ts (exports translate + supportLanguages)
→ src/translate.ts (orchestrator)
├─ src/service.ts resolve provider/url/apikey/model from $option
├─ src/precheck.ts ALL config validation (base URL/model/language) — before the cache
├─ src/cache.ts in-memory Map, FIFO-evict at 100
├─ src/params.ts build chat-completions body (stream:true)
│ ├─ src/prompt.ts system/user prompts, {var} templates
│ └─ src/wordlookup.ts word-lookup decision (predicate + qwen-mt exemption), detail tiers, dict prompts
├─ src/result.ts frame streams/completions (finish suffixes, <think> handling)
├─ $http.streamRequest (Bob's HTTP, Bearer auth, SSE)
└─ src/parser.ts eventsource-parser → OpenAI chunks
→ query.onStream() per chunk → query.onCompletion() at finish
Key patterns an assistant must preserve:
- Never throw across the Bob boundary. Every failure routes through
handleGeneralError(query, error)(src/util.ts) →query.onCompletion({error}). ServiceError types:param,api,secretKey,unsupportedLanguage. - Callback-based, not await-based.
translate()isasyncbut awaits nothing; completion is fire-once via acompletedflag guard. - Streaming only.
$http.streamRequest+stream: true; no non-streaming path.finish_reasonofstopor a known suffix completes; anything else keeps streaming. Invalid API keys are detected by regex on stream text (/Invalid token/i). - Results always carry
thinkInfo: {content: "", splitThinkTag: true}so Bob strips<think>reasoning blocks. Word lookup (ADR-003) is the deliberate exception:thinkInfoappears only when the model produced reasoning, withsplitThinkTag: false(tags already stripped indict.ts). Delta-style reasoning (reasoning_content/reasoningon the chunk delta — DeepSeek R1, QwQ) is captured intranslate.ts, streamed live viaonStreamframes on both paths, and re-wrapped as a<think>block at completion, so both render paths and the cache see one format. Capture is unconditional — thethinkingmenu is display-side (rendering hides reasoning when off), so cached entries replay thinking after re-enabling. - Provider registry is closed.
Providerunion +PROVIDERS+ the keyed-literal tables (SERVICE_BASE_URLS,API_KEY_OPTIONS,MODEL_OPTIONS) insrc/service.tsare the single source of truth; adding a provider means touching those pluspublic/info.jsonoptions andsrc/types.d.ts— follow the 5-step checklist inCLAUDE.md.ollama(keyless) andother(user URL) are intentionally asymmetric (Partial<Record<...>>). - Word lookup is decided once.
src/wordlookup.tsowns the predicate (translate pattern + single English token), the qwen-mt exemption, thewordDetailtiers and the JSON dict prompts;params.tscallslookupEnabled(query, model)once and passes the boolean down as a fact. Prompts, framing and the cache never re-derive it. - Qwen MT special case: model name matching
/qwen-mt/bypassesprompt.tsentirely — single user message +translation_optionsinstead of prompts. Don't "fix" prompts assuming they always apply. - Config validation has one seam:
preCheck(query, service)(src/precheck.ts) owns every config check and runs before the cache lookup — the cache never masks a broken config, andtranslate.tskeeps no guards of its own. Error precedence: base URL → custom model → target language. - Cache key uses
query.from/query.towhile the rest of the code usesdetectFrom/detectTo— different fields, don't unify casually. langMap(bob→api codes) is used only for validation inprecheck.ts; outgoing prompts/target_langget raw Bob codes.
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.
- 9d ago First seen · 115 lines · 2,627 tokens per session scan A 264deb054087
bob-plugin-ollama-translator AGENTS.md is an instructions file published in the GitHub repository CaicoLeung/bob-plugin-ollama-translator (27 stars, last pushed 23d ago), licensed MIT. It adds 2,627 tokens to every session, about $0.0131 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
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).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.