跳到正文
Skillpedia
PDF、Word 与幻灯片14k · #11313

report-to-pdf

它能做什么

这项技能根据静态的 HTML 分析报告或仪表板导出文件制作 PDF。适合需要可打印或可分享的研究结果 PDF 的人。

适用场景

  • ✓当你需要现有分析报告的 PDF 副本的时候。
  • ✓当你想把仪表板或图表导出保存为 PDF 的时候。
  • ✓当相关人员要求一份可以打印或作为附件发送的文件的时候。

技能链接

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/data-analytics/workflows/build-report/report-to-pdf/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/data-analytics/workflows/build-report/report-to-pdf/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想要一份 HTML 月度分析报告的 PDF 副本,以便附在邮件中发送。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会在无头浏览器中把静态 HTML 打印为 PDF,然后检查该 PDF。如果源文件只是没有报告内容的应用外壳,它会停下来,并要求提供真正的导出文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Report To PDF

Use this skill only when the user explicitly needs a PDF from an existing Data Analytics report, dashboard, or chart artifact. Prefer a static HTML export or another portable report file as the source.

The expected path is static HTML -> browser headless print-to-PDF -> PDF verification. If only a non-portable source exists, create or retrieve the matching static HTML/export source first.

Workflow

  1. Resolve the static source.

    Use an absolute local path to a static HTML report/export or a local URL served from that static export. If the source is a blob stub, sign-in page, redirect page, incomplete viewer, or an app shell that contains boot scripts but not the report content, stop and obtain a static HTML/export source before continuing.

    When the user provides a hosted artifact URL, first determine whether it exposes a usable static export or package source. If the static export is unavailable but the validated artifact payload is still available in the current run, create the matching static HTML/export from that payload and preserve source provenance in the handoff. If neither a static export nor the artifact payload is available, stop with a blocker instead of printing the live app shell or rebuilding the report from memory.

    When creating or repairing the static source, keep visible metadata reader-facing. Do not copy internal artifact runtime fields, package plumbing, or validator/debug state into the report body, header, footer, or source section. For example, omit raw labels such as snapshot status, package path, widget type, manifest path, renderer IDs, validation status, and local temp paths from the visible PDF. If a runtime detail matters for audit or troubleshooting, preserve it in support notes rather than the visible PDF. Translate data-state caveats into reader language only when they affect interpretation, such as "synthetic demo data" or "partial source coverage."

  2. Generate the PDF with Chrome CLI headless print-to-PDF.

    Use the platform-specific Chrome executable available in the environment. Common examples are /Applications/Google Chrome.app/Contents/MacOS/Google Chrome on macOS and google-chrome, chromium, or chromium-browser on Linux. This is the primary conversion method because it prints the static HTML with a browser rendering engine and usually preserves selectable text, layout, charts, tables, and print CSS.

    chrome \
      --headless=new \
      --disable-gpu \
      --no-first-run \
      --no-default-browser-check \
      --no-pdf-header-footer \
      --print-to-pdf=/absolute/path/to/report.pdf \
      /absolute/path/to/report.html
    
  3. If Chrome is unavailable or cannot produce a valid PDF, use a renderer-backed fallback.

    Use the next available local mechanism that renders the same static HTML/export source and prints or saves that rendered page to PDF. Keep the fallback tool-agnostic: the requirement is faithful HTML rendering followed by PDF output, not a specific implementation. Do not replace this with a model-authored PDF layout, manually redrawn charts, or a report reconstructed from memory.

    A fallback is acceptable only when:

    • the static HTML/export remains the source of truth
    • the rendered output preserves the report title, narrative, charts, tables, caveats, and source details
    • app-only controls are omitted
    • the resulting PDF passes the same verification checks as the primary Chrome path

    If no available local renderer can print the static HTML/export faithfully, stop and report the blocker with the missing capability and the source file that could not be converted.

  4. Verify the PDF itself.

    Confirm page count and metadata with pdfinfo or equivalent. Extract text with pdftotext or equivalent when the PDF should contain selectable text. Render representative pages with pdftoppm or equivalent and inspect them for blank charts, clipped content, missing source details, unwanted controls, internal runtime metadata, and layout regressions. For short reports, render every page. Include a negative check for app-only control labels such as share, edit, refresh, publish, toolbar, menu, and drag affordances, plus internal artifact labels such as snapshot status, widget type, manifest path, package path, validation status, and local temp paths.

  5. Repair before handoff.

    If the output is blank, clipped, missing charts, missing source details, or includes app-only chrome, fix the static

常见问题

它需要什么源文件?

源文件是静态 HTML 报告或导出文件,而不是实时的应用外壳。

它会凭记忆重建报告吗?

不会。这项技能要求遇到阻碍时停止,而不是凭记忆重建报告。

它只在被要求时使用吗?

是的。只有在你明确要求将报告转换为 PDF 时,才会使用这项技能。

详情

作者的原始描述

Narrow conversion skill. Invoke only when the user explicitly asks to convert an existing Data Analytics report, dashboard, or inline chart export into a PDF artifact.

repo: XiaomiMiMo/MiMo-Code

热度

GitHub 星标
14k
排名
#11313
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能