跳到正文
cccskills
免费在 GitHub 公开

subagent-output-schema-contract

Use when spawning an agent()/workpool() subagent with an outputSchema, or a task agent whose frontmatter sets structured: true, to reduce yield retry failures by stating the exact result envelope and required fields in the prompt.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md2.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Problem

When a subagent is spawned with an outputSchema, it must finish by calling the hidden yield tool with a result matching that schema. On a cold turn, models frequently get the wrapper or field names wrong on the first attempt:

  • Forgetting the required envelope: the result must be {"data": <schema-matching object>} on success or {"error": "<message>"} on failure — not the bare object.
  • Missing or misnamed required fields (e.g. a review-finding schema needing title/body/priority/confidence/file_path/line_start/line_end, or a research schema needing summary/architecture/files).
  • Using "result" as an incremental-yield section label instead of one of the schema's own top-level property names.

OMP's built-in retry loop (MAX_YIELD_RETRIES=3) recovers from this ~99% of the time, so it rarely loses work — but each failure burns one extra subagent turn (tokens + latency) that a clearer prompt avoids.

Practice

When calling agent() or workpool() with an outputSchema, append an explicit output-contract line to the task/prompt text (not just relying on the schema being attached mechanically):

Output contract: finish by calling yield with {"data": {...}} on success (or {"error": "<message>"} if you cannot complete the task). The data object must include these required fields verbatim: <list the schema's required top-level field names>. Do not wrap the object in an extra "result" key.

For schemas with nested/array sections (e.g. a findings[] array of review items), spell out the nested required fields too, since these are the most common source of mismatch.

This does not require any OMP config change — it is a parent-side prompting habit, applied every time an outputSchema is supplied to a spawned subagent.

Since omp 18.10.3, task() subagents return plain text (task.structured is false) and never call yield; apply this to task() only for agents whose frontmatter sets structured: true.

Non-fix

Do not attempt to "fix" this via ~/.omp/agent/config.yml or hooks — the yield envelope format and retry mechanism are implemented in upstream oh-my-pi's task executor (packages/coding-agent/src/task/executor.ts), not in user config. There is no dotfiles-side lever.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

2ndbrain

免费

Quick-save the last assistant response as a verbatim note in the 2ndBrain Obsidian vault (~/2ndBrain/quick-notes/<year>/). Use when the user asks to quick-save/save the last response to 2ndBrain, or invokes $2ndbrain or /skill:2ndbrain.

中文简介正在准备中。当前显示原文说明。

phatblat/dotfiles122026年10月20日 更新

Write commit messages under the agent-commits convention - a Conventional Commits fork with no chore catch-all, intent-only type tokens, facts in trailers, and legally-grounded AI provenance (Assisted-by, never Co-authored-by). Use when composing a commit in a repo whose commitlint.config.js extends agent-commits, when deciding between feat/fix/refactor/perf, or when recording AI participation.

中文简介正在准备中。当前显示原文说明。

phatblat/dotfiles122026年10月20日 更新

Coordinate multi-agent work through durable artifacts in git instead of chat. Use this whenever a task involves sending a message to another agent, agent mailboxes or handoffs, claiming work from a shared queue, notifying another agent or crew (OpenClaw, Grok Bot, Claude Code, Codex, Gas Town/Gas City workers) that work is ready, or whenever the user mentions the artifact bus, message bus, agent mail, beads mail, doorbells, or pings between agents — even if they don't say "bus" explicitly.

中文简介正在准备中。当前显示原文说明。

phatblat/dotfiles122026年10月20日 更新

aven

免费

Use aven to find tasks, update status, and leave durable handoff context.

中文简介正在准备中。当前显示原文说明。

phatblat/dotfiles122026年10月20日 更新

Plan, order and deliver a batch of backlog items (e.g. every High item) in a Conventional Docs repo, one decision, branch, worktree, draft PR, review and merge per item. Use when asked to work through the backlog, implement all items of a priority, or sequence several backlog items end to end.

中文简介正在准备中。当前显示原文说明。

phatblat/dotfiles122026年10月20日 更新

boris

免费

Codex workflow tips from Boris Cherny and the Codex team. Use when setting up Codex or optimizing workflows: parallel sessions, worktrees, plan mode, AGENTS.md, skills, subagents, hooks, MCP, permissions, and sandboxing.

中文简介正在准备中。当前显示原文说明。

phatblat/dotfiles122026年10月20日 更新

查看 phatblat 的全部技能

报告此技能的问题