Index of every page on this site: llms.txt
All skills
stealth-factory avatar

/dual-agent-review

@802887c
Run it yourself

Review a change set with two or more independent AI reviewers in parallel — a Sonnet subagent and the CodeRabbit CLI — then merge + dedupe their findings, triage valid vs invalid, fix (directly or via parallel fix-subagents), and hand back a report of what was fixed/how and what was ignored/why. Use when asked to 'review my changes with two/multiple agents', 'dual-agent / multi-reviewer review', 'get a second opinion from Sonnet and CodeRabbit', 'review the diff and fix the valid issues', 'run parallel reviewers and fix in parallel', or to cross-check one reviewer against another before committing. Diff-scoped by default (branch-vs-base or the PR diff), like CodeRabbit — NOT a whole-repo audit.

Use this Skill: https://skilld.dev/gh/stealth-factory/skills/dual-agent-review

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencereviewer-prompts.md

≈1.8k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Reviewer prompts, CLI recipes & report template

Copy-paste material for ../SKILL.md. Fill the {{placeholders}}.


Reviewer A — Sonnet subagent (general code review)

Spawn a subagent with model sonnet, read-only intent (it returns findings; it does not edit). Give it the diff plus the changed files for context.

You are an independent code reviewer. Review only the change set below against the rest of the repo for context. Do not review unrelated code.

Base: {{base}} · Changed files: {{file list}} Diff:

{{the scoped diff from SKILL.md §1 — committed: `git diff <base>...HEAD`;
  uncommitted: `git diff` + `git diff --staged`; all: `git diff $(git merge-base <base> HEAD)`. Use
  whichever scope you chose, and feed the SAME scope (and `-t` value) to Reviewer B.}}

Read the full changed files (and immediate callers) as needed for context, but report only on changed lines. Look for: correctness bugs, security issues, broken edge cases, race conditions, resource leaks, error-handling gaps, API misuse, and regressions. Skip pure style unless it causes a bug.

Return a JSON array; each item: { "file": "", "line": 0, "severity": "critical|warning|info", "claim": "what's wrong, one sentence", "evidence": "why it's wrong", "fix": "suggested change" } Return [] if nothing real. Do not invent issues to seem thorough — a clean diff is a valid result.

Large-diff variant — don't inline a huge diff. Subagents share the working directory, so for a big change set, pass the base ref + scope and have the subagent produce the diff itself instead of pasting it into the prompt (keeps the orchestrator message and the subagent's context lean). Swap the Diff: block above for:

Base: {{base}} · Scope: {{committed|uncommitted|all}} Generate the diff yourself, then review only it:

  • committed: git diff {{base}}...HEAD
  • uncommitted: git diff and git diff --staged
  • all: git diff $(git merge-base {{base}} HEAD)

Use the SAME scope handed to Reviewer B. Read full changed files for context; report only on changed lines. Same JSON output shape as above.

Optional extra lenses (Reviewer C+) — same shape, swap the focus line:

  • Security: "Focus on authn/authz, injection, secrets, SSRF, unsafe deserialization, path traversal, and untrusted-input handling."
  • Performance: "Focus on N+1 queries, unbounded loops/allocations, blocking I/O on hot paths, and missing caching/pagination."

Reviewer B — CodeRabbit CLI

This invokes the CodeRabbit CLI directly — it does not depend on CodeRabbit's own code-review skill being installed, only on the coderabbit binary + auth. Run it inside a subagent (ideally run_in_background — reviews can take minutes). Confirm auth first; if it fails, report "CodeRabbit unavailable" and let the orchestrator proceed with the other reviewer(s). Report unavailability distinctly from an empty result — an absent Reviewer B must not be counted as a clean pass (that would hide a reviewer that never ran).

{{type}} below must match the scope Reviewer A got (§1): committed, uncommitted, or all. --base applies to committed/all; drop it for a purely uncommitted review.

