Skip to content

Commit 264fdc2

Browse files
committed
Retire the stale bare-skill dispatch backlog item
ROADMAP ultraworkers#36 remained open even though current main already dispatches bare skill names in the REPL through skill resolution instead of forwarding them to the model. This change adds a direct regression test for that behavior and marks the backlog item done with fresh verification evidence. Constraint: User required fresh cargo fmt, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace before closeout Rejected: Leave ultraworkers#36 open because the implementation already existed | keeps the immediate backlog inaccurate and invites duplicate work Confidence: high Scope-risk: narrow Reversibility: clean Directive: Reopen ultraworkers#36 only with a fresh repro showing a listed project skill still falls through to plain prompt handling on current main Tested: cargo fmt --all --check; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace Not-tested: No interactive manual REPL session beyond the new bare-skill unit coverage
1 parent a4921cb commit 264fdc2

2 files changed

Lines changed: 70 additions & 21 deletions

File tree

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ Model name prefix now wins unconditionally over env-var presence. Regression tes
437437

438438
35. **OpenAI gpt-5.x requires max_completion_tokens not max_tokens****done (verified 2026-04-11):** current `main` already carries the Rust-side OpenAI-compat fix. `build_chat_completion_request()` in `rust/crates/api/src/providers/openai_compat.rs` switches the emitted key to `"max_completion_tokens"` whenever the wire model starts with `gpt-5`, while older models still use `"max_tokens"`. Regression test `gpt5_uses_max_completion_tokens_not_max_tokens()` proves `gpt-5.2` emits `max_completion_tokens` and omits `max_tokens`. Re-verified against current `origin/main` `d40929ca`: `cargo test -p api gpt5_uses_max_completion_tokens_not_max_tokens -- --nocapture` passes. Historical proof: `eb044f0a` landed the request-field switch plus regression test on 2026-04-09. Source: rklehm in #claw-code 2026-04-09.
439439

440-
36. **Custom/project skill invocation disconnected from skill discovery** -- dogfooded 2026-04-09. /skills lists custom skills (e.g. caveman) but bare skill-name invocation does not dispatch them; falls through to plain model prompt. Fix: audit classify_skills_slash_command, ensure any skill listed by /skills has a deterministic invocation path, or document the correct syntax. Source: gaebal-gajae dogfood 2026-04-09.
440+
36. **Custom/project skill invocation disconnected from skill discovery** **done (verified 2026-04-11):** current `main` already routes bare-word skill input in the REPL through `resolve_skill_invocation()` instead of forwarding it to the model. `rust/crates/rusty-claude-cli/src/main.rs` now treats a leading bare token that matches a known skill name as `/skills <input>`, while `rust/crates/commands/src/lib.rs` validates the skill against discovered project/user skill roots and reports available-skill guidance on miss. Fresh regression coverage proves the known-skill dispatch path and the unknown/non-skill bypass. Historical proof: `8d0308ee` landed the REPL dispatch fix. Source: gaebal-gajae dogfood 2026-04-09.
441441

442442
37. **Claude subscription login path should be removed, not deprecated** -- dogfooded 2026-04-09. Official auth should be API key only (`ANTHROPIC_API_KEY`) or OAuth bearer token via `ANTHROPIC_AUTH_TOKEN`; the local `claw login` / `claw logout` subscription-style flow created legal/billing ambiguity and a misleading saved-OAuth fallback. **Done (verified 2026-04-11):** removed the direct `claw login` / `claw logout` CLI surface, removed `/login` and `/logout` from shared slash-command discovery, changed both CLI and provider startup auth resolution to ignore saved OAuth credentials, and updated auth diagnostics to point only at `ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN`. Verification: targeted `commands`, `api`, and `rusty-claude-cli` tests for removed login/logout guidance and ignored saved OAuth all pass, and `cargo check -p api -p commands -p rusty-claude-cli` passes. Source: gaebal-gajae policy decision 2026-04-09.
443443

rust/crates/rusty-claude-cli/src/main.rs

Lines changed: 69 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,22 @@ fn removed_auth_surface_error(command_name: &str) -> String {
778778
)
779779
}
780780

