Skip to content

JunfengRan/PPTWork / ppt

Build PPT / PowerPoint / 演示文稿 / slide decks end-to-end via a .pptwork/<deck>/ filesystem contract. Use when the user wants to plan, author, screenshot, or export a slide deck. Provides Node scripts for deck CRUD, headless screenshot, and editable PPTX export. Covers clarification, story planning, single-page authoring (via the ppt-html-authoring skill), visual QC, and export troubleshooting.

FileKindSize
SKILL.mdskill md13.2 KB
assets/claude-warm/_preview/bento-asymmetric/slide.htmlother3.6 KB
assets/claude-warm/_preview/bento-asymmetric/thumbnail.pngbinary65.2 KB
assets/claude-warm/_preview/cover-editorial/slide.htmlother2.0 KB
assets/claude-warm/_preview/cover-editorial/thumbnail.pngbinary43.0 KB
assets/claude-warm/_preview/flow-timeline/slide.htmlother3.1 KB
assets/claude-warm/_preview/flow-timeline/thumbnail.pngbinary30.3 KB
assets/claude-warm/_preview/quote-highlight/slide.htmlother1.7 KB
assets/claude-warm/_preview/quote-highlight/thumbnail.pngbinary33.6 KB
assets/claude-warm/_preview/section-divider/slide.htmlother1.8 KB
assets/claude-warm/_preview/section-divider/thumbnail.pngbinary35.6 KB
assets/claude-warm/html/bento-asymmetric.htmlother3.6 KB
assets/claude-warm/html/cover-editorial.htmlother2.0 KB
assets/claude-warm/html/flow-timeline.htmlother3.1 KB
assets/claude-warm/html/quote-highlight.htmlother1.7 KB
assets/claude-warm/html/section-divider.htmlother1.8 KB
assets/claude-warm/index.jsonconfig1.8 KB
assets/corporate-light/_preview/agenda-grid/slide.htmlother3.2 KB
assets/corporate-light/_preview/agenda-grid/thumbnail.pngbinary53.5 KB
assets/corporate-light/_preview/closing-cta/slide.htmlother2.2 KB
assets/corporate-light/_preview/closing-cta/thumbnail.pngbinary91.8 KB
assets/corporate-light/_preview/cover-hero/slide.htmlother2.4 KB
assets/corporate-light/_preview/cover-hero/thumbnail.pngbinary198.9 KB
assets/corporate-light/_preview/kpi-stat-row/slide.htmlother2.4 KB
assets/corporate-light/_preview/kpi-stat-row/thumbnail.pngbinary127.6 KB
assets/corporate-light/_preview/two-column-insight/slide.htmlother3.6 KB
assets/corporate-light/_preview/two-column-insight/thumbnail.pngbinary42.5 KB
assets/corporate-light/html/agenda-grid.htmlother3.2 KB
assets/corporate-light/html/closing-cta.htmlother2.2 KB
assets/corporate-light/html/cover-hero.htmlother2.4 KB
assets/corporate-light/html/kpi-stat-row.htmlother2.4 KB
assets/corporate-light/html/two-column-insight.htmlother3.6 KB
assets/corporate-light/index.jsonconfig2.0 KB
package.jsonmanifest484 B
references/disk-layout.mdmarkdown2.2 KB
references/editable-html-rules.mdmarkdown2.0 KB
references/export-troubleshooting.mdmarkdown5.8 KB
references/material-digest.mdmarkdown2.0 KB
references/research.mdmarkdown2.7 KB
references/story-planning.mdmarkdown5.2 KB
references/visual-qc.mdmarkdown4.4 KB
scripts/deck.mjsscript9.5 KB
scripts/export.mjsscript8.0 KB
scripts/import-reference.mjsscript1.2 KB
scripts/lib/deck.mjsscript2.1 KB
scripts/lib/find-browser.mjsscript1.7 KB
scripts/lib/render.mjsscript12.6 KB
scripts/screenshot.mjsscript2.5 KB
test/smoke.mjsscript10.1 KB

scripts/screenshot.mjs

View on GitHub
#!/usr/bin/env node
// Render a slide's slide.html into thumbnail.png at 1280x720 (PowerPoint
// LAYOUT_WIDE). Re-renders on every call; no cache.
//
// Usage:
//   node screenshot.mjs <slide-dir>
//   node screenshot.mjs <deck-name> <slide-name>
//
// Resolves <slide-dir> against process.cwd(). When called with two args, treats
// them as deck/slide under .pptwork/.

import fs from "node:fs/promises";
import path from "node:path";
import { renderSlideToPng } from "./lib/render.mjs";
import { getSlidePath, deckExists, slideExists } from "./lib/deck.mjs";

const directory = process.cwd();

function out(...lines) {
  process.stdout.write(lines.flat().join("\n") + "\n");
}

function fail(...lines) {
  process.stdout.write(lines.flat().join("\n") + "\n");
  process.exit(1);
}

async function resolveSlideDir(args) {
  if (args.length === 1) return path.resolve(directory, args[0]);
  if (args.length >= 2) {
    const [deck, slide] = args;
    if (!(await deckExists(directory, deck))) {
      fail(`[Error] Deck "${deck}" does not exist (.pptwork/${deck}/ missing).`);
    }
    if (!(await slideExists(directory, deck, slide))) {
      fail(`[Error] Slide "${slide}" not found in deck "${deck}".`);
    }
    return getSlidePath(directory, deck, slide);
  }
  fail(
    "[Error] usage:",
    "  screenshot.mjs <slide-dir>",
    "  screenshot.mjs <deck-name> <slide-name>",
  );
}

async function main() {
  const args = process.argv.slice(2);
  const slideDir = await resolveSlideDir(args);
  const htmlPath = path.join(slideDir, "slide.html");
  const thumbnailPath = path.join(slideDir, "thumbnail.png");

  try {
    await fs.access(htmlPath);
  } catch {
    fail(
      `[Error] slide.html not found at ${htmlPath}`,
      `[Hint] Write slide.html first, then re-run.`,
    );
  }

  try {
    const { png, width, height } = await renderSlideToPng(htmlPath);
    await fs.writeFile(thumbnailPath, png);
    const rel = path.relative(directory, thumbnailPath);
    out(
      "[Done] Re-rendered slide PNG.",
      `[File] ${path.relative(directory, htmlPath)}`,
      `[Thumbnail] ${rel}`,
      `[Size] ${width}x${height}`,
      `[Bytes] ${png.length}`,
      "",
      `[Next] Open ${rel} (Read tool / image viewer) to verify visually.`,
    );
  } catch (e) {
    fail(
      `[Error] Screenshot failed: ${e?.message || String(e)}`,
      `[Hint] Ensure Chrome/Chromium is installed locally, or set PPT_BROWSER_EXECUTABLE / PPT_BROWSER_EXECUTABLE.`,
      `[Hint] Or run \`npx playwright install chromium\` inside skills/ppt to use playwright's bundled browser.`,
    );
  }
}

main();
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 197kUpdated Claude CodeCodexVerifiedInstall