add-editor-action
Installation
SKILL.md
Add an editor action
- Implement the operation as a pure function on the document in
packages/rive/src/ops.ts(structural) orpackages/rive/src/api.ts(user-facing, name-addressable). Keep it DOM-free. - Register the action in
apps/web/apps/web/src/components/editor/actions.tsinside theACTIONSarray, near related ones:{ id: 'object.myThing', label: 'My thing', category: 'Object', keys: ['Alt+M'], edits: true, enabled: hasSelection, run: () => st().commit((doc) => myThing(doc, st().selection)) },category: one of File, Edit, Object, Arrange, Tools, View, Animatewhen: 'animate'or'design'if it only applies in one mode- Pick keys that don't clash: search
keys: [in the file. Users can rebind anything.
- Add it to menus in
apps/web/apps/web/src/components/editor/menus.tswithact('object.myThing')where it belongs (object, canvas or layer menus). - Check with
bun run check-types. Then, in the browser: run it via the shortcut, the context menu and the shortcuts dialog (?), undo it, and make sure it's disabled for Viewers. - Document the shortcut in
docs/shortcuts.md, and indocs/user-guide.mdif it's a notable feature. - If this work exposes a reproducible OpenRive defect outside the action being added, follow
openrive-report-issueautomatically. Fix failures caused by the current change as part of the task instead of filing them as upstream bugs.