781+
fn try_resolve_bare_skill_prompt(cwd: &Path, trimmed: &str) -> Option<String> {
782+
let bare_first_token = trimmed.split_whitespace().next().unwrap_or_default();
783+
let looks_like_skill_name = !bare_first_token.is_empty()
784+
&& !bare_first_token.starts_with('/')
785+
&& bare_first_token
786+
.chars()
787+
.all(|c| c.is_alphanumeric() || c == '-' || c == '_');
788+
if !looks_like_skill_name {
789+
return None;
790+
}
791+
match resolve_skill_invocation(cwd, Some(trimmed)) {
792+
Ok(SkillSlashDispatch::Invoke(prompt)) => Some(prompt),
793+
_ => None,
794+
}
795+
}
796+
781797
fn join_optional_args(args: &[String]) -> Option<String> {
782798
let joined = args.join(" ");
783799
let trimmed = joined.trim();
@@ -2977,22 +2993,12 @@ fn run_repl(
29772993
// Bare-word skill dispatch: if the first token of the input
29782994
// matches a known skill name, invoke it as `/skills <input>`
29792995
// rather than forwarding raw text to the LLM (ROADMAP #36).
2980-
let bare_first_token = trimmed.split_whitespace().next().unwrap_or_default();
2981-
let looks_like_skill_name = !bare_first_token.is_empty()
2982-
&& !bare_first_token.starts_with('/')
2983-
&& bare_first_token
2984-
.chars()
2985-
.all(|c| c.is_alphanumeric() || c == '-' || c == '_');
2986-
if looks_like_skill_name {
2987-
let cwd = std::env::current_dir().unwrap_or_default();
2988-
if let Ok(SkillSlashDispatch::Invoke(prompt)) =
2989-
resolve_skill_invocation(&cwd, Some(&trimmed))
2990-
{
2991-
editor.push_history(input);
2992-
cli.record_prompt_history(&trimmed);
2993-
cli.run_turn(&prompt)?;
2994-
continue;
2995-
}
2996+
let cwd = std::env::current_dir().unwrap_or_default();
2997+
if let Some(prompt) = try_resolve_bare_skill_prompt(&cwd, &trimmed) {
2998+
editor.push_history(input);
2999+
cli.record_prompt_history(&trimmed);
3000+
cli.run_turn(&prompt)?;
3001+
continue;
29963002
}
29973003
editor.push_history(input);
29983004
cli.record_prompt_history(&trimmed);
@@ -8176,10 +8182,11 @@ mod tests {
81768182
resolve_repl_model, resolve_session_reference, response_to_events,
81778183
resume_supported_slash_commands, run_resume_command, short_tool_id,
81788184
slash_command_completion_candidates_with_sessions, status_context,
8179-
summarize_tool_payload_for_markdown, validate_no_args, write_mcp_server_fixture, CliAction,
8180-
CliOutputFormat, CliToolExecutor, GitWorkspaceSummary, InternalPromptProgressEvent,
8181-
InternalPromptProgressState, LiveCli, LocalHelpTopic, PromptHistoryEntry, SlashCommand,
8182-
StatusUsage, DEFAULT_MODEL, LATEST_SESSION_REFERENCE, STUB_COMMANDS,
8185+
summarize_tool_payload_for_markdown, try_resolve_bare_skill_prompt, validate_no_args,
8186+
write_mcp_server_fixture, CliAction, CliOutputFormat, CliToolExecutor, GitWorkspaceSummary,
8187+
InternalPromptProgressEvent, InternalPromptProgressState, LiveCli, LocalHelpTopic,
8188+
PromptHistoryEntry, SlashCommand, StatusUsage, DEFAULT_MODEL, LATEST_SESSION_REFERENCE,
8189+
STUB_COMMANDS,
81838190
};
81848191
use api::{ApiError, MessageResponse, OutputContentBlock, Usage};
81858192
use plugins::{
@@ -8420,6 +8427,16 @@ mod tests {
84208427
}
84218428
}
84228429

8430+
fn write_skill_fixture(root: &Path, name: &str, description: &str) {
8431+
let skill_dir = root.join(name);
8432+
fs::create_dir_all(&skill_dir).expect("skill dir should exist");
8433+
fs::write(
8434+
skill_dir.join("SKILL.md"),
8435+
format!("---\nname: {name}\ndescription: {description}\n---\n\n# {name}\n"),
8436+
)
8437+
.expect("skill file should write");
8438+
}
8439+
84238440
fn write_plugin_fixture(root: &Path, name: &str, include_hooks: bool, include_lifecycle: bool) {
84248441
fs::create_dir_all(root.join(".claude-plugin")).expect("manifest dir");
84258442
if include_hooks {
@@ -9713,6 +9730,38 @@ mod tests {
97139730
assert!(help.contains("works with --resume SESSION.jsonl"));
97149731
}
97159732

9733+
#[test]
9734+
fn bare_skill_dispatch_resolves_known_project_skill_to_prompt() {
9735+
let _guard = env_lock();
9736+
let workspace = temp_dir();
9737+
write_skill_fixture(
9738+
&workspace.join(".codex").join("skills"),
9739+
"caveman",
9740+
"Project skill fixture",
9741+
);
9742+
9743+
let prompt = try_resolve_bare_skill_prompt(&workspace, "caveman sharpen club")
9744+
.expect("known bare skill should dispatch");
9745+
assert_eq!(prompt, "$caveman sharpen club");
9746+
9747+
fs::remove_dir_all(workspace).expect("workspace should clean up");
9748+
}
9749+
9750+
#[test]
9751+
fn bare_skill_dispatch_ignores_unknown_or_non_skill_input() {
9752+
let _guard = env_lock();
9753+
let workspace = temp_dir();
9754+
fs::create_dir_all(&workspace).expect("workspace should exist");
9755+
9756+
assert_eq!(
9757+
try_resolve_bare_skill_prompt(&workspace, "not-a-known-skill do thing"),
9758+
None
9759+
);
9760+
assert_eq!(try_resolve_bare_skill_prompt(&workspace, "/status"), None);
9761+
9762+
fs::remove_dir_all(workspace).expect("workspace should clean up");
9763+
}
9764+
97169765
#[test]
97179766
fn repl_help_includes_shared_commands_and_exit() {
97189767
let help = render_repl_help();

0 commit comments

Comments
 (0)