command-dispatch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Command Dispatch

命令调度

Use this skill to identify user intent and dispatch the corresponding system or plugin command.
使用此Skill识别用户意图并调度对应的系统或插件命令。

When to Use

使用场景

  • The user sends a
    /xxx
    slash command (execute directly)
  • The user describes an action in natural language, for example:
    • "Sync sites" →
      /cookiecloud
    • "Show my subscriptions" →
      /subscribes
    • "Refresh subscriptions" →
      /subscribes refresh
    • "What's downloading?" →
      /downloading
    • "Organize downloaded files" →
      /transfer
    • "Clear cache" →
      /clear_cache
    • "Restart the system" →
      /restart
    • "Pause all QB tasks" →
      /pause_torrents
      (plugin command)
  • 用户发送
    /xxx
    格式的斜杠命令(直接执行)
  • 用户用自然语言描述操作,例如:
    • “同步站点” →
      /cookiecloud
    • “显示我的订阅” →
      /subscribes
    • “刷新订阅” →
      /subscribes refresh
    • “正在下载什么?” →
      /downloading
    • “整理已下载文件” →
      /transfer
    • “清除缓存” →
      /clear_cache
    • “重启系统” →
      /restart
    • “暂停所有QB任务” →
      /pause_torrents
      (插件命令)

Tools

工具

  • list_slash_commands
    — List all available slash commands (system + plugin), returns command name, description, and category
  • query_plugin_capabilities
    — Query detailed plugin capabilities (commands, actions, scheduled services)
  • run_slash_command
    — Execute a specified command (works for both system and plugin commands)
  • list_slash_commands
    — 列出所有可用的斜杠命令(系统+插件),返回命令名称、描述和分类
  • query_plugin_capabilities
    — 查询插件的详细功能(命令、操作、定时服务)
  • run_slash_command
    — 执行指定命令(支持系统和插件命令)

Workflow

工作流程

Step 1: Identify User Intent

步骤1:识别用户意图

Determine whether the user's message is requesting the execution of a command:
  • Direct command: Message starts with
    /
    , e.g.
    /sites
    ,
    /subscribes
    → skip to Step 3
  • Natural language: The user describes an actionable request → continue to Step 2
判断用户消息是否请求执行命令:
  • 直接命令:消息以/开头,例如/sites、/subscribes → 跳至步骤3
  • 自然语言:用户描述可执行的请求 → 继续步骤2

Step 2: Find Matching Command

步骤2:查找匹配命令

Use
list_slash_commands
to retrieve all available commands. Match the user's described intent against the
description
and
category
fields of each command.
If the user's description involves a specific plugin's functionality, additionally use
query_plugin_capabilities
to query that plugin's detailed capabilities.
Matching strategy:
  • Prefer exact matches on command description
  • Then narrow down by category and match
  • If no matching command is found, inform the user that no corresponding function is available
使用
list_slash_commands
获取所有可用命令。将用户描述的意图与每个命令的
description
category
字段进行匹配。
如果用户描述涉及特定插件的功能,额外使用
query_plugin_capabilities
查询该插件的详细功能。
匹配策略
  • 优先匹配命令描述的精确内容
  • 其次按分类缩小范围进行匹配
  • 若未找到匹配命令,告知用户无对应功能可用

Step 3: Extract Parameters and Execute

步骤3:提取参数并执行

Some commands support additional arguments (space-separated after the command), for example:
  • /redo <history_id>
    — Manually re-organize a specific record
  • /sites disable <site_id>
    — Disable one or more sites
  • /subscribes delete <subscribe_id>
    — Delete one or more subscriptions
Use
run_slash_command
to execute the command in the format
/command_name arg1 arg2
.
部分命令支持附加参数(命令后以空格分隔),例如:
  • /redo <history_id>
    — 手动重新整理特定记录
  • /sites disable <site_id>
    — 禁用一个或多个站点
  • /subscribes delete <subscribe_id>
    — 删除一个或多个订阅
使用
run_slash_command
/command_name arg1 arg2
的格式执行命令。

Step 4: Report Result

步骤4:反馈结果

Command execution is asynchronous. After triggering, inform the user that the command has started. If the command does not exist, list available commands for reference.
命令执行是异步的。触发执行后,告知用户命令已启动。若命令不存在,列出可用命令供参考。

Important Notes

重要注意事项

  • Command execution requires admin privileges; the tool will automatically check permissions
  • Both system and plugin commands are executed via the
    run_slash_command
    tool — no need to distinguish between them
  • If you are unsure which command matches the user's intent, use
    list_slash_commands
    first to look up before deciding
  • Never guess non-existent commands; always select from the available command list
  • 命令执行需要管理员权限,工具会自动检查权限
  • 系统命令和插件命令均通过
    run_slash_command
    工具执行——无需区分两者
  • 若不确定哪个命令匹配用户意图,先使用
    list_slash_commands
    查询后再做决定
  • 切勿猜测不存在的命令,务必从可用命令列表中选择