balise-affinity
Understand, audit, and reason about Affinity by Canva documents, workflows, object choices, text modes, UI overlays,…
Automate Affinity by Canva through the Affinity MCP and JavaScript SDK for manipulating open documents, selected objects, layers/nodes, geometry, text, fills, line styles, document commands, exports, and visual verification. Use when an agent needs to test or use the Affinity
$ npx -y skills add mrstev3n/balise-skills --skill balise-affinity-mcp --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/balise-affinity-mcpContext preview
The summary Claude sees to decide when to auto-load this skill.
Automate Affinity by Canva through the Affinity MCP and JavaScript SDK for manipulating open documents, selected objects, layers/nodes, geometry, text, fills, line styles, document commands, exports, and visual verification. Use when an agent needs to test or use the Affinity
name: balise-affinity-mcp description: Automate Affinity by Canva through the Affinity MCP and JavaScript SDK for manipulating open documents, selected objects, layers/nodes, geometry, text, fills, line styles, document commands, exports, and visual verification. Use when an agent needs to test or use the Affinity MCP, edit the current Affinity file, inspect or modify objects or selections, create or adjust Affinity elements, automate Affinity features, or capture reusable Affinity SDK lessons.
Use the Affinity MCP as a live application-control surface. Work from the open document, inspect before editing, prefer small reversible commands, and verify visual results.
1. Load Affinity tools if they are not already present. 2. Read SDK documentation in this order:
3. Inspect the current document before making changes. 4. Choose the narrowest edit: selected object first, current spread next, whole document only when requested. 5. Execute scripts with the Affinity MCP `execute_script` capability; a harness may expose a qualified tool name. Use `console.log(JSON.stringify(...))` for observable output. 6. Verify with `render_selection(document_session_uuid)` whenever the result is visual. 7. Do not save, export, flatten, delete broad selections, or resize the spread unless the user asked for that kind of change.
Use this baseline probe before editing:
const {Document} = require('/document');
const doc = Document.current;
if (!doc) {
console.log(JSON.stringify({ok: false, reason: 'NO_CURRENT_DOCUMENT'}));
} else {
console.log(JSON.stringify({
ok: true,
title: doc.title,
path: doc.path,
sessionUuid: doc.sessionUuid,
isReadOnly: doc.isReadOnly,
isDirty: doc.isDirty,
needsSaving: doc.needsSaving,
pageCount: doc.pageCount,
spreadCount: doc.spreadCount,
selectedCount: doc.selection.nodes.length,
currentSpreadBox: doc.currentSpread.baseBox
}, null, 2));
}Stop cleanly if `Document.current` is null or `doc.isReadOnly` is true.
Use node operations for visible document objects:
Use descriptions and final selection intentionally so the user can inspect or undo the right thing.
For basic shapes:
For exact freeform shapes:
For appearance:
Read `references/affinity-js-patterns.md` for tested snippets. Read `references/affinity-concepts-and-nuances.md` when the task requires choosing between Affinity object types, text modes, non-destructive techniques, or verification methods.
Do not assume text node defaults exist. In current SDK usage, these fail:
Use `StoryBuilder` plus `FrameTextNodeDefinition.createFromStoryBuilder(frameBox, storyBuilder)` or `ArtTextNodeDefinition.createFromStoryBuilder(point, storyBuilder)`:
For existing selected text, read `commands.js` and `storydelta.js` before applying formatting commands such as `doc.formatText(...)`.
Choose the text object type intentionally:
Des skills portables pour Claude Code, Codex, Cursor, le Figma Agent, Figma Make et les autres outils compatibles avec le standard Agent Skills. Installez un skill précis ou une collection prête à l’emploi. Chaque skill utilise SKILL.md comme format canonique.
Understand, audit, and reason about Affinity by Canva documents, workflows, object choices, text modes, UI overlays,…
Structurer une idée de marque encore floue et produire une exploration argumentée du nom et du territoire de marque. Utiliser…
Stress-tests UI content resilience across design files, screenshots, prototypes, source code, and rendered interfaces. Use when…
Architecturer, auditer, construire, intégrer et faire évoluer un design system robuste de Figma au code. Utiliser pour cadrer un…
Audits and prepares designs, specifications, prototypes, design-system artifacts, and implemented interfaces for developer…
Discover opportunities and move ideas toward evidence-based action from domains, raw corpus, problems, ideas, or ongoing…