anomalyco / anomalyco/opencode
Selecting a skill via prompt_skills keybind or Ctrl+P clears the input draft
@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:
- 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
/skillinvocations 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 customprompt_skillskeybind) - Select any skill (e.g., "brainstorming")
- Observed: The draft text is gone; the skill is invoked immediately as a standalone message
- Expected:
/skill brainstormingis inserted into the input, preserving the draft
Environment
- OpenCode version:
1.18.8 - OS: macOS (Darwin)
prompt_skillskeybind: custom (ctrl+s), but the issue reproduces with the default Ctrl+P path too
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.