xiaohongshu
xiaohongshu
hammerspoon
Configure and manage Hammerspoon automation, app launching, and window switching. Use when working with ~/.config/hammerspoon config files, adding keybindings, modifying the leader modal, or troubleshooting Hammerspoon functionality. Window management is handled by AeroSpace.
Full skill instructions
Manage Hammerspoon configuration for macOS automation including app launching, window switching, emoji/symbol pickers, and leader modal. Window management is handled by AeroSpace.
~/.config/hammerspoon/~/.hammerspoon → ~/.config/hammerspoon/hs (installed via hs.ipc.cliInstall() in init.lua)hyper-key.lua - Inline hyper key implementation
HyperKey.new(mods) constructorbind(key):toFunction(name, fn) and bind(key):toApplication(app)self.bindings tableinit.lua - Main entry point
hs.ipc.cliInstall() to enable CLI accesshyper modifier: {cmd, ctrl, alt, shift}leader-modal.lua - Modal keybinding system
leader-dsl.lua - DSL for defining leader bindings
Leader(key, description, bindings) - Define leader menuBind(key, description, action, options) - Define action~/.config/hammerspoon/clues/ directoryclues/.lua* - Leader binding definitions
windows.lua - Window management (moved to AeroSpace)hammerspoon.lua - Reload config, console, update apps, switcherapps.lua - App launchingsystem.lua - System operationscleanshot.lua - CleanShot integrationemoji.lua - Emoji pickersuperwhisper.lua - SuperWhisper integrationemoji-picker.lua - Emoji chooser
symbol-picker.lua - Symbol chooser
chooser-style.lua - Shared chooser styling
window-switcher.lua - Unified launcher/dispatcher modal
hs.chooser API with fuzzy matchingcmd+space and cmd+tabfuzzy.lua - Dynamic programming fuzzy matching
notch-clock.lua - Clock in notch area
The hs command-line tool provides direct interaction with Hammerspoon. It requires hs.ipc.cliInstall() to be called in init.lua (already configured).
Check for errors and module status:
echo "
local status = {modules_loaded = {}, errors = {}}
local modules = {'hyper-key', 'config-watch', 'window-hotkeys', 'quick-switch', 'window-switcher'}
for _, mod in ipairs(modules) do
local ok, result = pcall(require, mod)
if ok then
table.insert(status.modules_loaded, mod)
else
table.insert(status.errors, mod .. ': ' .. tostring(result))
end
end
return hs.json.encode(status, true)
" | hs -c ''
View live console output:
hs -C
Execute Hammerspoon commands:
echo "hs.alert.show('test')" | hs -c ''
echo 'hs.reload()' | hs -c ''
Interactive Lua REPL:
hs
Mirror prints to console:
hs -P
Run a script:
hs /path/to/script.lua
Common flags:
-A - Auto-launch Hammerspoon if not running-C - Clone console prints to this terminal (best for checking errors)-P - Mirror prints to Hammerspoon console-c - Execute command and return result-i - Force interactive mode-n - Disable colorized output-N - Force colorized output-q - Quiet mode (errors and results only)Reload Hammerspoon:
echo 'hs.reload()' | hs -c ''
# or via URL:
open -g hammerspoon://reload
Check if running:
ps aux | rg -i hammerspoon
Open console window:
open "hammerspoon://consoleWindow"
Test configuration:
Edit any .lua file in ~/.config/hammerspoon/ to trigger auto-reload
Create a file in ~/.config/hammerspoon/clues/:
return Leader("key", "Description", {
Bind("a", "Action 1", { fn = function() ... end }),
Bind("b", "Action 2", { shell = "/path/to/script" }),
Bind("c", "Action 3", { mode = "mode_name" }),
})
~/.config/hammerspoon/module-name.luainit.lua: local module = require("module-name")Current Hammerspoon setup replaces:
Other macOS automation tools:
Use the hs CLI to check for module loading errors:
echo "
local status = {modules_loaded = {}, errors = {}}
local modules = {'hyper-key', 'config-watch', 'window-hotkeys', 'quick-switch', 'window-switcher'}
for _, mod in ipairs(modules) do
local ok, result = pcall(require, mod)
if ok then
table.insert(status.modules_loaded, mod)
else
table.insert(status.errors, mod .. ': ' .. tostring(result))
end
end
return hs.json.encode(status, true)
" | hs -c ''
Or view live console output: hs -C
ls -la ~/.hammerspoonps aux | rg Hammerspoonecho 'hs.reload()' | hs -c ''hs -C or open "hammerspoon://consoleWindow"echo "hs.alert.show('test')" | hs -c ''config-watch.lua is loaded in init.lua.luaIf hs command not found, ensure hs.ipc.cliInstall() is called in init.lua
Decision criteria for using spoons:
Future spoon management (not yet implemented): If spoons are needed, they will be managed via GitHub workflow:
.github/workflows/versions.lua.github/workflows/hammerspoon.yml build workflowhammerspoon-YYYY.MM.DD-darwin-arm64.tar.gzThis ensures pinned, reproducible spoon dependencies similar to other tools in the repo.
init.lua~/.claude/plans/hammerspoon-consolidation.mdxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience