brain-pdf

brain-pdf is a skill for Claude Code, Codex from cyberbird2048/gbrainmcp-clean. It costs 53 tokens per session (1,729 once invoked), scanned A, a copy of brain-pdf, MIT.

A document-rendering tool that turns a Brain Page—a Markdown knowledge-base page—into a polished PDF. The PDF is only an output copy; the Brain Page remains the original.

In plain words
What is it for?
Use it to make reports, briefings, essays, reading guides, or personalized book mirrors with running headers and page numbers. It requires the gstack make-pdf program to be installed.
Why use it?
It removes the manual work of cleaning page metadata and formatting long documents for sharing or storage. It also keeps the editable source separate from the PDF.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for gstack. Also seen: built for gstack.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is **Convention:** see [conventions/quality.md](../conventions/quality.md) for.

Good fit Use it to make reports, briefings, essays, reading guides, or personalized book mirrors with running headers and page numbers. It requires the gstack make-pdf program to be installed.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/cyberbird2048/gbrainmcp-clean
agentmods
npx agentmods add skills/cyberbird2048/gbrainmcp-clean/brain-pdf

Made for: Claude Code, Codex.

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 brain-pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/cyberbird2048/gbrainmcp-clean/brain-pdf/github.svg)](https://agentmods.dev/skills/cyberbird2048/gbrainmcp-clean/brain-pdf)
Your own site
<a href="https://agentmods.dev/skills/cyberbird2048/gbrainmcp-clean/brain-pdf"><img src="https://agentmods.dev/badge/skills/cyberbird2048/gbrainmcp-clean/brain-pdf/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 brain-pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/cyberbird2048/gbrainmcp-clean/brain-pdf"><img src="https://agentmods.dev/badge/skills/cyberbird2048/gbrainmcp-clean/brain-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,729 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00053 $0.01729
Opus 5 $0.00026 $0.00864
Sonnet 5 $0.00011 $0.00346
Haiku 4.5 $0.00005 $0.00173

Measured 9d ago against content hash 13c3e3162763, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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 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.

Origin

This is a copy

100% identical to brain-pdf — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/brain-pdf/SKILL.md · 187 lines

How it starts

The opening of the file, as written. The whole thing — 187 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 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 gstack make-pdf binary. Output is suitable for:

  • Sharing a personalized book mirror via email or Telegram
  • 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: gstack make-pdf

This skill depends on the gstack make-pdf binary at:

$HOME/.claude/skills/gstack/make-pdf/dist/pdf

The user must have gstack co-installed. If absent, the skill cannot run. A future v0.26+ may bundle a fallback PDF renderer; for v0.25.1 gstack is a soft prereq.

Verify it exists before invoking:

P="$HOME/.claude/skills/gstack/make-pdf/dist/pdf"
[ -x "$P" ] || { echo "make-pdf not installed; install gstack" >&2; exit 1; }

Workflow

1. RESOLVE  → Confirm the brain page exists (gbrain get <slug>).
2. STRIP    → Remove YAML frontmatter — the renderer would otherwise
              dump it as a full page of raw metadata text.
3. RENDER   → Invoke make-pdf with sane defaults (no --cover, no --toc).
4. DELIVER  → Hand the PDF to the requester via the agent's preferred
              channel (do not use raw `MEDIA:` tags on Telegram —
              they fail silently).

Invocation

SLUG="path/to/page"
P="$HOME/.claude/skills/gstack/make-pdf/dist/pdf"

# 1. Confirm the page exists.
gbrain get "$SLUG" > /dev/null || { echo "Page $SLUG not found" >&2; exit 1; }

# 2. Get the raw markdown. Two paths: read from the brain repo (if user
#    syncs locally) OR ask gbrain for the body via the API.
BRAIN_DIR=$(gbrain config get sync.repo_path 2>/dev/null || echo)
if [ -n "$BRAIN_DIR" ] && [ -f "$BRAIN_DIR/$SLUG.md" ]; then
  RAW="$BRAIN_DIR/$SLUG.md"
else
  RAW=$(mktemp /tmp/brain-page-XXXXXX.md)
  gbrain get "$SLUG" --raw > "$RAW"   # whatever flag exposes raw body
fi

# 3. Strip YAML frontmatter — sed: skip the opening '---' through the
#    closing '---' (lines 1..N), then keep everything after.
CLEAN=$(mktemp /tmp/brain-page-clean-XXXXXX.md)
sed '1{/^---$/!q}; /^---$/,/^---$/d' "$RAW" > "$CLEAN"

# 4. Render. NO --cover, NO --toc by default — they look corporate
#    and waste space. Add them only if explicitly requested.
OUT="/tmp/$(basename "$SLUG").pdf"
CONTAINER=1 "$P" generate "$CLEAN" "$OUT"

echo "Rendered: $OUT"

Read the full file on GitHub · 187 lines

Files

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.

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. 9d ago First seen · 187 lines · 53 tokens per session scan A 13c3e3162763

Subscribe to this mod's changes

brain-pdf is a skill published in the GitHub repository cyberbird2048/gbrainmcp-clean (0 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 1,729 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to brain-pdf, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories