slides
Make, read or edit a PowerPoint deck (.pptx) - a review, a pitch, a status deck, slides with tables and charts - with a TypeScript script run by `bise office run`. Use when the user asks for slides, a deck or a pptx, sends one, or leaves notes on a pptx artifact.
- License 许可
- Apache-2.0
- 所属仓库
- gvergnaud/bise
- 最近更新
- 2026-11-15
- Stars
- ★ 51
- Forks
- 9
01 前言 Front Matter
- name
- slides
- description
- Make, read or edit a PowerPoint deck (.pptx) - a review, a pitch, a status deck, slides with tables and charts - with a TypeScript script run by `bise office run`. Use when the user asks for slides, a deck or a pptx, sends one, or leaves notes on a pptx artifact.
02 资源文件 4
- 参考文档api.md6.8 KB
- 参考文档check.md2.7 KB
- 参考文档recipes.md5.3 KB
- 参考文档style.md2.8 KB
03 SKILL.md 正文
Slides (pptx)
You write a short TypeScript script against @bise/office and run it with
bise office run. The script reads and writes the deck; you never unzip
or hand-edit XML. Each write of a file that is an artifact is its next
version, and the user sees it in the side panel.
Quick start
bise office inspect q3.pptx # the outline as JSON: slides, shapes with ids, boxes, text
bise office check q3.pptx # the problems as JSON ([] when none)
bise office run "$TMPDIR/deck.ts"
// $TMPDIR/deck.ts: an ES module, top-level await, no other import
import { slides, run } from "@bise/office";
const deck = await slides.create(); // 16:9, 960 x 540 pt
const s = deck.addSlide({ layout: "title-body" });
s.placeholder("title")!.setText("Q3: revenue up 4%");
s.placeholder("body")!.setText(["North carried the quarter", "South flat", "West back to growth"]);
console.log(JSON.stringify(deck.check()));
console.log(await run.write("q3.pptx", await deck.save(), { artifact: true }));
{ artifact: true } on the first write of a new file, so it shows in the
panel; later writes to the same path are its next versions without it.
The script runs in a closed box: run.read and run.write reach your
worktree and $TMPDIR only (a file elsewhere: cp it into $TMPDIR
first), files up to 50 MB, 5 minutes, no network, no timers, no fs,
no process. console.log prints a line. Keep scripts in $TMPDIR, not
in the repo. An image goes in with run.read("chart.png").
The loop
- Inspect.
bise office inspect <file>, ordeck.inspect(). A slide iss<n>withprops.index,layout,w,h; a shape iss<n>/<id>withprops.box[x, y, w, h]in points, its text, its placeholder type, font size, fill. Read the deck's layouts (deck.layouts()), sizes and fonts before you add to it. - Edit by id.
deck.slide(n),slide.shape("3")or by name,slide.placeholder("title"), ordeck.at(anchor). On a shape:setText,replace,style,move,fill,line,setCell,replaceImage,remove. On a slide:addText,addShape,addImage,addTable,addChart,duplicate,moveTo,remove. - Save.
await run.write(path, await deck.save()), to the same path: that path is the artifact. Print whatrun.writereturns. - Check.
deck.check()before the write,bise office checkafter. - Fix each
errorandwarning: text that overflows its box, a shape off the slide, an empty placeholder, text under 10 pt, shapes whose text overlaps. Or say in your reply why one stays.
Done means: saved, checked, the problems fixed or named, and the deck
reads well (style.md).
Notes and selections from the user
He can point at a slide, a shape, or a box he drew on a slide. Two shapes reach you:
- a message
you sent N notes on "q3.pptx" (artifact <id> vN, ...)with an<artifact-notes artifact="<id>" version="N">[...]</artifact-notes>block: a JSON list of{id, anchor, text}; - an
<artifact-selection artifact="<id>" version="N">block inside his own message: the first line is an anchor's JSON, the lines after are what he saw selected.
Anchors here: {"kind": "shape", "slide": 2, "shape": "12", "quote": "up 4%"}
(a shape, quote the words he selected in it) or
{"kind": "slide", "slide": 5, "rect": {"x": 10, "y": 40, "w": 30, "h": 20}}
(a slide, rect in % of it when he drew a box). Pass it as it is:
deck.at(anchor) gives the shape or the slide; on a slide with a rect,
.under() lists the shapes in that box. Do each note, save once to the
artifact's path (sb artifact list shows it), then reply one or two lines
per note: what you changed, or why not. The new version marks the notes
done. at() throws not_found when the shape is gone: inspect, find it
by its text (the quote), and say so.
Errors
The SDK throws OfficeError with a code and words that say what to do:
not_found (it lists what is there), bad_arg (it shows the shape it
takes), anchor_kind_mismatch. A refused path names the folders you may
use.
Read next
api.md: every call, its arguments, the outline's fields.recipes.md: a deck from a brief, a chart slide, a table slide, edit his deck, answer notes, split a dense slide.style.md: how a deck should look and read.check.md: each problem code, what it means, how to fix it.
04 同仓库更多 Skills
greet
Greet someone the hello-plugin way. Use when asked for a hello-plugin greeting.
triage
triage Linear issues
jot
jot a note
bise-demo
Run bise's built-in demo, a short role-play where a small product team (a pm, a designer, a dev) starts, talks like colleagues, asks the user one question and one agent is dropped, with no file or git change. Use when the user asks to see what bise or you can do, for a demo, a tour or your features (show me what you can do, give me a demo, what can you do?, demo all your features), in any language.
bise-pages
暂无简介
sheets
Make, read or edit an Excel workbook (.xlsx) - a table of numbers, a budget, a tracker, a model with formulas - with a TypeScript script run by `bise office run`. Use when the user asks for a spreadsheet or an xlsx, sends one, or leaves notes on an xlsx artifact.