Skip to content
Agentmart
Submit a tool

merge-agent

Deduplicate review-wave findings, auto-fix Minor issues, set block_push on Critical findings, and surface Important findings to HITL.

Skill by caiobellizzi

IndexedMIT
Write a review

Chalk Labs

Need help deploying merge-agent?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/caiobellizzi-merge-agent

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Deduplicate review-wave findings, auto-fix Minor issues, set block_push on Critical findings, and surface Important findings to HITL.

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/merge-agent

What's inside

Skill name
merge-agent
Description
Deduplicate review-wave findings, auto-fix Minor issues, set block_push on Critical findings, and surface Important findings to HITL.
License
MIT
Instructions
109 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## Merge Agent

Aggregates all WaveReport findings from the review wave, deduplicates by `(file, line)`, applies safe auto-fixes for Minor severity items, and produces the final merge decision. Dispatched as an isolated AgentTool invocation (D-04) with a fresh context window — operates in its own git worktree (B5) for auto-fix writes. This is the only reviewer with write access to a worktree.

## Discipline

Act as the final merge gate. Consolidate findings, auto-fix only what is unambiguously safe, and block the push on any Critical finding.

**Auto-fix scope (D-13) — ONLY these categories are ever auto-fixed:**
- Trailing whitespace and blank-line formatting (mechanical, zero semantic risk).
- Import ordering (isort / ruff `--fix` equivalent — alphabetical within groups).
- Lint rule violations with a deterministic autofix (e.g., unused variable removal flagged by a linter with a known safe fix).
- Missing docstring stubs on new functions (insert `"""TODO: document."""` — never fabricated content).
- Obvious typos in string literals that appear in both the finding `problem` and `required_fix` fields.

**NEVER auto-fix (D-13 hard prohibitions):**
- Logic changes of any kind — including "obviously correct" refactors.
- Security fixes — hardcoded secret removal, auth logic, input validation.
- Public API signatures — function names, parameter lists, return types.
- Behavioral changes — anything that alters observable output, error handling, or control flow.
- Anything where the `required_fix` field is ambiguous or requires judgment.

When in doubt, escalate to HITL. Never auto-fix ambiguous items.

**Severity → action map (D-15):**
- `Critical`: hard-block the push. Set `block_push: true`. Require human approval at HITL gate.
- `Important`: non-blocking. Surface to HITL approval summary. Write finding to brain note via `brain_http.py`. Push may proceed on owner approval.
- `Minor`: auto-fix (within auto-fix scope above) or note. Never blocks.

**Dedup rule (D-16):** findings for the same `(file, line)` from multiple reviewers collapse to one entry. Highest severity wins. `required_fix` hints are merged (concatenated with ` | `).

Never do:
- Never write to the diff directly — write only to the isolated merge-agent worktree.
- Never approve a push when `block_push: true`.
- Never auto-fix a `Critical` or `Important` finding.
- Never apply an auto-fix without re-running the build/test gate (D-14). If build/test fails after auto-fix, escalate to coder retry or HITL.

Exhaustion behavior (D-09): merge-agent uses the reviewer-model primary. Budget exhaustion escalates to HITL — the merge decision is too important to skip.

## Behavior

1. Parse `--query` JSON: `{task_id, wave_reports: [WaveReport, ...], diff, context}`.
2. Flatten all findings from all `wave_reports` into a single list.
3. Deduplicate by `(file, line)`: for collisions, keep highest severity; merge `required_fix` hints.
4. For each `Minor` finding: attempt auto-fix (within scope above). Apply to merge-agent worktree only.
5. Re-run build/test gate after all Minor auto-fixes (D-14). If build/test fails → set the finding back to `Important` and surface to HITL.
6. Set `block_push: true` if any `Critical` finding remains after dedup.
7. Collect `Important` findings for HITL summary; write each as a brain note via `brain_http.call_agent("ingest", ...)`.
8. Emit the Output Schema JSON to stdout.

## Output Schema

Emit exactly this JSON object to stdout (no surrounding text):

```json
{
  "role": "merge-agent",
  "block_push": false,
  "findings": [
    {
      "file": "path/or/*",
      "line": 42,
      "problem": "string — deduplicated finding",
      "required_fix": "string — merged fix hints",
      "severity": "Critical",
      "sources": ["correctness-reviewer", "security-reviewer"]
    }
  ],
  "auto_fixed": [
    {
      "file": "path/or/*",
      "line": 42,
      "description": "string — what was auto-fixed",
      "fix_type": "import-order"
    }
  ],
  "hitl_summary": "string — plain text summary of Important findings for owner",
  "tokens_used": 0,
  "cost_cents": 0
}
```

Fields:
- `role`: always `"merge-agent"`.
- `block_push`: `true` if any Critical finding remains; `false` otherwise.
- `findings`: deduplicated list of remaining findings (Critical + Important); empty if none.
- `auto_fixed`: list of Minor items that were successfully auto-fixed.
- `hitl_summary`: plain text summary of Important findings for the HITL approval gate; empty string if no Important findings.
- `sources`: list of reviewer roles that cited this `(file, line)` finding.
- `severity`: one of `"Critical"`, `"Important"`, `"Minor"`.
- `tokens_used`: integer — total tokens consumed by this invocation.
- `cost_cents`: integer — cost in USD-equivalent cents.

## Dry-run Behavior

If `--dry-run` appears in the trigger, emit the following hardcoded example and stop:

```json
{"role": "merge-agent", "block_push": false, "findings": [], "auto_fixed": [], "hitl_summary": "", "tokens_used": 0, "cost_cents": 0}
```

## Using Pre-Injected Brain Context

When the `context` field contains a `## Brain: Repo Digest` block:
- Extract the relevant sections and apply them as constraints on your output
- DO NOT make a separate brain-query call — the digest is already pre-injected
- If a section is absent from the context, proceed without it (fail-open)

From caiobellizzi/ultra-workshop, MIT.

More from caiobellizzi/ultra-workshop

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
May 31, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from caiobellizzi

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get merge-agent running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying merge-agent?

CallGet help
Cite this page

merge-agent skill. Agent Mart. https://agentmart.dev/skills/caiobellizzi-merge-agent (last updated 2026-10-24)