Agent-almanac cross-review-project
git clone https://github.com/pjt222/agent-almanac
T=$(mktemp -d) && git clone --depth=1 https://github.com/pjt222/agent-almanac "$T" && mkdir -p ~/.claude/skills && cp -r "$T/i18n/wenyan-lite/skills/cross-review-project" ~/.claude/skills/pjt222-agent-almanac-cross-review-project-e0748b && rm -rf "$T"
i18n/wenyan-lite/skills/cross-review-project/SKILL.mdCross-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
- Two projects share architectural concerns and could learn from each other
- You want independent code review that goes beyond what a single reviewer sees
- Cross-pollination is the goal: finding patterns in one project that are missing in the other
- You need structured, evidence-backed review with accept/reject/discuss verdicts
Inputs
- Required: Two project paths accessible to two Claude Code instances
- Required:
broker running and configured as an MCP server in both instancescross-review-mcp - Optional: Focus areas — specific directories, patterns, or concerns to prioritize
- Optional: Agent IDs — identifiers for each instance (default: project directory name)
Procedure
Step 1: Verify Prerequisites
Confirm the broker is running and both instances can reach it.
- Check the broker is configured as an MCP server:
claude mcp list | grep cross-review - Call
to verify the broker is responsive and no stale agents are registeredget_status - Read the protocol resource at
— this is a markdown document describing the review dimensions and QSG constraintscross-review://protocol
Expected: The broker responds to
get_status with an empty agent list. The protocol resource is readable as markdown.
On failure: 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.
- Call
with:register
: a short, unique identifier (e.g., project directory name)agentId
: the project nameproject
:capabilities["review", "suggest"]
- Verify registration by calling
— your agent should appear with phaseget_status"registered" - Wait for the peer agent to register: call
with the peer's agent ID and phasewait_for_phase"registered"
Expected: Both agents registered with the broker.
get_status shows 2 agents at phase "registered".
On failure: 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.
- Read systematically:
- Entry points (main files, index, CLI commands)
- Dependency graph (package.json, DESCRIPTION, go.mod)
- Architectural patterns (directory structure, module boundaries)
- Known issues (TODO comments, open issues, tech debt)
- Test coverage (test directories, CI configuration)
- Compose a
artifact — a structured summary the peer can use to navigate your codebase efficientlyBriefing - Call
with:send_task
: your agent IDfrom
: peer agent IDto
:type"briefing"
: JSON-encoded briefingpayload
- Call
with phasesignal_phase"briefing"
Expected: Briefing sent and phase signaled. The broker enforces that you must send a briefing before advancing to review.
On failure: 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.
- Call
with the peer's ID and phasewait_for_phase"briefing" - Call
to retrieve the peer's briefingpoll_tasks - Call
with the received task IDs — this is required (peek-then-ack pattern)ack_tasks - Read the peer's actual source code, informed by their briefing
- Produce findings across 6 categories:
— a pattern in your project that the peer could adoptpattern_transfer
— a practice the peer lacks (testing, validation, error handling)missing_practice
— internal contradiction within the peer's codebaseinconsistency
— unnecessary complexity that could be reducedsimplification
— potential runtime failure or edge casebug_risk
— missing or misleading documentationdocumentation_gap
- Each finding must include:
: unique identifier (e.g.,id
)"F-001"
: one of the 6 categories abovecategory
: path in the peer's projecttargetFile
: what you founddescription
: why this is a valid finding (code references, patterns)evidence
(recommended): the equivalent in your own project that demonstrates the pattern — this is the single mechanism for genuine cross-pollinationsourceAnalog
- Bundle at least 5 findings (QSG constraint: m ≥ 5 keeps Γ_h ≈ 1.67 in selection regime)
- Call
with typesend_task
and the JSON-encoded findings array"review_bundle" - Call
with phasesignal_phase"review"
Expected: Review bundle accepted by the broker. Fewer than 5 findings will be rejected.
On failure: 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.
- Call
with the peer's ID and phasewait_for_phase"review" - Call
to retrieve findings about your projectpoll_tasks - Call
with the received task IDsack_tasks - For each finding, produce a
:FindingResponse
: matches the finding's IDfindingId
:verdict
(valid, will act on it),"accept"
(invalid, with counter-evidence), or"reject"
(needs clarification)"discuss"
: why you accept or reject — must be non-emptyevidence
(optional): specific code references that contradict the findingcounterEvidence
- Send all responses via
with typesend_task"response" - Call
with phasesignal_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.
Expected: All findings responded to with verdicts. Empty responses are rejected by the broker.
On failure: 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.
- Call
with the peer's ID and phasewait_for_phase"dialogue" - Poll any remaining tasks and acknowledge them
- Compile a
artifact:Synthesis- Accepted findings with planned actions (what you will change and why)
- Rejected findings with reasons (preserves the reasoning for future review)
- Call
with typesend_task
and the JSON-encoded synthesis"synthesis" - Call
with phasesignal_phase"synthesis" - Optionally create GitHub issues for accepted findings
- Call
with phasesignal_phase"complete" - Call
to clean upderegister
Expected: Both agents reach
"complete". The broker requires at least 2 registered agents to advance to complete.
On failure: If the peer has already deregistered, you can still complete locally. Compile your synthesis from the findings you received.
Validation
- Both agents registered and reached
phase"complete" - Briefings exchanged before reviews began (phase enforcement)
- Review bundles contained at least 5 findings each
- All findings received a verdict (accept/reject/discuss) with evidence
-
called after everyack_taskspoll_tasks - Synthesis produced with accepted findings mapped to actions
- Agents deregistered after completion
Common Pitfalls
- Fewer than 5 findings: The broker rejects bundles with m < 5. This is not arbitrary — with N=2 agents and 6 categories, m < 5 puts Γ_h at or below the critical boundary where consensus is indistinguishable from noise. Review more deeply; if 5 findings genuinely cannot be found, the projects may not benefit from cross-review.
- Forgetting
: The broker uses peek-then-ack delivery. Tasks remain in queue until acknowledged. Forgetting to ack causes duplicate processing on the next poll.ack_tasks - Forgetting the
parameter:from
requires an explicitsend_task
field matching your agent ID. Self-sends are rejected.from - Same-model epistemic correlation: Two Claude instances share training biases. Temporal ordering ensures they don't read each other's output during review, but their priors are correlated. For genuine epistemic independence, use different model families across instances.
- Skipping
: ThesourceAnalog
field is optional but is the single mechanism for genuine cross-pollination — it shows your implementation of the pattern you're recommending. Always populate it when a source analog exists.sourceAnalog - Treating
as blocking: Nothing in the protocol gatesdiscuss
on pending discussions being resolved. Treatcomplete
verdicts as flags for manual follow-up after the session.discuss - Not reviewing telemetry: The broker logs all events to JSONL. After a session, review the log to validate QSG assumptions — estimate α empirically (
) and check per-category accept rates.α ≈ 1 - reject_rate
Related Skills
— for building or extending the broker itselfscaffold-mcp-server
— A2A protocol patterns the broker draws fromimplement-a2a-server
— single-agent review (this skill extends it to cross-agent structured exchange)review-codebase
— swarm consensus patterns (QSG is the theoretical foundation)build-consensus
— configuring the broker as an MCP server in Claude Codeconfigure-mcp-server
— can be used to analyze the broker itself (battle-tested: 40 agents, 10 hypothesis families)unleash-the-agents