anomalyco / anomalyco/opencode

Selecting a skill via prompt_skills keybind or Ctrl+P clears the input draft

Open
#39,376 7 comments 3 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Jul 28, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When the input box already contains text (a draft prompt), selecting a skill via Ctrl+P → Skills or the prompt_skills keybind immediately invokes the skill tool and clears the existing input draft. The user's in-progress text is lost.

This is problematic for multi-skill workflows: a user writes a prompt, then wants to load a second skill (whose name they don't remember) to use alongside the first. They open the skill selector — and their draft is gone.

The problem

Selecting a skill from the selector submits a message (invokes the skill tool via session.prompt) rather than inserting /skill <name> into the input box. This means:

  1. The current draft is discarded (replaced by the skill invocation message)
  2. The user cannot compose /skill A + /skill B + their actual prompt in a single submission
  3. There is no way to browse the skill list while preserving draft text

Expected behavior

Selecting a skill from prompt_skills (or Ctrl+P) should insert /skill <name> at the cursor position in the input box (similar to how slash-command autocomplete works in autocomplete.tsx), not submit it as a standalone message. This would let users:

  • Keep their existing draft
  • Compose multiple /skill invocations with their prompt before submitting
  • Browse the skill list without fear of losing work

Steps to reproduce

  1. Type some text in the input box (e.g., "help me refactor the auth module")
  2. Press Ctrl+P → select "Skills" (or use a custom prompt_skills keybind)
  3. Select any skill (e.g., "brainstorming")
  4. Observed: The draft text is gone; the skill is invoked immediately as a standalone message
  5. Expected: /skill brainstorming is inserted into the input, preserving the draft

Environment

  • OpenCode version: 1.18.8
  • OS: macOS (Darwin)
  • prompt_skills keybind: custom (ctrl+s), but the issue reproduces with the default Ctrl+P path too

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.