zellij-plugin-dev
Develop Zellij plugins with Rust/WASM, API reference, event system, UI rendering, plugin lifecycle, and real-world examples from diverse open source plugins
What this skill does
# Zellij Plugin Development Skill
Comprehensive assistance for developing Zellij terminal multiplexer plugins using Rust and WebAssembly.
## When to Use This Skill
Trigger this skill when:
- Developing Zellij plugins in Rust/WASM
- Implementing plugin UI, rendering, or event handling
- Working with the Zellij plugin API
- Integrating external systems (Docker, Git, etc.)
- Building status bars, navigation tools, or workflow automation
- Debugging plugin issues or understanding plugin lifecycle
- Learning plugin development patterns and best practices
## Quick Reference
### Core Plugin Structure
```rust
use zellij_tile::prelude::*;
#[derive(Default)]
struct State {
// Your plugin state
}
impl ZellijPlugin for State {
fn load(&mut self, configuration: BTreeMap<String, String>) {
request_permission(&[PermissionType::ReadApplicationState]);
subscribe(&[EventType::Key, EventType::PaneUpdate]);
}
fn update(&mut self, event: Event) -> bool {
// Handle events, return true to re-render
false
}
fn render(&mut self, rows: usize, cols: usize) {
// Render UI
}
}
```
### Building
```bash
# Add WASM target
rustup target add wasm32-wasi
# Build
cargo build --release
# Location: target/wasm32-wasi/release/<PLUGIN_NAME>.wasm
```
### Loading Plugins
```bash
# Temporary load
zellij plugin -- file://<PATH_TO_FILE>
# Floating
zellij plugin --floating -- file://<PATH>
# With configuration
zellij plugin -- file://<PATH> --configuration key=value
```
## Reference Files
### Official Documentation
- **plugin-development-tutorial.md** - Complete tutorial from scaffolding to distribution
- **plugin-api-commands.md** - All 100+ plugin API commands organized by category
- **plugin-api-events.md** - Event system, subscription patterns, and event handling
### Real-World Plugin Examples
- **plugin-examples-ui-navigation.md** - Monocle (fuzzy finder) and Room (tab switcher)
- **plugin-examples-status-theming.md** - zjstatus (configurable status bar)
- **plugin-examples-external-integration.md** - zj-docker (Docker integration)
## Development Workflow
### 1. Project Setup
Use the official scaffolding tool:
```bash
zellij plugin -f -- https://github.com/zellij-org/create-rust-plugin/releases/latest/download/create-rust-plugin.wasm
```
This launches `develop-rust-plugin` for real-time iteration (Ctrl+Shift+R to rebuild).
### 2. Core Implementation
**Load Phase:**
- Request permissions
- Subscribe to events
- Initialize state
**Update Phase:**
- Handle events
- Update state
- Return true to trigger re-render
**Render Phase:**
- Draw UI based on state
- Use color indices (0-3) for theme compatibility
### 3. Testing & Distribution
**Local Testing:**
```bash
zellij plugin -- file:./target/wasm32-wasi/release/plugin.wasm
```
**Release:**
```bash
cargo build --release
# Share via awesome-zellij repository
```
## Common Patterns
### Modal UI (Floating Windows)
```kdl
bind "Ctrl t" {
LaunchOrFocusPlugin "file:path/to/plugin.wasm" {
floating true
}
}
```
### Command Execution with Context
```rust
let context = BTreeMap::from([
("operation".to_string(), "git_status".to_string())
]);
run_command(vec!["git", "status"], context);
// Handle result
Event::RunCommandResult(exit_code, stdout, stderr, context) => {
if context.get("operation") == Some(&"git_status".to_string()) {
self.process_result(stdout);
}
}
```
### Configuration-Driven Widgets
```kdl
plugin location="path/to/plugin.wasm" {
format_left "{widget1} {widget2}"
format_right "{widget3}"
widget1_param1 "value"
widget1_param2 "value"
}
```
### State Synchronization
```rust
fn load(&mut self, _config: BTreeMap<String, String>) {
subscribe(&[EventType::PaneUpdate]);
}
fn update(&mut self, event: Event) -> bool {
match event {
Event::PaneUpdate(panes) => {
self.sync_pane_state(panes);
true
}
_ => false
}
}
```
## Permission Categories
**Read-Only:**
- `ReadApplicationState` - Access mode, tabs, panes, sessions
**Write Operations:**
- `ChangeApplicationState` - Modify panes, tabs, navigation
- `OpenFiles` - Open files in $EDITOR
- `OpenTerminalsOrPlugins` - Create terminal/plugin panes
- `WriteToStdin` - Write to pane stdin
**Advanced:**
- `RunCommands` - Execute background commands
- `Reconfigure` - Modify configuration
- `WebAccess` - HTTP requests
- `FullHdAccess` - Host filesystem access
## Plugin Categories & Examples
### UI & Navigation
- **monocle** - Fuzzy file finder with gitignore support
- **room** - Tab search and switcher
- **harpoon** - Quick pane navigation
### Status & Display
- **zjstatus** - Configurable status bar with theming
- **zellij-datetime** - Date/time display
- **zjframes** - Pane frame management
### Development Tools
- **multitask** - Mini-CI system
- **grab** - Rust code fuzzy finder
- **zellij-bookmarks** - Command bookmarks
### External Integration
- **zj-docker** - Docker container management
- **zj-git-branch** - Git branch operations
### Session Management
- **zellij-sessionizer** - Folder-based sessions
- **zsm** - Session switcher with zoxide
## Resources
### Documentation
- **Official Docs:** https://zellij.dev/documentation/plugins
- **Rust API:** https://docs.rs/zellij-tile/latest/zellij_tile/
- **Tutorial:** https://zellij.dev/tutorials/developing-a-rust-plugin/
### Community
- **awesome-zellij:** https://github.com/zellij-org/awesome-zellij
- **Discord:** Zellij community for developer support
- **GitHub Topic:** https://github.com/topics/zellij-plugin
### Tools
- **create-rust-plugin:** Scaffolding tool (plugin)
- **develop-rust-plugin:** Live development helper (plugin)
- **rust-plugin-example:** Official example repository
## Working with This Skill
### For Beginners
Start with `plugin-development-tutorial.md` for foundational concepts and step-by-step guidance.
### For Specific Features
- UI/Navigation: See `plugin-examples-ui-navigation.md`
- Status Bars/Theming: See `plugin-examples-status-theming.md`
- External Integration: See `plugin-examples-external-integration.md`
- API Commands: See `plugin-api-commands.md`
- Events: See `plugin-api-events.md`
### For Code Examples
Each example file contains real-world patterns extracted from production plugins.
## Advanced Topics
### Widget Systems
Build configurable, composable UI components (see zjstatus example).
### External Process Management
Spawn and manage long-running processes (see zj-docker example).
### Multi-Agent Patterns
Coordinate multiple plugins via message passing.
### Performance Optimization
- Static vs dynamic rendering modes
- Efficient state updates
- Resource-conscious command execution
## Notes
- Plugins compile to WASM (wasm32-wasi target)
- Use color indices (0-3) instead of hex for theme compatibility
- Always check exit codes for command execution
- Leverage Zellij's pane system for long-running processes
- Use context maps to route command results
- Request permissions during `load()` phase
## File Organization
```
references/
├── plugin-development-tutorial.md # Complete tutorial
├── plugin-api-commands.md # API reference
├── plugin-api-events.md # Event system
├── plugin-examples-ui-navigation.md # UI patterns
├── plugin-examples-status-theming.md # Configuration & theming
└── plugin-examples-external-integration.md # External systems
scripts/
# Helper scripts for development automation
assets/
# Templates, boilerplate, example projects
```
## Updating
To refresh this skill with updated documentation:
1. Re-run the scraper with the same configuration
2. Add new plugin examples as they emerge
3. Update patterns based on community best practices
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.