# Summarizer Protocol

> Loaded by the summarizer agent to supply operating protocol and invariants for structured markdown summary generation in the parity-test-c pipeline. Not user-invocable.

- Skill: `gustavo-meilus/summarizer-protocol` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gustavo-meilus/summarizer-protocol`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gustavo-meilus/summarizer-protocol/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: gustavo-meilus (https://skillmd.com/u/gustavo-meilus)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/gustavo-meilus/summarizer-protocol

---


# Summarizer — Operational Protocol

<overview>
The summarizer agent reads the structured findings produced by the analyzer, renders a formatted markdown document with `## Key Themes` and `## Structure Overview` sections, and writes the final output to `{ROOT}/output/parity-test-c-summary.md`. It is the final step of the parity-test-c Sequential pipeline (Pattern 1) on Tier 1c (Antigravity CLI). The quality bar is: the output markdown must be human-readable and contain both required sections without truncation.
</overview>

## Protocol

<protocol>

### 1. DISCOVER

1. Read inputs from the orchestrator dispatch context:
   - `findings_path`: path to `analyzer-findings.json` written by the analyzer.
   - `output_path`: path where the final markdown summary must be written (always `{ROOT}/output/parity-test-c-summary.md`).
   - `state_path`: path to `pipeline-state.json` for status updates.
   - `run_id`: current run identifier.
   - `root`: resolved scope root.
2. Verify `findings_path` exists and is valid JSON. If the file does not exist: emit `BLOCKED` with message: "Analyzer findings not found at `{findings_path}`. The analyzer step may have failed.".
3. Parse the findings JSON. If JSON is malformed: emit `BLOCKED` with message: "Analyzer findings at `{findings_path}` are not valid JSON. Re-run the analyzer step."

### 2. PROCESS

Render the markdown summary using the following template (populated from the parsed findings):

```markdown
# Document Summary — parity-test-c

> Generated by the parity-test-c pipeline (Tier 1c — Antigravity CLI)

## Source

**Document:** `{findings.source_path}`
**Word count:** {findings.structure.word_count}
**Tone:** {findings.structure.tone}

## Key Themes

{For each theme in findings.themes, render a bullet point:}
- {theme}

## Structure Overview

**Detected sections:**

{For each section in findings.structure.sections, render a numbered list item:}
1. {section}
```

Ensure:
- `## Key Themes` section is present and contains at least one bullet.
- `## Structure Overview` section is present and lists at least one section.
- No section is left empty or contains placeholder text.

### 3. DELIVER

1. Create the `{ROOT}/output/` directory if it does not exist.
2. Write the rendered markdown to `output_path` using the `Write` tool.
3. Update `pipeline-state.json`:
   - Set `phases[1].status` = `"completed"`.
   - Set `phases[1].outputs` = `[output_path]`.
   - Set top-level `status` = `"completed"`.
   - Set `completed_at` = current ISO-8601 timestamp.
4. Emit terminal status:
   - `DONE` — summary written successfully; both required sections present.
   - `DONE_WITH_CONCERNS` — summary written but one or more sections had insufficient content from findings (note which section and why).
   - `BLOCKED` — findings file missing or malformed; output not written.

</protocol>

<invariants>
- ALWAYS write the output to exactly `{ROOT}/output/parity-test-c-summary.md` — never a different path.
- ALWAYS include both `## Key Themes` and `## Structure Overview` sections in the output.
- NEVER write partial output — if rendering fails mid-way, do not write the file; emit BLOCKED.
- ALWAYS update `pipeline-state.json` phases[1] and top-level status after writing.
- Emit exactly one terminal status: DONE / DONE_WITH_CONCERNS / NEEDS_CONTEXT / BLOCKED.
</invariants>

