Skip to content

PlutoLei/paperbanana-skill / plugins/paperbanana-slide-deck

paperbanana-slide-deck

Unverified

Create or revise a complete PaperBanana slide deck, including image slides and native editable PowerPoint text, tables, charts and diagrams. Use for PaperBanana deck requests; preserve the user's selected presentation tool and existing deck mode.

FileKindSize
.claude-plugin/plugin.jsonconfig396 B
.gitignoreother22 B
SKILL.mdskill md6.4 KB
bun.lockother4.5 KB
package.jsonmanifest424 B
references/editable-slide-spec.mdmarkdown9.0 KB
references/outline-format.mdmarkdown927 B
references/style-guide.mdmarkdown1.3 KB
references/styles/3d-model.mdmarkdown2.7 KB
references/styles/abstract.mdmarkdown2.5 KB
references/styles/academia.mdmarkdown2.5 KB
references/styles/adorable-3d-character.mdmarkdown2.5 KB
references/styles/afrofuturism.mdmarkdown2.8 KB
references/styles/alcohol-ink.mdmarkdown2.4 KB
references/styles/analog-film.mdmarkdown2.6 KB
references/styles/architectural.mdmarkdown2.4 KB
references/styles/art-deco.mdmarkdown2.5 KB
references/styles/art-nouveau.mdmarkdown2.5 KB
references/styles/artistic-vision.mdmarkdown2.7 KB
references/styles/avant-garde.mdmarkdown2.6 KB
references/styles/baroque.mdmarkdown2.4 KB
references/styles/bauhaus-style-poster.mdmarkdown2.5 KB
references/styles/bauhaus-style.mdmarkdown2.6 KB
references/styles/blueprint-schematic-drawing.mdmarkdown2.5 KB
references/styles/cel-shaded-art.mdmarkdown2.5 KB
references/styles/chromolithography.mdmarkdown2.4 KB
references/styles/cinematic-dynamic.mdmarkdown2.6 KB
references/styles/cinematic.mdmarkdown2.6 KB
references/styles/classicism-art.mdmarkdown2.5 KB
references/styles/collage.mdmarkdown2.4 KB
references/styles/color-field-painting.mdmarkdown2.6 KB
references/styles/color-sketchnote.mdmarkdown2.4 KB
references/styles/colored-pencil-art.mdmarkdown2.6 KB
references/styles/conceptual-art.mdmarkdown2.5 KB
references/styles/constructivism.mdmarkdown2.5 KB
references/styles/constructivist.mdmarkdown2.5 KB
references/styles/craft-clay.mdmarkdown2.7 KB
references/styles/cubism.mdmarkdown2.6 KB
references/styles/cubist.mdmarkdown2.5 KB
references/styles/cyanotype.mdmarkdown2.5 KB
references/styles/cyberpunk-cityscape.mdmarkdown2.4 KB
references/styles/de-stijl.mdmarkdown2.5 KB
references/styles/digital-art.mdmarkdown2.8 KB
references/styles/double-exposure.mdmarkdown2.6 KB
references/styles/dreamscape.mdmarkdown2.4 KB
references/styles/dynamic-illustration.mdmarkdown2.6 KB
references/styles/embroidery.mdmarkdown2.6 KB
references/styles/encaustic.mdmarkdown2.4 KB
references/styles/expressionism.mdmarkdown2.6 KB
references/styles/expressionist.mdmarkdown2.4 KB
references/styles/fairy-tale.mdmarkdown2.4 KB
references/styles/fashion-editorial.mdmarkdown2.3 KB
references/styles/film-noir.mdmarkdown2.4 KB
references/styles/flat-2d-art.mdmarkdown2.6 KB
references/styles/flat-papercut.mdmarkdown2.4 KB
references/styles/futurism.mdmarkdown2.6 KB
references/styles/futuristic.mdmarkdown2.4 KB
references/styles/glamour.mdmarkdown2.4 KB
references/styles/glitchcore.mdmarkdown2.6 KB
references/styles/gothic.mdmarkdown2.5 KB
references/styles/halftone.mdmarkdown2.4 KB
references/styles/hdr.mdmarkdown2.5 KB
references/styles/high-fashion.mdmarkdown2.6 KB
references/styles/hyperrealism.mdmarkdown2.5 KB
references/styles/idyllic.mdmarkdown2.6 KB
references/styles/illuminated-manuscript.mdmarkdown2.9 KB
references/styles/impressionism.mdmarkdown2.7 KB
references/styles/impressionist.mdmarkdown2.5 KB
references/styles/infographic-drawing.mdmarkdown2.6 KB
references/styles/isometric.mdmarkdown2.6 KB
references/styles/japanese-ink-drawing.mdmarkdown2.7 KB
references/styles/kawaii.mdmarkdown2.5 KB
references/styles/kirigami.mdmarkdown2.5 KB
references/styles/knolling-photography.mdmarkdown2.6 KB
references/styles/light-cheery-atmosphere.mdmarkdown2.5 KB
references/styles/line-art.mdmarkdown2.6 KB
references/styles/logo-design.mdmarkdown2.6 KB
references/styles/long-exposure.mdmarkdown2.4 KB
references/styles/lowpoly.mdmarkdown2.6 KB
references/styles/luxurious-elegance.mdmarkdown2.6 KB
references/styles/luxury.mdmarkdown2.3 KB
references/styles/lyrical-geometry.mdmarkdown2.7 KB
references/styles/macro-photography.mdmarkdown2.8 KB
references/styles/marker-drawing.mdmarkdown2.6 KB
references/styles/minimalism.mdmarkdown2.5 KB
references/styles/minimalist.mdmarkdown2.3 KB
references/styles/monochrome.mdmarkdown2.4 KB
references/styles/mosaic.mdmarkdown2.5 KB
references/styles/nautical.mdmarkdown2.4 KB
references/styles/neo-futurism.mdmarkdown2.3 KB
references/styles/neo-impressionism.mdmarkdown2.3 KB
references/styles/neon-noir.mdmarkdown2.5 KB
references/styles/neonpunk.mdmarkdown2.7 KB
references/styles/one-line-art.mdmarkdown2.5 KB
references/styles/op-art.mdmarkdown2.5 KB
references/styles/origami.mdmarkdown2.7 KB
references/styles/ornate-intricate.mdmarkdown2.4 KB
references/styles/paper-quilling.mdmarkdown2.5 KB
references/styles/pencil-sketch.mdmarkdown2.4 KB
references/styles/pop-art.mdmarkdown2.2 KB
references/styles/real-estate.mdmarkdown2.2 KB
references/styles/renaissance.mdmarkdown2.4 KB
references/styles/retail.mdmarkdown2.3 KB
references/styles/retro-futurism.mdmarkdown2.5 KB
references/styles/sci-fi.mdmarkdown2.4 KB
references/styles/shepard-fairey-style.mdmarkdown2.5 KB
references/styles/silhouette-art.mdmarkdown2.5 KB
references/styles/silhouette.mdmarkdown2.4 KB
references/styles/simple-vector-art.mdmarkdown2.4 KB
references/styles/space-art.mdmarkdown2.8 KB
references/styles/space.mdmarkdown2.4 KB
references/styles/stacked-papercut.mdmarkdown2.5 KB
references/styles/stained-glass.mdmarkdown2.5 KB
references/styles/steampunk.mdmarkdown2.4 KB
references/styles/sumi-e-detailed.mdmarkdown2.7 KB
references/styles/sumi-e-symbolic.mdmarkdown2.7 KB
references/styles/suminagashi.mdmarkdown2.5 KB
references/styles/surrealism.mdmarkdown2.4 KB
references/styles/surrealist.mdmarkdown2.4 KB
references/styles/tilt-shift.mdmarkdown2.5 KB
references/styles/tranquil.mdmarkdown2.4 KB
references/styles/typography.mdmarkdown2.5 KB
references/styles/ukiyo-e.mdmarkdown2.5 KB
references/styles/van-gogh.mdmarkdown2.5 KB
references/styles/vaporwave.mdmarkdown2.5 KB
references/styles/vibrant-rim-light.mdmarkdown2.4 KB
references/styles/vintage-airline-poster.mdmarkdown2.5 KB
references/styles/vintage-travel-poster.mdmarkdown2.6 KB
references/styles/volumetric-lighting.mdmarkdown2.4 KB
references/styles/whimsical.mdmarkdown2.2 KB
references/styles/zentangle.mdmarkdown2.4 KB
scripts/build-deck.tsscript2.5 KB
scripts/editable/render-editable-pptx.tsscript4.6 KB
scripts/editable/render-previews.pyscript6.6 KB
scripts/editable/render_inputs.pyscript2.2 KB
scripts/editable/review-editable.pyscript16.3 KB
scripts/editable/slide-spec.schema.jsonconfig2.6 KB
scripts/editable/validate-slide-spec.tsscript5.5 KB
scripts/merge-to-pptx.tsscript4.0 KB
tests/editable-mode.test.tsscript2.5 KB
tests/fixtures/editable/slide-spec.jsonconfig1.4 KB
tests/image-mode.test.tsscript1.4 KB
tests/mode-router.test.tsscript528 B
tests/test_critic_core_integration.pyscript4.4 KB
tests/test_render_previews.pyscript8.6 KB
tests/test_review_editable.pyscript15.7 KB

