Skip to content

fix(app): invoke skills anywhere in prompts - #52055

Closed
lazyayuan wants to merge 1 commit into
anomalyco:devfrom
lazyayuan:slash-skill-anywhere
Closed

lazyayuan wants to merge 1 commit into
anomalyco:devfrom
lazyayuan:slash-skill-anywhere

Conversation

@lazyayuan

Copy link
Copy Markdown

Issue for this PR

Closes #52051

Related to #40689.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Desktop/Web slash autocomplete only recognized commands at the beginning of the prompt. Selecting a Skill after entering other text could also replace the draft or submit the Skill name as ordinary prompt text.

This change detects the slash query immediately before the cursor anywhere in the prompt, including multiline drafts. Selecting a server-backed command replaces only that query, preserves the surrounding text and attachments, and renders the selected command as a blue token. Submitting the draft executes that command and passes the surrounding text as its arguments.

Built-in client commands keep their existing behavior.

How did you verify your code works?

  • Tested completion at the beginning, middle, and end of a prompt and on a later line.
  • Verified selection preserves text before and after the slash query.
  • Verified the selected command renders as an RGB (69, 130, 204) token.
  • Verified submission sends a command request with the surrounding draft as arguments.
  • Ran 92 Session UI prompt tests and 22 prompt state/history/request-building tests.
  • Ran 8 Playwright regressions covering both the legacy and V2 prompt inputs.
  • Manually verified the flow in OpenCode Desktop.

Screenshots / recordings

slash-skill-anywhere.mov

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: slash skill autocomplete only works at the start of the prompt

2 participants