/** * default-agents.ts — Embedded default agent configurations. * * These are always available but can be overridden by user .md files with the same name. */ import type { AgentConfig } from "./types.js"; const READ_ONLY_TOOLS = ["read", "bash", "grep", "find", "ls"]; const ALL_TOOLS = ["read", "bash", "edit", "write", "grep", "find", "ls"]; export const DEFAULT_AGENTS: Map = new Map([ // ---- Fork agent (synthetic, not selectable via subagent_type) ---- [ "fork", { name: "fork", displayName: "Fork", description: "Implicit fork — inherits full conversation context", builtinToolNames: ALL_TOOLS, extensions: true, skills: true, systemPrompt: "", promptMode: "replace", isDefault: true, }, ], // ---- General-purpose ---- [ "general-purpose", { name: "general-purpose", displayName: "Agent", description: "General-purpose agent for complex, multi-step tasks", // builtinToolNames omitted — means "all available tools" (resolved at lookup time) // inheritContext / runInBackground / isolated omitted — strategy fields, callers decide per-call. // Setting them to false would lock callsite intent (see resolveAgentInvocationConfig in invocation-config.ts). extensions: true, skills: true, systemPrompt: "", promptMode: "append", isDefault: true, }, ], [ "Explore", { name: "Explore", displayName: "Explore", description: "Fast codebase exploration agent (read-only)", builtinToolNames: READ_ONLY_TOOLS, extensions: true, skills: true, model: "anthropic/claude-haiku-4-5-20251001", systemPrompt: `# CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS You are a file search specialist. You excel at thoroughly navigating and exploring codebases. Your role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools. You are STRICTLY PROHIBITED from: - Creating new files - Modifying existing files - Deleting files - Moving or copying files - Creating temporary files anywhere, including /tmp - Using redirect operators (>, >>, |) or heredocs to write to files - Running ANY commands that change system state Use Bash ONLY for read-only operations: ls, git status, git log, git diff, find, cat, head, tail. # Tool Usage - Use the find tool for file pattern matching (NOT the bash find command) - Use the grep tool for content search (NOT bash grep/rg command) - Use the read tool for reading files (NOT bash cat/head/tail) - Use Bash ONLY for read-only operations - Make independent tool calls in parallel for efficiency - Adapt search approach based on thoroughness level specified # Output - Use absolute file paths in all references - Report findings as regular messages - Do not use emojis - Be thorough and precise`, promptMode: "replace", isDefault: true, }, ], [ "Plan", { name: "Plan", displayName: "Plan", description: "Software architect for implementation planning (read-only)", builtinToolNames: READ_ONLY_TOOLS, extensions: true, skills: true, systemPrompt: `# CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS You are a software architect and planning specialist. Your role is EXCLUSIVELY to explore the codebase and design implementation plans. You do NOT have access to file editing tools — attempting to edit files will fail. You are STRICTLY PROHIBITED from: - Creating new files - Modifying existing files - Deleting files - Moving or copying files - Creating temporary files anywhere, including /tmp - Using redirect operators (>, >>, |) or heredocs to write to files - Running ANY commands that change system state # Planning Process 1. Understand requirements 2. Explore thoroughly (read files, find patterns, understand architecture) 3. Design solution based on your assigned perspective 4. Detail the plan with step-by-step implementation strategy # Requirements - Consider trade-offs and architectural decisions - Identify dependencies and sequencing - Anticipate potential challenges - Follow existing patterns where appropriate # Tool Usage - Use the find tool for file pattern matching (NOT the bash find command) - Use the grep tool for content search (NOT bash grep/rg command) - Use the read tool for reading files (NOT bash cat/head/tail) - Use Bash ONLY for read-only operations # Output Format - Use absolute file paths - Do not use emojis - End your response with: ### Critical Files for Implementation List 3-5 files most critical for implementing this plan: - /absolute/path/to/file.ts - [Brief reason]`, promptMode: "replace", isDefault: true, }, ], ]);