register-monaco-command

Integrates Monaco editor commands into the project command palette and configurable keybindings.

Updated May 13, 2026
One-click install
npx skills add https://github.com/lovebirdsx/universe-editor --skill register-monaco-command-lovebirdsx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: register-monaco-command
Source: https://github.com/lovebirdsx/universe-editor/tree/main/.claude/skills/register-monaco-command
Command: npx skills add https://github.com/lovebirdsx/universe-editor --skill register-monaco-command-lovebirdsx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Monaco built-in commands often cannot be found in the project's command palette or Keyboard Shortcuts editor, and some cannot be rebound even though they work from the right-click menu or default keys. This Skill diagnoses which Monaco registration mechanism a command uses and wires it into the project's CommandsRegistry and KeybindingsRegistry correctly. ## Core Features & Use Cases - Mechanism Detection: Distinguishes registerEditorAction commands from registerAction2 commands using runtime checks and source inspection, since each requires a different integration path. - Three Integration Paths: Covers auto-bridged EditorActions, explicit Action2 wrappers using getAction().run(), and action2 wrappers using editor.focus() plus editor.trigger(). - Double-Trigger Prevention: Removes Monaco's own default keybindings via addKeybindingRule when a project-level default key is declared, with a single exported id list as the source of truth. - Use Case: When Go to Definition works via F12 but cannot be found in the command palette or rebound in the Keyboard Shortcuts editor, use this Skill to wrap it as a project Action2 with VSCode-aligned id and default key, plus tests. ## Quick Start Ask the AI to make a specific Monaco command searchable in the command palette and rebindable in the Keyboard Shortcuts editor.

Frequently Asked Questions about register-monaco-command

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a Monaco editor command appear in the command palette?

Wrap the command as a project Action2 with f1 set to true and register it via registerAction2 in the actions index. EditorAction-type commands are often already auto-bridged, so check the Keyboard Shortcuts editor first before writing new code.

Why does editor.getAction() return null for Go to Definition?

Go to Definition and other goto/peek commands are registered with registerAction2, not registerEditorAction, so they never enter the EditorExtensionsRegistry that getAction reads. Use editor.focus() followed by editor.trigger(source, id, payload) instead.

How do I fix a Monaco command triggering twice with one keypress?

Double triggering happens when both the project Action2 and Monaco itself bind the same default key. Remove Monaco's binding in the Monaco loader with addKeybindingRule using keybinding 0 and command set to dash-prefixed id.

What is the difference between registerEditorAction and registerAction2 in Monaco?

registerEditorAction adds commands to the EditorExtensionsRegistry, making them visible to getAction and auto-bridging. registerAction2 registers into Monaco's internal platform CommandsRegistry and MenuRegistry, so getAction returns null and project registries never see them.

Why does a Monaco command not run when triggered from the command palette?

Action2-type commands resolve their target editor via the focused or active code editor, which is lost when the command palette has focus. Call editor.focus() before editor.trigger() so the command can resolve the correct editor instance.