CherryHQ / CherryHQ/cherry-studio
[Feature]: Unified @ and / Command System — Codex-Style Discoverable Mentions and Slash Commands Across All Surfaces
- Dominant language
- TypeScript
- Stars
- 51.8k
- Forks
- 5k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 603
Description
## Background
Cherry Studio's composer-input ecosystem for "quick references and quick actions" is fragmented across three asymmetric pieces today: (1) The `/` symbol only works as a **button-spawned menu** (not a text trigger) — typing `/` in the input does nothing, but clicking the slash-commands tool button opens a small menu of 5 commands (`/clear`, `/compact`, `/context`, `/cost`, `/todos`) that exist **only for Claude Code agents**; (2) Mention-style references use **different trigger symbols** for different things — `#` for knowledge bases, `?` for web search, file attachment is a separate button entirely, model selection is yet another button, mentioned models are tracked as `mentionedModels: Model[]` but populated via popover not text input; (3) The `@` symbol — the universal "mention this thing" convention from Slack, Cursor, Codex, Claude Code — is **completely unused** in Cherry's composer. Users who want to invoke a skill, switch agent mid-conversation, attach a folder, or reference a specific KB entry have no consistent muscle-memory shortcut — every action requires finding a different button. Codex's pattern (and Cursor's, and Claude Code's) is dead simple: type `/` for commands, type `@` for entities (files / agents / skills / KBs / models). Cherry's current state, where `/` is button-only and `@` is unused, is the bottom of the discoverability spectrum. Unifying these into one input-triggered system with a single registry — that any built-in feature or user-installed Skill can extend — closes the gap and gives users one shortcut to remember.
## Goal
Typing `/` in any composer input opens a command palette listing all commands available in the current context (built-in + skill-provided + agent-specific); typing `@` opens an entity palette listing files, folders, agents, skills, knowledge bases, models, and prompts — both with fuzzy search, keyboard navigation, and one-button activation, working identically across chat, agent, side chat, and temporary chat surfaces.
## Spec
- **`/` becomes a real text trigger** in the composer: typing `/` opens an inline command palette that filters as the user types. Existing button-spawned slash menu is removed in favor of this single input-triggered flow.
- **`@` becomes the universal entity trigger**: typing `@` opens an inline entity palette covering: `@file`, `@folder`, `@url`, `@agent`, `@skill`, `@kb`, `@model`, `@prompt`. Each entity type can be filtered by typing further (e.g. `@code` filters to entities containing "code" across all types).
- **The existing `#` (KB) and `?` (web search) triggers are migrated**: `#kb-name` becomes `@kb:kb-name`, `?query` becomes a search command surfaced via `/search`. Old triggers continue working for a transition period (one release cycle) with an inline hint suggesting the new syntax.
- **Unified command registry** — a single `CommandRegistry` exposes:
- `registerCommand({ name, description, surface, handler })` — Cherry's built-in commands and Skills can both register; surface filter (chat / agent / skill-creator / all) controls visibility.
- The 5 existing Claude Code commands move into this registry with `surface: 'agent'`.
- Skills can declare commands in their `SKILL.md` frontmatter (`commands: ['/skill-name', '/skill-name --quick']`) so user-installed Skills automatically populate the palette.
- **Unified entity registry** — same pattern for `@`: `registerEntityProvider({ type, search, render })` where each type (file / agent / skill / KB / model / prompt) has a provider that returns matching entities given a query string. New entity types added by Skills or future features hook in without touching the palette UI.
- **Cross-surface consistency**: the same `/` and `@` palettes work identically in chat, agent, side chat (per #15452 if implemented), and temporary chat (per #15576). Surface-specific commands are visibly grouped (e.g. `/clear` only shown in agent surface).
- **Agent switching mid-chat**: typing `@agent:reviewer` lets the next message be routed to a different agent in the same conversation — supporting power workflows like "let CodeReviewer look at this snippet, then back to main agent". The receiving agent gets the relevant context excerpt automatically.
- **Skill invocation via `/`**: typing `/skill-name` invokes a Skill explicitly (today Skills only trigger via description matching). Explicit invocation is faster and more discoverable for power users.
- **Keyboard support**: `/` and `@` open the palette; `↑↓` navigate; `Enter` accepts; `Esc` dismisses; `Tab` accepts and stays open for chained selection; type-to-filter is always on.
- **Discoverability**: when the user has no `/` or `@` activity, an unobtrusive first-time hint appears in the composer: `Tip: type / for commands, @ for files & agents`. Dismissable.
## Verification
- User types `/` in chat composer → palette opens listing available commands (filtered by current surface). Typing `co` filters to `/compact`, `/context`, `/cost`. Enter selects.
- User types `@` → palette shows entity types as section headers (`Files`, `Agents`, `Skills`, `Knowledge Bases`, `Models`, `Prompts`). Typing `read` filters across all types to matching entities (e.g. `README.md` under Files, `CodeReader` under Agents).
- User types `@agent:CodeReviewer` in mid-conversation with Cherry Assistant → next message routed to CodeReviewer agent; the response appears inline with `From CodeReviewer:` label; main agent context is preserved.
- User installs a Skill whose `SKILL.md` declares `commands: ['/summarize-pr']` → after install, typing `/sum` in chat surfaces `/summarize-pr` in the palette; selecting it invokes the Skill directly.
- User types `#docs-kb` (legacy syntax) → palette still shows the KB picker but with an inline hint `Tip: use @kb:docs-kb in future`; selection works as today.
- User in temporary chat (per #15576) types `/` → palette opens with the same commands as a regular chat; surface filter respects the ephemeral context (e.g. `/clear` works, `/cost` works).
- User in agent surface types `/` → palette includes both the 5 Claude Code commands AND any user-skill-provided commands AND `@`-style entity commands like `/agent:switch-to`.
- Power-user keyboard flow: `@`, type `read`, `↓` to navigate, `Enter` accepts → file mention inserted; user continues typing → `@`, type `code`, `Tab` to accept and stay open, picks an agent → both mentions in the same message.
- First-time user in a fresh install sees the discoverability tip `Tip: type / for commands, @ for files & agents` once per surface; dismisses; never sees it again on that surface.
- On upgrade, existing button-spawned slash menu and current `#` / `?` triggers continue to work for one release cycle; deprecation hint surfaces inline on use; after the cycle, only the new unified system is supported.
- Skill that registers a command with `surface: 'chat-only'` does not appear when the user is in an agent surface — surface filtering verified.
## Related
- #15323 (open — `/clear` command in Agent session; this issue's unified `/` system includes `/clear` and all other slash commands; #15323 is partially superseded — its mechanism is absorbed)
- #15452 (open — `/btw` side question + queue injection; the `/btw` command registers via this issue's command registry once both land)
- #15545 (related — "Create Skill" Entry Point; this issue's `/` palette includes a `/new-skill` command that triggers the Skill Creator entry flow)
- #15576 (related — Temporary Chat; this issue's `/` and `@` work identically in temporary chats per the "cross-surface consistency" spec)
- #15660 (related — Structured Agent Goals; this issue's `/goal set` / `/goal status` / `/goal done` slash commands register through the unified system)
- #15643 (related — SDK Capabilities; this issue's `/effort` / `/thinking` slash commands surface the controls #15643 exposes)
- #10741 (closed historical — Discoverable Slash Command Platform for Agent Workflows; closed without implementation; this issue is the focused redo with broader scope including `@` mentions)
Contributor guide
Research direction
Start by locating the composer inputs, existing slash-command button, and current # and ? trigger handling across chat, agent, side chat, and temporary chat surfaces. Read the related issues and SKILL.md command requirements before mapping the proposed CommandRegistry and entity providers. Done means both keyboard-driven palettes work consistently, legacy triggers remain during the transition, and the listed verification flows pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100