Figjam plugin
Skill ComeOnOliver/skillshub/skills/aiskillstore/marketplace/7nohe/figjam-plugin
FigJam plugin development workflow. Use when working on plugin code (code.ts, ui.ts), debugging WebSocket communication, or building the plugin.From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill figjam-pluginAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.7 KB, 376 tokens by cl100k_base, as published. Nobody here has run it
FigJam Plugin Development
Architecture
Two-thread model:
-
packages/plugin/src/code.ts- Main thread (Figma API, renderer)- NO browser APIs (window, document, fetch)
- Access to figma.* API
- Renders nodes/edges to FigJam canvas
-
packages/plugin/src/ui.ts- UI iframe (WebSocket client)- Browser APIs available
- Manages WebSocket connection to CLI
- Handles connection UI
Communication Flow
CLI (serve) ←→ WebSocket ←→ Plugin UI (ui.ts) ←→ postMessage ←→ Plugin Main (code.ts)
JSON Import (UI)
- Accepts DSL JSON (nodes as array) or IR JSON (nodes as object)
- Validates with
@figram/coreand normalizes to IR before posting to main thread - Validation errors are surfaced in the UI alert with path/message details
Build
cd packages/plugin && bun run build
Output: packages/plugin/dist/ (code.js, ui.html)
Import Plugin
- Open Figma Desktop
- Menu → Plugins → Development → Import plugin from manifest
- Select
packages/plugin/manifest.json
Debugging
- UI errors: Browser DevTools console (right-click plugin UI → Inspect)
- Main thread errors: Figma DevTools (Menu → Plugins → Development → Open console)
- WebSocket issues: Check UI console for connection status
Key Files
manifest.json- Plugin configurationsrc/code.ts- Canvas rendering logicsrc/ui.ts- WebSocket client and connection UIsrc/ui.html- UI template (bundled by build)src/icons/- AWS service icons
What ships with it
9.8 KB alongside SKILL.md
GitHub clipped this repository’s file list, so this is at least 1 file and may be more.
- skill-report.json9.8 KB