| name | analyze-agent-transcript-failure-hypothesis |
| description | Per-Segment analyzer. Produces an improvement hypothesis for every Failure Outcome and every retro-Failure (a Correction trigger at the next Segment's head implies the prior Segment failed even if it didn't recognize it). Both user-source and agent-source Corrections qualify as retro-Failure signals; user-source is the stronger signal. Each hypothesis names the most plausible root cause โ usually a missing Skill, a Skill whose description didn't trigger, a missing MCP capability, or a user-side prompting issue โ and the concrete change that would have prevented the failure. Fed by analyze-agent-transcript; outputs flow into the Prompting / Skills / MCP recommendation buckets of the final report.
|
| user-invocable | false |
Analyze failure hypothesis
Per-Segment analyzer for Failure Outcomes and retro-Failures.
Inputs
segment: a Segment from segments.json whose Outcome is Failure, or whose immediately-following sibling Segment starts with a Correction trigger (either source). The orchestrator hands you the Segment directly โ you do not walk raw JSONL.
surrounding_segments: the parent Segment, the prior sibling, and the next sibling โ needed to reason about retro-Failures and recovery.
transcript.json: the OpenTranscripts Transcript document, available to dereference event ids from segment.meta.event_range when you need turn-level evidence.
external_context (optional): external-context.json if present โ grounds the hypothesis in why the session happened.
philosophy_skills, philosophy_mcp, philosophy_prompting: reference docs, so the hypothesis stays in line with team stance. philosophy-on-prompting grounds the prompting_issue root-cause class โ judge whether the prompt failed to close its loop (no definition of done / verification) vs. hit a foreseeable capability gap that routes to a Skill or MCP server.
Output
This is the item body. The orchestrator wraps it with id / segment_id / analyzer (see the orchestrator's "Findings-item shape" section) โ emit only the fields below.
{
"failure_kind": "outright_failure"
| "retro_failure_via_user_correction"
| "retro_failure_via_agent_correction"
| "failure_confirmed_by_correction",
"root_cause_class": "missing_skill" | "non_triggering_skill"
| "missing_mcp_tool" | "wrong_mcp_response_shape"
| "prompting_issue" | "user_mistake" | "agent_reasoning_error",
"evidence": "<event-id-level evidence: which assistant event went wrong, which correction confirmed it (user-source or agent-source)>",
"hypothesis": "<one-paragraph improvement hypothesis>",
"recommendation_route": "prompting" | "skills" | "mcp" | "multi" | "none",
"recommendation_seed": "<short draft of the concrete change โ promoted to a full proposal by the matching analyze-{skills,mcp}-gaps skill>"
}
Evidence cites OpenTranscripts event ids (the id strings in transcript.json / segments.json), never integer turn numbers.
Sequencing checklist
Notes
- The default cause of a Correction is a Skill issue, not a user mistake. Per the
transcript-segment reference, this is the team's prior โ only override it with explicit evidence. Applies whether the Correction came from the user or from the agent self-correcting.
- Weight retro-Failure recommendations by Correction source. A
retro_failure_via_user_correction deserves a more forceful hypothesis (user-visible failure mode) than retro_failure_via_agent_correction (agent recovered on its own โ still worth fixing, but lower urgency).
- Don't propagate failure up the tree. A leaf Failure does not automatically make its parent a Failure; the segmenter already made that call. Analyze the Segment you were handed.
- Stay short. One hypothesis per Segment. If you find yourself listing three independent causes, the Segment was probably under-decomposed โ flag it back to phase 2 instead of papering over it here.
- The recommendation_seed is a seed, not a finished proposal. The corresponding
analyze-agent-transcript-skill-gaps / analyze-agent-transcript-mcp-gaps run is responsible for fleshing it out against the philosophy docs.
outcome.explanation is the WHAT; your hypothesis is the WHY + WHAT-TO-DO. For every Failure in segments.json the decomposer writes a one-sentence explanation of what happened to leave the Goal unmet (e.g. "wait-for-ci ran gh pr checks --watch as a single blocking call and was SIGKILL'd at exit 137"). Your hypothesis builds on that โ name the root-cause class and the concrete change that would have prevented it. The two are complementary; do not restate outcome.explanation verbatim in hypothesis, but feel free to quote a short phrase from it as the anchor.