Skip to content
cccskills
FreePublished on 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.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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.

The English summary is being prepared. Showing the original description.

phatblat/dotfiles12Updated Oct 20, 2026

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.

The English summary is being prepared. Showing the original description.

phatblat/dotfiles12Updated Oct 20, 2026

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.

The English summary is being prepared. Showing the original description.

phatblat/dotfiles12Updated Oct 20, 2026

aven

Free

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

The English summary is being prepared. Showing the original description.

phatblat/dotfiles12Updated Oct 20, 2026

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.

The English summary is being prepared. Showing the original description.

phatblat/dotfiles12Updated Oct 20, 2026

boris

Free

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.

The English summary is being prepared. Showing the original description.

phatblat/dotfiles12Updated Oct 20, 2026

See all skills by phatblat

Report a problem with this skill