Inline Sub-Agents

An inline sub-agent is a named agent definition embedded directly in a workflow markdown file. Instead of creating a separate agent file, you define the agent’s frontmatter and instructions in a dedicated section of the same workflow file.

Start a sub-agent block with a level-2 heading in the following form:

## agent: `name`

When a matching ## end agent: \name`marker is present, the block continues until that marker even if the block contains other##headings. Without an explicit end marker, the block continues until the next##` heading or end of file.

Add a closing heading to bound the block explicitly instead of relying on the next ## heading or EOF:

## agent: `name`
...
## end agent: `name`
## agent: