Skip to main content
prompt GP ChatGPT

insert — Claude Code prompt: what it does, how to install

Prompt detailing slide insertion commands for genoffice. It specifies parameters for placing shapes, text containers, and smart connectors on slides.

Apache-2.0 ★ 12,746 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/insert.md
Open on GitHub

What insert does

This prompt defines operations for placing slide elements with exact coordinates. Each command expects a slide target and a bounding frame defined in EMU units. Pixels will not work directly. Once an element is placed, its identifier appears in created. Later actions in that same transaction cannot target this identifier yet, so styles must be applied immediately or during a subsequent call.

Using addElement puts preset geometries, text containers, or basic lines onto an existing slide. Text paragraphs accept styling like font size in points and hexadecimal colors. For linking diagrams, addConnector attaches connector lines between two top-level shapes so they remain glued during moves. As the instructions note, assembling an entire presentation element by element from scratch is an error; empty decks should use generate_deck instead.

What it helps with

  • place styled text boxes or geometric shapes using EMU coordinates
  • connect slide shapes with glued connectors that stay attached on move
  • configure solid fills, strokes, and autofit settings for presentation cards
  • add directional arrows between top-level slide components

Example prompts for the agent

  • Insert a roundRect shape with #E8F0FE fill on slide 1 using insert
  • Connect e_SHAPE to e_PICTURE with an elbow connector via addConnector
  • /insert: add a Key Takeaways text box with fontSize 32 on slide 1

How to install insert

Manually: put the files in place

.claude/commands/insert.md

Questions about insert

How to install insert in Claude Code?

Save the prompt markdown file to .claude/commands/insert.md in your project root.

What does the insert prompt do?

It provides instructions and schemas for running addElement and addConnector operations to insert shapes, text boxes, and lines into slides.

Can addConnector bind to nested elements inside a group?

No, addConnector only supports top-level element identifiers. To connect a grouped item, target the parent group identifier instead.

Source text

insert.md · Apache-2.0
# Insert ops

> Create new elements on a slide: text boxes, preset shapes and lines (addElement), connectors glued to shapes, tables, native charts, SmartArt-style diagrams.

Insert ops take `target:{slide}` (no `el`) and an `offset:{x,y,cx,cy}` frame
in document-space EMU. They report the new element id in `created`; later ops
in the same transaction cannot reference it yet, so insert first and style in
the next call, or pass the style inline where the op supports it.

### addElement

`{kind:"textbox"|<preset geometry>,offset:{x,y,cx,cy},paragraphs?,fill?,stroke?,adjustments?:{<gd name>:val},bodyPr?:{autoFit?:"shrink"|"resize"}}`

Adds a text box, a preset-geometry shape, or a line/connector.

| Field       | Type                                                                                           | Notes                                                                                                                                                                                                                                              |
| ----------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| kind        | string                                                                                         | `"textbox"`; a preset geometry (`rect`, `roundRect`, `ellipse`, `triangle`, `diamond`, `rightArrow`, `chevron`, `star5`, `hexagon`, `wedgeRoundRectCallout`, ...); or a line kind `line`, `lineArrow`, `lineArrowDouble`, `lineBent`, `lineCurved` |
| offset      | `{x, y, cx, cy}` EMU                                                                           | Required                                                                                                                                                                                                                                           |
| paragraphs  | array of `{runs:[{text, bold?, italic?, underline?, fontSize?, fontFamily?, color?}], align?}` | Optional text; `fontSize` in pt                                                                                                                                                                                                                    |
| fill        | `"#RRGGBB"` or `"#RRGGBBAA"`                                                                   | Solid fill; text boxes have none by default                                                                                                                                                                                                        |
| stroke      | `{color, widthEmu}`                                                                            | Outline; lines default to a 1 pt black stroke                                                                                                                                                                                                      |
| adjustments | `{<gdName>: number}`                                                                           | Preset adjust values, e.g. `{"adj": 25000}` for a roundRect radius                                                                                                                                                                                 |
| bodyPr      | `{autoFit?, wrap?, anchor?, insetsEmu?}`                                                       | `autoFit` `"shrink"` or `"resize"`; `wrap` `"square"`/`"none"`; `anchor` `"t"`/`"ctr"`/`"b"`                                                                                                                                                       |

