diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 7a6a1be4926..e3dd96835c7 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -55,7 +55,7 @@ use anyhow::Result; #[cfg(feature = "audio")] use audio::{Audio, Sound}; use chrono::{DateTime, Utc}; -use client::UserStore; +use client::{UserStore, zed_urls}; use cloud_api_types::Plan; use collections::HashMap; use editor::{Editor, MultiBuffer}; @@ -4934,9 +4934,20 @@ impl AgentPanel { if global_agents_md_loaded { let workspace = workspace.clone(); - menu = menu.entry( - "Open Global AGENTS.md", - None, + + menu = menu.custom_entry( + |_window, _cx| { + h_flex() + .w_full() + .gap_1() + .child(Label::new("Open Global Rules")) + .child( + Label::new("(AGENTS.md)") + .color(Color::Muted) + .size(LabelSize::Small), + ) + .into_any_element() + }, move |window, cx| { workspace .update(cx, |workspace, cx| { @@ -4959,9 +4970,19 @@ impl AgentPanel { if let Some(path) = project_agents_md_path.clone() { let workspace = workspace.clone(); - menu = menu.entry( - "Open Project AGENTS.md", - None, + menu = menu.custom_entry( + |_window, _cx| { + h_flex() + .w_full() + .gap_1() + .child(Label::new("Open Project Rules")) + .child( + Label::new("(AGENTS.md)") + .color(Color::Muted) + .size(LabelSize::Small), + ) + .into_any_element() + }, move |window, cx| { let path = path.clone(); workspace @@ -4983,6 +5004,10 @@ impl AgentPanel { ); } + menu = menu.entry("Rules Library", None, |_window, cx| { + cx.open_url(&zed_urls::rules_docs(cx)); + }); + menu = menu.separator(); } diff --git a/crates/client/src/zed_urls.rs b/crates/client/src/zed_urls.rs index 70ff9537d7a..8cd284da035 100644 --- a/crates/client/src/zed_urls.rs +++ b/crates/client/src/zed_urls.rs @@ -56,6 +56,10 @@ pub fn skills_docs(cx: &App) -> String { format!("{server_url}/docs/ai/skills", server_url = server_url(cx)) } +pub fn rules_docs(cx: &App) -> String { + format!("{server_url}/docs/ai/rules", server_url = server_url(cx)) +} + /// Returns the URL to Zed's ACP registry blog post. pub fn acp_registry_blog(cx: &App) -> String { format!(