Skip to content
Back to skills

Api Sketches

ASecurity

Call nodetool.sketches from a code action: create a sketch (layered image document), read it, add, arrange and restyle layers, place images on layers, resize the canvas, validate it, and manage its versions. Load before the first call into nodetool.sketches.

  • 552 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 29, 2026
content-marketinggonodeawsapi

Works with

  • api

Security analysis

A100/100

Scanned September 29, 2026

npx -y skills add nodetool-ai/nodetool --skill api-sketches --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Sketches?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Sketches
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nodetool-ai-api-sketches/badge)](https://www.skillsdirectory.com/skills/nodetool-ai-api-sketches)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-sketches
description: "Call nodetool.sketches from a code action: create a sketch (layered image document), read it, add, arrange and restyle layers, place images on layers, resize the canvas, validate it, and manage its versions. Load before the first call into nodetool.sketches."
---

# nodetool.sketches

A sketch is an image document: a canvas, a stack of layers, and the bindings
that say where the picture of a layer comes from. How to compose one is
`nodetool-sketch`. This is the call reference. One finished image with no
layers to keep is `nodetool.media.generateImage`, not a sketch.

| Call | Does | Answers |
| :--- | :--- | :--- |
| `list({query, limit})` | Lists sketches, newest first. | Rows with id, name and canvas size |
| `create(name, {width, height, background_color, project_id, id})` | Creates a blank canvas. The defaults are 1024×1024 on `#ffffff`. An existing `id` you own is returned instead of a copy. | `{image_document_id, …}` |
| `get(id)` | Reads the document: canvas, background, layers, bindings. Layer bitmaps stay opaque. | The document |
| `edit(id, ops)` | Applies layer ops in order and saves. An open editor picks the change up live. | The result of each op |
| `validate(idOrDocument)` | Checks the structure without a render. | `{ok, issues}` |
| `versions(id, {save_type, limit})`, `getVersion(id, n)` | Lists and reads whole-document snapshots. | Version rows, newest first |
| `snapshot(id, {name})` | Saves a manual version. | The version number |
| `restore(id, n)` | Rolls back. The state it replaces is snapshotted first. | The findings of the validation after the restore |
| `deleteVersion(id, n)` | Deletes one snapshot. This cannot be undone. | — |

## Ops

`target` is a layer id, its name, or `"active"`. Layer index 0 is the
**bottom** layer.

| Op | Arguments |
| :--- | :--- |
| `add_layer` | `name?`, `type?` (`"raster"` or `"mask"`), `index?`, `image?`, `x?`, `y?`, `width?`, `height?` |
| `remove_layer` | `target` |
| `rename_layer` | `target`, `name` |
| `set_layer_props` | `target`, `visible?`, `locked?`, `opacity?`, `blendMode?` |
| `set_layer_image` | `target`, `image`, `x?`, `y?`, `width?`, `height?` |
| `reorder_layer` | `target`, `index` |
| `duplicate_layer` | `target` |
| `select_layer` | `target` |
| `resize_canvas` | `width`, `height` |
| `set_setup` | `brief?`, `use_case?`, `variations?`, `stage?` — the state of the guided image flow. It renders nothing. |

- `image` is an asset id, an `asset://` locator, a `data:` URL or an http(s)
  URL. The layer points at it and the editor draws it at its natural size from
  the top-left of `{x, y, width, height}`, which defaults to the whole canvas.
  Pass the dimensions of the image when you know them.
- `use_case` is `product`, `portrait`, `key-art`, `social`, `logo`, `concept`
  or `texture`, and it also sets the canvas size.
- Pixels are never read or written here. Painting and generation happen in an
  open editor or a workflow run.

```js
const { image_document_id: id } = await nodetool.sketches.create("Poster",
  { width: 1080, height: 1350 });
await nodetool.sketches.edit(id, [
  { op: "add_layer", name: "Backdrop", image: bgUri },
  { op: "add_layer", name: "Product", image: productUri, x: 240, y: 300, width: 600, height: 600 },
  { op: "set_layer_props", target: "Product", blendMode: "normal", opacity: 1 }
]);
const check = await nodetool.sketches.validate(id);
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…