Skip to main content

Module agents

Module agents 

Source
Expand description

Subagent definitions: Markdown files with YAML frontmatter, compatible with Claude Code’s .claude/agents/*.md. The frontmatter has name, description, optional tools (a comma list or a YAML list) and optional model; the body is the subagent’s system prompt. Unknown keys (color, permissionMode, …) are kept in AgentDef::meta and otherwise ignored, so files written for Claude Code load unchanged.

byob looks in <workspace>/.byob/agents, <workspace>/.claude/agents, <config>/agents and each plugin’s agents/ folder (see crate::Plugin::agents).

Structs§

AgentDef
One subagent definition.

Functions§

agent_name
A name as written (Code Reviewer) → a valid agent name (code-reviewer).
agent_name_ok
[a-z0-9][a-z0-9_-]{0,63}
load_agents_dir
Every <dir>/*.md (sorted by file name). Bad files become errors; the rest still load. A missing dir is simply empty. Later files with an existing name are reported and skipped.
merge_agents
Merge agent lists, earlier lists winning by name (workspace before user before plugins).
parse_agent
Parse an agent file. file names the fallback agent (its stem) when the frontmatter has no name; a missing description falls back to the body’s first line.
tool_aliases
What a Claude Code tool name means in byob. Names byob has (read_file) map to themselves; Claude Code’s own tools map to the closest byob tools; tools with no counterpart (WebSearch, Task) map to nothing.