Skip to content

feat(TUI): Add inline $skill invocations with prepend + pasteText support#29217

Open
jjdubski wants to merge 5 commits into
anomalyco:devfrom
jjdubski:dev
Open

feat(TUI): Add inline $skill invocations with prepend + pasteText support#29217
jjdubski wants to merge 5 commits into
anomalyco:devfrom
jjdubski:dev

Conversation

@jjdubski
Copy link
Copy Markdown

@jjdubski jjdubski commented May 25, 2026

Issue for this PR

Closes #15617
Closes #10525
Closes #7846
Closes #20982
Closes #24587

Type of change

  • New feature

What does this PR do?

  • This adds inline $skill support to the prompt composer.
  • Typing $ surfaces available skills in autocomplete, and selecting one inserts the skill into the prompt (prepended to the actual prompt itself to match the behavior of /skills command + cleaner).
  • Also works if the user pastes text including the skills, highlighting on shorter paste & longer paste (if paste summary is disabled)
  • Skill gets added to a Set, so skills are added once, and the user prompt maintains original structure for easy copying and editing.

How did you verify your code works?

  • Ran bun test inside the packages/opencode directory
  • Ran bun typecheck
  • User testing (typing in the skills, sending prompts and trying out the paste feature)
Screenshot 2026-05-25 at 8 29 10 AM

Screenshots / recordings

Screenshot 2026-05-25 at 8 45 43 AM
skill.demo.mp4

Checklist

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

Any feedback would be greatly appreciated!

jjdubski added 3 commits May 25, 2026 07:44
Typing $ in the prompt now surfaces available skills in the same
autocomplete popup used for @ mentions and / commands. Selecting a
skill inserts $skillname as a highlighted virtual-text extmark.
On submit, $skill references are expanded inline to the full skill
content before the prompt is sent.
- Generalized mentionTriggerIndex() to accept a configurable trigger
  character, reused for $ detection alongside @
- Added source.kind discriminator to distinguish skill extmarks from
  paste extmarks for correct styling
When using  in the prompt, the skill content was expanded
inline at the reference position, overwriting the  text and
disrupting the user's prompt structure. The references now remain in
place and skill content is prepended at the beginning of the prompt.
Also removes unused  type and  function left over from the
original inline-replacement approach, and fixes the autocomplete
dropdown to right-align skill descriptions by padding display names to
a uniform width.
Previously, pasting text containing  references into the prompt
inserted plain text with no extmark highlighting, even though the skill
content was correctly prepended on submit via expand(). This made the
pasted  references visually inconsistent with type-ahead inserted
skills.
The paste flow now scans the pasted text for  references matching
known skills and creates skill-styled extmarks for them, matching the
appearance of autocomplete-inserted skills. Large pastes that get
summarized skip highlighting since the text is hidden behind the
[Pasted ~N lines] placeholder.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@magnuslarsen
Copy link
Copy Markdown

Very nice! Can't wait for this to be merged :-)

@mario-loomia
Copy link
Copy Markdown

Awesome! 👏 thanks for picking this up again.

@zcutlip
Copy link
Copy Markdown

zcutlip commented May 26, 2026

Very nice

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

Labels

None yet

Projects

None yet

4 participants