From 85ea8fe69ca674846e1d92abda13f9ff9a00f235 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Thu, 15 Jan 2026 06:43:42 +0530 Subject: [PATCH] Update project memory with agent-specific language prompts Document the new agent+language prompt injection feature including: - AGENT_LANGUAGE_PROMPTS static array location - get_agent_language_prompt() and get_agent_language_prompts_for_workspace_with_langs() - File naming pattern: prompts/langs/..md - Instructions for adding new agent+lang prompts --- analysis/memory.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/analysis/memory.md b/analysis/memory.md index c28e79a..faf1f1f 100644 --- a/analysis/memory.md +++ b/analysis/memory.md @@ -1,5 +1,5 @@ # Project Memory -> Updated: 2026-01-14T15:11:36Z | Size: 12.0k chars +> Updated: 2026-01-15T00:50:41Z | Size: 12.9k chars ### Remember Tool Wiring - `crates/g3-core/src/tools/memory.rs` [0..5000] - `execute_remember()`, `get_memory_path()`, `merge_memory()` @@ -211,4 +211,22 @@ Auto-detects programming languages in workspace and injects toolchain guidance. To add a new language: 1. Create `prompts/langs/.md` with toolchain guidance -2. Add entry to `LANGUAGE_PROMPTS` in `language_prompts.rs` with extensions \ No newline at end of file +2. Add entry to `LANGUAGE_PROMPTS` in `language_prompts.rs` with extensions + +### Agent-Specific Language Prompts +Injects agent+language-specific guidance when running in agent mode in a workspace with detected languages. + +- `crates/g3-cli/src/language_prompts.rs` + - `AGENT_LANGUAGE_PROMPTS` [21..26] - static array of (agent_name, lang_name, prompt_content) tuples + - `get_agent_language_prompt()` [115..121] - looks up prompt for specific agent+lang combo + - `get_agent_language_prompts_for_workspace()` [124..137] - uses `detect_languages()` then looks up agent-specific prompts + +- `crates/g3-cli/src/agent_mode.rs` + - Lines 149-159 - calls `get_agent_language_prompts_for_workspace()` and appends to system prompt + +- `prompts/langs/..md` - file naming pattern for agent+lang prompts + - `prompts/langs/carmack.racket.md` - Racket-specific guidance for carmack agent + +To add a new agent+lang prompt: +1. Create `prompts/langs/..md` +2. Add entry to `AGENT_LANGUAGE_PROMPTS` in `language_prompts.rs` with `include_str!` \ No newline at end of file