Cross review project

From pjt222/agent-almanac · View interactive version

Cross review project is an AI agent skill from the GitHub repository pjt222/agent-almanac. Conduct a structured cross-project code review between two Claude Code instances via the cross-review-mcp broker. Each agent reads its own codebase, reviews the peer's code, and engages in evidence-backed dialogue — with QSG scaling laws enforcing review quality through minimum bandwidth constraints

How to use this skill

Skill file

Cross-Review Project

Two Claude Code instances review each other's projects through structured artifact exchange via the cross-review-mcp broker. The broker enforces Quantized Simplex Gossip (QSG) scaling laws — review bundles must contain at least 5 findings to stay in the selection regime (Γ_h ≈ 1.67), preventing shallow consensus from passing as agreement.

When to Use

Inputs

Procedure

Step 1: Verify Prerequisites

Confirm the broker is running and both instances can reach it.

  1. Check the broker is configured as an MCP server:

```bash

claude mcp list | grep cross-review

```

  1. Call get_status to verify the broker is responsive and no stale agents are registered
  2. Read the protocol resource at cross-review://protocol — this is a markdown document describing the review dimensions and QSG constraints

Got: The broker responds to get_status with an empty agent list. The protocol resource is readable as markdown.

If fail: If the broker is not configured, add it: claude mcp add cross-review-mcp -- npx cross-review-mcp. If stale agents exist from a previous session, call deregister for each before proceeding.

Step 2: Register

Register this agent with the broker.

  1. Call register with:
  1. Verify registration by calling get_status — your agent should appear with phase "registered"
  2. Wait for the peer agent to register: call wait_for_phase with the peer's agent ID and phase "registered"

Got: Both agents registered with the broker. get_status shows 2 agents at phase "registered".

If fail: If register fails with "already registered", the agent ID is taken from a previous session. Call deregister first, then re-register.

Step 3: Briefing Phase

Read your own codebase and send a structured briefing to the peer.

  1. Read systematically:
  1. Compose a Briefing artifact — a structured summary the peer can use to navigate your codebase efficiently
  2. Call send_task with:
  1. Call signal_phase with phase "briefing"

Got: Briefing sent and phase signaled. The broker enforces that you must send a briefing before advancing to review.

If fail: If send_task rejects the briefing, check that the from field matches your registered agent ID. Self-sends are rejected.

Step 4: Review Phase

Wait for the peer's briefing, then review their code and send findings.

  1. Call wait_for_phase with the peer's ID and phase "briefing"
  2. Call poll_tasks to retrieve the peer's briefing
  3. Call ack_tasks with the received task IDs — this is required (peek-then-ack pattern)
  4. Read the peer's actual source code, informed by their briefing
  5. Produce findings across 6 categories:
  1. Each finding must include:
  1. Bundle at least 5 findings (QSG constraint: m ≥ 5 keeps Γ_h ≈ 1.67 in selection regime)
  2. Call send_task with type "review_bundle" and the JSON-encoded findings array
  3. Call signal_phase with phase "review"

Got: Review bundle accepted by the broker. Fewer than 5 findings will be rejected.

If fail: If the bundle is rejected for insufficient findings, review more deeply. The constraint exists to prevent shallow reviews from dominating. If you genuinely cannot find 5 issues, reconsider whether cross-review is the right tool for this project pair.

Step 5: Dialogue Phase

Receive findings about your own project and respond with evidence-backed verdicts.

  1. Call wait_for_phase with the peer's ID and phase "review"
  2. Call poll_tasks to retrieve findings about your project
  3. Call ack_tasks with the received task IDs
  4. For each finding, produce a FindingResponse:
  1. Send all responses via send_task with type "response"
  2. Call signal_phase with phase "dialogue"

Note: the "discuss" verdict is not gated by the protocol — treat it as a flag for manual follow-up, not an automated sub-exchange.

Got: All findings responded to with verdicts. Empty responses are rejected by the broker.

If fail: If you cannot form an opinion on a finding, default to "discuss" with evidence explaining what additional context you need.

Step 6: Synthesis Phase

Produce a synthesis artifact summarizing accepted findings and planned actions.

  1. Call wait_for_phase with the peer's ID and phase "dialogue"
  2. Poll any remaining tasks and acknowledge them
  3. Compile a Synthesis artifact:
  1. Call send_task with type "synthesis" and the JSON-encoded synthesis
  2. Call signal_phase with phase "synthesis"
  3. Optionally create GitHub issues for accepted findings
  4. Call signal_phase with phase "complete"
  5. Call deregister to clean up

Got: Both agents reach "complete". The broker requires at least 2 registered agents to advance to complete.

If fail: If the peer has already deregistered, you can still complete locally. Compile your synthesis from the findings you received.

Validation

Pitfalls

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.