skills/swiftbar/SKILL.md
Create, edit, and debug SwiftBar menu bar plugins for macOS. ALWAYS use this skill when the user wants to put anything in the macOS menu bar — whether they say "menu bar plugin", "status bar widget", "menu bar item", or just want to show live data, counters, status indicators, or monitoring info in the macOS top bar. Also triggers for SwiftBar, BitBar, xbar by name, editing or debugging existing menu bar plugin scripts (.sh/.py with | parameters and --- separators), or any request to build a script that outputs formatted lines for a menu bar app. This is the go-to skill whenever macOS menu bar customization is involved, even if the user doesn't mention SwiftBar specifically — if they want a script-based menu bar item on macOS, this skill applies.
npx skillsauth add aivokone/ak-skills-ops swiftbarInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build and maintain SwiftBar menu bar plugins for macOS. SwiftBar executes scripts in a designated Plugin Folder and parses their stdout into menu bar items and dropdown menus.
Languages: Bash for simple plugins, Python for anything involving APIs, JSON parsing, or complex logic. Choose based on complexity — don't use Python when 10 lines of bash would do.
Ask the user where their SwiftBar Plugin Folder is located if you don't know. Common locations:
~/SwiftBar/ or ~/swiftbar/~/Library/SwiftBar/Once known, install plugins directly there so the user sees results immediately.
{name}.{interval}.{ext}
cpu-usage, weather, git-status)500ms, 1s, 5m, 2h, 1d (omit for manual-only refresh)sh for bash, py for PythonExamples: weather.10m.sh, cpu.2s.py, pomodoro.1s.sh
Every SwiftBar plugin is a script that prints to stdout. The output follows a line-based protocol:
Header Line ← Shown in menu bar
--- ← Separator: everything below is dropdown-only
Dropdown Item 1
Dropdown Item 2
--- ← Visual divider in dropdown
Another Item
Rules:
--- are header lines (displayed in the menu bar, cycled if multiple)--- appear in the dropdown menu--- lines create visual dividers in the dropdownAppend parameters after a pipe |:
Item text | param1=value1 param2=value2
| Parameter | Example | Effect |
|-----------|---------|--------|
| color | color=red or color=#ff0000 | Text color (name or hex) |
| color | color=black,white | Text color for light,dark mode |
| font | font=Menlo | macOS font name |
| size | size=14 | Font size in points |
| length | length=20 | Truncate text (full in tooltip) |
| trim | trim=true | Strip whitespace |
| md | md=true | Enable markdown (bold, italic) |
| tooltip | tooltip=Hover text | Tooltip on hover |
| Parameter | Example | Effect |
|-----------|---------|--------|
| sfimage | sfimage=checkmark.circle | SF Symbol (macOS Big Sur+) |
| sfcolor | sfcolor=green | SF Symbol color |
| image | image=<base64> | Custom image |
| templateImage | templateImage=<base64> | Adaptive image (dark/light) |
| Parameter | Example | Effect |
|-----------|---------|--------|
| href | href=https://example.com | Open URL on click |
| bash | bash=/path/to/script.sh | Run script on click |
| terminal | terminal=false | Run bash silently (no Terminal) |
| param0..paramN | param0=-l param1=/tmp | Arguments for bash |
| refresh | refresh=true | Re-run plugin after click |
| shortcut | shortcut=CMD+OPTION+T | Keyboard shortcut |
| Parameter | Example | Effect |
|-----------|---------|--------|
| checked | checked=true | Show checkmark |
| badge | badge=3 | Right-aligned badge |
| alternate | alternate=true | Show when Option key held |
| dropdown | dropdown=false | Header-only (not in dropdown) |
Prefix lines with -- for each nesting level:
echo "Top item"
echo "--Sub-item 1"
echo "--Sub-item 2"
echo "----Nested sub-item"
Add metadata as comments at the top of the script (after the shebang):
#!/bin/bash
# <xbar.title>Plugin Name</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Author Name</xbar.author>
# <xbar.author.github>github-username</xbar.author.github>
# <xbar.desc>What this plugin does</xbar.desc>
# <xbar.dependencies>jq,curl</xbar.dependencies>
# <swiftbar.hideAbout>true</swiftbar.hideAbout>
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated>
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin>
# <swiftbar.hideSwiftBar>true</swiftbar.hideSwiftBar>
# <swiftbar.refreshOnOpen>true</swiftbar.refreshOnOpen>
# <swiftbar.runInBash>false</swiftbar.runInBash>
# <swiftbar.type>streamable</swiftbar.type>
# <swiftbar.environment>[API_KEY=, CITY=London]</swiftbar.environment>
# <swiftbar.schedule>0,30 * * * *</swiftbar.schedule>
Use swiftbar.environment for user-configurable values (users set them via SwiftBar's UI). Use swiftbar.hideAbout / swiftbar.hideLastUpdated etc. to clean up the dropdown.
SwiftBar injects these into every plugin:
| Variable | Purpose |
|----------|---------|
| OS_APPEARANCE | Light or Dark — use for adaptive styling |
| SWIFTBAR_PLUGIN_CACHE_PATH | Per-plugin cache dir (temp data) |
| SWIFTBAR_PLUGIN_DATA_PATH | Per-plugin data dir (persistent state) |
| SWIFTBAR_PLUGINS_PATH | Path to the plugin folder |
| SWIFTBAR_PLUGIN_PATH | Path to the current plugin script |
See references/patterns.md for detailed examples of:
Single execution, finite runtime. Refreshes on the interval in the filename.
Long-running process. Use ~~~ to signal a menu update:
# <swiftbar.type>streamable</swiftbar.type>
while true; do
echo "Status: $(date +%H:%M)"
echo "---"
echo "Running..."
echo "~~~"
sleep 5
done
Temporary items via URL scheme — for notifications or transient alerts:
open -g "swiftbar://setephemeralplugin?name=alert&content=Build+Done&exitafter=10"
#!/bin/bash or #!/usr/bin/env python3xbar.title, xbar.desc, xbar.author---chmod +x the fileWhen a plugin isn't working:
#!/bin/bash, #!/usr/bin/env python3)chmod +x)|, params after)jq, curl, python3 are installedUseful for inter-plugin communication and automation:
| URL | Action |
|-----|--------|
| swiftbar://refreshplugin?name=<name> | Refresh specific plugin |
| swiftbar://refreshallplugins | Refresh all plugins |
| swiftbar://notify?plugin=<name>&title=<t>&body=<b> | Show notification |
| swiftbar://enableplugin?name=<name> | Enable plugin |
| swiftbar://disableplugin?name=<name> | Disable plugin |
Use open -g to prevent SwiftBar from stealing focus.
tools
Use this skill FIRST for any Seravo-hosted WordPress task. Trigger when the user mentions Seravo, production/shadow, deploy, Git-based deploys, SSH, DDEV, DB sync/import/export, or Seravo custom wp-* commands (wp-backup*, wp-purge-cache, wp-list-env). Start by identifying the environment (production vs shadow vs local) and enforce safety: agents must not run destructive or state-changing commands on production. When production write is needed, provide exact copy-paste commands for the user. Use Seravo-specific CLI and workflows instead of generic WP guidance to avoid wrong commands and risky prod changes.
development
Systematic PR fix loop — checks feedback from all channels (conversation, inline, reviews), fixes code, posts fix reports, and loops until no new feedback remains. All operations through provided scripts.
development
Local docs cache for the project. Always check docs/reference/ before fetching externally. Use for init (set up cache), update (refresh docs), lookup (local-first search), and save (persist fetched docs). If external docs are fetched (Context7/web), save a tailored topic file to docs/reference/ and add a verbal pointer in AGENTS.md.
tools
Query any Google Ads account via GAQL. Use when the user asks about Google Ads campaigns, conversions, keywords, ad performance, or bidding. Triggered by: Google Ads, campaign, conversion, PPC, CPC, keyword, click, impression, ROAS, CPA.