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 skills/timurgaleev/memex/brain-pdfnpx skills add timurgaleev/memex --skill brain-pdfgit clone --depth 1 https://github.com/timurgaleev/memexWrote 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/skills/timurgaleev/memex/brain-pdf)<a href="https://agentmods.dev/skills/timurgaleev/memex/brain-pdf"><img src="https://agentmods.dev/badge/skills/timurgaleev/memex/brain-pdf.svg" alt="Measured on agentmods" 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 | $0.00052 | $0.01632 |
| Opus 5 | $0.00026 | $0.00816 |
| Sonnet 5 | $0.00010 | $0.00326 |
| Haiku 4.5 | $0.00005 | $0.00163 |
Grade A, and why
brain-pdf 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 4d 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 — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.
brain-pdf — Render a Brain Page to Publication-Quality PDF
Convention: see conventions/quality.md (via
get_skill conventions/quality) for output rules. The PDF is a rendering — never the primary artifact. If a PDF exists, the source brain page exists behind it.
The rule
The brain page is ALWAYS the source of truth. The PDF is a rendering of it, never a standalone artifact. If a PDF exists somewhere, the brain page must exist behind it.
What this does
Renders a brain page (markdown with frontmatter) into a
publication-quality PDF using the host agent's PDF renderer (e.g. the
agent harness's make-pdf skill or an equivalent markdown-to-PDF
toolchain). Output is suitable for:
- Sharing a personalized book mirror via email or chat
- Delivering a strategic-reading playbook as a clean read
- Producing a briefing or report with running headers and page numbers
- Archiving a long-form essay in a portable format
Prerequisite: a host-side PDF renderer
This skill depends on a markdown-to-PDF renderer available on the host where the agent runs. memex itself does not render PDFs — it serves the page body; rendering is the agent's job.
Verify a renderer is available before invoking (check for the agent
harness's make-pdf skill, or a pandoc/Chromium-print pipeline). If
none is installed, the skill cannot run — tell the user which
prerequisite is missing instead of improvising a degraded rendering.
Workflow
1. RESOLVE → Confirm the brain page exists (page_get <slug>).
2. STRIP → Remove YAML frontmatter — the renderer would otherwise
dump it as a full page of raw metadata text.
3. RENDER → Invoke the PDF renderer with sane defaults (no cover,
no TOC).
4. DELIVER → Hand the PDF to the requester via the agent's preferred
file-delivery channel (an explicit attachment tool — not
inline media markup, which can fail silently).
Invocation
SLUG="path/to/page"
# 1. Confirm the page exists and pull the raw markdown body.
# memex is DB-canonical: there is no repo checkout of the page —
# the body always comes from the brain over MCP.
RAW=$(mktemp "$TMPDIR/brain-page-XXXXXX.md")
memex call page_get "{\"slug\":\"$SLUG\"}" > /dev/null \
|| { echo "Page $SLUG not found" >&2; exit 1; }
memex call page_get "{\"slug\":\"$SLUG\"}" | jq -r '.content' > "$RAW"
# 2. Strip YAML frontmatter — sed: skip the opening '---' through the
# closing '---' (lines 1..N), then keep everything after.
CLEAN=$(mktemp "$TMPDIR/brain-page-clean-XXXXXX.md")
sed '1{/^---$/!q}; /^---$/,/^---$/d' "$RAW" > "$CLEAN"
# 3. Render. NO cover, NO TOC by default — they look corporate
# and waste space. Add them only if explicitly requested.
OUT="$TMPDIR/$(basename "$SLUG").pdf"
# invoke the host renderer, e.g. the agent's make-pdf skill:
# make-pdf "$CLEAN" "$OUT"
echo "Rendered: $OUT"
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago First seen · 181 lines · 52 tokens per session scan A fba1e7fa72f3
brain-pdf is a skill published in the GitHub repository timurgaleev/memex (8 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 1,632 once invoked, about $0.0003 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-31.
Other skills, from other repositories
pdf-processing
Extract text from PDFs, fill forms, and merge documents.
treatment-plans
Generate concise (3-4 page), focused medical treatment plans in LaTeX/PDF format for all clinical specialties. Supports general medical treatment, rehabilitation therapy, mental health care, chronic disease management, perioperative care, and pain management. Includes SMART goal frameworks, evidence-based…
wechat-article-ingest
微信公众号文章 → Markdown 提取 + A层观点提取 + B层问题链生成。 支持直接链接抓取和 PDF 提取两种方式。.
documentation-server
Use when you need to store, retrieve, search, or manage documents in a local knowledge base with semantic search and hybrid (vector + full-text) retrieval. Also use when interacting with the documentation server web interface, managing uploads, or performing AI-powered document analysis. Use this instead of MCP-native…
agoragentic-anydoc-document-evidence
Convert a local Word, PowerPoint, spreadsheet, OpenDocument, RTF, EPUB, CSV, or text-based PDF into bounded Markdown and an Agoragentic evidence handoff. Use when an agent needs document contents plus runtime-verified provenance, explicit evidence coverage, known-loss warnings, and a pending-or-incomplete parse…
papers-download-from-list
Uses colocated paper download tools to download, verify, and repair local PDFs from obsidian-vault/paperlist.csv rows so that obsidian-vault/paperPDFs/ stays complete and deduplicated. Use when candidate rows are in state=Wait and should become Downloaded before the formal analysis chain.