From 9a226421a1a18cb5d65b8a63c9f38a2a65b73130 Mon Sep 17 00:00:00 2001 From: jeffa-block <233853744+jeffa-block@users.noreply.github.com> Date: Fri, 27 Mar 2026 08:23:01 +1100 Subject: [PATCH] fix: use platform-appropriate commands in developer extension instructions (#7898) --- .../platform_extensions/developer/mod.rs | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/crates/goose/src/agents/platform_extensions/developer/mod.rs b/crates/goose/src/agents/platform_extensions/developer/mod.rs index 9633d5ed..b6cee198 100644 --- a/crates/goose/src/agents/platform_extensions/developer/mod.rs +++ b/crates/goose/src/agents/platform_extensions/developer/mod.rs @@ -29,13 +29,23 @@ pub struct DeveloperClient { tree_tool: Arc, } -impl DeveloperClient { - pub fn new(_context: PlatformExtensionContext) -> Result { - let info = InitializeResult::new( - ServerCapabilities::builder().enable_tools().build(), - ) - .with_server_info(Implementation::new(EXTENSION_NAME, "1.0.0").with_title("Developer")) - .with_instructions(indoc! {" +fn developer_instructions() -> &'static str { + if cfg!(windows) { + indoc! {" + Use the developer extension to build software and operate a terminal. + + Make sure to use the tools *efficiently* - reading all the content you need in as few + iterations as possible and then making the requested edits or running commands. You are + responsible for managing your context window, and to minimize unnecessary turns which + cost the user money. + + For editing software, prefer the flow of using tree to understand the codebase structure + and file sizes. When you need to search, prefer findstr or Select-String (via shell). + Then use type or Get-Content to gather the context you need, always reading before + editing. Use write and edit to efficiently make changes. Test and verify as appropriate. + "} + } else { + indoc! {" Use the developer extension to build software and operate a terminal. Make sure to use the tools *efficiently* - reading all the content you need in as few @@ -47,7 +57,15 @@ impl DeveloperClient { and file sizes. When you need to search, prefer rg which correctly respects gitignored content. Then use cat or sed to gather the context you need, always reading before editing. Use write and edit to efficiently make changes. Test and verify as appropriate. - "}); + "} + } +} + +impl DeveloperClient { + pub fn new(_context: PlatformExtensionContext) -> Result { + let info = InitializeResult::new(ServerCapabilities::builder().enable_tools().build()) + .with_server_info(Implementation::new(EXTENSION_NAME, "1.0.0").with_title("Developer")) + .with_instructions(developer_instructions()); Ok(Self { info,