编辑 | blame | 历史 | 原始文档

Agent Definition Schema

Store each Agent at .ai/agents/<agent-name>.md, using lowercase hyphen-case.

Required headings:

# <Agent Name>
## role
## input
## output
## decision
## execution
## return_contract

execution declares capability, not a thread already started:

default_mode: inline
allowed_modes:
  - inline
  - subagent-readonly
  - subagent-shared
  - subagent-worktree
parallelizable: false
write_scope: []
requires: []
conflicts_with: []
failure_policy: return-partial | retry-once | escalate

Use only modes the role can safely perform. A read-only role has an empty write_scope and never declares a writable mode. The return_contract must use the unified fields from subagent-execution.md.

Make role, input, output, and decision specific enough for deterministic routing. Do not copy the root policy into Agent files.