From efd34c151aeda9b49b5f8ad51e5cb079aba64f6a Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 27 May 2026 21:05:41 +0900 Subject: [PATCH] fix(#805): skills show in text mode silently returned empty success instead of error --- ROADMAP.md | 2 ++ rust/crates/commands/src/lib.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ROADMAP.md b/ROADMAP.md index aac43b7e..735315fe 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -7774,3 +7774,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed) 803. **`claw agents list --bogus`, `skills list --bogus`, and `plugins list --bogus` in text mode silently returned empty success** — dogfooded 2026-05-27 on `fcebf644`. The JSON-mode flag guards added in #792/#793 only covered the JSON branch; the text-mode path through `handle_agents_slash_command`, `handle_skills_slash_command`, and `print_plugins` still passed flag-shaped tokens as substring filters. Fix: added flag-prefix guards to all three text-mode list handlers (agents and skills in `commands/src/lib.rs`, plugins in `main.rs print_plugins`). Also removed the now-redundant JSON-only guard from print_plugins (the early guard catches both modes). Updated `plugins_list_flag_shaped_filter_returns_unknown_option_793` test to check stderr. 62 CLI contract tests pass. [SCOPE: claw-code] 804. **`claw agents show ` and `claw skills show ` in text mode returned wrong `agent_not_found`/silent empty instead of catching extra args** — dogfooded 2026-05-27 on `bad1b97f`. Parity gap with JSON-mode fix #796: the text-mode show handlers in `commands/src/lib.rs` still used single-split `split_once(' ')` without checking for spaces in the extracted name. Fix: added `contains(' ')` guard to both text-mode show arms; extra tokens now return `unexpected extra arguments` with usage hint. 62 CLI contract tests pass. [SCOPE: claw-code] + +805. **`claw skills show ` in text mode silently returned "No skills found." instead of an error** — dogfooded 2026-05-27 on `2c3c0f60`. The text-mode show handler in `handle_skills_slash_command` returned `render_skills_report(&matched)` with an empty vec instead of checking for empty match and returning an error. JSON mode already returned `skill_not_found` since #706. Fix: added `matched.is_empty()` guard with `skill_not_found` error + `\n` hint suggesting `claw skills list`. 62 CLI contract tests pass. [SCOPE: claw-code] diff --git a/rust/crates/commands/src/lib.rs b/rust/crates/commands/src/lib.rs index 24233580..064aed5a 100644 --- a/rust/crates/commands/src/lib.rs +++ b/rust/crates/commands/src/lib.rs @@ -2606,6 +2606,13 @@ pub fn handle_skills_slash_command(args: Option<&str>, cwd: &Path) -> std::io::R .into_iter() .filter(|s| s.name.to_lowercase() == name_raw) .collect(); + // #805: text-mode show must return an error when skill not found (parity with JSON) + if matched.is_empty() { + return Err(std::io::Error::new( + std::io::ErrorKind::NotFound, + format!("skill '{name_raw}' not found\nRun `claw skills list` to see available skills."), + )); + } Ok(render_skills_report(&matched)) } Some("install") => Ok(render_skills_usage(Some("install"))),