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.02659 | $0.02659 |
| Opus 5.5 | $0.01064 | $0.01064 |
| Sonnet 5.5 | $0.00532 | $0.00532 |
| Haiku 4.5 | $0.00266 | $0.00266 |
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 19d 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.
- 19d ago Changed · +32 tokens per session 6487496e1d38
- 2mo 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 (28 stars, last pushed 19d ago), licensed MIT. It adds 2,659 tokens to every session, about $0.0106 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.
bob-plugin-ollama-translator AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| bob-plugin-ollama-translator AGENTS.mdCaicoLeung/bob-plugin-ollama-translator | Instructions file | 28 | 19d ago | MIT | A | 2,659 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |