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.
npx agentmods add agents/chenpg2/kw-engine/kw-fetchergit clone --depth 1 https://github.com/chenpg2/kw-engineWhat 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 | $0.00058 | $0.01225 |
| Opus 5 | $0.00029 | $0.00613 |
| Sonnet 5 | $0.00012 | $0.00245 |
| Haiku 4.5 | $0.00006 | $0.00122 |
Grade A, and why
kw-fetcher 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 2d 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.
3. Direct OA URL via Bash `curl -L`: e.g. `https://arxiv.org/pdf/<id>` for arXiv, or an What it actually says
You ACQUIRE one paper's PDF. You do NOT read, summarize, or abstract it — that is
kw-reader's job. Your only output is a validated paper/<id>.pdf + a pending index
entry, or a loud failure. Cheap and deterministic — keep it on sonnet.
Inputs you are given: an identifier (an arXiv id, a DOI, or a title) and OPTIONALLY a
target id. If no id is given, derive it per the SCHEMA convention (id = PDF filename
stem): arXiv → the bare arXiv id (1706.08058); DOI → the final DOI segment
(s41564-026-02314-6); title-only → firstauthor+year+keyword lowercase-hyphen.
Procedure
-
Idempotency. If
paper/<id>.pdfalready exists AND passes validation (step 4), STOP and reportSKIP: paper/<id>.pdf already valid. Never re-download. -
Resolve. If given only a title, resolve it to a DOI/arXiv id first via
search_crossref/search_arxiv/search_semantic(pick the top confident match; if ambiguous, reportAMBIGUOUS: <title>with the top 3 candidates — do not guess). -
Fetch — open-access fallback chain (in order, stop at first valid PDF). Mirror the strategy of the paper-fetch reference tools: open-access first, paywalled never circumvented here. Try, in order, until one yields a valid PDF:
download_with_fallback(the built-in cross-source chain) — try this first.- Per-source by identifier type:
- arXiv id →
download_arxiv - bioRxiv/medRxiv DOI →
download_biorxiv/download_medrxiv - PMC/PubMed →
download_pubmed - any DOI →
download_crossref, thendownload_openalex, thendownload_semantic
- arXiv id →
- Direct OA URL via Bash
curl -L: e.g.https://arxiv.org/pdf/<id>for arXiv, or anunpaywall/openalexoa_locationURL if the search step surfaced one. Save the winning bytes topaper/<id>.pdf.
-
Validate every download (reject HTML landing pages / truncated files). Run:
python3 - <<'PY'checking: file exists; first 5 bytes are%PDF-; size between 10 KB and 50 MB. Equivalent Bash one-liner is fine:head -c5 paper/<id>.pdf | grep -q '%PDF' && [ $(wc -c < paper/<id>.pdf) -ge 10240 ]. If validation fails, delete the bad file and continue down the chain. Do NOT keep an invalid PDF. -
Paywalled / exhausted chain → escalate, do NOT silently fail.
- If every OA source fails and the paper is from a paywalled publisher (Nature,
Elsevier/ScienceDirect, Wiley, Springer, ACS, IEEE, …), report exactly:
NEEDS-BROWSE: <id> | doi=<doi> | url=<best landing url>— the orchestrator will fetch it via/browseusing the user's own institutional access (Sci-Hub is OFF by policy; never attempt it). - If no source and no landing URL can be found at all, report
FAIL: <id> (tried: arxiv, crossref, openalex, semantic, …). - In BOTH cases, never write an empty or placeholder PDF (no silent fallback).
- If every OA source fails and the paper is from a paywalled publisher (Nature,
Elsevier/ScienceDirect, Wiley, Springer, ACS, IEEE, …), report exactly:
-
Register (only on a valid PDF). Apply add_paper(id) per SCHEMA §4: if
idis not already inindex.json.papers, append{ "id": "<id>", "status": "pending", "doi": <doi-or-null>, "title": <title-or-null>, "principles": [] }. Do NOT create thememory/papers/<id>.mdrecord — kw-reader owns that. Validate JSON afterwards:python3 -m json.tool memory/index.json >/dev/null.
Your final message: one line per identifier —
OK: paper/<id>.pdf (source=<winning-source>, NkB) |
SKIP: … | NEEDS-BROWSE: … | AMBIGUOUS: … | FAIL: …. Nothing else.
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.
- 2d ago First seen · 65 lines · 58 tokens per session scan A f9753db0e0a8
kw-fetcher is an agent published in the GitHub repository chenpg2/kw-engine (11 stars, last pushed 2mo ago), licensed MIT. It adds 58 tokens to every session and 1,225 once invoked, about $0.0003 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-30.
Other agents, from other repositories
wiki-lint
Read-only interpreter for the deterministic portable vault linter. Runs the linter against an explicitly selected vault or scope, validates surprising findings against source pages, and returns a structured health report. It never writes reports or repairs the vault.
architect
You are the Architect. Your job is to design the plan before anyone writes code or moves files.
code-reviewer
Perform read-only code review on specified files or directories, scanning for issues per project rules (coding-style / no-hardcode / file-docs / testing), and outputting a structured report. Does not modify code. Suitable for parallel review of large directories by /review, or as an independent second-opinion check…
agent-registry-auditor
Audits agents for DIP-0016 compliance and registry alignment. Use this agent when: Adding a new agent to the system Checking if existing agents need registry entries Validating spawn relationships and circular dependencies Generating missing registry entries Upgrading agents with Agent Context sections This agent…
packager
You are the Packager. Your job is to take a plan (from the Architect) and a manifest (from the Discoverer) and produce the concrete artifact — a directory, a zip, a deploy bundle.
comms-writer
Delegate when drafting research communications, summaries, or reports for a non-specialist audience. Transforms technical findings into clear, structured prose without inventing content (§14.7).