SkillsGrove
SkillsGrove/ドキュメント作成/OICWS/Coscribe/PPTX Pages

PPTX Pages

インストール

$npx skills add https://github.com/OICWS/Coscribe --skill 'PPTX Pages'
$git clone --depth 1 https://github.com/OICWS/Coscribe.git /tmp/Coscribe && mkdir -p ~/.claude/skills && cp -r /tmp/Coscribe/office-agent/src/coscribe/builtin_skills/pptx-pages ~/.claude/skills/PPTX-Pages
この Agent Skill をインストールしてください:https://github.com/OICWS/Coscribe/tree/cf9a00cd7333f2318db917713fbe12c3f6a96079/office-agent/src/coscribe/builtin_skills/pptx-pages — まず SKILL.md とスクリプトを読み、安全であることを確認してから、私のスキルフォルダにインストールしてください。

概要

原文の説明 · MITHow to build a new PowerPoint deck as one SVG page per slide with build_pptx_from_pages -- the workflow, the page language, layout and colour choices, a deck on the user's own template, and how to edit a deck built this way. Load before writing any new deck.
以下の SKILL.md は OICWS/Coscribe(コミット cf9a00c)から MIT ライセンスに基づいて転載しています。本文は変更しておらず、ファイル先頭のメタデータのみ省略し、画像はリンクとして表示し、非常に長いファイルは途中までの表示としています。Copyright 2026 OICWS。ライセンス:LICENSE。表示しているのは指示ファイルのみです。スクリプト等は元のリポジトリをご覧ください。

A deck built this way is a folder of SVG pages, one per slide, compiled into a .pptx whose shapes and text stay editable in PowerPoint. The pages are the deck's source: to change the deck later, edit the pages and build again. Design guidance below is condensed in part from ppt-master's design references (MIT licence, copyright Hugo He).

Workflow

  1. Read the material the user gave (read_docx / read_xlsx / read_pdf / read_file). Every number, name and date on a slide comes from it; a figure you compute (a sum, a share) must be exact. Never add a year, a version number or a statistic the material does not have: no date on the cover or in a footer unless the material gives one. Write a figure with its unit as the material writes it ("399 元" stays "399 元", not "¥399"; "41%" stays "41%"), because the reader checks the slide against the material.
  2. Plan the deck before drawing: one line per page with its role (cover, agenda, section, content, closing), its title (a short claim, not a label: "华东增长最快", not "区域数据"), and the figures it must show. A breakdown keeps all its parts (every share of a survey, every price of an offer); before writing pages, check that each figure in the material is on a page or left out on purpose. One idea per page. Page count as the user asked; otherwise about one page per two minutes of talk.
  3. Write the design spec (section "Design spec" below) into design.md in the pages folder, after reading the one visual-style file it picks. Every page follows it.
  4. Write the pages with write_file into a folder next to the deck, e.g. q3-review-pages/, named so they sort in order: 01-cover.svg, 02-agenda.svg, ... Write every page before the first build, and write each one carefully once: every extra round trip costs the user money. Speaker notes for a talk deck, or when the user asks for them (讲稿, 演讲者备注): what the presenter says on that page, in its <desc id="notes">, a few sentences, not the slide's text again.
  5. Build once: build_pptx_from_pages(pages_dir, path, sources=[the material's files]). Fix every error it reports by editing the named page, then build again; at most two repair rounds. Fix the warnings that are real (an invented number, faint body text) in the same edits; do not rebuild for a warning you decide to keep (an axis tick, a watermark).
  6. Look once: when the build has no errors, render_pptx_preview(path) once and change only what is clearly wrong, with one more build at most.

To redesign a deck the user made ("美化", a rough draft to make presentable): read_pptx gives every slide's text, tables, chart data and pictures; keep all of it, the pictures saved as above, pass the old deck in sources so the number check holds the new pages to it, and write the new deck under a new name.

To revise a deck built this way, identify its original PPTX and source folder. Edit the existing SVG pages and build back to that same PPTX path. Apply colours, fonts and layout changes in the source pages whenever they can express them. Finish the source edits and rebuild before making any PPTX-only changes. Use the existing slide history for undo. If the user asks for a separate version, use a separate output name and a separate copy of the source pages so both decks stay editable.

If the builder refuses to replace the original, preserve the current PPTX. Use the edit_pptx_* tools on that same file if they can make the requested change while keeping its existing edits. Otherwise ask the user before using replace_changes. A rebuild to a second path followed by a move or copy over the original also replaces its edits and needs the same explicit approval. Leave the original in place while waiting.

Not for this way: a few words in a deck the user brought (use the edit tools); for their template, see "Changing the template's own slides".

Design spec

A deck looks designed when one decision runs through every page. Before any page, choose:

  1. Talk or read: whether someone presents the deck or people read it on their own. The user decides, not the style: take it from the request ("汇报", "演讲", "听众", a talk → talk; "发给", "阅读", "读者", a report to send round → read). When the request does not say and you can ask, ask once with ask_user_question, the two choices in one line each; a deck made with no one to ask is read.
    • Talk: the speaker carries the content, the page carries one point. A claim title, then one figure, chart or picture, or at most three short lines; body 24-28 px. What the speaker will say is in the speaker notes, not on the page. In two languages, the second one is a smaller line under the title and the key points only.
    • Read: the page stands on its own, as a document would. Full statements, tables and sources are fine; body 18-22 px, annotations 14-16. Still one idea per page, and room between blocks.
  2. A visual style: how the deck looks. Pick one from the list by the content and audience, read its file with read_skill_file("PPTX Pages", "visual-styles/<id>.md"), and no other style file.
  3. A method (optional): how the deck argues, for a kind of deck the list names; read read_skill_file("PPTX Pages", "methods/<id>.md"). Its fallback colours and typography are defaults the spec may take.

Then write design.md in the pages folder, short, with exactly these parts:

  • Use: talk or read, and how the request said it.
  • Direction: the style's id and one sentence that names this deck's look (e.g. "双语公报:数据 新闻式栅格,中文主行与英文副行成对").
  • Palette: field, surface, ink, primary, accent (and at most two more), each as #RRGGBB with its job. The accent marks the key figure only.
  • Type: the families by role, from fonts every Windows PC has: Chinese titles SimSun (serif, authority) or Microsoft YaHei / SimHei (sans); Chinese body Microsoft YaHei or DengXian; Latin and figures Cambria or Times New Roman (serif) or Arial, Calibri, Segoe UI (sans), not Georgia (its digits rise and drop, so amounts look misaligned); Consolas for code. At most three families. A text sets its own font-family ("SimSun, Cambria") when it differs from the root's. Sizes in px: display 56-80, title 36-44, lead 24-28, body as talk or read sets it, annotation 16-18 (14-16 when read), source line 13-14.
  • Grid: margins (56-80 px), columns, the gap between blocks, the corner radius (0 for a hard-edged style).
  • Recurring elements: what sits in the same place on every content page (a header rule, a section index, a source line) and what the cover and the section pages share.
  • Pages: one line each, its role and its composition (a hero number, chart and takeaway, a table, a comparison, a timeline, cards...). No three pages in a row with the same composition; a dense page is followed by a lighter one.

Visual styles (visual-styles/<id>.md):

id Look
swiss-minimal Strict grid, sharp geometry, aggressive whitespace, near-zero decoration
editorial Magazine hierarchy: columns, hairline rules, serif and sans interplay
data-journalism Economist / Bloomberg infographic: dense grid, hero numbers, sidebars, source lines
brutalist Newspaper density, heavy rules, raw structure
photo-editorial Photography leads, text as captions and points
soft-rounded Rounded cards, gentle elevation, approachable (product, training)
glassmorphism Frosted-glass panels, gradient light (SaaS, product)
dark-tech Dark canvas, luminous accents, geometric precision (tech, AI, launches)
blueprint Engineering schematic: line work on dark paper, annotated
ink-wash New-Chinese ink wash: rice paper, brush, seal red
ink-notes Whiteboard ink, minimal hand-drawn marks
sketch-notes Warm hand-drawn sketchnotes
chalkboard Classroom chalkboard
paper-cut Layered cut paper, soft shadows
memphis Pop colour blocks, geometric confetti
zine Risograph zine, halftone, limited palette
vintage-poster Mid-century print poster
pixel-art 8-bit retro game

Methods (methods/<id>.md): operating-review (business reviews: result, variance, cause, owned action), consulting-decision and mbb-consulting (answer-first decision documents), solution-proposal, investor-pitch, product-launch, creative-pitch, narrative-keynote, academic-research, science-explainer, technical-deepdive, incident-postmortem, workshop-teaching (training), duty-manual (rules and procedures). Their mentions of confirmation steps, workspaces and image rows belong to the project they come from: take the method and the defaults, not the procedure.

The style files and methods are ppt-master's (MIT licence, copyright Hugo He; NOTICE.md).

On the user's own template

When the user names their template (a .pptx or .potx), the deck is built on it:

  1. build_pptx_from_pages(pages_dir, path, template="公司模板.pptx") with the pages folder still empty returns the template's viewBox, theme colours and fonts, its layouts, and each example_slides entry's layout, background and decoration (bands, panels, pictures with their box and fill).
  2. Fix the look from it, not from a visual style's defaults: the template's colours (the decoration's fills first; they are what the template looks like), its fonts, and its decoration's place.
  3. Each page's root takes data-template-slide="N": the slide starts with example slide N's background and decoration, and the page draws only the content, around them and in colours that read on that background. A cover starts from the template's cover, a content page from a content slide, a closing page from its last slide. No page draws a full background. Everything in the slide's decoration comes along, its text and any table too, and a page cannot take it off: for a slide whose decoration holds sample words or a table you do not want, start from its layout instead (data-layout="<name>", the master's look without them).
  4. Build with the same template; every later build passes it too.

Changing the template's own slides, a little or a lot

When the user wants their template's slides themselves changed ("改模板里的内容", "在模板上改"), pick the way by how much changes:

  • A little (the slides stay; words, numbers, a table's cells, a picture, a chart added): copy_file the template to the new deck's name and edit the copy: read_pptx for what each slide holds, duplicate_pptx_slide / delete_pptx_slide / reorder_pptx_slide for the slides you need, edit_pptx_text, edit_pptx_table_cell, replace_pptx_image, add_pptx_chart. These tools add no new table, and a table's rows stay as many as the template has.
  • A lot (new slides, a new table, another structure): build pages on the template as above, each page starting from the template slide whose look it keeps (data-template-slide), with native tables and charts ("Charts and tables" below) and your own text. Put the template slide's useful content (its words, its table's rows) into the page yourself; read_pptx gives it.

Never tell the user something cannot be done on their template before checking both ways.

Layout

Canvas 1280 x 720. Keep text inside a 64 px margin. A title zone of about 100 px at the top, the content field below it, an optional footer line at the bottom.

Pick the structure from how the content relates, not from habit:

Content Structure
One claim or one number A single focus: the number large (72-120 px) with one line of context, lots of space
Two things compared Two matched halves with one difference marked, or a table
A few parallel points (3-4) Columns or a row of cards with the same treatment
Steps or a timeline A line with nodes, or chevrons, labels above or below
Evidence and its conclusion An uneven split: the chart or table large (60-70%), the takeaway beside it
A whole and its parts A centre with satellites, or a stacked bar

Vary the structure from page to page; a deck of identical card grids reads as a template. After a dense page, a lighter one.

Type and colour

  • Sizes: as the design spec fixes them (body never under 24 on a talk page, 18 on a read page). Bold for the title and for one or two load-bearing words or numbers per sentence, not for whole paragraphs.
  • Left-align body text. Break lines at phrase or punctuation boundaries; a line should not end with a single character.
  • Colour by proportion: the dominant colour on about 60% of the visual weight, the support on 30%, the accent on 10% (the key number, the one word that matters). Green for up and red for down only when the content has a direction.
  • Contrast: body text at least 4.5:1 against what is behind it; secondary grey text not lighter than about #6B7280 on white. White text needs a dark field under all of it.
  • Depth comes from spacing and tints, not shadows: at most two or three shadowed objects per page (feDropShadow, dy 4-8, opacity 0.06-0.10). Cards in a row stay flat.

Charts and tables

A chart or a table is a native PowerPoint chart or table, not drawn shapes: the user can change its data in PowerPoint, and its JSON is shorter than drawing it. The group holds the JSON only:

<g id="revenue-chart" data-pptx-replace-with="chart"><metadata type="application/json">
{"x": 64, "y": 160, "width": 560, "height": 480, "type": "column",
 "categories": ["华东", "华南", "华北"],
 "series": [{"name": "Q3 营收(万元)", "values": [5410, 3980, 2120],
             "point_colors": ["#C2410C", "#94A3B8", "#94A3B8"]}],
 "data_labels": {"number_format": "#,##0"}, "font_size": 18,
 "style": {"colors": ["#94A3B8"], "text_color": "#374151", "grid_color": "#E5E7EB"}}
</metadata></g>
  • type: column, bar (horizontal; categories top-down), line, area, pie, doughnut. Several series for a comparison, with "show_legend": true; point_colors on a column or bar series marks the bar the point is about.
  • Values are the material's numbers as plain numbers (5410, not "5,410"); number_format writes them: "#,##0", "0.0", and 0"%" for a share written as 41 (shows 41%). font_size is in px like the page.
  • Negative values: "axes": {"category": {"label_position": "low"}}, so the category names sit below the plot instead of on the bars.
  • The text above the chart says the finding with its figure ("位置便利占 41%,居首"), not the axis: the reader, and the checks, read the figure there.
  • The preview draws a chart or table from its data, as PowerPoint will; a labelled box in its place is still in the deck. Fix it in its JSON, never by drawing it again as shapes.
<g id="regions" data-pptx-replace-with="table"><metadata type="application/json">
{"x": 680, "y": 180, "width": 536, "height": 260, "schema": "ppt-master.semantic-table.v2",
 "columns": ["区域", "营收(万元)", "同比"],
 "rows": [["华东", {"text": "5,410", "align": "r"},
           {"text": "+12.2%", "align": "r", "color": "#15803D", "bold": true}],
          ["华北", {"text": "2,120", "align": "r"}, {"text": "-3.1%", "align": "r"}]],
 "style": {"font_size": 18, "header_fill": "#0F172A", "header_text": "#FFFFFF",
           "band_fill": "#F1F5F9", "border_color": "#E5E7EB"}}
</metadata></g>
  • A cell is a string, or {"text", "align": "r"} for a number, plus bold, color, fill to mark the cell the point is about. Every row is in rows, written as the material writes it.
  • A long table goes over two pages rather than below 16 px.

Icons

An icon is one line: <use data-icon="ship" x="100" y="200" width="48" height="48" stroke="#0E3A66"/> (an id names it for the edit tools). The build draws the icon at that box in the colour given, with the deck's other icons' line weight. The names are listed in read_skill_file("PPTX Pages", "icons.md"): trending-up, users, building-factory, ship, target, shield-check, calendar, coin, bolt, leaf, rocket and about 280 more; a wrong name is reported with the nearest ones. Use them where they carry meaning (a category, a step, a status), one size per role, never drawn from scratch.

Illustrations

A picture the deck needs (a cover scene, a section divider, a metaphor beside a point) is drawn on the page in SVG, and the build turns every part of it into a shape the user can recolour and move. Draw it flat, from the deck's palette: a few large shapes (path with curves, polygon, circle, ellipse, rect), layered back to front, in one <g id="...">, about 40 shapes at most. A silhouette reads better than detail: a ship is a hull, a deck and two funnels.

What carries over: linear and radial gradients, opacity and fill-opacity, stroke-dasharray, rotate, a drop shadow (a <filter> with feOffset and feGaussianBlur) and a glow (the blur alone). What does not: <mask> (an error: cut the shape out instead) and <pattern> (it turns solid: draw the repeated dots or lines as shapes).

One illustration on the cover and section pages at most, none on a page of numbers. Text keeps a plain area of its own: never on top of the drawing's busy part.

Photos

A photograph earns its place when the content is a real place, product, team or event; otherwise draw (above) or let the page's figures carry it. The user's own pictures come first: those in the material, in the workspace, or inside a deck they gave you (read_pptx lists them; save each into the pages folder with run_python_script: a python-pptx picture's image.blob, image.ext). Without them, and only when the deck's style is built on photographs, search_licensed_images (an English query, orientation "landscape") returns openly licensed images; download_image the chosen one into the pages folder. Never search_images for a deck: its results carry no licence. When the first message lists a design system's pictures (brand/...), copy_file its logo into the pages folder and place it with <image href="logo.svg" x y width height/> where its note says (a cover, a closing slide, a small mark in a corner), never redrawn, recoloured or stretched; the build warns when no page places it. Place a photo with <image href="store.jpg" x y width height preserveAspectRatio="xMidYMid slice"/> (cropped to fill its box), text over it only on a dark scrim, and for an "attribution-required" result its attribution_text as a 13-14 px credit line on the same page. One search per photo, at most three photos a deck unless the user asks for more.

Avoid

  • A text box that runs past its card or the page; long sentences on slides (split them).
  • Decoration with no job: stripes down every edge, gradients on body text, icons drawn from scratch instead of taken from the icon set.
  • Every page the same layout; every card with a shadow.
  • Light grey text on a light background; text over a picture without a dark scrim under it.
  • Facts, dates or numbers the material does not have.
ライセンス全文を見る(MIT)
MIT License

Copyright (c) 2026 OICWS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.