Agent skill

Brigade PDF Toolkit

by spinabot in spinabot/brigade

Creates and edits PDFs in Brigade through four paths: a quick content tool, an edit tool for forms and merging, a pdf-lib script for full control, and HTML-to-PDF for styled layouts.

MITAuto-check passedDocuments & Office

Install Brigade PDF Toolkit

skills CLI
$ npx skills add spinabot/brigade --skill pdf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install spinabot/brigade pdf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/spinabot/brigade.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pdf .claude/skills/pdf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pdf
GitHub stars
11k
Token cost
~1.3k tokens
SKILL.md length
408 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Creates and edits PDFs in Brigade through four paths: a quick content tool, an edit tool for forms and merging, a pdf-lib script for full control, and HTML-to-PDF for styled layouts.

  • Generating a report or letter as a PDF
  • SKILL.md covers Path 1 — quick content PDF…, Path 2 — edit an existing PDF…, Path 3 — full power: script… and Path 4 — pixel-perfect /…, plus 2 more sections
  • Calls soffice
  • Filling an existing PDF form

What it does

A table routes each need to one of four paths. Path 1 uses the make_document tool for simple content PDFs with a title, headings, paragraphs and an image in a single-column US-Letter layout. Path 2 uses the edit_document tool to fill existing form fields and to merge, split, remove pages, stamp and watermark. Path 3 is a script with @cantoo/pdf-lib run through brigade exec-node, and Path 4 converts HTML and CSS into pixel-precise, brand-styled layouts with an optional binary.

The pdf-lib path covers drawing text, lines, shapes, SVG paths and images, embedding custom TTF or OTF fonts with full Unicode, creating and filling text, checkbox, radio, dropdown and option-list fields, flattening, copying, merging, splitting and rotating pages, metadata and password encryption, while unpdf extracts text. Before filling a form the agent must check that real fillable fields exist, since a flat or scanned form needs text drawn at coordinates. PDF is a final format, so an editable .docx or .xlsx source should be delivered alongside it when the recipient needs to edit.

When your agent uses it

  • Generating a report or letter as a PDF
  • Filling an existing PDF form
  • Creating a PDF form with new fields
  • Merging, splitting, stamping or watermarking PDFs
  • Embedding CJK fonts or encrypting a PDF

Example prompts

  • “Fill the fields in ./forms/application.pdf from the data in applicant.json.”
  • “Merge ./reports/q1.pdf and ./reports/q2.pdf and stamp each page with Draft.”
  • “Build a one-page invoice PDF with a Chinese company name and password-protect it.”

Requirements

  • Brigade, with its make_document and edit_document tools and exec-node
  • An optional HTML-to-PDF binary for the fourth path

What it can do on your machine

Read from SKILL.md and the folder at commit 4c2a18f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • soffice

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Brigade PDF Toolkit loads about 1.3k tokens when it runs. Until then it costs about 98 tokens; SKILL.md has 408 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~98
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from spinabot/brigade at commit 4c2a18f, republished under its MIT licence (© spinabot). 408 words, ~1,315 tokens.

