用途:Codex CLI 不会像 Claude 插件那样自动发现 agent 文件,本技能用于在 Codex 中重建 agent 行为,并标准化 agent card 格式。
主要能力:将 agent 行为拆分为四部分——定义角色与工作流的 prompt 文件、设置模型/沙箱/审批默认值的 Codex config profile、描述何时使用及如何启动 agent 的 skill、用于隔离执行的 worker 进程(codex-subagent、codex exec 或 worker-dispatch)。
Agent card 格式:存放于 agents/<agent-name>.md,YAML frontmatter 加 prompt 正文。frontmatter 仅供人与校验器使用,Codex 不会自动读取。必填字段为 name(kebab-case)与 description(何时使用);推荐字段包括 profile、model、sandbox_mode、approval_policy、tools(仅作提示,实际约束靠沙箱与审批策略)。
运行方式:首选 codex-subagent 运行器,如 codex-subagent pr-reviewer <<'EOF' 后接任务上下文;回退方案为手动 codex exec,用 awk 提取正文后通过管道传给 codex exec -p review-worker -。Profile 定义在 ~/.codex/config.toml 的 [profiles.名称] 段中,例如 model、sandbox_mode、approval_policy。
触发:要让 agent 自动启用,可创建描述触发条件与调用方式的 skill,其中说明如何运行 agent card 或派生 worker,例如 description 写明当用户请求 PR 审查或代码审计时运行 pr-reviewer agent card。
校验与参考:使用 scripts/validate-agent.sh 校验必填字段与 prompt 长度;references 下提供 system-prompt-design、triggering-examples、agent-creation-system-prompt 等文档,examples 下提供 agent-creation-prompt 与 complete-agent-examples 模板。
限制:agent card 的 frontmatter 不被 Codex 自动解析,自动触发需自行编写 skill;具体模型名、沙箱模式与审批策略等取值以实际环境与 Codex 配置为准,资料未提供安装命令、收费信息与平台支持范围。