# Availability gate. UNAVAILABLE is a distinct outcome from "reviewed, no findings" —
# emit a clear status marker, never an empty `[]` (which the orchestrator would read as
# a clean review), so Reviewer B is counted as absent, not passing. Distinguish
# "binary missing" from "installed but not logged in" — they need different fixes.
if ! command -v coderabbit >/dev/null 2>&1; then
  echo 'STATUS=coderabbit-unavailable reason=not-installed'; exit 0
fi
if ! coderabbit auth status >/dev/null 2>&1; then
  echo 'STATUS=coderabbit-unavailable reason=not-authenticated'; exit 0
fi

# ONE review, scoped to {{type}} (committed|uncommitted|all). --base is included for
# committed/all and omitted for uncommitted. Swap --agent for --plain for text output.
base_flag=""; [ "{{type}}" = uncommitted ] || base_flag="--base {{base}}"
coderabbit review --agent -t {{type}} $base_flag
  • -t — review type: all | committed | uncommitted — match the diff you scoped.
  • --base — branch to compare against (e.g. main); omit for uncommitted.
  • --agent — structured JSON for agent/skill integrations; --plain — detailed text.
  • Flags evolve — run coderabbit review --help to confirm the current set before relying on it.

Alternative — delegate to CodeRabbit's own skill. If coderabbitai/skills is installed, the subagent can instead trigger CodeRabbit's code-review skill in natural language ("review the {{type}} changes against {{base}}") and let it drive the CLI. That's less control over scope/output (so harder to dedupe), but stays current with CodeRabbit's own flags. The direct CLI call above is the default for this reason.

CodeRabbit groups findings by Critical / Warning / Info; map those onto the same {file, line, severity, claim, evidence, fix} shape so they merge cleanly with Reviewer A's. Return the normalized array to the orchestrator.


Parallel fix-subagent (one per valid, independent issue)

Only after triage. One issue per subagent; never two fixers on the same file at once (partition by file or give each an isolated worktree).

Apply this single, pre-approved fix. Scope: one file, one issue. Do not refactor beyond it or touch other files.

File: {{file}} · Issue: {{claim}} · Approved fix: {{fix}}

Make the minimal change in the surrounding code's style. Then verify it (build / relevant test / re-read) and report back: { "file": "", "applied": true|false, "how": "what you changed", "verified": "what you ran/checked" }. If the fix turns out wrong or unsafe, make no change and report applied: false with why.


Final report template

## Dual-agent review — {{base}}...HEAD ({{N}} files)
Reviewers: Sonnet · CodeRabbit{{· extra lenses}}   ({{mark any that were UNAVAILABLE — e.g. "CodeRabbit: unavailable (not authenticated)" — so the reader knows it didn't run}})

### ✅ Fixed ({{count}})
- **{{file}}:{{line}}** — {{claim}} _(flagged by: {{A/B/both}})_
  → {{how it was fixed}}; verified: {{check}}

### ⛔ Ignored / rejected ({{count}})
- **{{file}}:{{line}}** — {{claim}} _(flagged by: {{A/B}})_
  → Rejected: {{one-line reason}}

### ⏸ Deferred / needs human ({{count}})
- **{{file}}:{{line}}** — {{claim}}
  → {{why deferred / what decision is needed}}

### Adjudicated disagreements
- {{reviewer A said X, B said Y → call + why}}

**Tally:** fixed {{n}} · rejected {{m}} · deferred {{k}} · verify: {{pass/fail + what ran}}

Keep it honest: only list under Fixed what the verify step actually confirmed. A finding you consciously declined goes under Ignored / rejected (with its reason); a real one you couldn't safely fix goes under Deferred. An unverified fix is Deferred, never Fixed.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill facilitates code reviews using multiple AI agents and the CodeRabbit CLI. It adheres to security best practices by treating external outputs as untrusted data and providing safe installation instructions for well-known third-party tools.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: CRITICAL · 2 issues

Signed by skilld at 802887c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated 3 months ago
Other metadata
metadata
{
  "author": "stealth-factory",
  "co-author": "wiiiimm",
  "version": "1.1.0"
}

README badge

README badge for stealth-factory/skills/dual-agent-review