$npx -y skills add WenyuChiou/agent-collab-skills --skill agent-output-reconcilerUse when multiple agents have completed a round and the user asks to reconcile outputs, compare Codex and Gemini, synthesize run results, identify conflicts, or decide what should be retried.
| 1 | # agent-output-reconciler |
| 2 | |
| 3 | Cross-agent diff + synthesizer. After `agent-task-splitter` plans a |
| 4 | round and the delegate skills have run their tasks, this skill reads |
| 5 | everything they produced and reports: |
| 6 | |
| 7 | - Did each task succeed? |
| 8 | - Where do agents agree (same files changed similarly, same |
| 9 | conclusions)? |
| 10 | - Where do they conflict (same files changed differently, contradictory |
| 11 | recommendations)? |
| 12 | - What's the recommended next move (merge / retry / escalate)? |
| 13 | |
| 14 | ## When to use |
| 15 | |
| 16 | Trigger phrases: |
| 17 | |
| 18 | - "Reconcile these N agent outputs." |
| 19 | - "Did Codex and Gemini agree on this round?" |
| 20 | - "Synthesize the multi-agent run results." |
| 21 | - "What did the agents do this round? Any conflicts?" |
| 22 | - "Round N is done — give me the reconciliation report." |
| 23 | |
| 24 | Not for: |
| 25 | |
| 26 | - Running the agents — that's `codex-delegate` (Claude lanes run via the Agent tool; `gemini-delegate` is deprecated, fails closed). |
| 27 | - Final accept-or-reject gate before merging — that's |
| 28 | `agent-acceptance-gate`. The reconciler **describes**; the |
| 29 | acceptance gate **decides**. |
| 30 | - Single-agent runs — if only one task in `.coord/plan.yml`, there's |
| 31 | nothing to reconcile. |
| 32 | |
| 33 | ## Inputs (auto-discovered) |
| 34 | |
| 35 | 1. **`.coord/plan.yml`** — the round's plan. Use the `round` field |
| 36 | to identify which task files are in scope. |
| 37 | 2. **`.ai/<agent>_log_<NNN>_<slug>.txt.result.json`** — one per |
| 38 | non-Claude task. Schema (from `codex-delegate`'s contract): |
| 39 | ```json |
| 40 | { |
| 41 | "status": "success|fallback|error", |
| 42 | "delegate": "codex|gemini", |
| 43 | "model": "...", |
| 44 | "log_file": "...", |
| 45 | "output_file": "...", |
| 46 | "summary": "...", |
| 47 | "risks": [], |
| 48 | "files_changed": [], |
| 49 | "tests_run": [], |
| 50 | "timestamp_utc": "...", |
| 51 | |
| 52 | // v0.2.2+ optional fields — see §2.6 promise/delivery contract: |
| 53 | "promised": [], // artifacts this task surfaces for downstream consumers |
| 54 | "consumed": [] // artifacts this task used from upstream tasks |
| 55 | } |
| 56 | ``` |
| 57 | Each entry in `risks` must be a single sentence (≤ 30 words). |
| 58 | Long-form analysis belongs in `output_file`, not here — verbose |
| 59 | `risks` entries are a context-contract violation and the |
| 60 | reconciler should flag them. |
| 61 | 3. **`.ai/<agent>_result_<NNN>_<slug>.md`** — agent-written summary |
| 62 | (referenced from each task file's `Acceptance` section). |
| 63 | 4. **`.ai/<agent>_log_<NNN>_<slug>.txt`** — full log path; read only |
| 64 | the configured tail for error context if `status: error`. |
| 65 | 5. **For `agent: claude` tasks** — read the Claude session's |
| 66 | in-conversation output (whatever Claude said in the chat for that |
| 67 | task, treated as the equivalent of `result.md`). |
| 68 | 6. **`.coord/context_<NNN>.md`** (optional, if `agent-context-budget` |
| 69 | ran) — declared per-task context budgets. Reconciler uses these |
| 70 | to flag oversized summaries / unbounded `risks` arrays at the |
| 71 | per-task granularity, not just the plan-wide default. Absence is OK. |
| 72 | |
| 73 | If the user passes specific paths, use those instead of |
| 74 | auto-discovery. |
| 75 | |
| 76 | ## Workflow |
| 77 | |
| 78 | ### 1. Identify round + tasks |
| 79 | |
| 80 | Read `.coord/plan.yml`. If multiple rounds exist, default to the |
| 81 | highest `round` number unless the user specifies. Collect the list |
| 82 | of `(task_id, agent, slug)`. |
| 83 | |
| 84 | ### 2. Read each task's outputs |
| 85 | |
| 86 | For each task: |
| 87 | - Codex / Gemini: load `result.json` + `result_<NNN>_<slug>.md` + |
| 88 | log tail only when `status: error` (default max: last 50 lines). |
| 89 | - Claude: pull from current conversation history. |
| 90 | |
| 91 | Flag any task where: |
| 92 | - `result.json` is missing → run never completed. |
| 93 | - `status: "error"` → run failed. |
| 94 | - `status: "fallback"` → run completed but in degraded mode. |
| 95 | - `result_<NNN>_<slug>.md` missing → agent didn't write the |
| 96 | required summary (acceptance criterion violated). |
| 97 | - `result_<NNN>_<slug>.md` exceeds `context_policy.result_summary_word_budget` |
| 98 | (default 250 words) → context contract violated. |
| 99 | |
| 100 | ### 2.4. Multi-locale lockstep check (catches Gemini drop / merge) |
| 101 | |
| 102 | When the round's outputs include ≥ 2 locale variants of the same |
| 103 | file stem (e.g., `06-memory-rag.md` + `06-memory-rag.en.md` + |
| 104 | `06-memory-rag.zh-Hans.md`), verify they actually stayed in lockstep: |
| 105 | |
| 106 | 1. **Line count parity** — each mirror within ±3% of canonical's |
| 107 | line count. Larger delta usually means Gemini dropped or |
| 108 | duplicated a section. |
| 109 | 2. **H2 count parity** — `grep -c '^## '` returns identical count |
| 110 | across all locales. |
| 111 | 3. **Per-table column count parity** — for each markdown table at |
| 112 | position N in canonical, verify table N in each mirror has the |
| 113 | same column count. (F2 incident in `docs/observed-failure-modes.md`: |
| 114 | Gemini merged a 5-column Projects table's rows into a 3-column |
| 115 | Tools table.) |
| 116 | 4. **Required headline-term cross-presence** — if `plan.yml` declares |
| 117 | `required_terms` for this round, each must appear in every locale |
| 118 | variant. Missing in one locale = mirror sync dropped content. |
| 119 | 5. |