.claude/skills/creating-karabiner-modifications/SKILL.md
Use when configuring Karabiner-Elements keyboard customizations, before writing JSON - provides systematic workflow for complex modifications with correct structure, common patterns, and guidance on manual vs generator approaches
npx skillsauth add ajbcoding/claude-skill-eval creating-karabiner-modificationsInstall 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.
Karabiner-Elements is a macOS keyboard customization tool using JSON configuration. This skill provides a systematic workflow to create complex modifications correctly and efficiently.
Core principle: Clarify requirements first, choose simplest approach, use correct structure, test with EventViewer.
Use this skill when:
~/.config/karabiner/karabiner.jsonESPECIALLY under time pressure - templates prevent structural errors that waste more time debugging.
Don't use for:
If you catch yourself thinking:
All of these mean: Use the templates below. Faster AND correct.
ALWAYS ask if ambiguous:
digraph choose_approach {
"User comfortable with code?" [shape=diamond];
"Many complex rules?" [shape=diamond];
"Use external generator" [shape=box];
"Manual JSON" [shape=box];
"User comfortable with code?" -> "Many complex rules?" [label="yes"];
"User comfortable with code?" -> "Manual JSON" [label="no"];
"Many complex rules?" -> "Use external generator" [label="yes"];
"Many complex rules?" -> "Manual JSON" [label="no"];
}
External generators (more efficient for complex cases):
See: https://karabiner-elements.pqrs.org/docs/json/external-json-generators/
Manual JSON (direct editing):
Use templates below for common patterns.
Use Karabiner-EventViewer (included with Karabiner-Elements):
Don't rely on "it should work" - always test.
{
"description": "Change caps_lock to escape",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "escape"
}
]
}
]
}
{
"description": "Change control+m to return",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "m",
"modifiers": {
"mandatory": ["control"]
}
},
"to": [
{
"key_code": "return_or_enter"
}
]
}
]
}
{
"description": "Caps lock to control (hold) or escape (tap)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "escape"
}
]
}
]
}
{
"description": "Command+h to delete in Terminal only",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["command"]
}
},
"to": [
{
"key_code": "delete_or_backspace"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["^com\\.apple\\.Terminal$"]
}
]
}
]
}
Config file: ~/.config/karabiner/karabiner.json
Structure: Add rules to the complex_modifications.rules array:
{
"profiles": [
{
"name": "Default profile",
"complex_modifications": {
"rules": [
// ADD NEW RULES HERE
{
"description": "...",
"manipulators": [...]
}
]
}
}
]
}
| Mistake | Fix |
|---------|-----|
| Using "title" field | Use "description" instead |
| Extra "rules" wrapper | Rule object has description + manipulators directly |
| Forgetting "type": "basic" | Always include in each manipulator |
| Wrong bundle identifier | Check app's bundle ID: osascript -e 'id of app "AppName"' |
| Not testing | Always use EventViewer to verify |
| Over-engineering | Start with simple approach, add complexity only if needed |
| Skipping skill under time pressure | Time pressure causes errors; templates save time |
| Excuse | Reality | |--------|---------| | "I'll work from memory to save time" | Memory fails under pressure. Templates take 10 seconds. | | "I know the Karabiner syntax" | Knowing ≠ remembering correctly. "title" vs "description" errors are common. | | "This is too urgent for workflow" | Debugging wrong structure wastes 10x more time than using template. | | "Simple config doesn't need templates" | Simple configs break from same field name errors as complex ones. | | "Templates are slower" | Copy-paste template: 10 sec. Debug JSON error: 5 min. |
Common key codes:
"a" to "z""1" to "9", "0""left_control", "left_shift", "left_command", "left_option""escape", "return_or_enter", "delete_or_backspace", "tab", "spacebar""up_arrow", "down_arrow", "left_arrow", "right_arrow""f1" to "f12", "f13" to "f24"Full reference: Use EventViewer to see key codes for any key.
Avoid unless necessary. Simple modifier remapping works for 95% of cases.
Only use lazy modifiers when you specifically need the modifier itself not to generate events until combined with another key.
Following this workflow:
content-media
Download YouTube video transcripts when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.
development
Transform learning content (like YouTube transcripts, articles, tutorials) into actionable implementation plans using the Ship-Learn-Next framework. Use when user wants to turn advice, lessons, or educational content into concrete action steps, reps, or a learning quest.
tools
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
tools
Replace with description of the skill and when Claude should use it.