Skip to main content

Module agent_defs

Module agent_defs 

Source
Expand description

Custom agent definitions loaded from .recursive/agents/**/*.md files.

Each markdown file has optional YAML frontmatter delimited by --- at the start of the file. The frontmatter declares:

FieldRequiredDescription
nameyesUnique agent name (must match directory)
system_promptyesSystem prompt for the agent
allowed_toolsnoArray of tool names; empty = read-only

After the closing ---, the remaining markdown body is treated as human-readable documentation and is ignored by the runtime.

Example (code-reviewer.md):

---
name: code-reviewer
system_prompt: |
  You are an expert code reviewer.  Examine diffs and flag:
  - correctness issues
  - performance concerns
  - security vulnerabilities
allowed_tools:
  - Read
  - Glob
  - Grep
---

# Code Reviewer
Reviews pull requests for quality and security.

§Resolution in AgentTool

When a manifest entry includes a definition field (instead of — or in addition to — system_prompt), the definition is resolved from the loaded registry and merged with any inline overrides. This lets callers write:

{
  "manifest": {
    "reviewer": { "definition": "code-reviewer" }
  }
}

Structs§

AgentDefinition
A single agent definition parsed from a .recursive/agents/*.md file.
AgentDefinitions
A read-only registry of named agent definitions loaded from disk.