Run an iterative analyst -> reviewer loop on a report. The analyst revises based on reviewer feedback until no critical improvements remain (max 5 cycles).
Run an iterative improvement cycle on an analysis report.
Arguments:
$ARGUMENTS should contain the report path (e.g., analysis/reports/pilot_analysis.qmd) and optionally a plan pathBefore starting the loop, create a single branch for this report's review loop (e.g., review-loop/<report-name>). All reviewer and analyst commits go on this branch. Do NOT commit to main.
Repeat the following for up to 5 cycles:
Spawn an analysis-reviewer sub-agent (foreground) with this prompt:
<report-path>doc/reviews/review_<report-name>_cycle<N>.mdanalysis-reviewer/commitRead the reviewer's output. Check:
Stop if: all sections are "Keep" with at most minor suggestions. Report the final status to the user.
If critical issues were found, spawn an analysis-analyst sub-agent (foreground) with this prompt:
doc/reviews/review_<report-name>_cycle<N>.md<report-path> addressing all items marked Remove or Revise/commitThen go back to step 1.