GitNexus/pr-swarm-review
Gergő Magyar 85727ca625
feat(review): add PR reviewer swarm agents (#1851)
* feat(review): add PR reviewer swarm agents

Seven read-only subagents coordinated by an orchestration skill for
structured, evidence-grounded production-readiness PR reviews.

Agents: facts-historian, branch-hygiene, risk-architect, test-ci-verifier,
security-boundary, docs-dod, synthesis-critic. All use Read/Grep/Glob/Bash
only — no edit tools.

Skill invoked as /gitnexus-pr-swarm-review <PR>.

* Address PR review feedback (#1851)

- Pin explicit model IDs in all 7 reviewer-swarm agents per CLAUDE.md
  (no unversioned aliases). Set the two mechanical agents
  (test-ci-verifier, branch-hygiene-reviewer) to claude-haiku-4-5-20251001
  per @Cenrax's "this could be haiku"; the five analytical agents use
  claude-sonnet-4-6.
- Add an explicit read-only Bash policy (permitted/prohibited command
  lists) to every agent's Rules section, so the read-only guarantee is
  defended against injected/adversarial PR content rather than prose-only.
- Add a hard synthesis-critic gate to the swarm skill: do not post the
  final review until the critic's "Required corrections before posting"
  section is empty (was advisory only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(review): make PR reviewer swarm portable across AI CLIs

Restructure the reviewer swarm around a single CLI-neutral source of truth so it
runs from any AI CLI, not just Claude Code.

- pr-swarm-review/: canonical orchestration.md (Swarm + Solo execution modes with
  an identical output contract) and personas/0N-*.md (the 7 review personas,
  relocated verbatim from the Claude agents, each tagged with a model tier and the
  read-only Bash policy). Single source of truth — edit here, not in the wrappers.
- Thin per-CLI adapters that read the canonical spec at runtime (no duplication):
  - Claude Code: coordinator skill (Swarm mode) + the 7 agents are now thin
    wrappers that read their persona file (frontmatter/model preserved; mechanical
    lanes Haiku, analytical lanes Sonnet).
  - Gemini CLI: .gemini/commands/gitnexus-pr-swarm-review.toml
  - GitHub Copilot: .github/prompts/gitnexus-pr-swarm-review.prompt.md
  - Cursor: .cursor/commands/gitnexus-pr-swarm-review.md
- AGENTS.md: canonical "PR Swarm Review" section -> orchestration.md, the universal
  entrypoint honored by Codex, Cursor, Gemini, Copilot, and any AGENTS.md-aware
  agent (Codex user-level prompt install noted in the README).

Graceful degradation: only Claude Code has parallel subagents (Swarm mode); every
other CLI runs the 7 lanes sequentially in one agent (Solo mode) with the same
output contract. prettier --check clean (root config).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 18:24:16 +01:00
..
personas feat(review): add PR reviewer swarm agents (#1851) 2026-05-29 18:24:16 +01:00
orchestration.md feat(review): add PR reviewer swarm agents (#1851) 2026-05-29 18:24:16 +01:00
README.md feat(review): add PR reviewer swarm agents (#1851) 2026-05-29 18:24:16 +01:00

GitNexus PR Reviewer Swarm (cross-CLI)

A coordinated, read-only production-readiness PR review for GitNexus, runnable from any AI coding CLI. Seven specialized review personas produce one structured, evidence-grounded review.

Single source of truth

All review logic lives here and is shared by every CLI — edit these, not the per-CLI wrappers:

pr-swarm-review/
  orchestration.md      # coordinator contract: Swarm vs Solo modes, lanes, classifications, output structure
  personas/             # the 7 canonical persona prompts (role + rules + output sections)
    01-pr-facts-historian.md       (model tier: sonnet)
    02-branch-hygiene-reviewer.md  (model tier: haiku)
    03-risk-architect.md           (model tier: sonnet)
    04-test-ci-verifier.md         (model tier: haiku)
    05-security-boundary-reviewer.md (model tier: sonnet)
    06-docs-dod-reviewer.md        (model tier: sonnet)
    07-synthesis-critic.md         (model tier: sonnet)
  README.md             # this file

Per-CLI entrypoints are thin wrappers that read the files above at runtime. Only Claude Code has first-class parallel subagents (Swarm mode); every other CLI runs the same lanes sequentially in one agent (Solo mode) with an identical output contract.

Invoke it from your CLI

CLI How to invoke Adapter file
Claude Code /gitnexus-pr-swarm-review <PR> (Swarm mode; dispatches the 7 gitnexus-* subagents) .claude/skills/gitnexus-pr-swarm-review/SKILL.md + .claude/agents/gitnexus-*.md
Gemini CLI /gitnexus-pr-swarm-review <PR> .gemini/commands/gitnexus-pr-swarm-review.toml
GitHub Copilot /gitnexus-pr-swarm-review (then paste the PR) .github/prompts/gitnexus-pr-swarm-review.prompt.md
Cursor /gitnexus-pr-swarm-review (then paste the PR) .cursor/commands/gitnexus-pr-swarm-review.md
Codex CLI Ask: "run the GitNexus PR swarm review for " (Codex reads AGENTS.md) — or install the user-level prompt below AGENTS.md § PR Swarm Review
Any AGENTS.md-aware agent Ask it to "follow pr-swarm-review/orchestration.md for " AGENTS.md § PR Swarm Review

Codex (optional user-level slash command)

Codex prompts are user-level only (not repo-shareable). To get a /gitnexus-pr-swarm-review slash command, create ~/.codex/prompts/gitnexus-pr-swarm-review.md:

---
description: GitNexus production-readiness PR swarm review (Solo mode)
argument-hint: <PR URL or number>
---
Read `pr-swarm-review/orchestration.md` in this repo and run it in **Solo mode** for $ARGUMENTS.
You are single-agent: adopt each persona in `pr-swarm-review/personas/` in dependency order,
then self-critique with lane 7 before emitting the review. Stay read-only.

Key properties

  • Read-only. No persona edits files, commits, or posts to GitHub. Each enforces an explicit permitted/prohibited Bash list.
  • Evidence-grounded. Every finding cites files, line ranges, checks, issue/PR refs, or commands.
  • Missing visibility becomes verification work rather than invented facts.
  • Manually invoked. No hooks or automatic triggers.

Extending to a new CLI

Add one thin wrapper for the CLI's command/prompt format whose body says: read pr-swarm-review/orchestration.md and run it (Swarm mode if the runtime has parallel subagents, else Solo mode). Do not copy the persona/orchestration text into the wrapper.

Relationship to the existing review skill

This coexists with /gitnexus-pr-review (a single-agent linear checklist using GitNexus MCP tools). This swarm is a multi-agent / multi-persona deep production-readiness review.