Skip to main content

telos_agent/orchestration/subagent/
builtins.rs

1use crate::orchestration::subagent::definition::{AgentDefinition, AgentSource};
2
3pub fn builtin_agents() -> Vec<AgentDefinition> {
4    let mut general = AgentDefinition::new(
5        "general-purpose",
6        "Use this agent for general multi-step work when no specialized agent fits.",
7        "You are a general-purpose subagent. Complete only the delegated task. Use the provided scope and constraints, avoid unrelated work, and report concise results with key files and any blockers.",
8        AgentSource::BuiltIn,
9    );
10    general.allowed_tools = vec!["*".into()];
11
12    let mut explore = AgentDefinition::new(
13        "Explore",
14        "Use this agent for broad read-only codebase exploration and research.",
15        "You are an explore agent. Search and analyze existing code. Do not edit files. Report findings with file paths, concise evidence, and any uncertainty. Do not duplicate unrelated investigation.",
16        AgentSource::BuiltIn,
17    );
18    explore.allowed_tools = vec![
19        "Read".into(),
20        "Grep".into(),
21        "Glob".into(),
22        "WebFetch".into(),
23        "WebSearch".into(),
24        "Bash".into(),
25    ];
26    explore.disallowed_tools = vec!["Write".into(), "Edit".into(), "subagent".into()];
27    explore.skills = vec!["explore".into()];
28
29    let mut plan = AgentDefinition::new(
30        "Plan",
31        "Use this agent to explore requirements and produce an implementation plan without editing files.",
32        "You are a planning agent. Explore the repository, identify constraints, and produce an actionable implementation plan. Do not modify files. Keep the plan scoped to the delegated objective.",
33        AgentSource::BuiltIn,
34    );
35    plan.allowed_tools = explore.allowed_tools.clone();
36    plan.disallowed_tools = explore.disallowed_tools.clone();
37    plan.skills = vec!["brainstorm".into(), "explore".into()];
38
39    let mut verification = AgentDefinition::new(
40        "Verification",
41        "Use this agent to run checks, inspect failures, and verify completed work.",
42        "You are a verification agent. Run relevant checks, inspect failures carefully, and report exact verification evidence. Do not rubber-stamp work; explain any unverified risk.",
43        AgentSource::BuiltIn,
44    );
45    verification.allowed_tools = vec![
46        "Read".into(),
47        "Grep".into(),
48        "Glob".into(),
49        "Bash".into(),
50        "WebFetch".into(),
51        "WebSearch".into(),
52    ];
53    verification.skills = vec!["verify".into()];
54
55    vec![general, explore, plan, verification]
56}
57
58#[cfg(test)]
59mod tests {
60    use super::*;
61
62    #[test]
63    fn builtin_agents_have_descriptions_and_prompts() {
64        let agents = builtin_agents();
65        assert!(agents.iter().all(|agent| !agent.description.is_empty()));
66        assert!(agents.iter().all(|agent| !agent.system_prompt.is_empty()));
67    }
68
69    #[test]
70    fn builtin_agents_do_not_cap_tool_iterations() {
71        let agents = builtin_agents();
72        assert!(agents.iter().all(|agent| agent.max_iterations.is_none()));
73    }
74}