pdf

GitHub

生成高质量PDF文件,支持简历、报告等。通过WeasyPrint或ReportLab渲染,处理现有文件转换及基于Markdown的修订,并强制进行质量验证以确保输出合规。

docker/sandbox/skills/pdf/SKILL.md MODSetter/SurfSense

Trigger Scenarios

需要创建PDF文档 将现有文件转换为PDF 对已有PDF内容进行修订

Install

npx skills add MODSetter/SurfSense --skill pdf -g -y
More Options

Non-standard path

npx skills add https://github.com/MODSetter/SurfSense/tree/main/docker/sandbox/skills/pdf -g -y

Use without installing

npx skills use MODSetter/SurfSense@pdf

指定 Agent (Claude Code)

npx skills add MODSetter/SurfSense --skill pdf -a claude-code -g -y

安装 repo 全部 skill

npx skills add MODSetter/SurfSense --all -g -y

预览 repo 内 skill

npx skills add MODSetter/SurfSense --list

SKILL.md

Frontmatter
{
    "name": "pdf",
    "description": "Create polished PDF files for requests such as PDFs, resumes, CVs, reports, letters, one-pagers, and printable documents."
}

PDF

Create the requested PDF in /workspace. Everything required is preinstalled; never run pip install, npm install, or download dependencies.

Choose the renderer

  • Use WeasyPrint for typography-heavy documents authored naturally as HTML/CSS: resumes, CVs, letters, one-pagers, and styled reports.
  • Use ReportLab for programmatic layouts, drawing, charts, coordinates, or documents assembled directly from Python data.
  • Use A4 unless the user or source context implies US Letter. Use margins of at least 18 mm (0.7 in), 10–11 pt body text, and 1.3–1.5 line height.
  • Available families include DejaVu, Liberation, and Noto (including CJK). Prefer Liberation Sans/Serif for office-style documents and Noto for broad Unicode coverage.
  • Do not embed page numbers, folios, Page X of Y labels, CSS page counters, or numbered ReportLab footers. SurfSense's PDF viewer supplies its own page indicator, so embedded numbering would duplicate the interface.

Escape untrusted text before placing it in HTML.

Converting a file the user already has

When the request is to turn an existing workspace file into a PDF, call load_source_document(path="/documents/...") and convert the source_path it returns. Re-authoring the content with a renderer above would discard the original layout, so reach for it only when the source has no stored upload.

A source that is already a PDF needs no conversion. Convert Office formats with headless LibreOffice, giving each run its own profile directory so concurrent conversions cannot collide, and confirm the output exists before verifying:

soffice --headless -env:UserInstallation=file:///tmp/soffice-<unique> \
  --convert-to pdf --outdir <out-dir> <source_path>

LibreOffice names the output after the source stem, so read it back from <out-dir> rather than assuming your own filename.

Revisions

Start an in-place revision with load_artifact_for_revision. Read its markdown_path for the artifact's substantive content and any other context provided by the user, then regenerate the PDF at expected_output_path. PDF revisions are rebuilds from Markdown/context, not edits inferred from rendered pages. Do not use vision to reconstruct the old PDF; vision may still be used by verify_artifact after regeneration.

Save the verified revision with the returned artifact_id and expected_generation. A changed title, filename, or design is still the same artifact unless the user explicitly asks for a separate copy.

Required quality gate

After generating the requested PDF, call verify_artifact(path=output_path, format="pdf"). Warnings are advisory and do not require regeneration. If verification reports blocking findings, fix all blockers together, regenerate once at the same output path, and reverify. If a blocker remains, stop and explain it instead of entering another automatic rewrite loop. Only a verified file can be saved.

Then call save_artifact(path=output_path, title="...", markdown_representation="..."). Working files may use any paths; no source file, preview file, or matching filename stem is part of the publication contract.

The Markdown representation must faithfully contain the document's substantive text so the artifact remains accessible and searchable without parsing the PDF.

Version History

  • 014e47a Current 2026-09-23 08:23

    重构制品流程,要求显式指定验证格式以确保类型安全。

  • 2b50e7a 2026-08-20 17:07

Same Skill Collection

.agents/skills/codebase-design/SKILL.md
.agents/skills/migrate-radix-to-base/SKILL.md
.agents/skills/shadcn/SKILL.md
.agents/skills/tdd/SKILL.md
.agents/skills/translate/SKILL.md
.cursor/skills/alert-manager/SKILL.md
.cursor/skills/animation-vocabulary/SKILL.md
.cursor/skills/backlink-analyzer/SKILL.md
.cursor/skills/competitor-analysis/SKILL.md
.cursor/skills/content-gap-analysis/SKILL.md
.cursor/skills/content-quality-auditor/SKILL.md
.cursor/skills/content-refresher/SKILL.md
.cursor/skills/domain-authority-auditor/SKILL.md
.cursor/skills/emil-design-eng/SKILL.md
.cursor/skills/entity-optimizer/SKILL.md
.cursor/skills/frontend-design/SKILL.md
.cursor/skills/geo-content-optimizer/SKILL.md
.cursor/skills/improve-codebase-architecture/SKILL.md
.cursor/skills/internal-linking-optimizer/SKILL.md
.cursor/skills/keyword-research/SKILL.md
.cursor/skills/memory-management/SKILL.md
.cursor/skills/meta-tags-optimizer/SKILL.md
.cursor/skills/on-page-seo-auditor/SKILL.md
.cursor/skills/performance-reporter/SKILL.md
.cursor/skills/python-patterns/SKILL.md
.cursor/skills/rank-tracker/SKILL.md
.cursor/skills/review-animations/SKILL.md
.cursor/skills/schema-markup-generator/SKILL.md
.cursor/skills/seo-content-writer/SKILL.md
.cursor/skills/serp-analysis/SKILL.md
.cursor/skills/shadcn/SKILL.md
.cursor/skills/system-architecture/SKILL.md
.cursor/skills/tdd/SKILL.md
.cursor/skills/technical-seo-checker/SKILL.md
.cursor/skills/ugc-brief/SKILL.md
.cursor/skills/vercel-react-best-practices/SKILL.md
.cursor/skills/web-design-guidelines/SKILL.md
docker/sandbox/skills/docx/SKILL.md
docker/sandbox/skills/flashcards/SKILL.md
docker/sandbox/skills/html/SKILL.md
docker/sandbox/skills/infographic/SKILL.md
docker/sandbox/skills/mindmap/SKILL.md
docker/sandbox/skills/pptx/SKILL.md
docker/sandbox/skills/quiz/SKILL.md
docker/sandbox/skills/video/SKILL.md
docker/sandbox/skills/xlsx/SKILL.md
.agents/skills/frontend-workflow/SKILL.md
.cursor/skills/playwright-testing/SKILL.md

Metadata

Files
0
Version
176aed2
Hash
a17728ad
Indexed
2026-08-20 17:07

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-01 13:41
浙ICP备14020137号-1