Download SKILL.mdSave it as .claude/skills/pdf/SKILL.md (or your agent's skills folder).
name
pdf
description
Create and edit PDFs to a professional standard — generate from content, draw vector/precise layouts, embed custom (incl. CJK/Unicode) fonts, CREATE and fill AcroForm fields (text/checkbox/radio/dropdown), flatten, merge/split/rotate, stamp/watermark, encrypt, and extract text. Use when the user asks Brigade to make a PDF, fill or build a PDF form, or combine/split/stamp/secure PDFs.

pdf — professional PDFs

NeedPath
Simple content PDF (title, headings, paragraphs, image)Path 1 — make_document tool
Fill an existing form, merge/split/stamp/watermarkPath 2 — edit_document tool
Form-field CREATION, vector drawing, embedded fonts (bold/CJK), precise layout, encryption, page surgeryPath 3 — script @cantoo/pdf-lib via brigade exec-node
Pixel-perfect, brand-styled layout from HTML/CSSPath 4 — HTML→PDF (optional binary)

Note: PDF is a final format with no reflow engine. If the recipient must edit, deliver the editable source (.docx/.xlsx) and the PDF.


Path 1 — quick content PDF (make_document tool)

make_document(format="pdf", content={ title, pages:[{ heading, paragraphs, image:{path} }] })

Flow layout, US-Letter, single column, word-wrapped. Good for reports/summaries/letters. For forms, precise layout, or custom fonts → Path 3.

Path 2 — edit an existing PDF (edit_document tool)

  • fill_form {fields} — fill existing AcroForm fields by name (text/checkbox/dropdown).
  • merge {pdfs} / add_pages {pdfs} · split {pages} · remove_pages {pages}.
  • stamp {text} · watermark {text} (45° translucent).

Form decision: first detect whether the PDF has real fillable fields. If it does → fill them (clean, type-validated). If it's a flat/scanned form (no fields) → you must draw text at coordinates instead (Path 3, annotations) — never assume fields exist.

Path 3 — full power: script @cantoo/pdf-lib

Brigade bundles @cantoo/pdf-lib (a maintained pdf-lib fork — note the scoped name) plus @pdf-lib/fontkit (custom-font embedding) and unpdf (text extraction). write a gen.cjs, run brigade exec-node gen.cjs:

js
// gen.cjs — illustrative
const fs = require("node:fs");
const { PDFDocument, StandardFonts, rgb } = require("@cantoo/pdf-lib");

(async () => {
  const pdf = await PDFDocument.create();

  // embed a custom font (real bold / CJK / Unicode) — requires fontkit
  // const fontkit = require("@pdf-lib/fontkit"); pdf.registerFontkit(fontkit);
  // const font = await pdf.embedFont(fs.readFileSync("Brand-Bold.ttf"));
  const font = await pdf.embedFont(StandardFonts.HelveticaBold);

  const page = pdf.addPage([612, 792]);                 // US Letter; origin is BOTTOM-LEFT, y-up
  page.drawText("Invoice", { x: 54, y: 720, size: 22, font, color: rgb(0.1, 0.1, 0.1) });
  page.drawRectangle({ x: 54, y: 700, width: 504, height: 1, color: rgb(0.8, 0.8, 0.8) }); // vector rule

  // CREATE fillable form fields
  const form = pdf.getForm();
  const name = form.createTextField("client.name");
  name.addToPage(page, { x: 120, y: 640, width: 300, height: 18 });
  const agree = form.createCheckBox("agree");
  agree.addToPage(page, { x: 54, y: 600, width: 14, height: 14 });
  // form.flatten();                                     // bake fields into static content if no further filling

  fs.writeFileSync(process.argv[2] || "out.pdf", await pdf.save());
  console.log("wrote");
})();

@cantoo/pdf-lib covers: draw text/lines/rects/ellipses/SVG paths/images; embed custom TTF/OTF fonts (subset, full Unicode); create AND fill AcroForm text/checkbox/radio/dropdown/option-list fields; flatten; copy/merge/split/rotate pages; metadata; password encryption (the reason this fork is bundled). Extract text/structure with unpdf.

Coordinate gotcha: pdf-lib origin is bottom-left, y-up. If you author field positions from a top-left image/spec, convert: y_pdf = pageHeight - y_top - height. One coordinate convention per script.

Show full SKILL.md (144 more words)Show less

Path 4 — pixel-perfect / branded PDF from HTML+CSS (optional)

pdf-lib has no HTML/CSS layout engine — for a designed, brand-styled document, render HTML→PDF. Use whatever is present (detect first):

bash
command -v soffice >/dev/null 2>&1 && soffice --headless --convert-to pdf brand.html      # LibreOffice route

A headless browser (Puppeteer/Playwright page.pdf()) is the higher-fidelity alternative if installed. Prefer Path 1/3 unless the brand design genuinely requires CSS.

Conventions

  • Use real AcroForm fields when filling a fillable PDF; only fall back to drawn-text annotations for flat/scanned forms.
  • Embed a font for anything beyond basic Latin — standard PDF fonts lack bold-as-a-face and all CJK/emoji (missing glyphs render as boxes).
  • Keep ≥0.5" margins; align to a grid; don't rely on text reflowing (there's no engine — you place it).

Verify (required)

Confirm the output exists and opens. For filled/created forms, re-open and read back the field values (or render to an image with soffice/a viewer and look at placement) before declaring done — never fill or place blind.

© spinabot, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/pdf of spinabot/brigade.

Open the folder on GitHubat commit 4c2a18f

Compare with similar skills

Brigade PDF Toolkit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Brigade PDF Toolkit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Brigade PDF Toolkit this skillspinabot/brigade11k—~1.3kAutomated safety check: PassMIT
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
PDF Processing with PythonHKUDS/DeepTutor41k—~2.7kAutomated safety check: PassApache-2.0
PDF ToolkitTokenRhythm/opensquilla7.1k—~1.9kAutomated safety check: PassApache-2.0
Code2mediatsingliuwin/autoclaw280—~956Automated safety check: PassMIT
PDF ToolkitXiaomiMiMo/MiMo-Code14k—~1.7kAutomated safety check: PassApache-2.0

Similar skills

  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • Reads, extracts from, creates, merges, splits, watermarks, encrypts and fills PDF files with pdfplumber, pypdf and reportlab inside a Python sandbox.

    41k GitHub stars~2.7k tokensUpdated 3 days ago
    Documents & OfficeAuto-check passed
  • PDF Toolkit

    TokenRhythm/opensquilla

    Deterministic PDF operations through bundled scripts: extract text and tables, merge files or page ranges, split by range, fill form fields and build PDFs from data.

    7.1k GitHub stars~1.9k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Code2media

    tsingliuwin/autoclaw

    Universal media renderer with no fixed template — any custom layout, size or style becomes pixel-perfect images (PNG/JPEG/WebP), vector SVG, paged PDFs or animations (WebP/GIF).

    280 GitHub stars~956 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • Picks the right library for generating a new PDF, filling an existing PDF form, or extracting text and tables, defaulting to Node where possible.

    3.8k GitHub stars~2.9k tokensUpdated today
    Documents & OfficeAuto-check passed

More from spinabot/brigade

All 11 skills in this repo
  • Canvas Display

    spinabot/brigade

    Shows HTML content such as games, dashboards, visualizations and demos on a connected Brigade node's canvas, using a local canvas host server and a node bridge.

    11k GitHub stars~1.4k tokensUpdated 4 days ago
    Auto-check passed
  • Word Document Builder

    spinabot/brigade

    Creates and edits Word documents along four paths of rising capability, from a quick tool to the docx library, an OOXML round-trip and pandoc, then verifies the file.

    11k GitHub stars~2.1k tokensUpdated 4 days ago
    Auto-check passed
  • Writes HTML compositions with a GSAP timeline that the render_video tool turns into deterministic MP4 videos from data, text or layouts.

    11k GitHub stars~1.6k tokensUpdated 4 days ago
    Auto-check passed
  • Diagnoses why a Brigade companion app can't pair or connect, by first identifying the real node-to-gateway route and then fixing auth.

    11k GitHub stars~1.2k tokensUpdated 4 days ago
    Auto-check passed
  • OAuth Account Setup

    spinabot/brigade

    Connects an OAuth 2.0 account such as Gmail with the built-in oauth_authorize tool: an authorization link, automatic code capture and sealed token storage.

    11k GitHub stars~878 tokensUpdated 4 days ago
    Auto-check passed
  • Share Skills

    spinabot/brigade

    Explains how a skill folder should be laid out and bundled as a tar archive for sharing, with a checklist covering name, description and eligibility keys.

    11k GitHub stars~759 tokensUpdated 4 days ago
    Auto-check passed

Questions about Brigade PDF Toolkit

What does Brigade PDF Toolkit do?

Creates and edits PDFs in Brigade through four paths: a quick content tool, an edit tool for forms and merging, a pdf-lib script for full control, and HTML-to-PDF for styled layouts. A table routes each need to one of four paths. Path 1 uses the make_document tool for simple content PDFs with a title, headings, paragraphs and an image in a single-column US-Letter layout.

When should I use Brigade PDF Toolkit?

Brigade PDF Toolkit fits situations like: generating a report or letter as a PDF; filling an existing PDF form; creating a PDF form with new fields; merging, splitting, stamping or watermarking PDFs.

How do I install Brigade PDF Toolkit in Claude Code?

Run `npx skills add spinabot/brigade --skill pdf -a claude-code`. Or copy the skill folder (skills/pdf in spinabot/brigade) into .claude/skills/pdf in your project. Claude Code loads it when a task matches its description.

How do I install Brigade PDF Toolkit in Codex?

Run `npx skills add spinabot/brigade --skill pdf -a codex`. Or copy the skill folder (skills/pdf in spinabot/brigade) into .agents/skills/pdf in your project. Codex loads it when a task matches its description.

Can I use Brigade PDF Toolkit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add spinabot/brigade --skill pdf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf, .gemini/skills/pdf, .github/skills/pdf and .opencode/skills/pdf in your project.

What does Brigade PDF Toolkit need to run?

Going by SKILL.md and its folder, Brigade PDF Toolkit needs the command-line tools its instructions call (soffice). Our summary lists: Brigade, with its make_document and edit_document tools and exec-node; An optional HTML-to-PDF binary for the fourth path.

Does Brigade PDF Toolkit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Brigade PDF Toolkit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Brigade PDF Toolkit use?

Brigade PDF Toolkit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Brigade PDF Toolkit use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Brigade PDF Toolkit?

Skills that share tags, products or a category with Brigade PDF Toolkit: PDF Processing (anthropics/skills, 180k stars), PDF Processing with Python (HKUDS/DeepTutor, 41k stars), PDF Toolkit (TokenRhythm/opensquilla, 7.1k stars) and Code2media (tsingliuwin/autoclaw, 280 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Brigade PDF Toolkit?

spinabot (a GitHub organization) maintains it in spinabot/brigade, which has 11,276 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 3, 2026.

Source: spinabot/brigade on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.