Skip to content

feat: add /review-loop dual-reviewer slash command#49

Merged
khaliqgant merged 4 commits into
mainfrom
add-review-loop-command
May 19, 2026
Merged

feat: add /review-loop dual-reviewer slash command#49
khaliqgant merged 4 commits into
mainfrom
add-review-loop-command

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

Adds the /review-loop slash command and registers it for publishing.

/review-loop [base-ref] [--max N] [--pr N] runs a robust dual-reviewer code-review loop:

  • Claude and Codex each review the working-tree diff independently and in parallel, each fanning out into its own subagents across six concerns (correctness, security, types, tests, error handling, performance) and aggregating against a strict VERDICT: contract.
  • A Codex fixer repairs every valid finding from both reviews and hardens each fix with tests/proofs.
  • The loop repeats with fresh agent context until both reviewers independently sign off (VERDICT: COMPREHENSIVELY_SATISFIED) on the same post-fix state, or a hard blocker is recorded, or the iteration budget is exhausted.

The command is harness-agnostic and loads the writing-agent-relay-workflows and review-fix-signoff-loop skills, then runs the workflow file at AgentWorkforce/workflows repeatable/review-loop/workflow.ts.

Changes

  • commands/review-loop.md — command spec (args, skill loading, dry-run-first, honest reporting, constraints).
  • prpm.json — register review-loop as a slash-command package.

Test plan

  • prpm.json parses as valid JSON; review-loop appears among slash-command packages.
  • Companion workflow dry-run: Validation: PASS (0 errors, 0 warnings).

🤖 Generated with Claude Code

Adds the review-loop slash command: Claude and Codex each review the
working-tree diff independently while fanning out into their own
subagents, a Codex fixer repairs every valid finding from both reviews
and hardens it with tests, and the loop repeats with fresh agent context
until both reviewers independently sign off on the same post-fix state.

- commands/review-loop.md: harness-agnostic command spec
- prpm.json: register review-loop as a slash-command package

Pairs with the workflow at AgentWorkforce/workflows
repeatable/review-loop/workflow.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

Warning

Rate limit exceeded

@khaliqgant has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 24 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cff56f8f-0f00-4fa0-bd68-345a2fb0ee1a

📥 Commits

Reviewing files that changed from the base of the PR and between aaac09e and cfcb124.

📒 Files selected for processing (1)
  • prpm.json
📝 Walkthrough

Walkthrough

This PR adds a new review-loop slash-command skill with complete documentation specifying a deterministic dual-reviewer workflow. It defines argument parsing, skill loading, dry-run validation, artifact-based reporting, output contracts, and operational constraints. The command is registered as a new package in the manifest.

Changes

Review Loop Command

Layer / File(s) Summary
Specification and argument mapping
commands/review-loop.md
Introduces the review-loop, dual reviewers (Claude + Codex), subagent fan-out, and maps $ARGUMENTS into REVIEW_BASE, MAX_REVIEW_ITERATIONS, and REVIEW_PR_NUMBER with defaults and auto-detection.
Workflow location, pinning, preflight, and validation
commands/review-loop.md
Locates repeatable/review-loop/workflow.ts, requires pinning to an immutable ref (package version/tag/commit), prompts and records ref if none pinned, adds agent-relay CLI preflight check, mandates agent-relay run --dry-run with Validation: PASS before executing the real run, and specifies the exact runtime env-var invocation pattern.
Artifact reporting and output contract
commands/review-loop.md
Reads .workflow-artifacts/review-loop/SIGNOFF.md, per-iteration claude-review.md/codex-review.md and review-fix-report.md, surfaces BLOCKED_NO_COMMIT.md when present, defines one-line result format and artifact paths, and conditionally posts gh pr comment when signoff occurs.
Operational constraints and manifest registration
commands/review-loop.md, prpm.json
Lists constraints (no reimplementation/inlining, no commits/pushes/PR creation by the loop, required subagent fan-out, dual VERDICT: COMPREHENSIVELY_SATISFIED requirement, truthful blocked/budget reporting) and registers the review-loop slash-command package (version: 1.0.0) in prpm.json.
Related docs: CLI preflight and workflow guidance
commands/create-workflow.md, skills/writing-agent-relay-workflows/SKILL.md
Adds an agent-relay CLI availability check to workflow scaffolding docs; updates skill guidance to set failOnError: false on implementation agents, require implementation-reconcile to depend on those implementation steps, and include pr_url in valid verification types.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant agent_relay as agent-relay
  participant Workflow as repeatable/review-loop/workflow.ts
  participant Claude
  participant Codex
  participant Artifacts as .workflow-artifacts/review-loop

  Caller->>agent_relay: check CLI (preflight)
  Caller->>agent_relay: run --dry-run (Validation)
  agent_relay->>Workflow: execute (pinned ref, env vars)
  Workflow->>Claude: request review (claude-review.md)
  Workflow->>Codex: request review+fix (codex-review.md)
  Codex->>Workflow: produce fixes (review-fix-report.md)
  Workflow->>Artifacts: write SIGNOFF.md / BLOCKED_NO_COMMIT.md
  Workflow->>Caller: return final status & artifact paths
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hop where reviews entwine,