scripts/editable/render-editable-pptx.ts

View on GitHub
import { dirname, resolve } from "node:path";
import PptxGenJS from "pptxgenjs";
import { loadAndValidate, type SlideElement } from "./validate-slide-spec";

const THEMES = {
  "paperbanana-parchment": {
    background: "F7F2E6", ink: "25231F", muted: "6D6A64", rule: "C8C3B8",
    accent: "2A9D8F", accent2: "4A6FD4", headFont: "Charter", bodyFont: "Charter"
  },
  "paperbanana-clean": {
    background: "FFFFFF", ink: "1F2937", muted: "64748B", rule: "CBD5E1",
    accent: "0F766E", accent2: "4F46E5", headFont: "Aptos Display", bodyFont: "Aptos"
  }
} as const;

type Theme = (typeof THEMES)[keyof typeof THEMES];

function addElement(
  slide: ReturnType<PptxGenJS["addSlide"]>,
  pptx: PptxGenJS,
  el: SlideElement,
  baseDir: string,
  theme: Theme
): void {
  const box = { objectName: el.id, x: el.x, y: el.y, w: el.w, h: el.h };
  if (el.type === "text") {
    slide.addText(el.text ?? "", { ...box, fontFace: theme.bodyFont,
      fontSize: el.font_size ?? 18, color: el.color ?? theme.ink, margin: 0,
      align: el.align, valign: el.valign, bold: el.bold });
    return;
  }
  if (el.type === "shape") {
    slide.addShape((el.shape ?? pptx.ShapeType.rect) as Parameters<typeof slide.addShape>[0],
      { ...box, fill: { color: el.fill ?? "FFFFFF" }, line: { color: el.stroke ?? theme.rule } });
    return;
  }
  if (el.type === "line") {
    slide.addShape(pptx.ShapeType.line, { ...box, line: { color: el.stroke ?? theme.muted,
      width: 1.5, endArrowType: el.end_arrow ?? "none" } });
    return;
  }
  if (el.type === "table") {
    slide.addTable(el.rows as PptxGenJS.TableRow[], { ...box, fontFace: theme.bodyFont,
      fontSize: 16, border: { type: "solid", color: theme.rule, pt: 0.6 } });
    return;
  }
  if (el.type === "chart") {
    slide.addChart(pptx.ChartType[el.chart_type ?? "bar"], el.series as unknown[],
      { ...box, showLegend: true, legendPos: "b", showTitle: false, showValue: true,
        chartColors: [theme.accent], dataLabelFormatCode: "0.0000",
        catAxisLabelColor: theme.ink, catAxisLabelFontFace: theme.bodyFont,
        valAxisLabelColor: theme.ink, valAxisLabelFontFace: theme.bodyFont,
        dataLabelColor: theme.ink, dataLabelFontFace: theme.bodyFont,
        legendColor: theme.ink, legendFontFace: theme.bodyFont });
    return;
  }
  if (el.type === "image") {
    slide.addImage({ ...box, path: resolve(baseDir, el.path ?? ""), altText: el.alt_text });
    return;
  }
  if (el.type === "group") {
    // Layout-only container: PptxGenJS 4.0.1 exposes no native PowerPoint group
    // API, so the container itself is never emitted or rasterised. Children are
    // offset from group-relative to absolute slide coordinates and emitted as
    // native editable objects with their own stable objectName IDs.
    const children = el.children ?? [];
    const toAbsolute = (child: SlideElement): SlideElement =>
      ({ ...child, x: el.x + child.x, y: el.y + child.y });
    for (const child of children.filter((c) => c.type === "line")) {
      addElement(slide, pptx, toAbsolute(child), baseDir, theme);
    }
    for (const child of children.filter((c) => c.type !== "line")) {
      addElement(slide, pptx, toAbsolute(child), baseDir, theme);
    }
    return;
  }
  throw new Error(`unsupported element ${el.type}: ${el.id}`);
}

export async function renderEditableDeck(specPath: string, outputPath: string): Promise<string> {
  const { spec, absolute } = loadAndValidate(specPath);
  const theme = THEMES[spec.deck.theme as keyof typeof THEMES];
  if (!theme) throw new Error(`unsupported theme: ${spec.deck.theme}`);
  const pptx = new PptxGenJS();
  pptx.layout = "LAYOUT_WIDE";
  pptx.author = "PaperBanana";
  pptx.subject = "Editable PaperBanana slide deck";
  const baseDir = dirname(absolute);
  for (const slideSpec of spec.slides) {
    const slide = pptx.addSlide();
    slide.background = { color: theme.background };
    for (const el of slideSpec.elements.filter((item) => item.type === "line")) addElement(slide, pptx, el, baseDir, theme);
    for (const el of slideSpec.elements.filter((item) => item.type !== "line")) addElement(slide, pptx, el, baseDir, theme);
    slide.addNotes(slideSpec.speaker_notes);
  }
  await pptx.writeFile({ fileName: resolve(outputPath) });
  return resolve(outputPath);
}

if (import.meta.main) {
  const [specPath, outputPath] = process.argv.slice(2);
  if (!specPath || !outputPath) {
    console.error("Usage: bun render-editable-pptx.ts <slide-spec.json> <output.pptx>");
    process.exit(1);
  }
  try {
    const written = await renderEditableDeck(specPath, outputPath);
    console.log(`Created: ${written}`);
  } catch (err) {
    console.error("Error:", (err as Error).message);
    process.exit(1);
  }
}
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: 198kUpdated 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: 198kUpdated 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: 198kUpdated 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: 198kUpdated Claude CodeCodexVerifiedInstall