Skip to content

Block editor command palette integration #33

@pento

Description

@pento

Early idea — this will need significant exploration before building. The questions below need answers and the scope may change substantially during investigation.

Explore integrating MCP prompts into Gutenberg's Command Center (Cmd+K / Ctrl+K) via the @wordpress/commands package, so users can trigger Claude actions without opening the sidebar.

Commands to Register

Register commands using wp.data.dispatch('core/commands') or the useCommand hook:

  • "Proofread with Claude" — submits proofread command
  • "Review with Claude" — submits review command
  • "Edit with Claude..." — opens a prompt for editing focus, then submits edit command
  • "Translate with Claude..." — opens a prompt for target language, then submits translate command
  • "Respond to notes with Claude" — submits respond-to-notes command
  • "Draft with Claude..." — submits draft command (this one creates a new post, so it works differently from the sidebar actions which operate on the current post)

Exploration Questions

  • How well does @wordpress/commands support commands that need follow-up input (language, editing focus, topic)? Can we open a modal from a command, or does the command palette handle sub-prompts?
  • Should draft create a new post in a new tab, or navigate away from the current editor? How does the MCP handle this (it would need to create the post and then open it)?
  • Should commands be contextual (only registered when Claude is connected), or always visible with a "Claude not connected" error on invocation?
  • Can we register commands on non-editor screens (e.g., Posts list) for actions like draft?

Acceptance Criteria

  • Claude actions appear in the Command Center (Cmd+K)
  • Parameter-free commands (proofread, review, respond-to-notes) work directly
  • Commands requiring input have a reasonable UX (modal, sub-prompt, or similar)
  • Commands are disabled or show appropriate feedback when Claude is not connected
  • Draft command handles new post creation gracefully
  • Reuses the @wordpress/data store and hooks from AI Actions sidebar panel #32

Part of #28.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions