Communitygithub.com

ComposioHQ/paperjsx

透過結構化 JSON 輸入,生成 PPTX 簡報、DOCX 文件、XLSX 試算表與 PDF 報告。

paperjsx 是什麼?

這是一項用於產生專業文件的技能,核心功能是將 JSON 佈局規範轉換為多種常見格式的檔案,包括 PPTX 簡報、DOCX 文件、XLSX 試算表與 PDF 報告。它僅限於生成新檔案,不支援編輯現有文件。支援的平台包含 Claude Code、Cursor、Codex 等具備檔案系統與 Node.js 執行環境的 AI 代理。使用者只需依所需格式安裝對應的 npm 套件(如 `@paperjsx/json-to-pptx`),然後建立符合參考架構的 JSON 規範,再透過簡短的 Node.js 指令碼呼叫 PaperJSX 引擎即可產出結果。此技能特別適合需要自動化、批次化產生簡報、報表或發票的開發者與團隊。最後應驗證產出的檔案大小是否大於零位元組,以確保生成成功。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-codex-skills/tree/main/paperjsx

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

PaperJSX 文件生成

根據 JSON 佈局規範產生專業文件。PaperJSX 僅用於生成新檔案,不支援編輯現有檔案。

觸發時機

當使用者提出以下要求時,可使用此技能:

  • 建立簡報或產生投影片
  • 製作 PPTX 或 PowerPoint 檔案
  • 建立 Word 文件或 DOCX 檔案
  • 產生包含圖表的 Excel 試算表
  • 建立 JSON 轉 PPTX、JSON 轉 DOCX 或 JSON 轉 XLSX 檔案
  • 產生 PDF 發票、報告或圖表文件

安裝

請安裝對應格式的套件:

# 簡報
npm install @paperjsx/json-to-pptx

# Word 文件
npm install @paperjsx/json-to-docx

# 試算表
npm install @paperjsx/json-to-xlsx

# PDF 文件
npm install @paperjsx/json-to-pdf

運作方式

  1. 根據 references/json-schema.md 中的架構建立 JSON 佈局規範
  2. 撰寫一個 Node.js 指令碼,將 JSON 傳遞給 PaperJSX 引擎
  3. 執行指令碼以產生輸出檔案
  4. 驗證輸出檔案是否存在且非零位元組

請勿直接撰寫 PaperJSX 的指令式 API 程式碼。執行模型始終為:輸入 JSON 規範,輸出文件檔案。

範例:PPTX 生成

import { PaperEngine } from "@paperjsx/json-to-pptx";
import fs from "node:fs";

const spec = {
  type: "Document",
  meta: { title: "第四季回顧" },
  slides: [
    {
      type: "Slide",
      children: [
        { type: "Text", content: "2025年第四季業務回顧", style: { fontSize: 36, bold: true } }
      ]
    }
  ]
};

const buffer = await PaperEngine.render(spec);
fs.writeFileSync("presentation.pptx", buffer);
console.log("已產生 presentation.pptx");

範例:DOCX 生成

import { renderToDocx } from "@paperjsx/json-to-docx";
import fs from "node:fs";

const result = await renderToDocx({
  type: "DocxDocument",
  pageSize: "a4",
  orientation: "portrait",
  pages: [
    {
      elements: [
        { type: "heading", level: 1, text: "季度報告" },
        { type: "paragraph", text: "此處為章節內容。" }
      ]
    }
  ]
});

fs.writeFileSync("report.docx", result.buffer);
console.log("已產生 report.docx");

範例:XLSX 生成

import { SpreadsheetEngine } from "@paperjsx/json-to-xlsx";
import fs from "node:fs";

const spec = {
  meta: { title: "營收資料", creator: "PaperJSX" },
  sheets: [{
    name: "營收",
    rows: [
      { cells: [{ value: "季度" }, { value: "營收" }] },
      { cells: [{ value: "2026年第一季" }, { value: 420000 }] },
      { cells: [{ value: "2026年第二季" }, { value: 510000 }] }
    ]
  }]
};

const buffer = await SpreadsheetEngine.render(spec);
fs.writeFileSync("revenue.xlsx", buffer);
console.log("已產生 revenue.xlsx");

驗證

產生任何檔案後,務必進行驗證:

import fs from "node:fs";

const stats = fs.statSync("output.pptx");
if (stats.size === 0) {
  throw new Error("產生的檔案為空白");
}
console.log(`輸出檔案大小:${stats.size} 位元組`);

若引擎擲回錯誤,請將完整的錯誤訊息呈現給使用者。

架構參考

請參閱 references/json-schema.md 以取得所有支援格式的完整 JSON 佈局規範架構。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComposioHQ/-21risk-automation

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/-2chat-automation

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agent-deep-links

Build, validate, and troubleshoot deep links for Codex, Cursor, VS Code, Visual Studio, and similar tools. Use when users ask for clickable links (especially in Slack) that open threads, files, folders, or app settings.

相關技能