code-editor-switch
SKILL.md
code-editor-switch
Purpose
Use this skill to switch Finder/Open defaults for code, text, and config files to a new editor (for example Zed, VS Code, Cursor) using duti.
When to use
- Migrating from one editor to another on macOS.
- Standardizing file defaults for local repos and team machines.
- Fixing mismatched defaults for dotfiles and config files.
Non-negotiable rules
- Run this only on macOS.
- Prefer
dutiover direct LaunchServices plist edits. - Apply both generic UTIs and concrete extensions/names.
- Keep
public.dataopt-in only (--apply-public-data). - Verify with
duti -xafter applying mappings.
Workflow
1) Preflight
- Ensure
dutiexists:command -v duti >/dev/null || brew install duti
- Resolve bundle identifier for target editor:
osascript -e 'id of app "Cursor"'mdls -name kMDItemCFBundleIdentifier -raw "/Applications/Cursor.app"
2) Apply baseline mappings
- Run:
bash "scripts/switch-code-editor.sh" --editor "Cursor"
- This applies:
- Core UTIs (
public.text,public.plain-text,public.source-code, etc.) - Baseline code/config extensions (
ts,tsx,js,json,yaml,sql,py,css,toml,mdx, etc.) - No-extension names like
Dockerfile
- Core UTIs (
3) Add project-driven coverage
- Include project scan:
bash "scripts/switch-code-editor.sh" --editor "Cursor" --project "$HOME/Developer/fmd-labs/viral-app"
- Preview discovered tokens without applying:
bash "scripts/discover-project-editor-tokens.sh" "$HOME/Developer/fmd-labs/viral-app"
4) Verify
- Check representative mappings:
duti -x tsduti -x tsxduti -x envduti -x gitignoreduti -x Dockerfile
- If Finder still opens old handlers, log out/in to refresh LaunchServices behavior.
5) Optional aggressive mode
- Only if explicitly requested:
bash "scripts/switch-code-editor.sh" --editor "Cursor" --apply-public-data
- Warning: this can redirect many non-code files.
Known edge cases
.tscan resolve to a non-code UTI on some systems; extension mapping is required.- Dotfiles like
.env.localare often matched by suffix (local) plus text UTIs. - Some apps may reclaim specific extensions after updates/reinstalls.
Deliverables
When using this skill, always return:
- Target editor and resolved bundle ID.
- Exact script command used.
- Summary of UTI + token mappings applied.
- 3-5 verification checks (
duti -x ...).
Progressive disclosure
Load only what is needed:
references/coverage-from-viral-app.mdfor practical extension gaps.references/sources.mdfor source links and version checkpoints.scripts/discover-project-editor-tokens.shfor token discovery.scripts/switch-code-editor.shfor the full apply workflow.
Weekly Installs
1
Repository
wottpal/skillsFirst Seen
12 days ago
Security Audits
Installed on
mcpjam1
github-copilot1
junie1
windsurf1
zencoder1
crush1