Agent Mode Enhancements
• Agent prompts are now embedded within the g3 binary • README.md - Added new "Agent Mode" section documenting: • All 7 built-in agents with their focus areas • Usage examples (--list-agents, --agent <name>) • How to create custom workspace agents Behavior 1. Workspace agents take priority - If agents/<name>.md exists in the workspace, it's used 2. Embedded fallback - If no workspace agent exists, the embedded version is used 3. Portability - g3 binary now works on any repo without needing the agents/ directory 4. Discoverability - g3 --list-agents shows all available agents and their source
This commit is contained in:
@@ -4,6 +4,7 @@ pub mod filter_json;
|
||||
pub mod metrics;
|
||||
pub mod project_files;
|
||||
pub mod streaming_markdown;
|
||||
pub mod embedded_agents;
|
||||
|
||||
mod accumulative;
|
||||
mod agent_mode;
|
||||
@@ -44,6 +45,22 @@ pub async fn run() -> Result<()> {
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
// Check if --list-agents was requested
|
||||
if cli.list_agents {
|
||||
let workspace_dir = cli.workspace.clone().unwrap_or_else(|| std::env::current_dir().unwrap_or_default());
|
||||
let agents = embedded_agents::get_available_agents(&workspace_dir);
|
||||
println!("Available agents:");
|
||||
let mut names: Vec<_> = agents.keys().collect();
|
||||
names.sort();
|
||||
for name in names {
|
||||
let source = if agents[name] { "workspace" } else { "embedded" };
|
||||
println!(" {} ({})", name, source);
|
||||
}
|
||||
println!("\nUse: g3 --agent <name> [task]");
|
||||
println!("Workspace agents override embedded agents with the same name.");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Check if planning mode is enabled
|
||||
if cli.planning {
|
||||
let codepath = cli.codepath.clone();
|
||||
|
||||
Reference in New Issue
Block a user