From macos-service-skill
Create macOS Quick Actions (Services) that appear in Finder's right-click menu. Use this skill whenever the user wants to create a right-click action, Finder service, Quick Action, context menu item, Automator workflow, or .workflow bundle for macOS. Also use when they say "make a service", "add to right-click menu", "create a Finder action", or want to run a shell script on selected files from Finder.
How this skill is triggered — by the user, by Claude, or both
Slash command
/macos-service-skill:macos-serviceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create macOS Quick Actions (.workflow bundles) that appear in Finder's right-click > Services menu. These are built programmatically — no Automator GUI needed.
Create macOS Quick Actions (.workflow bundles) that appear in Finder's right-click > Services menu. These are built programmatically — no Automator GUI needed.
A Quick Action is a .workflow bundle installed to ~/Library/Services/. It contains two XML plist files:
<Service Name>.workflow/
Contents/
Info.plist — Controls menu name, accepted file types, which apps show it
document.wflow — Automator workflow definition with embedded shell script
Ask the user:
Write the shell script first as a normal bash script and test it. Selected files are passed as arguments ($@). Key considerations:
TOOL=""
for dir in /opt/homebrew/bin /usr/local/bin /usr/bin; do
[ -z "$TOOL" ] && [ -x "$dir/toolname" ] && TOOL="$dir/toolname"
done
"$f" and "$@"osascript display notification is silently swallowed by Automator's I/O redirect. Use display dialog instead for user feedback:
osascript -e 'display dialog "Done!" with title "My Service" buttons {"OK"} default button "OK"'
Create the directory structure and write both plist files. Read references/workflow-template.md for the complete, battle-tested XML templates — use them as-is and only modify the shell script content, service name, and file types.
Info.plist controls:
NSMenuItem > default — The menu item nameNSSendFileTypes — Array of UTI strings for accepted file typesNSRequiredContext > NSApplicationIdentifier — Restrict to Finder with com.apple.finderNSMessage — Always runWorkflowAsServicedocument.wflow contains:
ActionParameters > COMMAND_STRING — Your shell script (XML-escaped)ActionParameters > inputMethod — <integer>1</integer> means "pass input as arguments"ActionParameters > shell — /bin/bashworkflowMetaData — Identifies this as a services menu workflowThe shell script goes inside a <string> element in XML. These characters MUST be escaped:
| Character | XML Entity |
|---|---|
& | & |
< | < |
> | > |
Common patterns:
&& → &&2>/dev/null → 2>/dev/null2>&1 → 2>&1Quotes (", ') and $ do NOT need escaping in XML plist <string> elements.
mkdir -p "$HOME/Library/Services/<Service Name>.workflow/Contents"
# Write Info.plist and document.wflow using the Write tool
plutil -lint "$HOME/Library/Services/<Service Name>.workflow/Contents/Info.plist"
plutil -lint "$HOME/Library/Services/<Service Name>.workflow/Contents/document.wflow"
/System/Library/CoreServices/pbs -flush 2>/dev/null
If the service doesn't appear after flushing, the user may need to enable it in System Settings > Keyboard > Keyboard Shortcuts > Services, or restart Finder with killall Finder.
| UTI | Matches |
|---|---|
public.item | All files and folders |
public.data | All files (no folders) |
public.movie | All video files |
public.audio | All audio files |
public.image | All image files |
public.mpeg-4 | .mp4 files |
public.avi | .avi files |
org.matroska.mkv | .mkv files |
public.plain-text | .txt files |
public.json | .json files |
com.adobe.pdf | .pdf files |
public.folder | Folders only |
workflow-template.md — Complete XML templates for Info.plist and document.wflow. These are tested, working templates extracted from a real service. Read this file when building the workflow bundle.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub bfgpollara/macos-service-skill --plugin macos-service-skill