Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Writing a subagent

A subagent is one markdown file: YAML frontmatter with its name, summary, description, and tool surface, followed by a body used as its system prompt. Veyyon reads the file at startup, lists the subagent in /settings → Subagents, and makes it available to @ mentions and the task tool according to its availability setting.

Create a subagent in Settings

Open /settings → Subagents → Manage Subagents and select + New subagent…. Enter a lowercase name, one sentence describing what the subagent does, and an existing subagent to copy the initial tool list from. Veyyon generates a draft with prompts/subagent/subagent-creation-architect.md, previews the frontmatter and prompt, and writes ~/.veyyon/subagents/<name>.md when saved.

On any existing subagent’s page under /settings → Subagents → Manage Subagents, press e to open the definition in $EDITOR or d to duplicate it under a new name in ~/.veyyon/subagents/. Editing a bundled subagent writes the modified copy to ~/.veyyon/subagents/<name>.md.

Where the file goes

$ mkdir -p ~/.veyyon/subagents
$ $EDITOR ~/.veyyon/subagents/accessibility-reviewer.md

~/.veyyon/subagents/*.md is the directory Veyyon reads user-authored subagents from. Every profile reads that directory. Per-profile availability and model overrides are stored separately under subagent.agents.<name>.

Repository directories such as .veyyon/agents/ are not read, so a checked-in file cannot replace a bundled subagent by name.

Extensions ship subagents in their own agents/ directory, discovered from enabled extension roots.

The shape of the file

---
name: accessibility-reviewer
summary: Audit terminal UI contrast, focus indicators, and screen-reader labels
hint: component or screen to audit
description: Reviews terminal interfaces for accessibility problems and reports findings.
tools: read, search, bash
model: anthropic/claude-opus-4-5
thinkingLevel: high
---

You review terminal interfaces for accessibility problems.

Report each finding with the file, the line, and the input that reproduces it.
Report nothing you have not reproduced.

name and description are required; a file missing either is skipped. Every other field is optional.

FieldEffect
nameIdentifier used in @<name> mentions, task calls, and subagent.agents.<name>. Match the filename so the file and setting align.
summaryShort one-line label shown in /settings → Subagents, @ mention completion, and subagent.loading: summary. Derived from the first sentence of description when omitted.
hintComposer placeholder shown after @<name> in the input box.
descriptionFull routing description included in task when availability is auto and subagent.loading is full, or appended once per session when @<name> is mentioned and task does not already list it in full. State the work covered, not a job title.
toolsTools the subagent may call, as a list or comma-separated string. Omitted grants the session’s default tool set. yield is added whenever tools is present.
spawnsSubagents this subagent may spawn: a list, or * for any. Omitted allows no child spawns.
modelFallback chain used when neither the call, the subagent’s setting row, nor subagent.defaultModel sets a model. Omitted or inherit uses the spawning session’s live model.
thinkingLevelEffort used when neither the call, the subagent’s setting row, nor subagent.defaultEffort sets one: off, minimal, low, medium, high, xhigh, max, auto, or inherit. thinking is accepted as a synonym.
blockingtrue runs the subagent inline and waits for completion before returning to the parent turn.
autoloadSkillsSkills loaded into the subagent’s context at spawn.
readSummarizefalse makes read return verbatim file lines instead of structural summaries.
outputJSON Schema used to validate the subagent’s yield payload.

Two-word frontmatter keys accept camelCase or kebab-case (thinkingLevel or thinking-level, autoloadSkills or autoload-skills, readSummarize or read-summarize). Snake_case is ignored.

An unrecognized entry in tools with no mcp__ or extension prefix is reported at startup and grants no capability.

The body is the system prompt

Everything after the frontmatter is rendered with Handlebars as the worker’s system prompt. Write instructions directly for the worker: scope, file boundaries, verification steps, and expected output. The worker receives this prompt in place of the main session’s prompt.

Set availability

A newly discovered user subagent defaults to mention (On mention). You can invoke it immediately in a message with @accessibility-reviewer, without adding it to every turn’s task description.

To let the model choose the subagent on its own without a mention:

$ veyyon config set subagent.agents.accessibility-reviewer.availability auto

Or open /settings → Subagents → Manage Subagents, select accessibility-reviewer, and press Space to cycle Automatic (auto), On mention (mention), and Off (off). Press Enter on the row to configure its model, effort, and nested spawn policy, which take precedence over model: and thinkingLevel: in the markdown file.

Start from a bundled subagent

veyyon subagents unpack writes the bundled definitions (deep, quick, scout, reviewer, designer, librarian) to ~/.veyyon/subagents/ as markdown files.

$ veyyon subagents unpack --dir ./unpacked-subagents

--dir writes them to another directory so unedited copies stay outside ~/.veyyon/subagents/.

A file in ~/.veyyon/subagents/ with the same name as a bundled subagent overrides the bundled definition.

Verify discovery

Open /settings → Subagents → Manage Subagents. Each discovered subagent row shows its availability, resolved model, and capability marks (reads, runs, edits, spawns). Pressing Enter shows the source file path, tool list, output fields, and prompt preview.

A skipped file is reported at startup with the reason: missing name or description, unreadable file, or unknown tool name.