```json
{
  "op": "addElement",
  "target": { "slide": 1 },
  "kind": "textbox",
  "offset": { "x": 914400, "y": 685800, "cx": 7315200, "cy": 914400 },
  "paragraphs": [
    { "runs": [{ "text": "Key Takeaways", "bold": true, "fontSize": 32 }], "align": "left" }
  ],
  "bodyPr": { "autoFit": "shrink" }
}
```

```json
{
  "op": "addElement",
  "target": { "slide": 1 },
  "kind": "roundRect",
  "offset": { "x": 914400, "y": 2286000, "cx": 3200400, "cy": 1600200 },
  "fill": "#E8F0FE",
  "stroke": { "color": "#1A73E8", "widthEmu": 12700 },
  "adjustments": { "adj": 16667 },
  "paragraphs": [
    { "runs": [{ "text": "Card title", "bold": true, "color": "#1A73E8" }], "align": "center" }
  ]
}
```

```json
{
  "op": "addElement",
  "target": { "slide": 1 },
  "kind": "lineArrow",
  "offset": { "x": 4572000, "y": 3048000, "cx": 1828800, "cy": 0 }
}
```

Common mistakes

- Building whole pages element by element on an empty deck: use `generate_deck`; `addElement` is for adding to an already designed page.
- Pixel frames: convert with the px-to-EMU factor from `read_slide`.
- `autoFit` values other than `"shrink"`/`"resize"`.

### addConnector

`{from,to,kind?:"straight"|"elbow"|"curved",fromSide?,toSide?,arrow?:"none"|"end"|"both",line?:{color?,widthPt?,dash?}}`

Draws a connector glued to two shapes (`a:stCxn`/`a:endCxn`), so PowerPoint
and later `setTransform` moves keep it attached. When `fromSide`/`toSide`
(`top`/`left`/`bottom`/`right`) are omitted, the pair of edge midpoints that
are closest to each other is chosen. The frame is derived from the two
connection points; the new element id is in `created`.

| Field            | Type                                    | Notes                                                                        |
| ---------------- | --------------------------------------- | ---------------------------------------------------------------------------- |
| from, to         | element ids                             | Two different top-level elements on `target.slide`                           |
| kind             | `straight` (default), `elbow`, `curved` |                                                                              |
| fromSide, toSide | side name                               | Pin one or both ends; omitted sides are chosen automatically                 |
| arrow            | `none`, `end` (default), `both`         | Arrowhead at the `to` end, both ends, or none                                |
| line             | `{color?, widthPt?, dash?}`             | Defaults 1 pt black solid; `dash` is an OOXML preset (`dash`, `sysDot`, ...) |

```json
{
  "op": "addConnector",
  "target": { "slide": 0 },
  "from": "e_SHAPE",
  "to": "e_PICTURE",
  "kind": "elbow",
  "line": { "color": "#1A73E8", "widthPt": 1.5 }
}
```

Common mistakes

- Drawing a free line with `addElement` and hoping it follows the shapes: only `addConnector` (or `setConnectorEndpoints` with `start`/`end`) attaches.
- Using it between a group child and a shape: connect to the group (top-level ids only).

### addPicture (not-ai-callable)

`{bytes:base64|dataURL,ext?,offset} — use insert_web_image instead`

Embeds image bytes as a new picture. The model inserts images through
`insert_web_image` (URL) so the main process downloads and center-crops them.

### replacePicture (not-ai-callable)

`{bytes:base64|dataURL,ext?} — use replace_image instead`

Swaps a picture's bytes in place. The model uses `replace_image` with a URL.

### addTable

`{rows,cols,offset:{x,y,cx,cy},colWidthsEmu?,rowHeightsEmu?,cellProps?:[[{gridSpan?,rowSpan?,hMerge?,vMerge?,anchor?}]]}`

