Expand description
agent.md frontmatter + body loader — turns agent-profiles
agents/*.md files into AgentDefs.
§Input format
---
name: impl-lead
description: Implementation worker ...
model: sonnet
effort: high
tools: Read, Edit, Write, Grep, Glob
permissionMode: bypassPermissions
memory: user
abtest: true
---
<Markdown system prompt body>§Output
A Vec<AgentDef> — each entry carries profile: Some(AgentProfile { ... }), kind defaults to AgentKind::Operator, and spec is
Value::Null. The backend configuration (spec) is injected
separately by the caller — on the Operator-construction path.
§Scope
- Only YAML frontmatter delimited by
---is accepted. TOML and JSON are not supported. toolsaccepts both a CSV string ("Read, Edit") and a YAML array (["Read", "Edit"]).- Any field beyond the known set (
name/description/model/effort/tools) is dumped into anextrasValue— a future-proof carry for C-C-specific fields. - The body is kept verbatim, from just after the closing
---to the end of the file.
Enums§
- Load
Error - Errors specific to the agent.md loader.
Functions§
- compute_
body_ hash - Compute the content hash of an agent body (its
system_prompt). - load_
dir - Load every
*.mdunderdir. Sorted ascending by file name. - load_
file - Turn a single
agent.mdfile into anAgentDef. - parse
- Turn the text of an agent.md into an
AgentDef.pubso unit tests can reach it.kindmust be provided by the caller — same contract asload_file.