feat(commands): unified slash-command namespace with template substitution (closes #435)

Three sources share the /foo namespace with clear precedence:
  1. Native built-ins (match block in mod.rs)
  2. User-config commands (~/.deepseek/commands/*.md) — checked first
  3. Skills (~/.deepseek/skills/) — new fallback in the _ arm

Template substitution: $1, $2, $ARGUMENTS are replaced in user-command
and skill content before the message is sent. Existing exact-match and
alias behavior is unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangfeng
2026-05-04 16:39:28 -07:00
parent 3cff070570
commit e577db47e4
3 changed files with 30 additions and 3 deletions
+5
View File
@@ -567,6 +567,11 @@ pub fn execute(cmd: &str, app: &mut App) -> CommandResult {
),
_ => {
// Third source: skills (lowest precedence after native and user-config).
// Try to run a skill whose name matches the command.
if skills::run_skill_by_name(app, command, arg).is_some() {
return skills::run_skill_by_name(app, command, arg).unwrap();
}
let suggestions = suggest_command_names(command, 3);
if suggestions.is_empty() {
CommandResult::error(format!(