any2pdf

any2pdf is a skill for Claude Code, Codex from cosmicstack-labs/mercury-agent-skills. It costs 38 tokens per session (3,449 once invoked), scanned B, original, MIT.

A Python-based Markdown-to-PDF converter that uses ReportLab to create professionally typeset documents. It handles mixed Chinese and Latin text, code blocks, formulas, themes, covers, and watermarks.

In plain words
What is it for?
Use it for technical reports and other Markdown documents that need covers, themes, or publication-style PDF formatting.
Why use it?
It addresses layout and font problems that basic Markdown converters can cause, especially in multilingual technical documents.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: names the AskUserQuestion tool.

Good fit Use it for technical reports and other Markdown documents that need covers, themes, or publication-style PDF formatting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmicstack-labs/mercury-agent-skills/any2pdf
Install

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.

Any agent
npx skills add cosmicstack-labs/mercury-agent-skills --skill any2pdf
Clone the repo
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills

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 any2pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/any2pdf/github.svg)](https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/any2pdf)
Your own site
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/any2pdf"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/any2pdf/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 any2pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/any2pdf"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/any2pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,449 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 259
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium MCP Rug Pull · line 59
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found 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.00038 $0.03449
Opus 5 $0.00019 $0.01724
Sonnet 5 $0.00008 $0.00690
Haiku 4.5 $0.00004 $0.00345

Measured 8d ago against content hash 62b3da4c507b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

any2pdf scanned grade B 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 8d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt install fonts-dejavu-core fonts-liberation fonts-freefont-ttf \
categories/pdf-generation/any2pdf/SKILL.md · 294 lines

How it starts

The opening of the file, as written. The whole thing — 294 lines — stays where its author put it; the contents beside it link to each section on GitHub.

any2pdf — Markdown to Professionally Typeset PDF

Credits. This skill is adapted from lovstudio/any2pdf by lovstudio, distributed under the MIT license. The original repository ships the Python implementation (md2pdf.py), preview gallery, and reference theme JSONs. This document is the Mercury-compatible SKILL.md adaptation; the runtime code and design credit belong entirely to the original author.

This skill converts any Markdown file into a publication-quality PDF using Python's reportlab. It was developed through extensive iteration on real Chinese technical reports and solves several hard problems that naive MD→PDF converters get wrong — CJK/Latin mixed text wrapping, canvas CJK rendering on cover/headers/footers, code-block whitespace preservation, and mixed-font fallbacks across macOS, Linux, and Windows.


When to Use

Trigger this skill whenever the user:

  • Wants to convert .md.pdf
  • Has a markdown report or document and wants professional typesetting
  • Mentions "markdown to PDF", "md2pdf", "any2pdf", "md转pdf", "报告生成", or asks for a "typeset" or "professionally formatted" PDF from markdown source
  • Has a document with CJK characters mixed with Latin text
  • Has fenced code blocks, markdown tables, or nested lists that need to survive conversion
  • Needs local/remote images, Obsidian callouts, emoji, or LaTeX-style math formulas
  • Wants a cover page, table of contents, watermark, or back cover in their PDF

Where the Runtime Lives

After installing this skill via the Mercury CLI:

mercury skills install pdf-generation/any2pdf

the SKILL.md lands at ~/.mercury/skills/pdf-generation/any2pdf/SKILL.md.

The Python implementation (md2pdf.py), preview images, and theme files are not vendored into Mercury Skills — they live in the upstream repository. To use the skill end-to-end, also clone or install the upstream runtime:

Read the full file on GitHub · 294 lines

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. 8d ago First seen · 294 lines · 38 tokens per session scan B 62b3da4c507b

Subscribe to this mod's changes

any2pdf is a skill published in the GitHub repository cosmicstack-labs/mercury-agent-skills (471 stars, last pushed 17d ago), licensed MIT. It adds 38 tokens to every session and 3,449 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

pdf

A set of instructions for working with PDF files, which are documents designed to preserve their layout across devices.

agentscope-ai/QwenPaw · 95 tokens

md-to-pdf

Convert Markdown to styled PDFs with Mermaid diagrams, LaTeX/KaTeX math, tables, and code highlighting. Triggers on: "convert markdown to pdf", "make a pdf from this md", "export markdown as pdf", "pdf from markdown with equations".

Mathews-Tom/armory · 60 tokens

arxiv-preflight

Pre-submission validation audit for arXiv papers across TeX source, PDF, figures, metadata, bibliography, file organization, and common-error scans. Produces pass/fail report with specific fixes per arXiv requirement. Triggers on: "check my arXiv submission", "validate for arXiv", "arXiv preflight", "ready for arXiv"…

Mathews-Tom/armory · 120 tokens

marp-slides

Author MARP markdown slide decks exportable to PDF, PPTX, and HTML via marp-cli. Covers Marpit directives, custom CSS themes, SVG chart recipes, and dashboard components. Triggers on: "marp", "marp deck", "markdown slides", "slides from markdown", "marp-cli", "pdf from markdown", "pptx from markdown".

Mathews-Tom/armory · 81 tokens

graphic-ebook

Creates professionally designed B2B SaaS e-books in HTML + CSS, exported as print-ready PDF. 3–10 pages, 9 style presets, 11 page layout types. Trigger when user says "create an ebook", "design a lead magnet", "make a PDF guide", "build a gated content piece", "write a B2B ebook", "design a white paper", "create a…

Varnan-Tech/opendirectory · 97 tokens

iflytek-ocr-invoice

An image-reading tool that extracts structured information from Chinese invoices, receipts, bills, and tickets. OCR means turning text in a photo or scan into computer-readable data.

iflytek/iFly-Skills · 77 tokens