Module subagent

Module subagent 

Source
Expand description

Subagent configuration schema and parsing

Subagents are specialized AI agents that can be invoked for specific tasks. They are defined as Markdown files with YAML frontmatter and loaded from:

  • Project level: .vtcode/agents/ (highest priority)
  • User level: ~/.vtcode/agents/ (lower priority)
  • Built-in: shipped with the binary (lowest priority)

§Example subagent file

---
name: code-reviewer
description: Expert code review specialist. Use after writing or modifying code.
tools: read_file, grep_file, list_files
model: inherit
permission_mode: default
skills: rust-patterns, security-review
---

You are a senior code reviewer ensuring high standards of code quality.
Focus on readability, security, and best practices.

Structs§

SubagentConfig
Complete subagent configuration
SubagentFrontmatter
YAML frontmatter parsed from subagent markdown file
SubagentsConfig
Configuration for the subagent system in vtcode.toml

Enums§

SubagentModel
Model selection for subagent
SubagentParseError
Errors that can occur when parsing subagent configurations
SubagentPermissionMode
Permission mode for subagent tool execution
SubagentSource
Source location of a subagent definition

Functions§

discover_subagents_in_dir
Discover all subagent files in a directory
load_subagent_from_file
Load subagent from a markdown file