agentleFS
seayniclabsseayniclabs/lathe/skills/pdf/SKILL.md

pdf

Skill0 starsChanged 5 days agoMITView on GitHub

Convert a Markdown file to a PDF with Chrome or Chromium in headless mode. Use when the user asks to turn a Markdown note, report or spec into a PDF and Chrome or Chromium is installed. Lathe's own PDF tools do not render Markdown.

  • Installs packages

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 179 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If Chrome or Chromium is not installed, say so plainly and stop.

    line 13
  2. Very specific:

    Remove YAML frontmatter: delete the block between the first two --- lines when the file starts with one.

    line 20
  3. Distinctive:

    Check that the PDF exists and is not empty.

    line 38
  4. Very specific:

    Use absolute paths in every command.

    line 42
  5. Distinctive:

    Do not open the PDF after writing it.

    line 43
  6. Distinctive:

    Never change the Markdown file.

    line 44

“Common” is measured: kept by at least 6 in 10 of the 179 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Markdown to PDF with Chrome

This skill needs Google Chrome or Chromium on the machine, plus Python 3. It does not use a Lathe tool. Lathe's PDF tools merge, split, compress, read and render existing PDFs, but they do not render Markdown.

If Chrome or Chromium is not installed, say so plainly and stop. Name the install step: install Google Chrome from google.com/chrome on macOS, or sudo apt install chromium on Debian and Ubuntu.

Steps

  1. Get the input path. If the user gave none, ask which file to convert.
  2. Pick the output path. Put the PDF beside the Markdown file, with the same name and a .pdf extension, unless the user names a folder.
  3. Work in a new temporary folder for the HTML and any images. Never write into the source folder except for the PDF.
  4. Remove YAML frontmatter: delete the block between the first two --- lines when the file starts with one.
  5. Turn Obsidian links into plain text: [[target|label]] becomes label, and [[target]] becomes target.
  6. Render each ```mermaid block to PNG with npx --yes @mermaid-js/mermaid-cli -i <block>.mmd -o <block>.png -b white -w 1200 --scale 2. Replace the block with an <img> tag that points at the PNG. If npx is missing, leave the block as a code block and tell the user.
  7. Convert the Markdown to HTML with the Python markdown package and the tables, fenced_code and toc extensions. Install it in a virtual environment in the temporary folder: python3 -m venv venv && venv/bin/pip install markdown.
  8. Wrap the HTML in a page with a <meta charset="utf-8"> tag and a <style> block for body text, headings, tables and code.
  9. Print the page to PDF with Chrome in headless mode, using absolute paths:

    macOS:

    "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --disable-gpu \
      --print-to-pdf="/absolute/path/out.pdf" "file:///absolute/path/page.html"

    Linux, with chromium or google-chrome on the PATH:

    chromium --headless --disable-gpu --print-to-pdf="/absolute/path/out.pdf" "file:///absolute/path/page.html"
  10. Check that the PDF exists and is not empty. Report its absolute path and size in KB.

Rules

  • Use absolute paths in every command. Chrome needs file:// URLs with absolute paths.
  • Do not open the PDF after writing it. Report the path and let the user open it.
  • Never change the Markdown file.
  • Mermaid diagrams are always drawn as images. Never leave placeholder text in the PDF.

Download now (ZIP)

  • Other versions192 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 192

    1. NousResearch/hermes-agent★ 259ksame name
    2. anthropics/skills★ 186ksame name
    3. shareAI-lab/learn-claude-code★ 80ksame name
    4. shareAI-lab/analysis_claude_code★ 78ksame name
    5. openai/skills★ 27ksame name
    6. spinabot/brigade★ 11ksame name
    7. netease-youdao/LobsterAI★ 6.2ksame name
    8. OpenBMB/PilotDeck★ 4.5ksame name
    9. nextlevelbuilder/goclaw★ 3.7ksame name
    10. awslabs/amazon-bedrock-agentcore-samples★ 3.5ksame name

    182 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use Video Generation, VLM and 10 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • huang-x-hSkill

      Video Generation

      Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.

      Also in 6 projects that use this

    • huang-x-hSkill

      VLM

      Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.

      Also in 6 projects that use this

    • dav-niu474Skill

      gift-evaluator

      The PRIMARY tool for Spring Festival gift analysis and social interaction generation. Use this skill when users upload photos of gifts (alcohol, tea, supplements, etc.) to inquire about their value, authenticity, or how to respond socially. Integrates visual perception, market valuation, and HTML card generation.

      Also in 5 projects that use this

    • dav-niu474Skill

      Podcast Generate

      Generate podcast episodes from user-provided content or by searching the web for specified topics. If user uploads a text file/article, creates a dual-host dialogue podcast (or single-host upon request). If no content is provided, searches the web for information about the user-specified topic and generates a podcast. Duration scales with content size (3-20 minutes, ~240 chars/min). Uses z-ai-web-dev-sdk for LLM script generation and TTS audio synthesis. Outputs both a podcast script (Markdown) and a complete audio file (WAV).

      Also in 5 projects that use this

    • OpenAISkill

      migrate-to-codex

      Migrate supported instruction files, skills, agents, and MCP config into Codex project and global files.

      Also in 6 projects that use this

    • SeifBenayedSkill

      file-reading

      Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about an uploaded file you have not yet read. Do NOT use this skill if the file content is already visible in your context inside a documents block — you already have it.

      Also in 5 projects that use this

    • +1 more from huang-x-h
    • +2 more from dav-niu474
  • In this repository3 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.