Inserts a native table with PowerPoint's default style and empty cells. Fill
cells afterwards with `setTableCell` (one op per cell, same transaction is
fine once you know the table id from the first result).

| Field         | Type                                                                | Notes                                                                    |
| ------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| rows, cols    | integer >= 1                                                        |                                                                          |
| offset        | `{x, y, cx, cy}` EMU                                                | Columns and rows split the frame equally unless widths/heights are given |
| colWidthsEmu  | number[]                                                            | Exactly `cols` positive values                                           |
| rowHeightsEmu | number[]                                                            | Exactly `rows` positive values                                           |
| cellProps     | array of rows of `{gridSpan?, rowSpan?, hMerge?, vMerge?, anchor?}` | Row-major; `anchor` `"t"`/`"ctr"`/`"b"`; use for pre-merged headers      |

```json
{
  "op": "addTable",
  "target": { "slide": 1 },
  "rows": 3,
  "cols": 3,
  "offset": { "x": 914400, "y": 1371600, "cx": 7315200, "cy": 2286000 }
}
```

```json
{
  "op": "addTable",
  "target": { "slide": 1 },
  "rows": 2,
  "cols": 2,
  "offset": { "x": 914400, "y": 1371600, "cx": 5486400, "cy": 1371600 },
  "colWidthsEmu": [1828800, 3657600],
  "cellProps": [
    [{ "gridSpan": 2 }, { "hMerge": true }],
    [{}, {}]
  ]
}
```

Common mistakes

- `colWidthsEmu` with the wrong count: it must list exactly one width per column.
- Passing cell text here: the op creates empty cells; write text with `setTableCell`.

### addChart

`{kind:"bar"|"barStacked"|"line"|"area"|"pie"|"doughnut"|"scatter"|"radar"|"comboBarLine",categories:[…],series:[{name,values:[…]}],offset,title?,colorScheme?:["#RRGGBB"],holeSizePct?}`

Inserts a native, PowerPoint-editable chart.

| Field       | Type                                              | Notes                                                                                                                                                                                                     |
| ----------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| kind        | see signature                                     | `comboBarLine` draws the last series as a line on a secondary axis                                                                                                                                        |
| categories  | string[]                                          | At least one; the x-axis labels                                                                                                                                                                           |
| series      | array of `{name, values:number[]}`                | At least one; each `values` length should equal `categories` length                                                                                                                                       |
| offset      | `{x, y, cx, cy}` EMU                              |                                                                                                                                                                                                           |
| title       | string                                            | Optional chart title                                                                                                                                                                                      |
| colorScheme | `"#RRGGBB"[]`                                     | Optional series colors, cycled; omit to follow the theme                                                                                                                                                  |
| holeSizePct | number                                            | Doughnut hole size (10..90)                                                                                                                                                                               |
| barDir      | `"bar"`                                           | Optional: horizontal bars instead of columns                                                                                                                                                              |
| dataSource  | `"user"` / `"document"` / `"search"` / `"sample"` | Where the numbers came from; checked by apply_ops before the batch runs (not part of the op itself). `"search"` needs a web_search in this conversation; `"sample"` figures must be disclosed to the user |

```json
{
  "op": "addChart",
  "target": { "slide": 1 },
  "kind": "bar",
  "title": "Revenue by quarter",
  "categories": ["Q1", "Q2", "Q3", "Q4"],
  "series": [{ "name": "Revenue", "values": [120, 135, 150, 170] }],
  "offset": { "x": 914400, "y": 1371600, "cx": 7315200, "cy": 3657600 },
  "dataSource": "user"
}
```

```json
{
  "op": "addChart",
  "target": { "slide": 1 },
  "kind": "doughnut",
  "holeSizePct": 55,
  "categories": ["Direct", "Partner", "Online"],
  "series": [{ "name": "Share", "values": [45, 30, 25] }],
  "offset": { "x": 2743200, "y": 1371600, "cx": 3657600, "cy": 3657600 },
  "colorScheme": ["#1A73E8", "#34A853", "#FBBC04"]
}
```

