From 461ef4c43589c6ca68176c180fd04f2755c9f036 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Thu, 23 Apr 2026 13:43:01 -0700 Subject: feat: Add skill discovery, loading, and invocation (#3444) Adds a skills system that lets users define reusable LLM instructions as `SKILL.md` files with YAML frontmatter. --- crates/atuin-ai/src/stream.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'crates/atuin-ai/src/stream.rs') diff --git a/crates/atuin-ai/src/stream.rs b/crates/atuin-ai/src/stream.rs index e7155a08..d921b39c 100644 --- a/crates/atuin-ai/src/stream.rs +++ b/crates/atuin-ai/src/stream.rs @@ -63,7 +63,10 @@ impl ChatRequest { capabilities: &AiCapabilities, invocation_id: String, ) -> Self { - let mut caps = vec!["client_invocations".to_string()]; + let mut caps = vec![ + "client_invocations".to_string(), + "client_v1_load_skill".to_string(), + ]; if capabilities.enable_history_search.unwrap_or(true) { caps.push("client_v1_atuin_history".to_string()); } @@ -93,6 +96,7 @@ impl ChatRequest { } } +#[allow(clippy::too_many_arguments)] pub(crate) fn create_chat_stream( hub_address: String, token: String, @@ -101,6 +105,8 @@ pub(crate) fn create_chat_stream( send_cwd: bool, last_command: Option, user_contexts: Vec, + skill_summaries: Vec, + skill_overflow: Option, ) -> std::pin::Pin> + Send>> { Box::pin(async_stream::stream! { ensure_crypto_provider(); @@ -124,6 +130,13 @@ pub(crate) fn create_chat_stream( config["user_contexts"] = serde_json::json!(user_contexts); } + if !skill_summaries.is_empty() { + config["skills"] = serde_json::json!(skill_summaries); + if let Some(ref overflow) = skill_overflow { + config["skills_overflow"] = serde_json::json!(overflow); + } + } + let mut request_body = serde_json::json!({ "messages": request.messages, "context": context, -- cgit v1.3.1