fix(#706): skills show <name> returns error+exit1 when skill not found; classify_error_kind covers skill_not_found from prose message

This commit is contained in:
YeonGyu-Kim
2026-05-26 00:04:39 +09:00
parent f84799c8ef
commit dedad14ae4
3 changed files with 29 additions and 5 deletions

View File

@@ -2485,6 +2485,17 @@ pub fn handle_skills_slash_command_json(args: Option<&str>, cwd: &Path) -> std::
.into_iter()
.filter(|s| s.name.to_lowercase() == name)
.collect();
// #706: return typed error when named skill is not found instead of silent empty list
if matched.is_empty() {
return Ok(json!({
"kind": "skills",
"action": "show",
"status": "error",
"error_kind": "skill_not_found",
"message": format!("skill '{}' not found", name),
"requested": name,
}));
}
Ok(render_skills_report_json(&matched))
}
Some("install") => Ok(render_skills_usage_json(Some("install"))),