dream-num/univer-sdk-skills/univer-plugin-dev
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Develop custom plugins for Univer (spreadsheet/document/presentation engine). Use when writing a plugin, registering commands/mutations/operations, extending Facade API classes (FUniver, FWorkbook, FWorksheet, FRange), adding toolbar buttons or context menus, binding shortcuts, or listening to workbook/sheet/cell events. Triggers include 'write a plugin', 'custom command', 'extend FRange', 'toolbar button', 'shortcut', 'menu item', 'Facade extension', or any plugin development error.
Install
npx vskill@latest install dream-num/univer-sdk-skills/univer-plugin-devSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Univer Plugin Development
Guide for building custom plugins that extend Univer's functionality.
Compatibility: This skill is written for Univerv0.21.x. Core plugin patterns (lifecycle, DI, commands) remain stable, but specific service tokens and facade classes may shift. Prefer the user's existing codebase patterns when they differ from examples here.
Quick Start
Scaffold a new plugin
Use the bundled script to generate a minimal plugin skeleton:
This creates:
Register the plugin in your app
Core Concepts
Plugin Lifecycle
Plugins inherit from Plugin and override lifecycle hooks:
| Hook | When | What to do | |
|---|---|---|---|
onStarting() | Plugin mounted, no unit yet | Register commands, services, menus, shortcuts | |
onReady() | Business unit created | Access workbook/doc instance | |
onRendered() | UI rendered | DOM-dependent initialization | |
onSteady() | Everything stable | Background tasks |
Always use disposeWithMe() to register disposable resources so they auto-cleanup when the plugin is destroyed.
Command System
Three command types:
- COMMAND — Business entry point. Orchestrates mutations and operations. Supports undo/redo if you manually push to
IUndoRedoService. - MUTATION — Atomic data change. Persisted to snapshot. Automatically undoable.
- OPERATION — UI state change. Not persisted. Not undoable.
See references/command-system.md for full examples of each type and undo/redo construction.
Dependency Injection
Univer uses a custom DI container (Injector). Services are retrieved by:
Common service tokens:
ICommandService— register/execute commandsIMenuManagerService— add menus/toolbar itemsIShortcutService— register keyboard shortcutsIContextMenuService— context menusComponentManager— register React components/iconsIUniverInstanceService— get current workbook/doc/slideIUndoRedoService— push undo/redo entries
Facade Extension
Extend Facade classes to expose plugin capabilities to end users:
Common Tasks
For full examples (submenus, context menus, Range Popup, component replacement, complete toolbar+command+shortcut pipeline), see references/ui-customization.md.
Add a Toolbar Button
Register a Command
Extend Facade
References
- Plugin architecture:
references/plugin-architecture.md— lifecycle, DI, service registration, controller pattern - Command system:
references/command-system.md— COMMAND / MUTATION / OPERATION, undo/redo, mutation factories, custom mutations - Facade extension:
references/facade-extension.md— extend FUniver, FWorkbook, FWorksheet, FRange, multiple extensions merge strategy - UI customization:
references/ui-customization.md— menus, submenus, shortcuts, context menus, popups, component replacement - Event system:
references/event-system.md— events, hooks, custom events, RxJS streams
Also see univer-integrate skill for:
- Custom formula functions (
univer-integrateskill) - Permissions (
univer-integrateskill) - Network layer (
univer-integrateskill)
Scripts
- Scaffold:
scripts/scaffold-plugin.ts— generate a new plugin skeleton
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/univer-plugin-dev/SKILL.md
Popularity
- Repository stars
- 10
- Repository forks
- 4
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hookspluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dream-num/univer-sdk-skills/univer-plugin-dev)