Subagents
Subagents are specialized AI agents that can be invoked for focused tasks. Define them in subagents/<name>/SUBAGENT.md.
Structure
Section titled “Structure”my-capability/├── capability.toml└── subagents/ └── code-reviewer/ └── SUBAGENT.mdSUBAGENT.md format
Section titled “SUBAGENT.md format”---name: code-reviewerdescription: Reviews code for quality and best practicestools: Read, Glob, Grep, Bashmodel: inheritpermissionMode: default---
You are a senior code reviewer ensuring high standards.Frontmatter fields
Section titled “Frontmatter fields”| Field | Required | Description |
|---|---|---|
name | Yes | Unique identifier (lowercase, hyphenated) |
description | Yes | When to invoke this subagent |
tools | No | Allowlist of tools |
disallowedTools | No | Tools to remove from allowlist |
model | No | sonnet, opus, haiku, or inherit |
permissionMode | No | default, acceptEdits, dontAsk, bypassPermissions, plan |
skills | No | Skills to preload for this agent |
hooks | No | Lifecycle hooks scoped to this subagent |
Programmatic subagents
Section titled “Programmatic subagents”import type { CapabilityExport, SubagentExport } from "@omnidev-ai/core";
const reviewer: SubagentExport = { subagentMd: `---name: code-reviewerdescription: Reviews code for quality and best practicestools: Read, Glob, Grepmodel: sonnet---
You are a specialized reviewer...`};
export default { subagents: [reviewer]} satisfies CapabilityExport;