Generate system tray and context menu configurations with platform-specific icons, menu templates, and event handling
Generates Electron system tray menus with platform-specific icons, templates, and event handling.
npx claudepluginhub a5c-ai/babysitterThis skill is limited to using the following tools:
README.mdGenerate system tray and context menu configurations for Electron applications. This skill handles platform-specific icon requirements, menu template creation, and tray event handling across Windows, macOS, and Linux.
{
"type": "object",
"properties": {
"projectPath": {
"type": "string",
"description": "Path to the Electron project root"
},
"menuStructure": {
"type": "array",
"description": "Menu item definitions",
"items": {
"type": "object",
"properties": {
"label": { "type": "string" },
"type": { "enum": ["normal", "separator", "submenu", "checkbox", "radio"] },
"accelerator": { "type": "string" },
"enabled": { "type": "boolean" },
"visible": { "type": "boolean" },
"click": { "type": "string", "description": "Handler function name" },
"submenu": { "type": "array" }
}
}
},
"iconPaths": {
"type": "object",
"properties": {
"default": { "type": "string" },
"pressed": { "type": "string" },
"highlighted": { "type": "string" }
}
},
"features": {
"type": "array",
"items": {
"enum": ["tooltip", "balloon", "click-handler", "double-click", "context-menu", "dynamic-update"]
}
},
"targetPlatforms": {
"type": "array",
"items": { "enum": ["win32", "darwin", "linux"] }
}
},
"required": ["projectPath", "menuStructure"]
}
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"description": { "type": "string" }
}
}
},
"iconRequirements": {
"type": "object",
"description": "Required icon files per platform"
},
"warnings": { "type": "array", "items": { "type": "string" } }
},
"required": ["success"]
}
// tray-manager.js
const { app, Tray, Menu, nativeImage } = require('electron');
const path = require('path');
class TrayManager {
constructor(mainWindow) {
this.mainWindow = mainWindow;
this.tray = null;
}
create() {
const iconPath = this.getIconPath();
this.tray = new Tray(iconPath);
this.tray.setToolTip('My Application');
this.tray.setContextMenu(this.buildMenu());
// Platform-specific behavior
if (process.platform === 'win32') {
this.tray.on('double-click', () => this.showWindow());
} else if (process.platform === 'darwin') {
this.tray.on('click', () => this.toggleWindow());
}
}
getIconPath() {
const iconName = process.platform === 'win32'
? 'tray.ico'
: process.platform === 'darwin'
? 'trayTemplate.png' // Template image for macOS
: 'tray.png';
return path.join(__dirname, '../assets/icons', iconName);
}
buildMenu() {
const template = [
{
label: 'Show App',
click: () => this.showWindow()
},
{ type: 'separator' },
{
label: 'Status',
submenu: [
{ label: 'Online', type: 'radio', checked: true },
{ label: 'Away', type: 'radio' },
{ label: 'Busy', type: 'radio' }
]
},
{ type: 'separator' },
{
label: 'Quit',
accelerator: process.platform === 'darwin' ? 'Cmd+Q' : 'Ctrl+Q',
click: () => app.quit()
}
];
return Menu.buildFromTemplate(template);
}
showWindow() {
if (this.mainWindow) {
this.mainWindow.show();
this.mainWindow.focus();
}
}
toggleWindow() {
if (this.mainWindow.isVisible()) {
this.mainWindow.hide();
} else {
this.showWindow();
}
}
updateMenu(newTemplate) {
this.tray.setContextMenu(Menu.buildFromTemplate(newTemplate));
}
setIcon(iconPath) {
this.tray.setImage(iconPath);
}
destroy() {
if (this.tray) {
this.tray.destroy();
this.tray = null;
}
}
}
module.exports = TrayManager;
// For macOS dark/light mode support
const icon = nativeImage.createFromPath('trayTemplate.png');
icon.setTemplateImage(true);
assets/icons/
├── tray.ico # Windows (multi-resolution)
├── trayTemplate.png # macOS @1x (16x16 or 22x22)
├── trayTemplate@2x.png # macOS @2x
├── tray.png # Linux (24x24 or 22x22)
└── tray-active.png # State variant
electron-builder-config - Include tray icons in buildnative-notification-builder - Notifications from trayappkit-menu-bar-builder - macOS native menu bar appselectron-architect - Architecture guidanceplatform-convention-advisor - Platform UI conventionsActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.