agentleFS
yenavayenava/yenava-skills/content-to-pdf/SKILL.md

content-to-pdf

Skill4 starsChanged 8 months agoMITView on GitHub

Use when the user wants to convert Markdown or structured written content into a polished PDF with good typography, cover metadata, optional table of contents, and print-ready layout. Trigger on requests like "转成 PDF", "排版成 PDF", "导出 PDF", "做成报告 PDF", "把内容排好版", or when the main need is formatting and exporting content rather than writing the content itself.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for:

    line 14
  2. Distinctive:

    Do not use this skill when the main problem is writing the manuscript itself.

    line 24
  3. Distinctive:

    Prefer Markdown with YAML frontmatter.

    line 30
  4. Distinctive:

    Default to one of these generic document modes:

    line 47
  5. Distinctive:

    If the user does not specify, infer from the content and pick the most natural one.

    line 53
  6. Distinctive:

    Use clear heading levels instead of overdesigning.

    line 65
  7. Distinctive:

    keep headings from getting stranded at the page bottom,

    line 73
  8. Distinctive:

    keep backgrounds subtle enough for print.

    line 76
  9. Distinctive:

    Use normal Markdown for paragraphs, lists, tables, blockquotes, and code.

    line 101
  10. Distinctive:

    Use raw HTML only for special layout needs.

    line 102
  11. Very specific:

    Use <div class="page-break"></div> when a forced page break is necessary.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Content To PDF

Overview

This skill turns general written content into polished PDF documents. It is designed for Markdown-first workflows where the user already has content, notes, an article, a report, or a guide and wants a reliable path to clean layout, stable hierarchy, and printable output.

Best-Fit Use Cases

Use this skill for:

  • articles,
  • reports,
  • briefs,
  • proposals,
  • internal guides,
  • lightweight manuals,
  • content packages that need PDF delivery.

Do not use this skill when the main problem is writing the manuscript itself. In that case, use a writing skill first, then use this one for layout and export.

Workflow

1. Normalize The Source

Prefer Markdown with YAML frontmatter.

Useful frontmatter fields:

  • title
  • subtitle
  • summary
  • author
  • date
  • keywords
  • document_type
  • version
  • toc
  • theme

2. Choose The Output Mode

Default to one of these generic document modes:

  • article: clean reading flow, lighter metadata.
  • report: stronger structure, clearer metadata blocks.
  • guide: slightly more instructional and section-led.

If the user does not specify, infer from the content and pick the most natural one.

3. Keep The Structure Visible

The PDF should make hierarchy obvious:

  • title and subtitle,
  • optional summary,
  • optional table of contents,
  • section headings,
  • callouts, quotes, tables, and code blocks when present.

Use clear heading levels instead of overdesigning.

4. Preserve Readability In Print

When exporting:

  • use stable margins,
  • avoid cramped typography,
  • keep headings from getting stranded at the page bottom,
  • preserve table readability,
  • preserve code block contrast,
  • keep backgrounds subtle enough for print.

5. Use The Bundled Exporter

This skill includes a Playwright-based exporter for Markdown to PDF.

  • Template: template.html
  • Styles: styles.css
  • Formatting reference: format-guide.md
  • Presets reference: layout-presets.md
  • Example source: sample-content.md
  • Exporter: export_pdf.mjs

Example:

node content-to-pdf/scripts/export_pdf.mjs \
  --input content-to-pdf/examples/sample-content.md \
  --output output/pdf/content-to-pdf-sample.pdf

Markup Conventions

  • Frontmatter controls cover metadata and options.
  • # Heading and ## Heading are used to build the optional TOC.
  • Use normal Markdown for paragraphs, lists, tables, blockquotes, and code.
  • Use raw HTML only for special layout needs.
  • Use <div class="page-break"></div> when a forced page break is necessary.

Quality Bar

Before delivering, verify:

  • hierarchy is easy to scan,
  • the cover looks intentional when metadata exists,
  • the body feels like a designed document rather than a browser printout,
  • tables and code blocks are readable,
  • page breaks do not produce obvious visual defects.

Download now (ZIP)

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.