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:
- The current draft is discarded (replaced by the skill invocation message)
- The user cannot compose
/skill A + /skill B + their actual prompt in a single submission
- 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
- Type some text in the input box (e.g., "help me refactor the auth module")
- Press
Ctrl+P → select "Skills" (or use a custom prompt_skills keybind)
- Select any skill (e.g., "brainstorming")
- Observed: The draft text is gone; the skill is invoked immediately as a standalone message
- 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
Description
When the input box already contains text (a draft prompt), selecting a skill via Ctrl+P → Skills or the
prompt_skillskeybind immediately invokes theskilltool 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
skilltool viasession.prompt) rather than inserting/skill <name>into the input box. This means:/skill A+/skill B+ their actual prompt in a single submissionExpected 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 inautocomplete.tsx), not submit it as a standalone message. This would let users:/skillinvocations with their prompt before submittingSteps to reproduce
Ctrl+P→ select "Skills" (or use a customprompt_skillskeybind)/skill brainstormingis inserted into the input, preserving the draftEnvironment
1.18.8prompt_skillskeybind: custom (ctrl+s), but the issue reproduces with the default Ctrl+P path too