Common mistakes

- Inventing numbers: every value needs a source (user, deck, or a search in this conversation); with none, use illustrative values and say so to the user.
- `values` shorter or longer than `categories`.
- Editing an existing chart with `addChart`: use the `edit_chart` tool, which keeps position and z-order.

### addSmartArt

`{layout,items:[…],offset}`

Inserts a SmartArt-style diagram built from grouped shapes.

| Field  | Type                                                                                     | Notes                     |
| ------ | ---------------------------------------------------------------------------------------- | ------------------------- |
| layout | `"list"` / `"process"` / `"cycle"` / `"hierarchy"` / `"pyramid"` / `"matrix"` / `"venn"` |                           |
| items  | string[]                                                                                 | 1..8 node texts, in order |
| offset | `{x, y, cx, cy}` EMU                                                                     |                           |

```json
{
  "op": "addSmartArt",
  "target": { "slide": 1 },
  "layout": "process",
  "items": ["Discover", "Design", "Deliver"],
  "offset": { "x": 914400, "y": 1828800, "cx": 7315200, "cy": 1828800 }
}
```

### addMedia (not-ai-callable)

`{kind:"video"|"audio",bytes:base64|dataURL,ext,offset}`

Embeds a video or audio file; bytes payload from the UI file picker.

### addNarration (not-ai-callable)

`{bytes:base64|dataURL,ext,durationMs}`

Replaces the slide's recorded narration (Slide Show > Record): a hidden audio picture that plays from the slide start. Also turns on the deck's showNarration.

### clearNarration (not-ai-callable)

`{}`

Removes the slide's recorded narration.

### addModel3d (not-ai-callable)

`{bytes,ext,offset} — bytes payload`

Embeds a glTF binary (.glb) 3D model; bytes payload from the UI file picker.

### setModel3dView (not-ai-callable)

`{ax,ay,az,poster?,posterExt?} — rendering payload`

Turns a 3D model (angles in 60,000ths of a degree) and stores the rendering the editor drew.

### pasteElements (not-ai-callable)

`{items,dx,dy} — clipboard payload`

Pastes copied elements; the payload comes from the internal clipboard.

© genspark-ai · Apache-2.0 · genspark-ai/genoffice

Similar prompts

All prompts for Office documents →

From the same set65

The whole set →
table table is a Claude Code prompt for editing existing slide tables, from cell text and merges to sizing and styles. Invoke it to change a table in a presentation. GP ChatGPT ★ 12,746repo stars writing writing tells the agent how to edit a spreadsheet: formulas instead of hand-computed numbers, bulk range ops instead of cell-by-cell writes. GP ChatGPT ★ 12,746repo stars text Defines instructions for updating and styling slide text using setText and setFont operations. Useful when automating presentation edits in Claude Code. GP ChatGPT ★ 12,746repo stars base The base prompt guides Claude Code through reading and editing workbooks in an Excel-compatible desktop app. Use it to inspect data, make changes, or create documents from workbook content. GP ChatGPT ★ 12,746repo stars slide slide is a prompt for Claude Code and ChatGPT that handles page-level presentation edits: deleting, duplicating, inserting by layout, moving, and changing backgrounds. GP ChatGPT ★ 12,746repo stars system The system prompt guides the GenOffice Slides assistant through deck creation and slide edits. Use it when you want the assistant to choose a workflow based on the change you request. GP ChatGPT ★ 12,746repo stars element The element prompt gives the agent operations for changing presentation elements: fill, stroke, move, rotate, group, delete. GP ChatGPT ★ 12,746repo stars genoffice A Claude Code skill for creating and editing Office files locally via the GenOffice CLI. Generates slide decks or formula spreadsheets from raw inputs and converts file formats. CX Codex +1 ★ 12,746repo stars

Project sponsors

Companies that keep this analytics open