commands-settings
Skill9 starsChanged 5 days agoMITView on GitHub
Commands, keybindings, menus and settings: CommandId + defaultKeybindings, chords and when clauses evaluated in main, effective keybindings and menu accelerators, settings owned by main (layers, user-only keys, JSONC writes) and the Settings modal. Use when adding a command or shortcut, a menu item, a when context, or a setting.
- Reads credentials
In this repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- app-testingSkill
- claude-panelSkill
- containersSkill
- debuggerSkill
- files-git-searchSkill
- i18nSkill
- lspSkill
- main-ipcSkill
- main-processesSkill
- packaging-releaseSkill
- renderer-componentsSkill
- renderer-editorSkill
- renderer-storeSkill
- renderer-stylesSkill
- renderer-terminalSkill
- workspacesSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Every app action is a command (shared/commands.ts → menu in main/menu.ts → registerCommand in commands/builtin.ts).
- Very specific: line 44
Only the first binding of a menu command, without when and not a chord, is a menu accelerator (isMenuAccelerator).
- Very specific: line 67
Every setting declares scope: 'user' | 'any' in its rule (SETTING_RULES in shared/settings.ts.
- Very specific: line 82
Every new setting needs an entry in shared/settingsUi.ts (Record<SettingKey, SettingMeta>.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Commands, keybindings and settings
Every app action is a command (shared/commands.ts → menu in main/menu.ts → registerCommand in
commands/builtin.ts); settings and effective keybindings are owned by main.
Chord shortcuts
- Chord shortcuts (
Ctrl+K S, space-separated indefaultKeys) can't be menu accelerators: main handles them inbefore-input-event(keybindings/chordShortcuts.tsoverchords.ts, installed per view byindex.tson theviewCreatedworkspace event); the menu only shows them as a label hint. - The native menu is
menu/template.ts(purebuildTemplate(input),menuCommandIds,MENU_RECENT_LIMIT, unit tested) plusmenu.ts(the Electron wiring that feeds it and rebuilds on settings/locale/recent changes). - The same handler fires single-stroke bindings of commands without a menu item (user
keybindings.json); a command missing on the platform/build (isCommandAvailable) must stay out of those tables or its key is swallowed (e.g. Ctrl+R in the terminal). - Menu, chord and
workspace:openRequesteddeliveries usedeliverCommand/deliverOpenRequest(workspacesskill): a command fired while the view loads is queued, not dropped.
when clauses
whenclauses (keybindings/when.ts) are evaluated in main against contexts the renderer reports viawindow.setContext(focusContext.ts, only on change; hiding a focused panel must move focus or the context gets stuck).- A binding with
whenis never a menu accelerator (menus fire regardless of focus): it goes throughbefore-input-eventand the menu shows a label hint. AroleItemwhose binding has awhenbecomes a plain item (view.toggleFullScreenon Win/Linux is!inDebugMode): arolewithout accelerator would grab the native key. - Non-focus contexts (
inDebugMode, reported by the debugger reactions) are inCONTEXT_KEYSbut not inFOCUS_CONTEXT_KEYS;focusContext.tsreports only the focus ones (FocusContextsis keyed byFocusContextKey).
Effective keybindings
- Effective keybindings live in main (default ←
keybindings.json,keybindings/effective.ts); the menu is rebuilt on change and the renderer only displaysSettingsSnapshot.keybindings; never readdefaultKeybindingsfor labels.
Binding lists and conflicts
- A command has a LIST of bindings (
string[]in the snapshot; UI and menu show the first). - Only the first binding of a menu command, without
whenand not a chord, is a menu accelerator (isMenuAccelerator); everything else goes throughbefore-input-event. - Two commands may share a key only with disjoint
whens (whenDisjoint;terminalFocus/editorFocus/claudeFocus/markdownPreviewFocusare mutually exclusive;FOCUS_CONTEXT_KEYS), checked for the defaults bycommands.test.ts(e.g. ⌘W:workbench.closeTab!claudeFocusvsclaude.closeSessionclaudeFocus). - A user entry steals a key only from non-disjoint bindings.
- On Win/Linux the Window menu is explicit (no
windowMenurole: its native Ctrl+Wclosewould fire whenever no ⌘W binding is active). - Menu label hints are formatted with
shared/keybindingLabel.ts. - The unified palette (⌘K,
quickInput.unified) only matches workspaces by name/branch, never by path.
Settings
- Settings are owned by main (
ipc/settings.tsonly registers the channels;settings/service.tsimplements them andstartSettings/stopSettings; state/watchers/writes insettings/state.ts,watchers.ts,writeSetting.ts; other modules importgetEffectiveSettings/onSettingsChangefromsettings/state, never fromipc/settings): the renderer appliesSettingsSnapshots and notifies theirerrors. - The view ↔ workspace-layer binding is main's (
settings/binding.tsbindView, fired byonWindowRootChange; it releases the previous folder's layer, reads the new one and re-announces the snapshot).settings:setWorkspaceonly validates the folder and returns the snapshot. Anything that derives state from the layer at start (the tree watcher,workspace:open) awaitsbindView(wc, root)first. - Settings files under
userDataaren't seen by the workspace watcher; open settings tabs are resynced on each snapshot. - Every setting declares
scope: 'user' | 'any'in its rule (SETTING_RULESinshared/settings.ts; required, the compiler fails without it).USER_ONLY_SETTINGSis derived from theuserrules, never edited by hand. Keys that execute things or set app-wide policy (terminal.shell, executables,claude.env,lsp.servers,debug.adapters) areuser: a cloned repo's.walph/settings.jsonmust never choose an executable.settings.scope.test.tsfails if a rule validated byisValidShellSetting/isValidEnvMapis notuser. - There are no per-language overrides (
"[markdown]": {…}): the only per-file layer is EditorConfig, applied in the renderer on top of the effective settings (editorConfigActions.ts;renderer-editorskill). - Model settings (
claude.model,claude.fallbackModel) validate withisModelId(shared/claudeModel.ts), the same guard asclaude:setModelandstartoptions.
Settings modal
- The Settings modal (
components/settings/, ⌘, =workbench.openSettings; the JSON file isworkbench.openSettingsJson) never writes files nor keeps optimistic state: it callssetValue/resetValue(layer, key)and redraws from the snapshot (layers.user/layers.workspace= raw valid values per layer). - Every new setting needs an entry in
shared/settingsUi.ts(Record<SettingKey, SettingMeta>;json-onlyif no control). removeSettingFromTextcuts the property manually (jsonc-parser'smodify(…, undefined)eats the previous line's trailing comment) and removes every duplicate.Modalmakes#rootinert; toasts move to a body portal above it (their clock lives in aWeakMapper toast, so the remount keeps the deadline).- With the modal open,
executeCommandcloses it first (⌘W only closes it; global commands like zoom/quit/reload keep it). This is table-driven:registerOverlayPolicy({ priority, active(state), keeps?(id), close(id), consumes(id) })incommands/registry.ts. The registry imports no action module; each owner registers its policy in itsstart…Reactions(settings:startSettingsReactions;addWorkspace/mcp/usage:startOverlayReactions; the Containers screen:startDockerReactions), never at module load;overlayPolicies.test.tsexercises the real ones.executeCommandskips the table forGLOBAL_COMMANDS, then walks the policies by ascendingpriority: an active policy that doesn'tkeepsthe command runsclose, and stops the command whenconsumesis true (else the next active policy still acts). A new overlay or takeover screen registers a policy; never add aleaveXbranch to the registry.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