Claude and Codex trade their lines,
Looping fixes, signed in kind,
Artifacts keep truth in mind,
A rabbit nods — the loop aligned.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding a new /review-loop dual-reviewer slash command.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the /review-loop command, its functionality, and the files modified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-review-loop-command

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@commands/review-loop.md`:
- Around line 49-52: The fenced code block containing the shell snippet starting
with "REVIEW_BASE=<ref> MAX_REVIEW_ITERATIONS=<n> REVIEW_PR_NUMBER=<pr> \"
should include a language to satisfy markdownlint MD040; update the opening
fence from "```" to "```bash" so the block is marked as a bash/shell snippet in
commands/review-loop.md.
- Around line 37-42: The workflow fetch step currently pulls
repeatable/review-loop/workflow.ts from a mutable source; update the fetch logic
(where the README/instructions refer to retrieving the workflow or the command
spec that loads "repeatable/review-loop/workflow.ts") to require and validate an
immutable ref (a tag, release version, or commit SHA) before fetching or
running; change the command/spec parsing to accept and enforce a version
parameter and error if none is provided, and document that the loader must use
that pinned ref (tag/sha) when constructing the GitHub URL or package install
command so the workflow is always run from an immutable ref.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 93f65ccc-d1e4-4f8f-859d-72bdad790b92

📥 Commits

Reviewing files that changed from the base of the PR and between 170778d and 075503a.

📒 Files selected for processing (2)
  • commands/review-loop.md
  • prpm.json

Comment thread commands/review-loop.md Outdated
Comment thread commands/review-loop.md Outdated
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

- Require pinning the fetched workflow to an immutable ref (published
  package version, git tag/release, or commit SHA); never fall back to
  the default branch silently. (CodeRabbit: deterministic-run concern)
- Add `bash` language to the run-loop fenced block (markdownlint MD040).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@khaliqgant
Copy link
Copy Markdown
Member Author

Addressed both CodeRabbit comments in aadeff5:

  1. Immutable ref (Major): the "Locate the workflow" step now requires pinning to an immutable ref — published package @<version>, a git tag/release, or a commit SHA — and explicitly forbids silently falling back to the default branch (ask the user instead). The exact ref used is recorded in the run summary.
  2. MD040 (Minor): the run-loop fenced block is now ```bash.

cubic and Devin reported no issues.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread commands/review-loop.md Outdated
khaliqgant and others added 2 commits May 19, 2026 12:15
- commands/review-loop.md: add step verifying the agent-relay CLI is
  available before dry-run/launch; use full raw.githubusercontent URL for
  the commit-SHA example (cubic PR #49 P3)
- commands/create-workflow.md: same agent-relay CLI verification step
- writing-agent-relay-workflows: fix implementation-reconcile race by
  depending on the impl agent steps (failOnError:false) instead of a
  shared 'context' dep; restore pr_url to the valid verification-types
  row in the Common Mistakes table (relay PR #912 feedback)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- writing-agent-relay-workflows 1.6.12 -> 1.6.13 (reconcile race +
  pr_url table fix)
- create-workflow 1.0.2 -> 1.0.3 (agent-relay CLI precheck step)
- review-loop 1.0.0 -> 1.0.1 (agent-relay CLI precheck step + full
  raw.githubusercontent URL; also covers the un-bumped aadeff5 docs edit)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit c199792 into main May 19, 2026
2 checks passed
@khaliqgant khaliqgant deleted the add-review-loop-command branch May 19, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant