Skip to content

Feature: Add a new slash command #134

@quiet-node

Description

@quiet-node

Label: enhancement, good first issue
Milestone:
Projects:

Problem Statement

Thuki already has useful slash commands like /tldr, /rewrite, and /bullets. A /explain command would let users highlight any text (code, jargon, a paragraph) and instantly get a plain-English explanation, without having to type out a prompt manually.


Proposed Solution

Add a /explain command to the slash command registry in src/config/commands.ts.

The command should:

  • Accept highlighted text or typed text as input
  • Ask the model to explain it in plain, simple language
  • Output only the explanation (no preamble like "Sure! Here's an explanation...")

All the plumbing is already in place. Adding a command here is all that's needed: the autocomplete UI, the tab-completion, and the prompt builder all pick it up automatically.

File to edit: src/config/commands.ts

Follow the exact same shape as the existing entries (e.g. /tldr or /bullets). Each command needs:

  • trigger — the slash string, e.g. "/explain"
  • label — same as trigger
  • description — one-line hint shown in the autocomplete dropdown
  • docs — human-facing documentation fields (summary, usage, examples, behavior)
  • promptHelp — short model-facing summary
  • promptTemplate — the actual prompt sent to the model, using $INPUT as the placeholder for the user's text

A suggested prompt template to start from:

Explain the following in plain, simple language. Assume the reader is smart but not familiar with the topic. Be concise. Output only the explanation, no introduction or sign-off.

Text: $INPUT

Feel free to improve the wording.


Definition of Done

  • /explain appears in the COMMANDS array in src/config/commands.ts
  • Typing /explain in the ask bar shows it in the autocomplete suggestions
  • Submitting /explain with highlighted or typed text sends the prompt to the model and streams a response
  • bun run test:all:coverage passes (100% coverage maintained)
  • bun run validate-build passes with zero warnings and zero errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions