Tooluck logoTooluck
SKILL.md

comfyui-frontend-extensions

Agent skill fromartokun/comfyui-mcp

Authoring ComfyUI v2 frontend extensions with @comfyorg/extension-api, covering defineNode/defineExtension/defineWidget, shell UI (sidebar tabs, commands, hotkeys), typed events, and handles. Use when writing or editing ComfyUI web-UI extension code (custom node JS, sidebar panels, widgets).

How to install comfyui-frontend-extensions

install comfyui-frontend-extensions
# install the comfyui-mcp pack with the skills CLI
npx skills add artokun/comfyui-mcp

# or add only this skill to Claude Code: copy the folder

plugin/skills/comfyui-frontend-extensions/

# into

~/.claude/skills/comfyui-frontend-extensions/ (all projects)

.claude/skills/comfyui-frontend-extensions/ (one project)

plugin/skills/comfyui-frontend-extensions/SKILL.md

MITFull file
1# ComfyUI v2 Frontend Extension API
2
3The v2 extension API is the published npm package `@comfyorg/extension-api`. It
4replaces the legacy `app.registerExtension()` / `nodeType.prototype` monkey-patching
5model with a typed, tree-shakeable, import-based API.
6
7> If you are converting an existing v1 extension, read
8> [`references/migrate-v1-to-v2.md`](references/migrate-v1-to-v2.md) for a
9> pattern-by-pattern mapping.
10
11## Mental model
12
13| v1 (legacy) | v2 (`@comfyorg/extension-api`) |
14|-------------|-------------------------------|
15| One giant `app.registerExtension({...})` call | One `defineX` per concern, each independently disposable |
16| `window.app` / `app.*` globals | Direct `import` from the package; no `window.app` at module-eval time |
17| `nodeType.prototype.onExecuted = ...` patching | `node.on('executed', fn)` on a `NodeHandle` |
18| Mutate `widget.value`, assign `widget.callback` | `widget.setValue(v)` / `widget.on('valueChange', fn)` |
19| `api.addEventListener('execution_start', fn)` | `execution.on('start', fn)` (typed namespaces) |
20| Manual `removeEventListener` bookkeeping | Every subscription returns `Unsubscribe`; every `defineX` returns `DisposableHandle` |
21
22Core principles baked into the API:
23
24- **Import, don't reach for globals.** `import { defineNode } from '@comfyorg/extension-api'`. No `window.app` dependency at module evaluation time.
25…

Excerpt shown under the repository's MIT license.

More skills in comfyui-mcp

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates